Function at 0x404170
Capabilities:
Query environment variable

Disassembly:
push ebp
xor edx, edx
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [0x405378]
test eax, eax
setle dl
or dword [0x409074], edx
je 0x404438
mov dword [0x405378], 1
xor esi, esi
mov dword [0x409074], 0
mov dword [0x409080], esi
mov ebx, esi
mov dword [0x40907c], esi
mov dword [0x409084], esi
mov dword [0x409088], 0
mov dword [ebp - 0x30], esi
cmp dword [ebp - 0x30], ebx
jl 0x404487
mov ebx, dword [ebp + 0x10]
lea edx, [esi + 1]
mov edi, dword [ebp + 0x14]
mov dword [0x40907c], edx
cmp dword [ebp + 0xc], edx
mov ecx, edx
mov dword [0x409080], edx
jle 0x404252
mov eax, dword [ebx + edx*4]
mov dword [0x409084], edx
cmp byte [eax], 0x2d
mov dword [0x409088], eax
je 0x4042a0
movsx eax, byte [edi]
cmp al, 0x2d
je 0x404795
mov edx, dword [0x40908c]
test edx, edx
jne 0x404270
test ah, 0x10
jne 0x404290
cmp eax, 0x2b
mov dword [0x40908c], 0x1000
je 0x404540
mov dword [esp], str.POSIXLY_CORRECT
call sym._getenv
test eax, eax
je 0x404702
mov eax, dword [0x40908c]
or eax, 0x10
mov dword [0x40908c], eax
mov eax, dword [0x40907c]
mov ebx, 0xffffffff
mov dword [0x405378], eax
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
test ah, 0x10
jne 0x404290
and edx, 0x10
test edx, edx
jne 0x404252
mov esi, dword [0x409080]
lea edx, [esi + 1]
jmp 0x4041e0
or eax, edx
mov dword [0x40908c], eax
mov edx, eax
jmp 0x404275
lea edx, [eax + 1]
mov dword [0x409088], edx
movzx edx, byte [eax + 1]
test dl, dl
je 0x404204
cmp dl, 0x2d
je 0x404694
cmp dword [ebp + 8], 1
jle 0x4046c0
mov edi, dword [ebp + 0x18]
lea eax, [ebp + 0x18]
mov ecx, dword [ebp + 0x1c]
mov dword [ebp - 0x1c], eax
mov dword [0x409078], 0
test edi, edi
mov dword [ebp - 0x3c], ecx
je 0x404358
mov eax, dword [edi]
test eax, eax
je 0x404358
mov ebx, dword [0x409088]
mov esi, edi
mov dword [ebp - 0x38], 0xffffffff
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], ebx
add ebx, 1
mov dword [ebp - 0x34], ebx
lea ebx, [edi + 0x10]
mov ecx, dword [ebp - 0x30]
movzx edx, byte [ecx]
test dl, dl
je 0x404556
mov ecx, dword [ebp - 0x34]
jmp 0x404331
movzx edx, byte [ecx]
add eax, 1
add ecx, 1
test dl, dl
je 0x404556
cmp dl, byte [eax]
je 0x404320
cmp dl, 0x3d
je 0x404550
mov esi, ebx
add ebx, 0x10
mov eax, dword [ebx - 0x10]
add dword [ebp - 0x2c], 1
test eax, eax
jne 0x40430d
cmp dword [ebp - 0x38], 0xffffffff
jne 0x404b85
cmp dword [ebp + 8], 1
je 0x4043d6
mov ebx, dword [0x409088]
test ebx, ebx
je 0x4043d6
movzx ecx, byte [ebx]
test cl, cl
je 0x4043d6
mov esi, dword [ebp + 0x14]
test esi, esi
je 0x4043d6
mov esi, dword [ebp + 0x14]
movzx edi, byte [esi]
mov eax, edi
test al, al
je 0x4043d6
mov eax, edi
mov esi, dword [ebp + 0x14]
cmp al, 0x2b
sete byte [ebp - 0x2c]
cmp al, 0x2d
mov eax, dword [ebp + 0x14]
sete dl
add eax, 1
or dl, byte [ebp - 0x2c]
mov byte [ebp - 0x2c], dl
je 0x4043a2
mov esi, eax
lea edx, [esi + 1]
mov dword [ebp - 0x30], edx
add ebx, 1
mov eax, edi
cmp byte [ebp - 0x2c], 0
je 0x4043ba
mov edx, dword [ebp + 0x14]
movzx eax, byte [edx + 1]
cmp al, 0x3a
mov edx, esi
je 0x4048a8
cmp al, cl
je 0x4048b4
add edx, 1
movzx eax, byte [edx]
test al, al
jne 0x4043c4
mov eax, dword [0x409080]
mov ebx, 0x3f
mov dword [0x405370], 0
mov dword [0x409088], 0
lea edx, [eax + 1]
mov dword [0x405378], edx
mov edx, dword [0x405374]
test edx, edx
je 0x404261
mov ecx, dword [ebp + 0x10]
mov eax, dword [ecx + eax*4]
mov dword [esp + 0xc], eax
mov eax, dword [ecx]
mov dword [esp + 4], str._s:_unrecognised_option___s_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
jmp 0x404261
mov edx, dword [0x40907c]
lea esi, [eax - 1]
cmp eax, edx
mov dword [ebp - 0x30], edx
jl 0x4041a7
mov esi, dword [0x409080]
lea edx, [esi + 1]
cmp eax, edx
mov dword [ebp - 0x34], edx
jg 0x4045e0
mov ecx, dword [0x409088]
test ecx, ecx
mov dword [ebp - 0x2c], ecx
je 0x404478
movzx eax, byte [ecx]
test al, al
jne 0x404600
mov ebx, dword [0x409084]
cmp dword [ebp - 0x30], ebx
jge 0x4041d1
sub esi, ebx
lea edx, [esi + 1]
lea eax, [edx*4 + 0x12]
and eax, 0xfffffff0
mov dword [ebp - 0x34], esp
call fcn.004040f0
sub esp, eax
test edx, edx
lea ecx, [esp + 0x10]
jle 0x4044c3
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x2c], ebx
lea edi, [eax + ebx*4]
xor eax, eax
mov ebx, dword [edi + eax*4]
mov dword [ecx + eax*4], ebx
add eax, 1
cmp edx, eax
jne 0x4044b3
mov ebx, dword [ebp - 0x2c]
lea eax, [ebx - 1]
cmp dword [ebp - 0x30], eax
mov dword [0x409084], eax
jg 0x4044fa
mov edi, dword [ebp + 0x10]
mov eax, dword [ebp - 0x30]
lea ebx, [edi + ebx*4]
mov dword [ebp - 0x2c], ebx
lea ebx, [edi + eax*4]
mov eax, dword [ebp - 0x2c]
mov edi, dword [eax - 4]
mov dword [eax + esi*4], edi
sub eax, 4
cmp eax, ebx
jne 0x4044e2
mov ebx, dword [ebp - 0x30]
lea eax, [ebx - 1]
mov dword [0x409084], eax
test edx, edx
jle 0x40451d
mov esi, dword [ebp - 0x30]
xor eax, eax
mov edi, dword [ebp + 0x10]
lea ebx, [edi + esi*4]
lea esi, [esi]
mov esi, dword [ecx + eax*4]
mov dword [ebx + eax*4], esi
add eax, 1
cmp edx, eax
jne 0x404510
add edx, dword [ebp - 0x30]
mov dword [0x40907c], edx
mov esi, dword [0x409080]
mov esp, dword [ebp - 0x34]
mov ebx, dword [ebp + 0x10]
mov edi, dword [ebp + 0x14]
lea edx, [esi + 1]
jmp 0x4041e0
mov eax, 0x1010
jmp 0x40424d
mov dword [0x409078], ecx
cmp byte [eax], 0
jne 0x4045b7
mov ebx, dword [ebp - 0x3c]
mov dword [0x409088], 0
test ebx, ebx
je 0x404574
mov edi, dword [ebp - 0x2c]
mov ebx, dword [ebp - 0x3c]
mov dword [ebx], edi
mov edx, dword [0x409080]
mov ecx, dword [0x409078]
lea eax, [edx + 1]
test ecx, ecx
mov dword [0x405378], eax
je 0x4047c2
mov eax, dword [esi + 4]
test eax, eax
je 0x40482c
mov eax, dword [esi + 8]
test eax, eax
je 0x4048a0
mov edx, dword [esi + 0xc]
xor ebx, ebx
mov dword [eax], edx
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [ebp - 0x38], 0xffffffff
jne 0x40496a
mov esi, dword [ebp - 0x2c]
add dword [ebp - 0x2c], 1
mov dword [ebp - 0x38], esi
mov esi, ebx
add ebx, 0x10
mov eax, dword [ebx - 0x10]
test eax, eax
jne 0x40430d
jmp 0x40434e
lea esi, [eax - 1]
mov ebx, dword [0x409084]
mov dword [0x409080], esi
mov dword [0x409088], 0
jmp 0x4041c8
mov edi, dword [ebp - 0x2c]
movsx ebx, al
mov dword [0x405370], ebx
add edi, 1
mov dword [ebp - 0x30], edi
mov dword [0x409088], edi
mov edi, dword [ebp + 0x14]
movzx ecx, byte [edi]
cmp cl, 0x2d
je 0x40462b
cmp cl, 0x2b
mov dword [ebp - 0x38], edi
jne 0x40463b
mov ecx, dword [ebp + 0x14]
mov edi, dword [ebp + 0x14]
add ecx, 1
mov dword [ebp - 0x38], ecx
movzx ecx, byte [edi + 1]
cmp cl, 0x3a
mov edi, dword [ebp - 0x38]
je 0x4046f3
cmp al, cl
je 0x404710
add edi, 1
movzx ecx, byte [edi]
test cl, cl
jne 0x404647
cmp dword [ebp + 8], 2
je 0x4048ce
mov eax, dword [0x405374]
test eax, eax
jne 0x4047f3
mov edi, dword [ebp - 0x30]
test edi, edi
je 0x40467f
mov edi, dword [ebp - 0x30]
cmp byte [edi], 0
jne 0x404684
lea edx, [esi + 1]
mov esi, edx
mov dword [0x405378], esi
mov ebx, 0x3f
jmp 0x404261
cmp byte [eax + 2], 0
je 0x404a66
mov esi, dword [ebp + 8]
test esi, esi
jle 0x4046c7
add eax, 2
mov dword [0x409088], eax
mov dword [ebp + 8], 1
jmp 0x4042c8
mov dword [ebp + 8], 0
mov ebx, dword [ebp + 0x14]
mov dword [esp + 0xc], ebx
mov esi, dword [ebp + 0x10]
mov dword [esp + 8], esi
mov edi, dword [ebp + 0xc]
mov dword [esp + 4], edi
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._getopt_parse
lea esp, [ebp - 0xc]
mov ebx, eax
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
movzx ecx, byte [edi + 1]
add edi, 1
mov dword [ebp - 0x38], edi
jmp 0x404647
mov edx, dword [0x40908c]
and edx, 0x10
jmp 0x404278
cmp byte [edi + 1], 0x3a
mov dword [ebp - 0x38], edi
je 0x404746
mov eax, dword [ebp - 0x30]
mov dword [0x409078], 0
test eax, eax
je 0x404733
mov eax, dword [ebp - 0x2c]
cmp byte [eax + 1], 0
jne 0x404736
mov esi, dword [ebp - 0x34]
mov dword [0x405378], esi
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x2c]
mov dword [0x409078], eax
cmp byte [ecx + 1], 0
jne 0x404789
mov edi, dword [ebp - 0x38]
cmp byte [edi + 2], 0x3a
je 0x4048f0
mov eax, dword [ebp + 0xc]
sub eax, esi
cmp eax, 1
jle 0x404938
mov ecx, dword [ebp + 0x10]
add esi, 2
mov dword [0x409080], edx
mov dword [ebp - 0x34], esi
mov eax, dword [ecx + edx*4]
mov dword [0x409078], eax
mov dword [0x409088], 0
jmp 0x404733
mov eax, dword [0x409080]
mov ebx, 1
mov dword [0x409088], 0
lea edx, [eax + 1]
mov dword [0x405378], edx
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + eax*4]
mov dword [0x409078], eax
jmp 0x404261
cmp dword [esi + 4], 1
jne 0x40459b
cmp dword [ebp + 0xc], eax
jle 0x4049d6
mov ebx, dword [ebp + 0x10]
add edx, 2
mov dword [0x409080], eax
mov eax, dword [ebx + eax*4]
mov dword [0x405378], edx
mov dword [0x409078], eax
jmp 0x40459b
mov dword [esp + 0xc], ebx
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
mov dword [esp + 4], str._s:_invalid_option_____c_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
mov esi, dword [0x409088]
mov dword [ebp - 0x30], esi
mov esi, dword [0x409080]
jmp 0x404670
mov eax, dword [0x405374]
mov ecx, dword [ebp + 0x10]
test eax, eax
mov edx, dword [ecx]
je 0x40488e
cmp dword [ebp + 8], 1
mov ebx, dword [sym.imp.msvcrt.dll__iob]
mov word [ebp - 0x1f], 0x2d2d
setne al
sub eax, 1
and eax, 0x2d
add ebx, 0x40
mov byte [ebp - 0x1d], 0
mov byte [ebp - 0x1e], al
mov dword [esp + 8], edx
mov dword [esp + 4], str._s:
mov dword [esp], ebx
call sym._fprintf
mov eax, dword [esi]
mov dword [esp + 4], str.option___s_s_doesnt_accept_an_argument_n
mov dword [esp], ebx
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1f]
mov dword [esp + 8], eax
call sym._fprintf
mov eax, dword [esi + 0xc]
mov ebx, 0x3f
mov dword [0x405370], eax
jmp 0x404261
mov ebx, dword [esi + 0xc]
jmp 0x404261
movzx eax, byte [esi + 1]
mov edx, dword [ebp - 0x30]
jmp 0x4043c4
cmp byte [edx + 1], 0x3a
je 0x4046c7
movzx ecx, byte [ebx]
test cl, cl
jne 0x4043a8
jmp 0x4046c7
mov eax, dword [0x405374]
test eax, eax
jne 0x4048ff
mov dword [0x409088], 0
mov dword [0x405370], 0
jmp 0x404682
mov dword [0x409078], 0
jmp 0x404789
mov edx, dword [ebp - 0x2c]
mov dword [0x409088], edx
mov dword [esp + 0xc], edx
mov ecx, dword [ebp + 0x10]
mov eax, dword [ecx]
mov dword [esp + 4], str._s:_unrecognised_option____s_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
mov esi, dword [0x409080]
lea edx, [esi + 1]
jmp 0x4048d7
mov eax, dword [0x405374]
test eax, eax
jne 0x404aab
mov esi, dword [ebp + 0x14]
movzx eax, byte [esi]
cmp al, 0x2d
je 0x404953
cmp al, 0x2b
jne 0x40495a
mov edi, dword [ebp + 0x14]
movzx eax, byte [edi + 1]
xor ebx, ebx
cmp al, 0x3a
setne bl
lea ebx, [ebx + ebx*4 + 0x3a]
jmp 0x404261
cmp dword [ebp + 8], 2
je 0x404ad5
mov eax, dword [0x409080]
mov ebx, 0x3f
mov esi, dword [0x405374]
mov dword [0x405370], 0
mov dword [0x409088], 0
lea edx, [eax + 1]
test esi, esi
mov dword [0x405378], edx
je 0x404261
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + eax*4]
mov dword [esp + 0xc], eax
mov eax, dword [edx]
mov dword [esp + 4], str._s:_option___s_is_ambiguous_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
jmp 0x404261
mov edi, dword [ebp + 0x14]
movzx eax, byte [edi]
cmp al, 0x2d
je 0x4049e4
cmp al, 0x2b
jne 0x4049eb
mov edx, dword [ebp + 0x14]
movzx eax, byte [edx + 1]
mov edi, dword [0x405374]
xor ebx, ebx
cmp al, 0x3a
mov ecx, dword [ebp + 0x10]
setne bl
lea ebx, [ebx + ebx*4 + 0x3a]
test edi, edi
mov edx, dword [ecx]
je 0x404a59
cmp dword [ebp + 8], 1
mov edi, dword [sym.imp.msvcrt.dll__iob]
mov word [ebp - 0x1f], 0x2d2d
setne al
sub eax, 1
and eax, 0x2d
add edi, 0x40
mov byte [ebp - 0x1d], 0
mov byte [ebp - 0x1e], al
mov dword [esp + 8], edx
mov dword [esp + 4], str._s:
mov dword [esp], edi
call sym._fprintf
mov eax, dword [esi]
mov dword [esp + 4], str.option___s_s_requires_an_argument_n
mov dword [esp], edi
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1f]
mov dword [esp + 8], eax
call sym._fprintf
mov eax, dword [esi + 0xc]
mov dword [0x405370], eax
jmp 0x404261
mov edx, dword [0x40907c]
cmp edx, ecx
jge 0x404a92
mov ebx, dword [ebp + 0x10]
mov edi, dword [ebx + ecx*4 - 4]
mov dword [ebx + ecx*4], edi
mov ecx, esi
sub esi, 1
lea edi, [esi + 2]
cmp edi, edx
jg 0x404a73
mov dword [0x409084], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ecx + edx*4], eax
add edx, 1
mov ebx, 0xffffffff
mov dword [0x40907c], edx
mov dword [0x405378], edx
jmp 0x404261
mov dword [esp + 0xc], ebx
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
mov dword [esp + 4], str._s:_option_requires_an_argument_____c_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
jmp 0x404945
mov ebx, dword [ebp - 0x30]
cmp byte [ebx], 0
je 0x404974
cmp dword [ebp + 0x14], 0
je 0x404974
mov edi, dword [ebp + 0x14]
movzx esi, byte [edi]
mov eax, esi
test al, al
je 0x404974
mov ecx, dword [ebp + 0x14]
cmp al, 0x2d
sete dl
cmp al, 0x2b
mov ebx, dword [ebp + 0x14]
sete al
add ecx, 1
or dl, al
mov byte [ebp - 0x2c], dl
je 0x404b17
mov ebx, ecx
lea edi, [ebx + 1]
mov eax, dword [ebp - 0x30]
movzx ecx, byte [eax]
test cl, cl
je 0x404b5d
add dword [ebp - 0x30], 1
mov eax, esi
cmp byte [ebp - 0x2c], 0
je 0x404b37
mov edx, dword [ebp + 0x14]
movzx eax, byte [edx + 1]
cmp al, 0x3a
mov edx, ebx
jne 0x404b53
movzx eax, byte [ebx + 1]
mov edx, edi
jmp 0x404b53
add edx, 1
movzx eax, byte [edx]
test al, al
je 0x404974
cmp cl, al
jne 0x404b45
cmp byte [edx + 1], 0x3a
jne 0x404b1a
mov edi, dword [ebp + 0x14]
mov dword [esp + 0xc], edi
mov edx, dword [ebp + 0x10]
mov dword [esp + 8], edx
mov ecx, dword [ebp + 0xc]
mov dword [esp], 2
mov dword [esp + 4], ecx
call sym._getopt_parse
mov ebx, eax
jmp 0x404261
mov ebx, dword [ebp - 0x3c]
mov dword [0x409088], 0
test ebx, ebx
je 0x404b9e
mov ebx, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x3c]
mov dword [ecx], ebx
mov edx, dword [0x409080]
mov ecx, dword [0x409078]
lea eax, [edx + 1]
test ecx, ecx
mov dword [0x405378], eax
je 0x404bd8
mov eax, dword [ebp - 0x38]
shl eax, 4
add edi, eax
mov eax, dword [edi + 4]
test eax, eax
je 0x404c12
mov eax, dword [edi + 8]
test eax, eax
je 0x404c0a
mov edx, dword [edi + 0xc]
xor ebx, ebx
mov dword [eax], edx
jmp 0x404261
mov ecx, dword [ebp - 0x38]
shl ecx, 4
add edi, ecx
cmp dword [edi + 4], 1
jne 0x404bc5
cmp dword [ebp + 0xc], eax
jle 0x404c86
mov ecx, dword [ebp + 0x10]
add edx, 2
mov dword [0x409080], eax
mov eax, dword [ecx + eax*4]
mov dword [0x405378], edx
mov dword [0x409078], eax
jmp 0x404bc5
mov ebx, dword [edi + 0xc]
jmp 0x404261
mov esi, dword [ebp + 0x10]
cmp dword [0x405374], 0
mov edx, dword [esi]
je 0x404c74
cmp dword [ebp + 8], 1
mov ebx, dword [sym.imp.msvcrt.dll__iob]
mov word [ebp - 0x1f], 0x2d2d
setne al
sub eax, 1
and eax, 0x2d
add ebx, 0x40
mov byte [ebp - 0x1d], 0
mov byte [ebp - 0x1e], al
mov dword [esp + 8], edx
mov dword [esp + 4], str._s:
mov dword [esp], ebx
call sym._fprintf
mov eax, dword [edi]
mov dword [esp + 4], str.option___s_s_doesnt_accept_an_argument_n
mov dword [esp], ebx
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1f]
mov dword [esp + 8], eax
call sym._fprintf
mov eax, dword [edi + 0xc]
mov ebx, 0x3f
mov dword [0x405370], eax
jmp 0x404261
mov ebx, dword [ebp + 0x14]
movzx eax, byte [ebx]
cmp al, 0x2d
je 0x404c94
cmp al, 0x2b
jne 0x404c98
add dword [ebp + 0x14], 1
mov esi, dword [ebp + 0x14]
xor ebx, ebx
mov ecx, dword [ebp + 0x10]
cmp byte [esi], 0x3a
mov edx, dword [ecx]
setne bl
cmp dword [0x405374], 0
lea ebx, [ebx + ebx*4 + 0x3a]
je 0x404d09
cmp dword [ebp + 8], 1
mov esi, dword [sym.imp.msvcrt.dll__iob]
mov word [ebp - 0x1f], 0x2d2d
setne al
sub eax, 1
and eax, 0x2d
add esi, 0x40
mov byte [ebp - 0x1d], 0
mov byte [ebp - 0x1e], al
mov dword [esp + 8], edx
mov dword [esp + 4], str._s:
mov dword [esp], esi
call sym._fprintf
mov eax, dword [edi]
mov dword [esp + 4], str.option___s_s_requires_an_argument_n
mov dword [esp], esi
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1f]
mov dword [esp + 8], eax
call sym._fprintf
mov eax, dword [edi + 0xc]
mov dword [0x405370], eax
jmp 0x404261