Function at 0x40138e
Capabilities:
Access peb ldr_data
Get ntdll base address
Get process heap flags
Get process heap force flags
Query environment variable

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x48
mov eax, dword [ecx]
cmp dword [0x402010], 0xffffffff
mov dword [ebp - 0x30], eax
jne 0x40165e
mov dword [esp], str.WINEDEBUG
xor edi, edi
call dword [sym.imp.ucrtbase.dll_getenv]
mov dword [0x402010], edi
test eax, eax
je 0x40165e
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__strdup]
mov dword [ebp - 0x2c], eax
mov esi, eax
test eax, eax
je 0x40165e
mov dword [esp + 4], 0x2c
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_strchr]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x401406
mov byte [eax], 0
inc eax
mov dword [ebp - 0x1c], eax
mov dword [esp + 4], 0x403046
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_strcspn]
lea ebx, [esi + eax]
mov edi, eax
mov al, byte [ebx]
mov byte [ebp - 0x24], al
test al, al
je 0x401493
cmp esi, ebx
jae 0x401495
mov eax, dword [sym.imp.ucrtbase.dll_strlen]
xor ecx, ecx
mov dword [ebp - 0x20], eax
mov edx, dword [ecx*4 + 0x4030dc]
mov dword [ebp - 0x28], ecx
mov dword [esp], edx
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x34], edx
call eax
mov ecx, dword [ebp - 0x28]
cmp edi, eax
jne 0x401488
mov dword [esp + 8], edi
mov edx, dword [ebp - 0x34]
mov dword [esp], esi
mov dword [esp + 4], edx
call dword [sym.imp.ucrtbase.dll_memcmp]
mov ecx, dword [ebp - 0x28]
test eax, eax
jne 0x401488
mov eax, 1
xor edx, edx
shl eax, cl
cmp byte [ebp - 0x24], 0x2b
mov byte [ebp - 0x20], al
cmove eax, edx
mov byte [ebp - 0x28], al
mov al, byte [ebp - 0x20]
cmovne eax, edx
jmp 0x4014a6
inc ecx
cmp ecx, 4
jne 0x401433
jmp 0x401644
mov ebx, esi
cmp byte [ebx], 0x2d
setne al
dec eax
cmp byte [ebx], 0x2d
mov byte [ebp - 0x28], al
sete al
dec eax
mov byte [ebp - 0x20], al
mov al, byte [ebx]
sub eax, 0x2b
and eax, 0xfffffffd
cmp al, 1
adc ebx, 0
cmp byte [ebx], 0
je 0x401644
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
mov dword [esp + 4], 0x403049
mov dword [esp], ebx
mov dword [ebp - 0x38], eax
call eax
test eax, eax
jne 0x4014f0
mov al, byte [ebp - 0x28]
not eax
and al, byte [0x402014]
or eax, dword [ebp - 0x20]
mov byte [0x402014], al
jmp 0x401644
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strlen]
cmp eax, 0xe
ja 0x401644
mov eax, dword [0x402010]
xor esi, esi
mov edx, dword [0x404088]
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x34], eax
lea ecx, [eax - 1]
cmp dword [ebp - 0x24], ecx
jg 0x40156b
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x3c], edx
lea esi, [eax + ecx]
mov dword [esp], ebx
sar esi, 1
mov edi, esi
shl edi, 4
add edi, edx
lea eax, [edi + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
call eax
mov edx, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x40]
test eax, eax
jne 0x40155c
mov al, byte [ebp - 0x28]
not eax
and al, byte [edi]
or eax, dword [ebp - 0x20]
mov byte [edi], al
jmp 0x401644
jns 0x401563
lea ecx, [esi - 1]
jmp 0x401518
lea eax, [esi + 1]
mov dword [ebp - 0x24], eax
jmp 0x401518
mov eax, dword [0x40408c]
cmp dword [ebp - 0x34], eax
jl 0x4015de
add eax, eax
mov ecx, 0x10
cmp eax, ecx
cmovl eax, ecx
mov dword [0x40408c], eax
shl eax, 4
test edx, edx
jne 0x4015b2
xor ecx, ecx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
jmp 0x4015d9
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov ecx, dword fs:[0x18]
mov eax, dword [ecx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
sub esp, 0x10
mov dword [0x404088], eax
mov edx, dword [ebp - 0x24]
mov ecx, dword [0x404088]
mov esi, dword [0x402010]
shl edx, 4
mov dword [ebp - 0x34], edx
lea edi, [ecx + edx]
cmp dword [ebp - 0x24], esi
jge 0x40161d
mov edx, dword [ebp - 0x24]
mov eax, esi
mov dword [esp + 4], edi
sub eax, edx
shl eax, 4
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x34]
lea eax, [ecx + eax + 0x10]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_memmove]
lea eax, [edi + 1]
mov dword [esp + 4], ebx
inc esi
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strcpy]
mov al, byte [ebp - 0x28]
mov dword [0x402010], esi
not eax
and al, byte [0x402014]
or eax, dword [ebp - 0x20]
mov byte [edi], al
cmp dword [ebp - 0x1c], 0
je 0x401652
mov esi, dword [ebp - 0x1c]
jmp 0x4013e7
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_free]
mov eax, dword [0x402010]
xor edx, edx
lea ebx, [eax - 1]
mov eax, dword [0x404088]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x30]
lea ecx, [eax + 1]
cmp edx, ebx
jg 0x4016b9
lea esi, [edx + ebx]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], edx
sar esi, 1
mov dword [esp], ecx
mov edi, esi
shl edi, 4
add edi, eax
lea eax, [edi + 1]
mov dword [esp + 4], eax
mov dword [ebp - 0x20], ecx
call dword [sym.imp.ucrtbase.dll_strcmp]
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x24]
test eax, eax
jne 0x4016ad
mov al, byte [edi]
jmp 0x4016c8
jns 0x4016b4
lea ebx, [esi - 1]
jmp 0x401676
lea edx, [esi + 1]
jmp 0x401676
mov ebx, dword [ebp - 0x30]
mov al, byte [0x402014]
cmp byte [ebx], 0
jns 0x4016c8
mov byte [ebx], al
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret