Function at 0x4137a0
Capabilities:
Query environment variable
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
mov edi, dword [esp + 0x78]
mov esi, dword [esp + 0x70]
mov ebx, dword [esp + 0x74]
mov ebp, dword [esp + 0x80]
cmp edi, 0x24
ja 0x41434a
lea eax, [esp + 0x4c]
test ebx, ebx
cmove ebx, eax
call sub.cygwin1.dll___errno
mov dword [eax], 0
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.cygwin1.dll_strtoimax
mov edi, dword [ebx]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
cmp edi, esi
je 0x4138f0
call sub.cygwin1.dll___errno
mov edi, dword [eax]
xor esi, esi
test edi, edi
jne 0x4138d0
test ebp, ebp
je 0x4138b5
mov edi, dword [ebx]
movzx edx, byte [edi]
test dl, dl
je 0x4138b5
movsx eax, dl
mov dword [esp], ebp
mov byte [esp + 0x28], dl
mov dword [esp + 4], eax
call sub.cygwin1.dll_strchr
test eax, eax
movzx edx, byte [esp + 0x28]
je case.0x413894.1
mov dword [esp + 4], 0x30
mov dword [esp], ebp
mov byte [esp + 0x28], dl
call sub.cygwin1.dll_strchr
test eax, eax
movzx edx, byte [esp + 0x28]
je 0x413878
movzx eax, byte [edi + 1]
cmp al, 0x44
je 0x413950
cmp al, 0x69
je 0x413930
cmp al, 0x42
je 0x413950
mov dword [esp + 0x28], 1
mov eax, 0x400
sub edx, 0x42
cmp dl, 0x35
ja case.0x413894.1
movzx edx, dl
jmp dword [edx*4 + 0x42c014]
xor ebp, ebp
add edi, dword [esp + 0x28]
or esi, ebp
mov eax, esi
or eax, 2
mov dword [ebx], edi
cmp byte [edi], 0
cmovne esi, eax
mov ecx, dword [esp + 0x7c]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov dword [ecx], eax
mov eax, esi
mov dword [ecx + 4], edx
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.cygwin1.dll___errno
cmp dword [eax], 0x22
je 0x413962
add esp, 0x5c
mov eax, 4
pop ebx
pop esi
pop edi
pop ebp
ret
test ebp, ebp
je 0x4138de
movzx edx, byte [edi]
test dl, dl
je 0x4138de
movsx eax, dl
mov dword [esp], ebp
mov byte [esp + 0x28], dl
mov dword [esp + 4], eax
xor esi, esi
call sub.cygwin1.dll_strchr
test eax, eax
mov dword [esp + 0x18], 1
mov dword [esp + 0x1c], 0
movzx edx, byte [esp + 0x28]
jne 0x41383f
jmp 0x4138de
xor eax, eax
cmp byte [edi + 2], 0x42
sete al
lea eax, [eax + eax + 1]
mov dword [esp + 0x28], eax
mov eax, 0x400
jmp 0x413885
mov dword [esp + 0x28], 2
mov eax, 0x3e8
jmp 0x413885
mov si, 1
jmp 0x41380a
mov ecx, dword [esp + 0x7c]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov dword [ecx], eax
mov eax, esi
mov dword [ecx + 4], edx
or eax, 2
jmp 0x4138c8
cmp dword [esp + 0x1c], 0xffc00000
jl 0x414133
cmp dword [esp + 0x1c], 0x3fffff
jg 0x414230
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
xor ebp, ebp
shld edx, eax, 9
shl eax, 9
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
jmp 0x4138a2
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
xor ebp, ebp
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
call sub.cyggcc_s_1.dll___divdi3
mov ecx, 7
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], edi
mov esi, ebp
mov dword [esp + 0x74], ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x20], edx
mov edi, dword [esp + 0x30]
mov ebx, ecx
mov ebp, dword [esp + 0x34]
jmp 0x413a8e
jg 0x413a2c
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x18], eax
jb 0x413a98
mov dword [esp + 8], edi
mov dword [esp + 0xc], ebp
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jl 0x414190
jg 0x413a5e
cmp eax, dword [esp + 0x18]
jb 0x414190
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
imul edx, edi
imul eax, ebp
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul edi
mov dword [esp + 0x1c], edx
add dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
xor eax, eax
or esi, eax
sub ebx, 1
je 0x414120
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x1c], eax
jge 0x413a20
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
mov eax, 1
jmp 0x413a83
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
xor ebp, ebp
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
call sub.cyggcc_s_1.dll___divdi3
mov ecx, 8
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x74], ebx
mov dword [esp + 0x2c], eax
mov ebx, ebp
mov dword [esp + 0x20], edx
mov esi, ecx
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x34]
jmp 0x413b6e
jg 0x413b0c
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x18], eax
jb 0x413b78
mov dword [esp + 8], edi
mov dword [esp + 0xc], ebp
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jl 0x414170
jg 0x413b3e
cmp eax, dword [esp + 0x18]
jb 0x414170
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
imul edx, edi
imul eax, ebp
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul edi
mov dword [esp + 0x1c], edx
add dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
xor eax, eax
or ebx, eax
sub esi, 1
je 0x414250
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x1c], eax
jge 0x413b00
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
mov eax, 1
jmp 0x413b63
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
xor ebp, ebp
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
call sub.cyggcc_s_1.dll___divdi3
mov ecx, 4
mov dword [esp + 0x30], esi
mov dword [esp + 0x38], edi
mov esi, ebp
mov dword [esp + 0x2c], eax
mov ebp, ebx
mov edi, edx
mov ebx, ecx
cmp edi, dword [esp + 0x1c]
jg 0x414150
jl 0x413bea
mov ecx, dword [esp + 0x18]
cmp dword [esp + 0x2c], ecx
ja 0x414150
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jl 0x414210
jg 0x413c24
cmp eax, dword [esp + 0x18]
jb 0x414210
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
imul edx, dword [esp + 0x20]
imul eax, dword [esp + 0x18]
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul dword [esp + 0x20]
mov dword [esp + 0x1c], edx
add dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
xor eax, eax
or esi, eax
sub ebx, 1
jne 0x413bd0
mov ebx, ebp
mov edi, dword [esp + 0x38]
mov ebp, esi
mov esi, dword [esp + 0x30]
jmp 0x4138a2
cmp dword [esp + 0x1c], 0xc0000000
jl 0x414133
cmp dword [esp + 0x1c], 0x3fffffff
jg 0x414230
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
xor ebp, ebp
shld edx, eax, 1
add eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
jmp 0x4138a2
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
xor ebp, ebp
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
call sub.cyggcc_s_1.dll___divdi3
mov ecx, 5
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], edi
mov esi, ebp
mov dword [esp + 0x74], ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x20], edx
mov edi, dword [esp + 0x30]
mov ebx, ecx
mov ebp, dword [esp + 0x34]
jmp 0x413d6e
jl 0x413d0c
mov ecx, dword [esp + 0x18]
cmp dword [esp + 0x2c], ecx
ja 0x413d78
mov dword [esp + 8], edi
mov dword [esp + 0xc], ebp
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jl 0x4141f0
jg 0x413d3e
cmp eax, dword [esp + 0x18]
jb 0x4141f0
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
imul edx, edi
imul eax, ebp
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul edi
mov dword [esp + 0x1c], edx
add dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
xor eax, eax
or esi, eax
sub ebx, 1
je 0x414120
mov ecx, dword [esp + 0x1c]
cmp dword [esp + 0x20], ecx
jle 0x413d00
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
mov eax, 1
jmp 0x413d63
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
call sub.cyggcc_s_1.dll___divdi3
cmp dword [esp + 0x1c], edx
mov ecx, eax
mov ebp, edx
jl 0x414280
jg 0x413dcf
cmp dword [esp + 0x18], eax
jb 0x414280
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
mov dword [esp + 0x2c], ecx
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
jl 0x4142a1
jg 0x413e11
cmp eax, dword [esp + 0x18]
jb 0x4142a1
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
imul edx, dword [esp + 0x20]
imul eax, dword [esp + 0x18]
add eax, edx
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x18]
mul dword [esp + 0x20]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x2c]
add dword [esp + 0x1c], eax
cmp dword [esp + 0x1c], ebp
jl 0x413e57
jg 0x4142c2
cmp dword [esp + 0x18], ecx
jae 0x4142c2
xor ebp, ebp
mov eax, 1
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
or ebp, eax
jmp 0x4138a2
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
call sub.cyggcc_s_1.dll___divdi3
cmp dword [esp + 0x1c], edx
jl 0x414133
jg 0x413eb0
cmp dword [esp + 0x18], eax
jb 0x414133
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jl 0x414230
jg 0x413eea
cmp eax, dword [esp + 0x18]
jb 0x414230
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
xor ebp, ebp
imul eax, dword [esp + 0x18]
imul edx, dword [esp + 0x20]
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul dword [esp + 0x20]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
add dword [esp + 0x1c], ecx
jmp 0x4138a2
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
xor ebp, ebp
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
call sub.cyggcc_s_1.dll___divdi3
mov ecx, 6
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], edi
mov esi, ebp
mov dword [esp + 0x74], ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x20], edx
mov edi, dword [esp + 0x30]
mov ebx, ecx
mov ebp, dword [esp + 0x34]
jmp 0x413fde
jl 0x413f7c
mov ecx, dword [esp + 0x18]
cmp dword [esp + 0x2c], ecx
ja 0x413fe8
mov dword [esp + 8], edi
mov dword [esp + 0xc], ebp
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jl 0x4141b0
jg 0x413fae
cmp eax, dword [esp + 0x18]
jb 0x4141b0
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
imul edx, edi
imul eax, ebp
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul edi
mov dword [esp + 0x1c], edx
add dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
xor eax, eax
or esi, eax
sub ebx, 1
je 0x414120
mov ecx, dword [esp + 0x1c]
cmp dword [esp + 0x20], ecx
jle 0x413f70
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
mov eax, 1
jmp 0x413fd3
cmp dword [esp + 0x1c], 0xffe00000
jl 0x414133
cmp dword [esp + 0x1c], 0x1fffff
jg 0x414230
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
xor ebp, ebp
shld edx, eax, 0xa
shl eax, 0xa
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
jmp 0x4138a2
cdq
mov dword [esp + 8], eax
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0x80000000
xor ebp, ebp
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
call sub.cyggcc_s_1.dll___divdi3
mov ecx, 3
mov dword [esp + 0x38], esi
mov dword [esp + 0x30], eax
mov esi, ebp
mov dword [esp + 0x2c], edx
mov ebp, ebx
mov ebx, ecx
mov ecx, dword [esp + 0x1c]
cmp dword [esp + 0x2c], ecx
jg 0x4141d0
jl 0x41409c
mov ecx, dword [esp + 0x18]
cmp dword [esp + 0x30], ecx
ja 0x4141d0
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jl 0x414263
jg 0x4140d6
cmp eax, dword [esp + 0x18]
jb 0x414263
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
imul edx, dword [esp + 0x20]
imul eax, dword [esp + 0x18]
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul dword [esp + 0x20]
mov dword [esp + 0x1c], edx
add dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
xor eax, eax
or esi, eax
sub ebx, 1
jne 0x41407e
mov ebx, ebp
mov ebp, esi
mov esi, dword [esp + 0x38]
jmp 0x4138a2
mov ebp, esi
mov edi, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
mov ebx, dword [esp + 0x74]
jmp 0x4138a2
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
mov ebp, 1
jmp 0x4138a2
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
mov eax, 1
jmp 0x413c4f
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
mov eax, 1
jmp 0x413b63
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
mov eax, 1
jmp 0x413a83
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
mov eax, 1
jmp 0x413fd3
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
mov eax, 1
jmp 0x414101
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
mov eax, 1
jmp 0x413d63
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
mov eax, 1
jmp 0x413c4f
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
mov ebp, 1
jmp 0x4138a2
mov ebp, ebx
mov esi, dword [esp + 0x38]
mov edi, dword [esp + 0x3c]
mov ebx, dword [esp + 0x74]
jmp 0x4138a2
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
mov eax, 1
jmp 0x414101
mov ebp, 1
mov eax, 1
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0x80000000
or ebp, eax
jmp 0x4138a2
mov ebp, 1
mov eax, 1
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
or ebp, eax
jmp 0x4138a2
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
xor ebp, ebp
mov dword [esp], 0xffffffff
mov dword [esp + 4], 0x7fffffff
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
call sub.cyggcc_s_1.dll___divdi3
cmp edx, dword [esp + 0x1c]
jge 0x414310
mov eax, 1
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x1c], 0x7fffffff
or ebp, eax
jmp 0x4138a2
jg 0x414318
cmp eax, dword [esp + 0x18]
jb 0x4142ee
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
imul edx, dword [esp + 0x20]
imul eax, dword [esp + 0x18]
lea ecx, [eax + edx]
mov eax, dword [esp + 0x18]
mul dword [esp + 0x20]
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x1c], edx
or ebp, eax
add dword [esp + 0x1c], ecx
jmp 0x4138a2
mov dword [esp + 0xc], str.0___strtol_base__strtol_base___36
mov dword [esp + 8], str.xstrtoimax
mov dword [esp + 4], 0x60
mov dword [esp], str._usr_src_grep_2.21_2.i686_src_grep_2.21_lib_xstrtol.c
call sub.cygwin1.dll___assert_func
nop
nop