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

Disassembly:
sub esp, 0x64
push ebx
push ebp
mov ebp, dword [esp + 0x70]
push esi
push edi
xor edi, edi
mov di, word [ebp]
xor eax, eax
mov ax, word [ebp + 2]
mov ecx, edi
shr ecx, 1
mov dword [esp + 0x30], ecx
xor ecx, ecx
mov cl, byte [ebp + 0xc]
mov edx, eax
mov ebx, edi
mov dword [esp + 0x40], ecx
shr edx, 4
shr ebx, 4
xor ecx, ecx
mov dword [esp + 0x20], edi
test edx, edx
mov dword [esp + 0x48], eax
mov dword [esp + 0x38], ebx
mov dword [esp + 0x44], edx
lea esi, [ebp + 0x30]
mov dword [esp + 0x24], ecx
jbe 0x4085da
jmp 0x408219
mov ebx, dword [esp + 0x38]
test ebx, ebx
mov dword [esp + 0x10], 0
jbe 0x4085b9
imul eax, edi
mov edx, eax
mov dword [esp + 0x1c], 0
shr edx, 2
mov dword [esp + 0x3c], edx
lea edx, [ecx*8]
imul edx, dword [esp + 0x30]
shl ecx, 4
add edx, eax
imul ecx, edi
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], ecx
jmp 0x408267
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov edi, dword [esp + 0x20]
mov eax, dword [ebp + 0x10]
add ecx, eax
add eax, edx
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x5c], ecx
add edx, eax
lea ebx, [ecx + 8]
lea ecx, [ecx + edi*8]
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x70], edx
mov edx, dword [ebp + 0x1c]
add edi, edx
mov dword [esp + 0x6c], eax
mov dword [esp + 0x64], ecx
add ecx, 8
mov dword [edi], 2
mov eax, dword [esi + 0xc]
mov dword [esp + 0x60], ebx
mov dword [esp + 0x68], ecx
lea edx, [eax - 0x1e]
mov dword [esp + 0x2c], edi
test edx, edx
jle 0x4082d2
mov ebx, dword [esi + 4]
mov ecx, 0x20
sub ecx, edx
or edx, 0xffffffff
shr ebx, cl
mov ecx, eax
shr edx, cl
mov ecx, dword [esi]
and edx, ecx
lea ecx, [eax - 0x1e]
shl edx, cl
or ebx, edx
jmp 0x4082e6
or ebx, 0xffffffff
mov ecx, eax
shr ebx, cl
mov ecx, dword [esi]
and ebx, ecx
mov ecx, 0x1e
sub ecx, eax
shr ebx, cl
add eax, 2
cmp eax, 0x20
mov dword [esp + 0x78], eax
mov dword [esi + 0xc], eax
jb 0x408339
mov eax, dword [esi + 4]
mov dword [esi], eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 8]
mov ecx, eax
mov edx, eax
and ecx, 0xff0000
shr edx, 0x10
or ecx, edx
mov edx, eax
shl edx, 0x10
and eax, 0xff00
or edx, eax
mov eax, dword [esi + 0x10]
add eax, 4
shr ecx, 8
shl edx, 8
mov dword [esi + 0x10], eax
mov eax, dword [esp + 0x78]
or ecx, edx
add eax, 0xffffffe0
mov dword [esi + 4], ecx
mov dword [esi + 0xc], eax
mov eax, dword [esi + 0xc]
lea edx, [eax - 0x1f]
test edx, edx
jle 0x40836f
mov ecx, 0x20
sub ecx, edx
mov edx, dword [esi + 4]
shr edx, cl
mov ecx, eax
mov dword [esp + 0x78], edx
or edx, 0xffffffff
shr edx, cl
mov ecx, dword [esi]
and edx, ecx
lea ecx, [eax - 0x1f]
shl edx, cl
mov ecx, dword [esp + 0x78]
or ecx, edx
mov dword [esp + 0x28], ecx
jmp 0x408387
or edx, 0xffffffff
mov ecx, eax
shr edx, cl
mov ecx, dword [esi]
and edx, ecx
mov ecx, 0x1f
sub ecx, eax
shr edx, cl
mov dword [esp + 0x28], edx
inc eax
cmp eax, 0x20
mov dword [esp + 0x78], eax
mov dword [esi + 0xc], eax
jb 0x4083d8
mov edx, dword [esi + 4]
mov eax, dword [esi + 0x10]
mov dword [esi], edx
mov eax, dword [eax + 8]
mov ecx, eax
mov edx, eax
and ecx, 0xff0000
shr edx, 0x10
or ecx, edx
mov edx, eax
shl edx, 0x10
and eax, 0xff00
or edx, eax
mov eax, dword [esi + 0x10]
add eax, 4
shr ecx, 8
shl edx, 8
mov dword [esi + 0x10], eax
mov eax, dword [esp + 0x78]
or ecx, edx
add eax, 0xffffffe0
mov dword [esi + 4], ecx
mov dword [esi + 0xc], eax
push 1
push esi
call fcn.00406a60
shl al, 2
or al, bl
lea edx, [esp + 0x64]
mov byte [edi + 0xd3], al
mov cl, byte [ebp + 0xc]
add esp, 8
mov byte [edi + 0xd2], cl
xor ebx, ebx
mov dword [esp + 0x34], edx
mov dword [esp + 0x78], 5
mov edi, dword [ebp + 4]
mov edx, dword [esp + 0x10]
mov ecx, 0x20
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x4c]
push eax
mov eax, dword [ebp + 0x20]
push ebx
push ecx
mov ecx, dword [ebp + 0x1c]
push edx
push eax
push ecx
call fcn.00409cb0
mov eax, dword [esp + 0x40]
add esp, 0x18
test eax, eax
jne 0x408449
mov edx, dword [esp + 0x2c]
mov byte [ebx + edx + 0xcc], 0
cmp ebx, 4
push esi
jae 0x408456
call fcn.00407090
jmp 0x40845b
call fcn.004071b0
mov edi, eax
add esp, 4
test edi, edi
je 0x408470
push edi
push esi
call fcn.004072f0
add esp, 8
jmp 0x408472
xor eax, eax
mov ecx, dword [ebp + 4]
cmp edi, 8
mov word [ecx], ax
jle 0x4084cb
mov ecx, dword [esi + 0xc]
inc ecx
mov eax, ecx
mov dword [esi + 0xc], ecx
cmp eax, 0x20
jb 0x4084cb
mov edx, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov dword [esi], edx
mov eax, dword [ecx + 8]
add ecx, 4
mov edx, eax
mov edi, eax
and edx, 0xff0000
mov dword [esi + 0x10], ecx
shr edi, 0x10
or edx, edi
mov edi, eax
shl edi, 0x10
and eax, 0xff00
or edi, eax
mov eax, dword [esi + 0xc]
shr edx, 8
shl edi, 8
or edx, edi
add eax, 0xffffffe0
mov dword [esi + 4], edx
mov dword [esi + 0xc], eax
mov ecx, dword [esp + 0x78]
mov edi, dword [esp + 0x2c]
mov eax, 1
shl eax, cl
mov cl, byte [edi + 0xd3]
test cl, al
je 0x4084ff
mov eax, dword [ebp + 4]
xor edx, edx
mov dl, byte [ebx + edi + 0xcc]
push 1
push 1
push edx
push eax
push esi
call fcn.00406da0
add esp, 0x14
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x4c]
push ecx
push edx
push ebx
push edi
call fcn.00406530
mov eax, dword [esp + 0x50]
mov ecx, dword [ebp + 4]
mov edx, dword [ebp + 8]
push eax
push ecx
push edx
call dword [0x434aec]
mov eax, dword [ebp + 8]
push eax
call dword [0x434ae4]
mov eax, dword [esp + 0x40]
add esp, 0x20
cmp ebx, 4
jb 0x40853c
mov eax, dword [esp + 0x30]
mov edi, dword [esp + 0x34]
mov ecx, dword [ebp + 8]
push 8
push eax
mov edx, dword [edi]
push ecx
push edx
call dword [0x434adc]
mov edx, dword [esp + 0x88]
add esp, 0x10
inc ebx
dec edx
add edi, 4
cmp ebx, 6
mov dword [esp + 0x78], edx
mov dword [esp + 0x34], edi
jb 0x408409
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x38]
inc eax
add ebx, 0x10
add edi, 8
add edx, 0xd4
cmp eax, ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], edx
jb 0x40825b
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x48]
mov edi, dword [esp + 0x20]
mov ebx, dword [ebp + 0x1c]
inc ecx
mov dword [esp + 0x78], ebx
mov ebx, dword [ebp + 0x20]
mov dword [ebp + 0x1c], ebx
mov ebx, dword [esp + 0x78]
cmp ecx, edx
mov dword [ebp + 0x20], ebx
mov dword [esp + 0x24], ecx
jb 0x408215
mov eax, dword [esi + 0xc]
and eax, 7
je 0x408633
mov edx, dword [esi + 0xc]
mov ecx, 8
sub ecx, eax
add edx, ecx
cmp edx, 0x20
mov dword [esi + 0xc], edx
jb 0x408633
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov dword [esi], eax
mov eax, dword [ecx + 8]
add ecx, 4
mov edi, eax
mov ebx, eax
and edi, 0xff0000
mov dword [esi + 0x10], ecx
shr ebx, 0x10
or edi, ebx
mov ebx, eax
shl ebx, 0x10
and eax, 0xff00
or ebx, eax
shr edi, 8
shl ebx, 8
or edi, ebx
add edx, 0xffffffe0
mov dword [esi + 4], edi
mov dword [esi + 0xc], edx
mov ecx, dword [esi + 0x14]
mov ebp, dword [esi + 0x10]
mov eax, ecx
mov edi, dword [esi + 0x1c]
shl eax, 0x1d
mov edx, dword [esi + 0xc]
sub eax, ecx
add eax, ebp
shl eax, 3
sub eax, edi
pop edi
add eax, edx
pop esi
pop ebp
pop ebx
shr eax, 3
add esp, 0x64
ret