Function at 0x4041c0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov ecx, dword [ebp + 0x20]
mov eax, 0xfffffffa
test ecx, ecx
je 0x4043e8
cmp dword [ebp + 0x24], 0x38
jne 0x4043e8
cmp byte [ecx], 0x31
jne 0x4043e8
mov esi, dword [ebp + 8]
mov eax, 0xfffffffe
test esi, esi
je 0x4043e8
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0x1c]
mov dword [ebp - 0x18], ecx
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
mov dword [esi + 0x18], 0
mov dword [ebp - 0x14], edi
mov edi, dword [esi + 0x20]
test edi, edi
je 0x4043f0
cmp dword [esi + 0x24], 0
je 0x40440d
cmp dword [ebp - 0x14], 0xffffffff
je 0x40441e
test ebx, ebx
mov dword [ebp - 0x1c], edx
jns 0x40442a
neg ebx
mov dword [ebp - 0x10], 0
cmp edx, 4
ja 0x4043e8
cmp dword [ebp - 0x14], 9
ja 0x4043e8
cmp ecx, 8
jne 0x4043e8
mov ecx, dword [ebp - 0x18]
dec ecx
cmp ecx, 8
ja 0x4043e8
mov ecx, ebx
and ecx, 0xfffffff8
cmp ecx, 8
jne 0x4043e8
cmp ebx, 8
jne 0x404291
cmp dword [ebp - 0x10], 1
jne 0x4043e8
cmp ebx, 8
je 0x404450
push 0x16c4
push 1
push dword [esi + 0x28]
call edi
add esp, 0xc
test eax, eax
je 0x4043e3
mov dword [esi + 0x1c], eax
mov dword [eax], esi
mov edi, eax
mov dword [eax + 4], 0x2a
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0x18]
mov ecx, ebx
mov dword [edi + 0x18], eax
mov eax, 1
mov dword [edi + 0x1c], 0
mov dword [edi + 0x30], ebx
mov ebx, edx
shl eax, cl
lea ecx, [eax - 1]
mov dword [edi + 0x2c], eax
mov dword [edi + 0x34], ecx
lea ecx, [edx + 7]
mov edx, 1
mov dword [edi + 0x50], ecx
shl edx, cl
mov ecx, ebx
mov ebx, 1
add cl, 9
mov dword [edi + 0x4c], edx
dec edx
movzx ecx, cl
mov dword [edi + 0x54], edx
imul ecx, ecx, 0xab
shr ecx, 9
mov dword [edi + 0x58], ecx
push 2
push eax
push dword [esi + 0x28]
call dword [esi + 0x20]
add esp, 0xc
mov dword [edi + 0x38], eax
push 2
push dword [edi + 0x2c]
push dword [esi + 0x28]
call dword [esi + 0x20]
add esp, 0xc
mov dword [edi + 0x40], eax
push 2
push dword [edi + 0x4c]
push dword [esi + 0x28]
call dword [esi + 0x20]
add esp, 0xc
mov ecx, dword [ebp - 0x18]
mov dword [edi + 0x44], eax
mov dword [edi + 0x16c0], 0
add cl, 6
shl ebx, cl
mov dword [edi + 0x169c], ebx
push 4
push ebx
push dword [esi + 0x28]
call dword [esi + 0x20]
add esp, 0xc
mov dword [edi + 8], eax
mov ecx, dword [edi + 0x169c]
lea edx, [ecx*4]
mov dword [edi + 0xc], edx
cmp dword [edi + 0x38], 0
je 0x4043cb
cmp dword [edi + 0x40], 0
je 0x4043cb
test eax, eax
je 0x4043cb
cmp dword [edi + 0x44], 0
je 0x4043cb
mov edx, ecx
lea ecx, [ecx + ecx*2]
and edx, 0xfffffffe
add ecx, eax
add edx, eax
mov dword [edi + 0x16a4], edx
mov dword [edi + 0x1698], ecx
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x1c]
mov dword [edi + 0x84], edx
mov dword [edi + 0x88], ecx
mov byte [edi + 0x24], 8
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
jmp fcn.00404500
mov eax, dword [str.insufficient_memory]
mov dword [edi + 4], 0x29a
mov dword [esi + 0x18], eax
push esi
call fcn.00404460
add esp, 4
mov eax, 0xfffffffc
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret
mov edi, 0x408d50
mov dword [esi + 0x20], 0x408d50
mov dword [esi + 0x28], 0
cmp dword [esi + 0x24], 0
jne 0x40422d
mov dword [esi + 0x24], 0x408d70
cmp dword [ebp - 0x14], 0xffffffff
jne 0x404237
mov dword [ebp - 0x14], 6
jmp 0x404237
lea edx, [ebx - 0x10]
mov dword [ebp - 0x20], edx
xor edx, edx
cmp ebx, 0xf
setg dl
mov dword [ebp - 0x10], edx
cmovg ebx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
inc dword [ebp - 0x10]
cmp edx, 4
jbe 0x404254
jmp 0x4043e8
mov ebx, 9
jmp 0x40429a