Function at 0x40a640
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xbc
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x78], ecx
mov dword [ebp - 0x5c], 0x4060d0
mov dword [ebp - 0x58], 0x436179
lea eax, [ebp - 0x18]
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x50], 0x40b0e0
mov dword [ebp - 0x4c], esp
lea edx, [ebp - 0x74]
sub esp, 0xc
push edx
call fcn.00412b80
add esp, 0x10
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40b011
mov ebx, dword [0x43f880]
test ebx, ebx
je 0x40b000
mov esi, dword [ebp + 0xc]
mov edi, 0x438cb9
mov ecx, 2
cld
repe cmpsb byte [esi], byte es:[edi]
je 0x40a770
mov esi, dword [ebp + 0xc]
mov edi, str.POSIX
mov ecx, 6
repe cmpsb byte [esi], byte es:[edi]
je 0x40a770
mov esi, dword [ebp + 0xc]
cmp byte [esi], 0
je 0x40a720
sub esp, 0xc
push 0x24
mov dword [ebp - 0x70], 0xffffffff
call fcn.00408060
mov dword [ebp - 0x80], eax
add esp, 0xc
push 1
mov edi, dword [ebp + 0xc]
push edi
push eax
mov dword [ebp - 0x70], 6
call fcn.0040f620
mov edx, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x78]
mov dword [ecx], edx
add esp, 0x10
lea ebx, [ebp - 0x74]
sub esp, 0xc
push ebx
call fcn.00412bf0
add esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 0xc
push str.LC_ALL
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x84], eax
add esp, 0x10
test eax, eax
je 0x40a7d0
cmp byte [eax], 0
je 0x40a7d0
mov esi, eax
mov edi, 0x438cb9
mov ecx, 2
cld
repe cmpsb byte [esi], byte es:[edi]
je 0x40a770
mov esi, dword [ebp - 0x84]
mov edi, str.POSIX
mov ecx, 6
repe cmpsb byte [esi], byte es:[edi]
jne 0x40a788
lea esi, [esi]
mov edi, dword [0x43f880]
mov ecx, dword [ebp - 0x78]
mov dword [ecx], edi
mov eax, 1
lock add dword [edi], eax
jmp 0x40a700
sub esp, 0xc
push 0x24
mov dword [ebp - 0x70], 0xffffffff
call fcn.00408060
mov dword [ebp - 0x88], eax
add esp, 0xc
push 1
mov edx, dword [ebp - 0x84]
push edx
push eax
mov dword [ebp - 0x70], 5
call fcn.0040f620
mov esi, dword [ebp - 0x88]
mov ebx, dword [ebp - 0x78]
mov dword [ebx], esi
jmp 0x40a6fd
mov edx, 1
lock add dword [0x437118], edx
mov dword [ebp - 0x28], 0x43711c
sub esp, 0xc
push str.LANG
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x8c], eax
add esp, 0x10
test eax, eax
je 0x40a82b
cmp byte [eax], 0
je 0x40a82b
mov esi, eax
mov edi, 0x438cb9
mov ecx, 2
cld
repe cmpsb byte [esi], byte es:[edi]
je 0x40a82b
mov esi, dword [ebp - 0x8c]
mov edi, str.POSIX
mov ecx, 6
repe cmpsb byte [esi], byte es:[edi]
jne 0x40afd3
sub esp, 0xc
push 0x438cb9
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
push 0x438cb9
lea ebx, [ebp - 0x28]
push ebx
mov dword [ebp - 0x70], 4
call fcn.004283c0
pop eax
pop edx
mov dword [ebp - 0x90], 0
lea edi, [ebp - 0x28]
push 0x438cb9
push edi
call fcn.00415480
add esp, 0x10
test eax, eax
jne 0x40aeb0
lea esi, [esi]
lea edi, [edi]
sub esp, 0xc
mov ebx, dword [ebp - 0x90]
mov edx, dword [ebx*4 + 0x437080]
push edx
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x8c], eax
add esp, 0x10
test eax, eax
je 0x40a8e0
cmp byte [eax], 0
je 0x40a8e0
mov esi, eax
mov edi, 0x438cb9
mov ecx, 2
cld
repe cmpsb byte [esi], byte es:[edi]
je 0x40a8e0
mov esi, dword [ebp - 0x8c]
mov edi, str.POSIX
mov ecx, 6
repe cmpsb byte [esi], byte es:[edi]
jne 0x40a9f8
jmp 0x40a8e0
inc dword [ebp - 0x90]
sub esp, 0xc
mov eax, dword [ebp - 0x90]
mov esi, dword [eax*4 + 0x437080]
push esi
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x8c], eax
add esp, 0x10
test eax, eax
je 0x40a940
cmp byte [eax], 0
je 0x40a940
mov esi, eax
mov edi, 0x438cb9
mov ecx, 2
cld
repe cmpsb byte [esi], byte es:[edi]
je 0x40a940
mov esi, dword [ebp - 0x8c]
mov edi, str.POSIX
mov ecx, 6
repe cmpsb byte [esi], byte es:[edi]
jne 0x40a9f8
mov esi, esi
lea edi, [edi]
inc dword [ebp - 0x90]
cmp dword [ebp - 0x90], 5
jbe 0x40a880
lea ecx, [ebp - 0x28]
sub esp, 8
push 0x438cb9
push ecx
call fcn.00415480
add esp, 0x10
test eax, eax
jne 0x40a9a8
mov esi, dword [0x43f880]
mov eax, dword [ebp - 0x78]
mov dword [eax], esi
mov edi, 1
lock add dword [esi], edi
mov eax, dword [ebp - 0x28]
lea ecx, [eax - 0xc]
lea ebx, [ebp - 0x38]
mov esi, 0xffffffff
lock xadd dword [eax - 4], esi
test esi, esi
jg 0x40a700
sub esp, 8
push ebx
push ecx
call fcn.00427c50
jmp 0x40a6fd
sub esp, 0xc
push 0x24
mov dword [ebp - 0x70], 4
call fcn.00408060
mov dword [ebp - 0x9c], eax
add esp, 0xc
mov ecx, dword [ebp - 0x28]
add ecx, dword [ecx - 0xc]
mov al, byte [0x4391f8]
mov byte [ecx], al
push 1
mov edx, dword [ebp - 0x28]
push edx
mov ebx, dword [ebp - 0x9c]
push ebx
mov dword [ebp - 0x70], 1
call fcn.0040f620
mov edi, dword [ebp - 0x9c]
mov esi, dword [ebp - 0x78]
mov dword [esi], edi
add esp, 0x10
jmp 0x40a97e
cmp dword [ebp - 0x90], 5
ja 0x40a953
mov esi, 1
lock add dword [0x437118], esi
mov dword [ebp - 0x48], 0x43711c
mov dword [ebp - 0x94], 0
mov eax, dword [ebp - 0x90]
cmp dword [ebp - 0x94], eax
jae 0x40aba2
and eax, 1
cmp dword [ebp - 0x90], 1
ja 0x40aea0
sub esp, 0xc
mov edi, dword [str.LC_CTYPE]
push edi
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov eax, dword [str.LC_CTYPE]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov dword [ebp - 0x70], 3
call fcn.004281c0
add esp, 0xc
push 0x3d
push 1
lea edx, [ebp - 0x48]
push edx
call fcn.00428330
pop eax
pop edx
lea esi, [ebp - 0x28]
push esi
lea ebx, [ebp - 0x48]
push ebx
call fcn.00428220
add esp, 0xc
push 0x3b
push 1
lea ecx, [ebp - 0x48]
push ecx
call fcn.00428330
add esp, 0x10
mov dword [ebp - 0x94], 1
mov eax, dword [ebp - 0x90]
cmp dword [ebp - 0x94], eax
jae 0x40aba2
mov esi, dword [ebp - 0x94]
mov ebx, dword [esi*4 + 0x437080]
mov dword [ebp - 0xbc], ebx
sub esp, 0xc
push ebx
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov edx, dword [ebp - 0xbc]
push edx
lea edi, [ebp - 0x48]
push edi
mov dword [ebp - 0x70], 3
call fcn.004281c0
add esp, 0xc
push 0x3d
push 1
lea ecx, [ebp - 0x48]
push ecx
call fcn.00428330
pop edi
pop eax
lea eax, [ebp - 0x28]
push eax
lea edi, [ebp - 0x48]
push edi
call fcn.00428220
add esp, 0xc
push 0x3b
push 1
lea ebx, [ebp - 0x48]
push ebx
call fcn.00428330
mov edi, dword [ebp - 0x94]
mov ecx, dword [edi*4 + 0x437084]
mov dword [ebp - 0xc0], ecx
mov dword [esp], ecx
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov edx, dword [ebp - 0xc0]
push edx
lea esi, [ebp - 0x48]
push esi
mov dword [ebp - 0x70], 3
call fcn.004281c0
add esp, 0xc
push 0x3d
push 1
lea ebx, [ebp - 0x48]
push ebx
call fcn.00428330
pop ecx
pop ebx
lea eax, [ebp - 0x28]
push eax
lea esi, [ebp - 0x48]
push esi
call fcn.00428220
add esp, 0xc
push 0x3b
push 1
lea ecx, [ebp - 0x48]
push ecx
call fcn.00428330
add esp, 0x10
add dword [ebp - 0x94], 2
mov edx, dword [ebp - 0x90]
cmp dword [ebp - 0x94], edx
jb 0x40aabb
mov eax, dword [ebp - 0x90]
mov esi, dword [eax*4 + 0x437080]
mov dword [ebp - 0xac], esi
sub esp, 0xc
push esi
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov ebx, dword [ebp - 0xac]
push ebx
lea edi, [ebp - 0x48]
push edi
mov dword [ebp - 0x70], 3
call fcn.004281c0
add esp, 0xc
push 0x3d
push 1
lea ecx, [ebp - 0x48]
push ecx
call fcn.00428330
pop eax
mov ebx, dword [ebp - 0x8c]
push ebx
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov edi, dword [ebp - 0x8c]
push edi
lea edx, [ebp - 0x48]
push edx
call fcn.004281c0
add esp, 0xc
push 0x3b
push 1
lea esi, [ebp - 0x48]
push esi
call fcn.00428330
add esp, 0x10
inc dword [ebp - 0x90]
cmp dword [ebp - 0x90], 5
ja 0x40acda
sub esp, 0xc
mov edi, dword [ebp - 0x90]
mov eax, 0x437080
mov ecx, dword [eax + edi*4]
push ecx
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x8c], eax
add esp, 0x10
test eax, eax
je 0x40ac5d
cmp byte [eax], 0
jne 0x40ada7
mov ecx, dword [ebp - 0x90]
mov edi, 0x437080
mov esi, dword [edi + ecx*4]
mov dword [ebp - 0xb0], esi
sub esp, 0xc
push esi
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov edx, dword [ebp - 0xb0]
push edx
lea ebx, [ebp - 0x48]
push ebx
mov dword [ebp - 0x70], 3
call fcn.004281c0
add esp, 0xc
push 0x3d
push 1
lea ebx, [ebp - 0x48]
push ebx
call fcn.00428330
pop edi
pop eax
lea edx, [ebp - 0x28]
push edx
lea eax, [ebp - 0x48]
push eax
call fcn.00428220
add esp, 0xc
push 0x3b
push 1
lea ebx, [ebp - 0x48]
push ebx
call fcn.00428330
add esp, 0x10
inc dword [ebp - 0x90]
cmp dword [ebp - 0x90], 5
jbe 0x40ac30
mov esi, dword [ebp - 0x48]
sub esi, 0xc
mov edx, dword [esi + 8]
shr edx, 0x1f
test dl, dl
jne 0x40ad00
sub esp, 0xc
lea eax, [ebp - 0x48]
push eax
mov dword [ebp - 0x70], 3
call fcn.00427650
add esp, 0x10
mov esi, dword [ebp - 0x48]
mov ebx, esi
add ebx, dword [esi - 0xc]
lea edx, [ebx - 1]
mov edi, edx
sub edi, esi
sub ebx, edx
sub esp, 0xc
push 0
push esi
push ebx
push edi
lea ecx, [ebp - 0x48]
push ecx
mov dword [ebp - 0x70], 3
call fcn.00428ce0
add esp, 0x14
mov ecx, dword [ebp - 0x48]
sub ecx, 0xc
mov dword [ecx + 8], 0xffffffff
push 0x24
call fcn.00408060
mov dword [ebp - 0x98], eax
add esp, 0xc
mov esi, dword [ebp - 0x48]
add esi, dword [esi - 0xc]
mov al, byte [0x4391f8]
mov byte [esi], al
push 1
mov ebx, dword [ebp - 0x48]
push ebx
mov edi, dword [ebp - 0x98]
push edi
mov dword [ebp - 0x70], 2
call fcn.0040f620
mov edx, dword [ebp - 0x98]
mov ebx, dword [ebp - 0x78]
mov dword [ebx], edx
add esp, 0x10
mov eax, dword [ebp - 0x48]
lea ecx, [eax - 0xc]
lea ebx, [ebp - 0x38]
mov edi, 0xffffffff
lock xadd dword [eax - 4], edi
test edi, edi
jg 0x40a97e
sub esp, 8
push ebx
push ecx
call fcn.00427c50
jmp 0x40a9f3
mov esi, dword [ebp - 0x8c]
mov edi, 0x438cb9
mov ecx, 2
cld
repe cmpsb byte [esi], byte es:[edi]
je 0x40add0
mov esi, dword [ebp - 0x8c]
mov edi, str.POSIX
mov ecx, 6
repe cmpsb byte [esi], byte es:[edi]
jne 0x40ae2b
mov ebx, dword [ebp - 0x90]
mov edx, 0x437080
mov edi, dword [edx + ebx*4]
mov dword [ebp - 0xb4], edi
sub esp, 0xc
push edi
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov ecx, dword [ebp - 0xb4]
push ecx
lea esi, [ebp - 0x48]
push esi
mov dword [ebp - 0x70], 3
call fcn.004281c0
mov dword [esp], 0x438ccd
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
push 0x438ccd
lea eax, [ebp - 0x48]
push eax
call fcn.004281c0
jmp 0x40acc4
mov ebx, dword [ebp - 0x90]
mov eax, 0x437080
mov edi, dword [eax + ebx*4]
mov dword [ebp - 0xb8], edi
sub esp, 0xc
push edi
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov ecx, dword [ebp - 0xb8]
push ecx
lea esi, [ebp - 0x48]
push esi
mov dword [ebp - 0x70], 3
call fcn.004281c0
add esp, 0xc
push 0x3d
push 1
lea edx, [ebp - 0x48]
push edx
call fcn.00428330
pop ecx
mov edi, dword [ebp - 0x8c]
push edi
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov ecx, dword [ebp - 0x8c]
push ecx
lea esi, [ebp - 0x48]
push esi
call fcn.004281c0
jmp 0x40acb4
test eax, eax
je 0x40aabb
jmp 0x40aa44
mov edx, dword [ebp - 0x90]
and edx, 1
mov ecx, dword [ebp - 0x90]
inc ecx
cmp ecx, 6
jb 0x40afc6
sub esp, 0xc
mov edx, dword [ebp - 0x90]
mov edi, dword [edx*4 + 0x437080]
push edi
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x8c], eax
add esp, 0x10
test eax, eax
je 0x40aef5
cmp byte [eax], 0
jne 0x40afa9
inc dword [ebp - 0x90]
cmp dword [ebp - 0x90], 5
ja 0x40a953
sub esp, 0xc
mov ecx, dword [ebp - 0x90]
mov esi, dword [ecx*4 + 0x437080]
push esi
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x8c], eax
add esp, 0x10
test eax, eax
je 0x40af30
cmp byte [eax], 0
jne 0x40af90
inc dword [ebp - 0x90]
sub esp, 0xc
mov edx, dword [ebp - 0x90]
mov edi, dword [edx*4 + 0x437080]
push edi
call sub.cygwin1.dll_getenv
mov dword [ebp - 0x8c], eax
add esp, 0x10
test eax, eax
je 0x40af5e
cmp byte [eax], 0
jne 0x40af72
inc dword [ebp - 0x90]
cmp dword [ebp - 0x90], 5
jbe 0x40af08
jmp 0x40a953
sub esp, 8
push eax
lea ebx, [ebp - 0x28]
push ebx
call fcn.00415480
add esp, 0x10
test eax, eax
je 0x40af5e
jmp 0x40a9f8
sub esp, 8
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.00415480
add esp, 0x10
test eax, eax
je 0x40af30
jmp 0x40a9f8
sub esp, 8
push eax
lea ebx, [ebp - 0x28]
push ebx
call fcn.00415480
add esp, 0x10
test eax, eax
jne 0x40a9f8
jmp 0x40aef5
test edx, edx
je 0x40af08
jmp 0x40aec9
sub esp, 0xc
mov ecx, dword [ebp - 0x8c]
push ecx
call sub.cygwin1.dll_strlen
add esp, 0xc
push eax
mov esi, dword [ebp - 0x8c]
push esi
lea eax, [ebp - 0x28]
push eax
jmp 0x40a845
mov dword [ebp - 0x70], 0xffffffff
call fcn.0040bb10
jmp 0x40a698
sub esp, 0xc
push str.attempt_to_create_locale_from_NULL_name
mov dword [ebp - 0x70], 0xffffffff
call fcn.0040cd20
jmp 0x40a6fd