Skip to content

Instantly share code, notes, and snippets.

@adragomir
Forked from pervognsen/vex.s
Created July 10, 2017 21:48
Show Gist options
  • Save adragomir/d0fcc48cf39bd36cbc6b89f1c6513d9a to your computer and use it in GitHub Desktop.
Save adragomir/d0fcc48cf39bd36cbc6b89f1c6513d9a to your computer and use it in GitHub Desktop.
.globl _parse
.align 4, 0x90
_parse: ## @parse
.cfi_startproc
## BB#0:
push rbp
Ltmp8:
.cfi_def_cfa_offset 16
Ltmp9:
.cfi_offset rbp, -16
mov rbp, rsp
Ltmp10:
.cfi_def_cfa_register rbp
lea rax, [rip + _parse.stack_buffer]
lea r8, [rip + Ltmp11]
lea r10, [rip + Ltmp12]
lea r9, [rip + Ltmp13]
lea r11, [rip + _symbol_terminator]
jmp LBB2_1
.align 4, 0x90
LBB2_2: ## in Loop: Header=BB2_1 Depth=1
movzx ecx, byte ptr [rdi]
inc rdi
cmp ecx, 64
jne LBB2_1
## BB#3: ## in Loop: Header=BB2_1 Depth=1
mov qword ptr [rax], r8
add rax, 8
jmp LBB2_20
.align 4, 0x90
LBB2_32: ## in Loop: Header=BB2_20 Depth=2
mov qword ptr [rax], r10
add rax, 8
jmp LBB2_20
.align 4, 0x90
LBB2_5: ## Parent Loop BB2_1 Depth=1
## Parent Loop BB2_20 Depth=2
## => This Inner Loop Header: Depth=3
movsx rdi, cl
cmp byte ptr [rdi + r11], 0
jne LBB2_6
## BB#7: ## in Loop: Header=BB2_5 Depth=3
mov cl, byte ptr [rdx + 1]
inc rdx
cmp rdx, rsi
jne LBB2_5
## BB#8: ## in Loop: Header=BB2_20 Depth=2
mov rdi, rsi
jmp LBB2_9
.align 4, 0x90
LBB2_6: ## in Loop: Header=BB2_20 Depth=2
mov rdi, rdx
LBB2_9: ## in Loop: Header=BB2_20 Depth=2
movzx ecx, cl
cmp ecx, 58
je LBB2_28
## BB#10: ## in Loop: Header=BB2_20 Depth=2
cmp ecx, 61
je LBB2_26
## BB#11: ## in Loop: Header=BB2_20 Depth=2
cmp ecx, 123
jne LBB2_12
## BB#14: ## in Loop: Header=BB2_20 Depth=2
inc rdi
xor ecx, ecx
jmp LBB2_15
.align 4, 0x90
LBB2_26: ## Parent Loop BB2_1 Depth=1
## Parent Loop BB2_20 Depth=2
## => This Inner Loop Header: Depth=3
inc rdi
cmp rdi, rsi
je LBB2_27
## BB#25: ## in Loop: Header=BB2_26 Depth=3
movsx rcx, byte ptr [rdi]
cmp byte ptr [rcx + r11], 0
je LBB2_26
jmp LBB2_12
.align 4, 0x90
LBB2_28: ## in Loop: Header=BB2_20 Depth=2
inc rdi
jmp LBB2_29
.align 4, 0x90
LBB2_12: ## in Loop: Header=BB2_20 Depth=2
mov rdx, rax
lea rax, [rdx - 8]
jmp qword ptr [rdx - 8]
LBB2_22: ## in Loop: Header=BB2_15 Depth=3
inc rcx
.align 4, 0x90
LBB2_15: ## Parent Loop BB2_1 Depth=1
## Parent Loop BB2_20 Depth=2
## => This Inner Loop Header: Depth=3
cmp rdi, rsi
je LBB2_27
## BB#16: ## in Loop: Header=BB2_15 Depth=3
movzx edx, byte ptr [rdi]
inc rdi
cmp edx, 125
je LBB2_23
## BB#17: ## in Loop: Header=BB2_15 Depth=3
movzx edx, dl
cmp edx, 123
je LBB2_22
## BB#18: ## in Loop: Header=BB2_15 Depth=3
cmp edx, 64
jne LBB2_15
jmp LBB2_19
LBB2_23: ## in Loop: Header=BB2_15 Depth=3
test rcx, rcx
je LBB2_12
## BB#24: ## in Loop: Header=BB2_15 Depth=3
dec rcx
jmp LBB2_15
.align 4, 0x90
LBB2_19: ## in Loop: Header=BB2_20 Depth=2
mov qword ptr [rax], rcx
mov qword ptr [rax + 8], r9
add rax, 16
LBB2_20: ## Parent Loop BB2_1 Depth=1
## => This Loop Header: Depth=2
## Child Loop BB2_5 Depth 3
## Child Loop BB2_26 Depth 3
## Child Loop BB2_29 Depth 3
## Child Loop BB2_15 Depth 3
cmp rdi, rsi
mov cl, byte ptr [rdi]
mov rdx, rdi
mov rdi, rsi
jne LBB2_5
jmp LBB2_9
.align 4, 0x90
Ltmp13: ## Block address taken
LBB2_21: ## in Loop: Header=BB2_20 Depth=2
mov rcx, qword ptr [rdx - 16]
add rdx, -16
mov rax, rdx
jmp LBB2_15
.align 4, 0x90
LBB2_27: ## in Loop: Header=BB2_20 Depth=2
mov rdx, rax
mov rdi, rsi
lea rax, [rdx - 8]
jmp qword ptr [rdx - 8]
.align 4, 0x90
Ltmp12: ## Block address taken
LBB2_29: ## Parent Loop BB2_1 Depth=1
## Parent Loop BB2_20 Depth=2
## => This Inner Loop Header: Depth=3
cmp rdi, rsi
je LBB2_27
## BB#30: ## in Loop: Header=BB2_29 Depth=3
movzx ecx, byte ptr [rdi]
cmp ecx, 10
je LBB2_12
## BB#31: ## in Loop: Header=BB2_29 Depth=3
inc rdi
movzx ecx, cl
cmp ecx, 64
jne LBB2_29
jmp LBB2_32
.align 4, 0x90
Ltmp11: ## Block address taken
LBB2_1: ## =>This Loop Header: Depth=1
## Child Loop BB2_20 Depth 2
## Child Loop BB2_5 Depth 3
## Child Loop BB2_26 Depth 3
## Child Loop BB2_29 Depth 3
## Child Loop BB2_15 Depth 3
cmp rdi, rsi
jne LBB2_2
## BB#4:
pop rbp
ret
.cfi_endproc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment