Function at 0x40c120
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov dword [ebp - 0x34], eax
movzx eax, byte [ebp + 0xc]
mov dword [ebp - 0x2c], edx
mov dword [esp], edx
mov dword [ebp - 0x40], ecx
mov byte [ebp - 0x41], al
mov dword [ebp - 0x1c], 0
call sub.cygwin1.dll_wcslen
mov edx, dword [ebp - 0x2c]
mov ebx, dword [ebp - 0x2c]
add ebx, 2
mov dword [ebp - 0x38], eax
movzx eax, word [edx + 2]
test ax, ax
je 0x40c250
lea ecx, [ebp - 0x1c]
mov edx, ebx
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp - 0x34]
xor edi, edi
sub ecx, 0x3f
mov dword [ebp - 0x3c], ecx
cmp ax, 0x5b
je 0x40c285
cmp ax, 0x2a
je 0x40c260
cmp ax, 0x3f
je 0x40c260
cmp ax, 0x2b
je 0x40c260
cmp ax, 0x40
je 0x40c260
cmp ax, 0x21
je 0x40c260
cmp ax, 0x29
je 0x40c2d0
cmp ax, 0x7c
jne 0x40c280
test edi, edi
jne 0x40c280
cmp dword [ebp - 0x3c], 1
mov ecx, dword [ebp - 0x38]
jbe 0x40c1de
mov ecx, ebx
sub ecx, edx
sar ecx, 1
add ecx, 1
lea eax, [ecx + ecx]
lea esi, [eax + 4]
cmp esi, 3
jbe 0x40c250
shr ecx, 0x1f
test cl, cl
jne 0x40c250
cmp esi, 0x1f3f
ja 0x40c250
add eax, 0x22
and eax, 0xfffffff0
call fcn.00413220
mov ecx, ebx
lea esi, [esp + 0x1f]
sub ecx, edx
and esi, 0xfffffff0
sar ecx, 1
lea eax, [esi + 4]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [ebp - 0x48], ecx
mov dword [esp], eax
call sub.cygwin1.dll_wmemcpy
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x30]
mov word [eax + ecx*2], 0
mov dword [esi], 0
mov dword [edx], esi
lea edx, [ebx + 2]
mov dword [ebp - 0x30], esi
mov ebx, edx
movzx eax, word [ebx]
test ax, ax
jne 0x40c174
nop
mov eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp word [ebx + 2], 0x28
lea ecx, [ebx + 2]
jne 0x40c1b0
add edi, 1
mov ebx, ecx
mov eax, 0x28
jmp 0x40c17e
add ebx, 2
jmp 0x40c242
mov esi, dword [0x41a7f0]
test esi, esi
je 0x40c2f0
movzx ecx, word [ebx + 2]
lea eax, [ebx + 2]
cmp cx, 0x21
je 0x40c2e6
mov ebx, dword [0x41a7f0]
test ebx, ebx
js 0x40c2e0
cmp cx, 0x5d
jne 0x40c2c3
lea esi, [esi]
add eax, 2
movzx ecx, word [eax]
lea ebx, [eax + 2]
cmp cx, 0x5d
je 0x40c242
test cx, cx
jne 0x40c2b0
jmp 0x40c250
test edi, edi
je 0x40c314
sub edi, 1
add ebx, 2
jmp 0x40c242
cmp cx, 0x5e
jne 0x40c2a6
add eax, 2
movzx ecx, word [eax]
jmp 0x40c2a6
mov dword [ebp - 0x48], edx
mov dword [esp], str.POSIXLY_CORRECT
call sub.cygwin1.dll_getenv
mov edx, dword [ebp - 0x48]
cmp eax, 1
sbb eax, eax
or eax, 1
mov dword [0x41a7f0], eax
jmp 0x40c28f
mov ecx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x38]
sub ecx, 0x3f
cmp ecx, 1
jbe 0x40c32b
mov eax, ebx
sub eax, edx
sar eax, 1
add eax, 1
lea ecx, [eax + eax]
lea esi, [ecx + 4]
cmp esi, 3
jbe 0x40c250
shr eax, 0x1f
test al, al
jne 0x40c250
or eax, 0xffffffff
cmp esi, 0x1f3f
ja 0x40c255
lea eax, [ecx + 0x22]
and eax, 0xfffffff0
call fcn.00413220
lea esi, [esp + 0x1f]
mov edi, ebx
and esi, 0xfffffff0
sub edi, edx
sar edi, 1
lea eax, [esi + 4]
mov dword [esp + 8], edi
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.cygwin1.dll_wmemcpy
mov word [eax + edi*2], 0
mov eax, dword [ebp - 0x30]
mov dword [esi], 0
mov dword [eax], esi
mov esi, dword [ebp - 0x1c]
test esi, esi
je 0x40c3e6
cmp word [ebx - 2], 0x29
jne 0x40c520
cmp dword [ebp - 0x34], 0x2b
je 0x40c434
ja 0x40c5c7
cmp dword [ebp - 0x34], 0x21
je 0x40c54b
cmp dword [ebp - 0x34], 0x2a
je 0x40c40a
mov dword [esp + 0xc], str.___Invalid_extended_matching_operator_
mov dword [esp + 8], str.ext_wmatch
mov dword [esp + 4], 0x4b0
mov dword [esp], str._usr_src_coreutils_8.15_1_src_coreutils_8.15_lib_fnmatch_loop.c
call sub.cygwin1.dll___assert_func
mov dword [esp + 0xc], str.list___NULL
mov dword [esp + 8], str.ext_wmatch
mov dword [esp + 4], 0x455
mov dword [esp], str._usr_src_coreutils_8.15_1_src_coreutils_8.15_lib_fnmatch_loop.c
call sub.cygwin1.dll___assert_func
mov edx, dword [ebp + 0x10]
movzx eax, byte [ebp - 0x41]
mov ecx, dword [ebp + 8]
mov dword [esp + 4], edx
mov edx, dword [ebp - 0x40]
mov dword [esp], eax
mov eax, ebx
call fcn.0040c6e0
mov edx, eax
xor eax, eax
test edx, edx
je 0x40c255
mov esi, dword [ebp - 0x1c]
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ebp - 0x41]
mov edx, dword [ebp + 0x10]
mov edi, dword [ebp - 0x40]
and ecx, 0xfffffffb
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0x10]
and edx, 1
sub ecx, 2
and eax, 5
mov dword [ebp - 0x2c], eax
mov eax, esi
mov esi, edx
mov dword [ebp - 0x38], ecx
jmp 0x40c509
mov edx, dword [ebp + 0x10]
test esi, esi
cmove edx, dword [ebp - 0x30]
add eax, 4
mov ecx, dword [ebp - 0x34]
mov dword [esp + 4], edx
mov edx, dword [ebp - 0x40]
mov dword [esp], ecx
mov ecx, edi
call fcn.0040c6e0
test eax, eax
jne 0x40c503
mov edx, dword [ebp + 0x10]
test esi, esi
cmove edx, dword [ebp - 0x30]
cmp edi, dword [ebp - 0x40]
je 0x40c6d2
xor eax, eax
cmp word [edi - 2], 0x2f
je 0x40c6c4
movzx eax, al
mov ecx, dword [ebp + 8]
mov dword [esp + 4], edx
mov edx, edi
mov dword [esp], eax
mov eax, ebx
call fcn.0040c6e0
test eax, eax
je 0x40c67b
cmp edi, dword [ebp - 0x40]
je 0x40c503
mov edx, dword [ebp + 0x10]
test esi, esi
cmove edx, dword [ebp - 0x30]
xor eax, eax
cmp word [edi - 2], 0x2f
je 0x40c682
movzx eax, al
mov ecx, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], edx
mov edx, edi
call fcn.0040c6e0
test eax, eax
je 0x40c67b
mov eax, dword [ebp - 0x1c]
add edi, 2
cmp edi, dword [ebp + 8]
jbe 0x40c468
mov eax, dword [eax]
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x40c544
mov edi, dword [ebp - 0x40]
jmp 0x40c509
mov dword [esp + 0xc], str.p__1___L____
mov dword [esp + 8], str.ext_wmatch
mov dword [esp + 4], 0x456
mov dword [esp], str._usr_src_coreutils_8.15_1_src_coreutils_8.15_lib_fnmatch_loop.c
call sub.cygwin1.dll___assert_func
mov al, 1
jmp 0x40c255
mov eax, dword [ebp + 0x10]
mov edi, ebx
mov ecx, dword [ebp - 0x40]
movzx edx, byte [ebp - 0x41]
and eax, 1
mov dword [ebp - 0x2c], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x34], edx
and ecx, 0xfffffffb
and eax, 5
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 8]
cmp dword [ebp - 0x2c], eax
ja 0x40c5bd
mov ebx, esi
jmp 0x40c58b
mov ebx, dword [ebx]
test ebx, ebx
je 0x40c634
mov edx, dword [ebp - 0x30]
lea eax, [ebx + 4]
mov ecx, dword [ebp - 0x34]
test edx, edx
mov edx, dword [ebp + 0x10]
cmove edx, dword [ebp - 0x38]
mov dword [esp], ecx
mov ecx, dword [ebp - 0x2c]
mov dword [esp + 4], edx
mov edx, dword [ebp - 0x40]
call fcn.0040c6e0
test eax, eax
jne 0x40c581
test ebx, ebx
je 0x40c634
add dword [ebp - 0x2c], 2
jmp 0x40c575
mov eax, 1
jmp 0x40c255
cmp dword [ebp - 0x34], 0x3f
je 0x40c695
cmp dword [ebp - 0x34], 0x40
jne 0x40c3c2
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ebp - 0x41]
and edx, 1
and ecx, 0xfffffffb
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x34], eax
jmp 0x40c5ff
mov esi, dword [esi]
test esi, esi
mov dword [ebp - 0x1c], esi
je 0x40c5bd
mov edi, dword [ebp + 0x10]
lea eax, [esi + 4]
cmp dword [ebp - 0x2c], 0
mov dword [esp + 4], ebx
cmove edi, dword [ebp - 0x30]
mov dword [esp], eax
call sub.cygwin1.dll_wcscat
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp + 8]
mov dword [esp + 4], edi
mov dword [esp], edx
mov edx, dword [ebp - 0x40]
call fcn.0040c6e0
test eax, eax
jne 0x40c5f6
jmp 0x40c67b
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x40]
cmp dword [ebp - 0x30], 0
cmove edx, dword [ebp - 0x38]
cmp dword [ebp - 0x2c], eax
je 0x40c690
mov ecx, dword [ebp - 0x2c]
xor eax, eax
cmp word [ecx - 2], 0x2f
jne 0x40c65c
xor eax, eax
cmp dword [ebp - 0x3c], 5
sete al
movzx eax, al
mov dword [esp + 4], edx
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x2c]
mov dword [esp], eax
mov eax, edi
call fcn.0040c6e0
test eax, eax
jne 0x40c5b7
xor eax, eax
jmp 0x40c255
xor eax, eax
cmp dword [ebp - 0x2c], 5
sete al
jmp 0x40c4e4
mov eax, dword [ebp - 0x34]
jmp 0x40c65f
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp - 0x40]
mov ecx, dword [ebp + 8]
mov dword [esp + 4], eax
movzx eax, byte [ebp - 0x41]
mov dword [esp], eax
mov eax, ebx
call fcn.0040c6e0
mov edx, eax
xor eax, eax
test edx, edx
je 0x40c255
mov esi, dword [ebp - 0x1c]
jmp 0x40c5db
xor eax, eax
cmp dword [ebp - 0x2c], 5
sete al
jmp 0x40c4ab
mov eax, dword [ebp - 0x34]
jmp 0x40c4ae