Function at 0x403940
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
test r8, r8
mov esi, ecx
mov rbx, rdx
mov r13, r8
mov qword [rsp + 0xa8], r9
je 0x403cec
mov r9d, dword [0x0040506c]
test r9d, r9d
je 0x403b45
cmp dword [0x00405050], 0xffffffff
je 0x403b59
mov eax, dword [0x00409998]
test eax, eax
jne 0x403b59
movzx edx, byte [r13]
cmp dl, 0x2d
je 0x403b88
mov r8d, dword [0x00405050]
test r8d, r8d
jne 0x403d04
cmp dl, 0x2b
je 0x403d04
sub edx, 0x2b
and edx, 0xfd
je 0x403b90
test eax, eax
mov qword [0x00409990], 0
je 0x4039ed
mov dword [0x00405054], 0xffffffff
mov dword [0x00405058], 0xffffffff
mov edi, dword [rsp + 0xb8]
mov r12d, dword [rsp + 0xb8]
lea rbp, [0x00406335]
and edi, 2
and r12d, 1
nop word [rax + rax]
test eax, eax
jne 0x403a28
mov r10, qword [0x00405060]
movzx r14d, byte [r10]
test r14b, r14b
jne 0x403ab3
movsxd r8, dword [0x0040506c]
mov dword [0x00409998], 0
cmp r8d, esi
jge 0x403d11
movsxd rax, r8d
mov r15, qword [rbx + rax*8]
cmp byte [r15], 0x2d
mov qword [0x00405060], r15
je 0x403c00
test edi, edi
mov qword [0x00405060], rbp
jne 0x403d43
test r12d, r12d
je 0x403cec
mov r14d, dword [0x00405058]
cmp r14d, 0xffffffff
je 0x403be2
mov r15d, dword [0x00405054]
cmp r15d, 0xffffffff
jne 0x403ba0
mov r10, qword [0x00405060]
add r8d, 1
mov dword [0x0040506c], r8d
movzx r14d, byte [r10]
test r14b, r14b
je 0x403a28
cmp qword [rsp + 0xa8], 0
je 0x403d67
movsxd rax, dword [0x0040506c]
cmp qword [rbx + rax*8], r10
je 0x403d67
cmp r14b, 0x2d
je 0x403ec5
test byte [rsp + 0xb8], 4
je 0x403d67
xor eax, eax
cmp r14b, 0x3a
je 0x403b08
movsx edx, r14b
mov rcx, r13
call sym.strchr
test rax, rax
setne al
movzx eax, al
mov r9, qword [rsp + 0xb0]
mov r8, qword [rsp + 0xa8]
mov rdx, r13
mov dword [rsp + 0x20], eax
mov rcx, rbx
call dbg.parse_long_options
cmp eax, 0xffffffff
mov edi, eax
je 0x403d5c
lea rax, [0x00406335]
mov qword [0x00405060], rax
jmp 0x403cf1
mov dword [0x00409998], 1
mov dword [0x0040506c], 1
lea rcx, str.POSIXLY_CORRECT
call sym.getenv
movzx edx, byte [r13]
test rax, rax
setne al
movzx eax, al
mov dword [0x00405050], eax
mov eax, dword [0x00409998]
cmp dl, 0x2d
jne 0x4039a2
or dword [rsp + 0xb8], 2
add r13, 1
jmp 0x4039ca
mov edx, r15d
mov ecx, r14d
mov r9, rbx
call dbg.permute_args
mov edx, dword [0x0040506c]
mov eax, r15d
mov dword [0x00405054], 0xffffffff
sub eax, r14d
mov ecx, edx
add edx, 1
sub ecx, eax
mov dword [0x0040506c], edx
mov eax, dword [0x00409998]
mov dword [0x00405058], ecx
jmp 0x403a10
mov dword [0x00405058], r8d
add r8d, 1
mov dword [0x0040506c], r8d
jmp 0x403a14
movzx r14d, byte [r15 + 1]
test r14b, r14b
jne 0x403e7d
mov edx, 0x2d
mov rcx, r13
mov dword [rsp + 0x38], r8d
call sym.strchr
test rax, rax
movsxd r8, dword [rsp + 0x38]
je 0x403a5a
mov edi, dword [0x00405058]
cmp edi, 0xffffffff
je 0x403f28
cmp dword [0x00405054], 0xffffffff
je 0x403ee1
test r14b, r14b
jne 0x403e8c
lea rbp, [r15 + 1]
mov qword [0x00405060], rbp
cmp byte [r15 + 1], 0
jne 0x403ed7
mov edx, 0x2d
mov rcx, r13
call sym.strchr
test rax, rax
je 0x403cec
mov r10, r15
mov edi, 0x2d
movzx edx, byte [rax + 1]
cmp dl, 0x3a
je 0x403eed
cmp byte [r10 + 1], 0
jne 0x403cf1
add dword [0x0040506c], 1
jmp 0x403cf1
mov esi, dword [0x00405054]
lea rax, [0x00406335]
add r8d, 1
mov dword [0x0040506c], r8d
mov qword [0x00405060], rax
cmp esi, 0xffffffff
je 0x403cd8
mov edx, esi
mov r9, rbx
mov ecx, edi
call dbg.permute_args
sub esi, edi
sub dword [0x0040506c], esi
mov dword [0x00405054], 0xffffffff
mov dword [0x00405058], 0xffffffff
mov edi, 0xffffffff
mov eax, edi
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
and dword [rsp + 0xb8], 0xfffffffe
jmp 0x4039bb
mov esi, dword [0x00405054]
lea rax, [0x00406335]
mov edi, dword [0x00405058]
mov qword [0x00405060], rax
cmp esi, 0xffffffff
jne 0x403cc4
mov eax, dword [0x00405058]
cmp eax, 0xffffffff
je 0x403cd8
mov dword [0x0040506c], eax
jmp 0x403cd8
add r8d, 1
mov qword [0x00409990], r15
mov edi, 1
mov dword [0x0040506c], r8d
jmp 0x403cf1
mov r10, qword [0x00405060]
movzx r14d, byte [r10]
lea rbp, [r10 + 1]
movsx edi, r14b
cmp edi, 0x3a
mov qword [0x00405060], rbp
je 0x403e40
cmp edi, 0x2d
je 0x403f36
mov edx, edi
mov rcx, r13
mov qword [rsp + 0x38], r10
call sym.strchr
test rax, rax
mov r10, qword [rsp + 0x38]
je 0x403e40
cmp qword [rsp + 0xa8], 0
je 0x403c83
cmp edi, 0x57
jne 0x403c83
movzx edx, byte [rax + 1]
cmp dl, 0x3b
jne 0x403c87
cmp byte [r10 + 1], 0
jne 0x403fae
mov eax, dword [0x0040506c]
add eax, 1
cmp esi, eax
mov dword [0x0040506c], eax
jg 0x403fa1
mov edx, dword [0x00405070]
lea rax, [0x00406335]
mov qword [0x00405060], rax
test edx, edx
je 0x403e1c
cmp byte [r13], 0x3a
je 0x403e1c
lea rcx, str.option_requires_an_argument_____c
mov edx, 0x57
call dbg.warnx
mov dword [0x00405068], 0x57
cmp byte [r13], 0x3a
je 0x403f97
mov edi, 0x3f
jmp 0x403cf1
cmp byte [r10 + 1], 0
jne 0x403e4e
add dword [0x0040506c], 1
mov ecx, dword [0x00405070]
test ecx, ecx
je 0x403e6d
cmp byte [r13], 0x3a
je 0x403e6d
lea rcx, str.unknown_option_____c
mov edx, edi
call dbg.warnx
mov dword [0x00405068], edi
mov edi, 0x3f
jmp 0x403cf1
mov edi, dword [0x00405058]
cmp edi, 0xffffffff
jne 0x403c3d
lea r10, [r15 + 1]
cmp r14b, 0x2d
mov qword [0x00405060], r10
jne 0x403ab3
cmp byte [r15 + 2], 0
je 0x403ca0
cmp qword [rsp + 0xa8], 0
je 0x403feb
cmp r10, qword [rbx + r8*8]
je 0x403d67
add r10, 1
xor eax, eax
mov qword [0x00405060], r10
jmp 0x403b08
mov edi, 0x2d
jmp 0x403e4e
mov dword [0x00405054], r8d
jmp 0x403c4a
mov qword [0x00409990], 0
cmp byte [r10 + 1], 0
je 0x403f40
mov eax, dword [0x0040506c]
mov qword [0x00409990], rbp
lea rsi, [0x00406335]
add eax, 1
mov dword [0x0040506c], eax
mov qword [0x00405060], rsi
jmp 0x403cf1
lea rbp, [r15 + 1]
mov r10, r15
mov qword [0x00405060], rbp
mov r15, r10
jmp 0x403c5e
cmp byte [rax + 2], 0x3a
mov eax, dword [0x0040506c]
je 0x403f0c
add eax, 1
cmp esi, eax
mov dword [0x0040506c], eax
jg 0x403fd8
lea rax, [0x00406335]
mov qword [0x00405060], rax
mov eax, dword [0x00405070]
test eax, eax
je 0x403f86
cmp byte [r13], 0x3a
je 0x403f86
lea rcx, str.option_requires_an_argument_____c
mov edx, edi
call dbg.warnx
mov dword [0x00405068], edi
cmp byte [r13], 0x3a
jne 0x403e31
mov edi, 0x3a
jmp 0x403cf1
cdqe
mov rax, qword [rbx + rax*8]
mov qword [0x00405060], rax
mov r9, qword [rsp + 0xb0]
mov r8, qword [rsp + 0xa8]
mov rdx, r13
mov dword [rsp + 0x20], 0
mov rcx, rbx
call dbg.parse_long_options
mov edi, eax
jmp 0x403b32
movsxd rdx, eax
mov rdx, qword [rbx + rdx*8]
mov qword [0x00409990], rdx
jmp 0x403f0c
lea rbp, [r15 + 2]
mov r15, r10
mov qword [0x00405060], rbp
jmp 0x403c5e