Function at 0x409170
Capabilities:
Query environment variable

Disassembly:
push ebp
xor eax, eax
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov edx, dword [0x40b114]
test edx, edx
setle al
or eax, dword [0x40e640]
jne 0x4091a3
mov edi, dword [0x40e658]
cmp edx, edi
jge 0x4094dd
mov dword [0x40e640], eax
jmp 0x4091ba
mov eax, 1
xor edi, edi
mov edx, 1
mov dword [0x40b114], eax
mov dword [0x40e640], edi
lea ebx, [edx - 1]
xor esi, esi
mov edi, ebx
mov dword [0x40e648], ebx
mov dword [0x40e658], ebx
mov dword [0x40e678], ebx
mov dword [0x40e668], esi
mov eax, dword [0x40e668]
test eax, eax
je 0x409276
movzx edx, byte [eax]
test dl, dl
je 0x409276
mov ecx, dword [ebp + 0x14]
movsx edx, dl
inc eax
mov dword [0x40b10c], edx
mov bl, dl
mov dword [0x40e668], eax
movzx eax, byte [ecx]
cmp al, 0x2b
sete dl
cmp al, 0x2d
sete al
or eax, edx
test al, 1
jne 0x409516
movzx eax, byte [ecx]
cmp al, 0x3a
je 0x40953f
cmp al, bl
je 0x4095e2
inc ecx
movzx eax, byte [ecx]
test al, al
jne 0x409227
cmp dword [ebp + 8], 2
je 0x409548
mov esi, dword [0x40b110]
test esi, esi
jne 0x409772
mov edx, dword [0x40e668]
mov eax, dword [0x40e648]
test edx, edx
je 0x409263
cmp byte [edx], 0
jne 0x409264
inc eax
mov dword [0x40b114], eax
mov eax, 0x3f
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [0x40e678]
cmp esi, edi
jle 0x4094c9
mov dword [ebp - 0x3c], esp
mov eax, dword [0x40e648]
sub eax, esi
lea ebx, [eax + 1]
lea eax, [ebx*4 + 0x1e]
and eax, 0xfffffff0
call fcn.00409000
lea eax, [esp + 0x1f]
xor ecx, ecx
and eax, 0xfffffff0
mov dword [ebp - 0x40], eax
cmp ecx, ebx
jge 0x4092cd
mov edx, dword [ebp + 0x10]
lea edx, [edx + esi*4]
mov dword [ebp - 0x5c], edx
mov eax, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x40]
add dword [ebp - 0x5c], 4
mov eax, dword [eax]
mov dword [edx + ecx*4], eax
inc ecx
cmp ecx, ebx
jl 0x4092b9
dec esi
cmp esi, edi
mov eax, esi
jl 0x4092f7
lea eax, [ebx + esi]
lea edx, [esi - 1]
mov esi, dword [ebp + 0x10]
lea ecx, [esi + eax*4]
mov esi, dword [ebp + 0x10]
mov eax, dword [esi + edx*4 + 4]
mov esi, edx
mov dword [ecx], eax
sub ecx, 4
cmp esi, edi
mov eax, edx
lea edx, [edx - 1]
jge 0x4092e0
mov dword [0x40e678], eax
xor ecx, ecx
cmp ecx, ebx
jge 0x409318
mov eax, dword [ebp + 0x10]
lea edx, [eax + edi*4]
mov esi, dword [ebp - 0x40]
mov eax, dword [esi + ecx*4]
inc ecx
mov dword [edx], eax
add edx, 4
cmp ecx, ebx
jl 0x409308
lea ebx, [edi + ebx]
mov dword [0x40e658], ebx
mov esp, dword [ebp - 0x3c]
mov ebx, dword [0x40e648]
inc ebx
cmp ebx, dword [ebp + 0xc]
mov dword [0x40e648], ebx
jge 0x4094b2
lea esi, [esi]
mov dword [0x40e678], ebx
mov eax, dword [ebp + 0x10]
mov esi, ebx
mov edx, dword [eax + ebx*4]
mov dword [0x40e668], edx
cmp byte [edx], 0x2d
jne 0x409440
lea eax, [edx + 1]
mov dword [0x40e668], eax
movzx eax, byte [edx + 1]
test al, al
je 0x409440
cmp al, 0x2d
jne 0x4094f9
cmp byte [edx + 2], 0
lea eax, [edx + 2]
je 0x409854
mov edx, dword [ebp + 8]
test edx, edx
jle 0x40942b
mov dword [0x40e668], eax
mov dword [ebp + 8], 1
mov dword [ebp - 0x44], 0xffffffff
mov esi, dword [ebp + 0x18]
xor edi, edi
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x4c], eax
xor eax, eax
test esi, esi
mov dword [0x40e644], eax
je 0x409421
mov eax, dword [esi]
test eax, eax
je 0x409421
mov dword [ebp - 0x54], 0
mov edx, dword [0x40e668]
mov dword [ebp - 0x50], edx
mov edx, dword [ebp - 0x50]
mov ecx, dword [esi]
jmp 0x4093e9
cmp byte [ecx], al
jne 0x409520
inc ecx
movzx eax, byte [edx]
inc edx
test al, al
jne 0x4093e0
cmp byte [ecx], 0
je 0x409675
mov edx, dword [ebp - 0x44]
test edx, edx
jns 0x409624
mov dword [ebp - 0x44], edi
add dword [ebp - 0x54], 0x10
add esi, 0x10
mov eax, dword [esi]
inc edi
test eax, eax
jne 0x4093d3
mov eax, dword [ebp - 0x44]
test eax, eax
jns 0x409939
cmp dword [ebp + 8], 1
jle 0x409810
mov eax, dword [0x40e668]
cmp byte [eax], 0
jne 0x4095bd
lea esi, [esi]
mov esi, dword [ebp + 0x14]
movzx eax, byte [esi]
cmp al, 0x2d
je 0x409565
movsx edx, al
mov eax, dword [0x40e688]
test eax, eax
jne 0x4094f0
test dh, 0x10
jne 0x4094f0
mov eax, 0x1000
cmp edx, 0x2b
mov dword [0x40e688], eax
je 0x40948a
mov dword [esp], str.POSIXLY_CORRECT
call sub.msvcrt.dll_getenv
test eax, eax
je 0x40950f
mov eax, dword [0x40e688]
or eax, 0x10
mov dword [0x40e688], eax
test al, 0x10
jne 0x4094b2
mov eax, dword [0x40e648]
inc eax
mov ebx, eax
mov dword [0x40e648], ebx
cmp ebx, dword [ebp + 0xc]
jl 0x409340
mov eax, dword [0x40e658]
mov dword [0x40b114], eax
lea esp, [ebp - 0xc]
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [0x40e648]
lea edi, [ebx + 1]
mov dword [0x40e658], edi
jmp 0x40932a
xor ebx, ebx
mov dword [0x40e640], ebx
jmp 0x4091d9
test dh, 0x10
je 0x409497
or eax, edx
jmp 0x409492
cmp dword [ebp + 8], 1
jle 0x409533
mov eax, dword [ebp + 8]
test eax, eax
jg 0x40939d
jmp 0x40942b
mov eax, dword [0x40e688]
jmp 0x409497
inc ecx
jmp 0x40921c
cmp al, 0x3d
jne 0x409408
mov dword [0x40e644], edx
jmp 0x4093f1
mov dword [ebp + 8], 0
jmp 0x40942b
inc ecx
movzx eax, byte [ecx]
jmp 0x409227
mov eax, dword [0x40b110]
test eax, eax
jne 0x40958a
xor eax, eax
xor edi, edi
mov dword [0x40e668], eax
mov dword [0x40b10c], edi
jmp 0x40924f
mov esi, dword [ebp + 0x10]
xor ecx, ecx
lea eax, [ebx + 1]
mov dword [0x40e668], ecx
mov dword [0x40b114], eax
mov eax, dword [esi + ebx*4]
mov dword [0x40e644], eax
mov eax, 1
jmp 0x40926e
mov eax, dword [0x40e668]
dec eax
mov dword [0x40e668], eax
mov dword [esp + 0xc], eax
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
mov dword [esp + 8], eax
mov eax, str._s:_unrecognised_option____s_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x409551
mov eax, dword [ebp + 0x14]
mov dword [esp + 0xc], eax
mov edx, dword [ebp + 0x10]
mov dword [esp + 8], edx
mov ecx, dword [ebp + 0xc]
mov dword [esp + 4], ecx
mov ebx, dword [ebp + 8]
mov dword [esp], ebx
call fcn.00409170
jmp 0x40926e
test ecx, ecx
je 0x409237
cmp byte [ecx + 1], 0x3a
je 0x4097b1
mov ebx, dword [0x40e648]
xor eax, eax
mov dword [0x40e644], eax
mov eax, dword [0x40e668]
mov edx, ebx
test eax, eax
je 0x409611
cmp byte [eax], 0
jne 0x409614
lea edx, [ebx + 1]
mov dword [0x40b114], edx
mov eax, dword [0x40b10c]
jmp 0x40926e
xor eax, eax
mov dword [0x40b10c], eax
xor eax, eax
mov dword [0x40e668], eax
lea eax, [ebx + 1]
mov dword [0x40b114], eax
mov eax, dword [0x40b110]
test eax, eax
je 0x409269
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + ebx*4]
mov dword [esp + 0xc], eax
mov eax, dword [edx]
mov dword [esp + 8], eax
mov eax, str._s:_option___s_is_ambiguous_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x409269
xor eax, eax
mov dword [0x40e668], eax
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x40968e
mov ecx, dword [ebp - 0x4c]
mov dword [ecx], edi
mov ebx, dword [0x40e648]
mov ecx, dword [0x40e644]
lea edx, [ebx + 1]
mov dword [0x40b114], edx
test ecx, ecx
je 0x409735
mov eax, dword [esi + 4]
test eax, eax
jne 0x40975f
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x48]
mov edx, dword [ebx]
mov ebx, dword [ebp - 0x54]
add ebx, eax
mov eax, dword [0x40b110]
test eax, eax
je 0x409728
movzx eax, word [0x40d00d]
cmp dword [ebp + 8], 1
mov word [ebp - 0x28], ax
movzx eax, byte [0x40d00f]
mov byte [ebp - 0x26], al
je 0x4096e5
mov byte [ebp - 0x27], 0
mov dword [esp + 8], edx
mov eax, str._s:
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [ebx]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x28]
mov dword [esp + 8], eax
mov eax, str.option___s_s_doesnt_accept_an_argument_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [ebx + 0xc]
mov dword [0x40b10c], eax
jmp 0x409269
cmp dword [esi + 4], 1
jne 0x40975f
cmp edx, dword [ebp + 0xc]
jge 0x40988f
mov dword [0x40e648], edx
lea eax, [ebx + 2]
mov ebx, edx
mov dword [0x40b114], eax
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + ebx*4]
mov dword [0x40e644], eax
mov edx, dword [esi + 8]
test edx, edx
je 0x4097a2
mov eax, dword [esi + 0xc]
mov dword [edx], eax
xor eax, eax
jmp 0x40926e
mov eax, dword [0x40b10c]
mov ebx, str._s:_invalid_option_____c_n
mov dword [esp + 0xc], eax
mov esi, dword [ebp + 0x10]
mov eax, dword [esi]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x40924f
mov ebx, dword [ebp - 0x54]
mov esi, dword [ebp - 0x48]
mov eax, dword [ebx + esi + 0xc]
jmp 0x40926e
mov eax, dword [0x40e668]
mov dword [0x40e644], eax
cmp byte [eax], 0
jne 0x409808
cmp byte [ecx + 2], 0x3a
je 0x409800
mov eax, dword [0x40e648]
sub dword [ebp + 0xc], eax
cmp dword [ebp + 0xc], 1
jle 0x409a32
mov edx, dword [ebp + 0x10]
lea ebx, [eax + 1]
mov dword [0x40e648], ebx
mov eax, dword [edx + ebx*4]
mov dword [0x40e644], eax
lea eax, [ebx + 1]
mov dword [0x40b114], eax
xor eax, eax
mov dword [0x40e668], eax
jmp 0x409601
xor ecx, ecx
mov dword [0x40e644], ecx
mov ebx, dword [0x40e648]
jmp 0x4097ec
mov ecx, dword [0x40b110]
xor edi, edi
xor esi, esi
mov dword [0x40b10c], edi
lea eax, [ebx + 1]
mov dword [0x40e668], esi
test ecx, ecx
mov dword [0x40b114], eax
je 0x409269
mov ecx, dword [ebp + 0x10]
mov edx, str._s:_unrecognised_option___s_n
mov eax, dword [ecx + ebx*4]
mov dword [esp + 0xc], eax
mov eax, dword [ecx]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
jmp 0x409660
mov edi, dword [0x40e658]
cmp ebx, edi
jle 0x409882
mov edx, dword [ebp + 0x10]
mov ecx, dword [edx + ebx*4]
mov ebx, dword [ebp + 0x10]
mov eax, esi
cmp eax, edi
mov edx, dword [ebx + esi*4 - 4]
mov dword [ebx + esi*4], edx
lea edx, [esi - 1]
mov esi, edx
jg 0x409864
mov dword [0x40e678], edx
mov dword [ebx + edi*4], ecx
lea eax, [edi + 1]
mov dword [0x40e658], eax
jmp 0x4094b7
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x48]
mov edi, dword [ebp - 0x54]
mov esi, dword [ecx]
mov ecx, dword [ebp + 0x14]
add edi, eax
movzx eax, byte [ecx]
cmp al, 0x2b
sete dl
cmp al, 0x2d
sete al
or eax, edx
test al, 1
je 0x4098b3
inc ecx
xor ebx, ebx
cmp byte [ecx], 0x3a
mov eax, dword [0x40b110]
setne bl
test eax, eax
lea ebx, [ebx + ebx*4 + 0x3a]
je 0x40992a
movzx eax, word [0x40d00d]
cmp dword [ebp + 8], 1
mov word [ebp - 0x38], ax
movzx eax, byte [0x40d00f]
mov byte [ebp - 0x36], al
je 0x4098e7
mov byte [ebp - 0x37], 0
mov dword [esp + 8], esi
mov ecx, str._s:
mov dword [esp + 4], ecx
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [edi]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x38]
mov dword [esp + 8], eax
mov eax, str.option___s_s_requires_an_argument_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [edi + 0xc]
mov dword [0x40b10c], eax
mov eax, ebx
jmp 0x40926e
mov esi, dword [ebp - 0x4c]
xor edi, edi
mov dword [0x40e668], edi
test esi, esi
je 0x409956
mov ebx, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x4c]
mov dword [ecx], ebx
mov ebx, dword [0x40e648]
mov ecx, dword [0x40e644]
lea edx, [ebx + 1]
mov dword [0x40b114], edx
test ecx, ecx
je 0x4099e0
mov eax, dword [ebp - 0x44]
mov esi, dword [ebp - 0x48]
shl eax, 4
mov edx, dword [eax + esi + 4]
test edx, edx
jne 0x409a10
lea ebx, [eax + esi]
mov eax, dword [0x40b110]
mov ecx, dword [ebp + 0x10]
test eax, eax
mov edx, dword [ecx]
je 0x409728
movzx eax, word [0x40d00d]
cmp dword [ebp + 8], 1
mov word [ebp - 0x38], ax
movzx eax, byte [0x40d00f]
mov byte [ebp - 0x36], al
je 0x4099b2
mov byte [ebp - 0x37], 0
mov dword [esp + 8], edx
mov eax, str._s:
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [ebx]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x38]
jmp 0x40970b
mov eax, dword [ebp - 0x44]
mov esi, dword [ebp - 0x48]
shl eax, 4
cmp dword [eax + esi + 4], 1
jne 0x409a10
cmp edx, dword [ebp + 0xc]
jge 0x409a68
mov dword [0x40e648], edx
lea eax, [ebx + 2]
mov ebx, edx
mov dword [0x40b114], eax
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + ebx*4]
mov dword [0x40e644], eax
mov eax, dword [ebp - 0x44]
mov esi, dword [ebp - 0x48]
shl eax, 4
mov edx, dword [eax + esi + 8]
test edx, edx
je 0x409b1d
mov eax, dword [eax + esi + 0xc]
mov dword [edx], eax
xor eax, eax
jmp 0x40926e
mov edx, dword [0x40b110]
test edx, edx
jne 0x409aed
mov ecx, dword [ebp + 0x14]
movzx eax, byte [ecx]
cmp al, 0x2b
sete dl
cmp al, 0x2d
sete al
or eax, edx
test al, 1
je 0x409a57
inc ecx
xor eax, eax
cmp byte [ecx], 0x3a
setne al
lea eax, [eax + eax*4 + 0x3a]
jmp 0x40926e
mov ecx, dword [ebp + 0x10]
mov ebx, dword [ebp - 0x48]
mov esi, dword [ecx]
mov ecx, dword [ebp + 0x14]
lea edi, [eax + ebx]
movzx eax, byte [ecx]
cmp al, 0x2b
sete dl
cmp al, 0x2d
sete al
or eax, edx
test al, 1
je 0x409a8a
inc ecx
xor ebx, ebx
cmp byte [ecx], 0x3a
mov eax, dword [0x40b110]
setne bl
test eax, eax
lea ebx, [ebx + ebx*4 + 0x3a]
je 0x40992a
movzx eax, word [0x40d00d]
cmp dword [ebp + 8], 1
mov word [ebp - 0x28], ax
movzx eax, byte [0x40d00f]
mov byte [ebp - 0x26], al
je 0x409ac2
mov byte [ebp - 0x27], 0
mov dword [esp + 8], esi
mov eax, str._s:
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [edi]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x28]
jmp 0x40990d
mov eax, dword [0x40b10c]
mov dword [esp + 0xc], eax
mov ecx, dword [ebp + 0x10]
mov eax, dword [ecx]
mov dword [esp + 8], eax
mov eax, str._s:_option_requires_an_argument_____c_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x409a40
mov edx, dword [ebp - 0x48]
mov eax, dword [eax + edx + 0xc]
jmp 0x40926e