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

Disassembly:
sub esp, 0x54
mov dword [esp], ecx
mov ecx, dword [esp + 0x64]
mov eax, ecx
push ebx
shr eax, 4
push ebp
and eax, 7
push esi
mov esi, dword [esp + 0x68]
push edi
mov edi, ecx
shr ecx, 8
and ecx, 7
mov dword [esp + 0x38], ecx
and edi, 7
mov edx, 1
cmp edx, ecx
sbb ecx, ecx
xor edx, edx
neg ecx
cmp edx, eax
sbb edx, edx
neg edx
mov dword [esp + 0x24], edx
mov edx, 9
cmp edx, esi
sbb edx, edx
neg edx
mov dword [esp + 0x28], edx
mov edx, 8
cmp edx, esi
sbb edx, edx
neg edx
mov dword [esp + 0x54], edx
mov edx, 5
cmp edx, esi
sbb ebx, ebx
neg ebx
mov edx, 2
cmp edx, esi
sbb ebp, ebp
xor edx, edx
neg ebp
cmp edx, esi
sbb edx, edx
neg edx
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0x24]
mov dword [esp + 0x44], ecx
lea ecx, [edx + ecx*2]
xor edx, edx
cmp edx, edi
sbb edx, edx
neg edx
lea ecx, [edx + ecx*2]
mov edx, dword [esp + 0x34]
lea ecx, [ecx + ecx*2]
lea ecx, [edx + ecx*2]
mov edx, dword [esp + 0x70]
add ecx, ebp
add ecx, ebx
add ecx, dword [esp + 0x54]
and edx, 7
add ecx, dword [esp + 0x28]
lea ecx, [edx + ecx*8]
mov edx, dword [esp + 0x10]
lea ecx, [edx + ecx*2 + 0x69f128]
mov edx, 6
cmp edx, esi
mov dword [esp + 0x6c], ecx
sbb ecx, ecx
neg ecx
mov edx, 3
cmp edx, esi
sbb edx, edx
neg edx
mov dword [esp + 0x5c], edx
add edx, ecx
add edx, ebp
mov dword [esp + 0x60], ecx
add edx, ebx
mov ecx, dword [esp + 0x10]
lea edx, [ecx + edx*2 + 0x69f428]
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x14], edx
mov edx, 2
cmp edx, ecx
sbb edx, edx
neg edx
mov dword [esp + 0x40], edx
xor edx, edx
cmp edx, ecx
sbb edx, edx
neg edx
mov dword [esp + 0x3c], edx
mov edx, 4
cmp edx, eax
sbb edx, edx
neg edx
mov dword [esp + 0x4c], edx
mov edx, 2
cmp edx, eax
sbb edx, edx
neg edx
mov dword [esp + 0x48], edx
mov edx, 1
cmp edx, eax
sbb edx, edx
neg edx
mov dword [esp + 0x2c], edx
mov edx, 2
cmp edx, edi
sbb edx, edx
neg edx
mov dword [esp + 0x50], edx
mov edx, 1
cmp edx, esi
sbb edx, edx
neg edx
mov dword [esp + 0x30], edx
mov edx, 5
cmp edx, ecx
sbb ecx, ecx
neg ecx
add ecx, dword [esp + 0x3c]
mov edx, 3
add ecx, dword [esp + 0x40]
add ecx, dword [esp + 0x44]
cmp edx, eax
sbb eax, eax
neg eax
add eax, dword [esp + 0x2c]
lea ecx, [ecx + ecx*2]
lea ecx, [eax + ecx*2]
add ecx, dword [esp + 0x48]
add ecx, dword [esp + 0x4c]
add ecx, dword [esp + 0x24]
cmp edx, edi
sbb eax, eax
neg eax
add eax, dword [esp + 0x50]
mov edx, 1
cmp edx, edi
sbb edx, edx
neg edx
lea eax, [eax + ecx*4]
mov ecx, dword [esp + 0x30]
add edx, eax
mov eax, dword [esp + 0x10]
lea edx, [ecx + edx*4]
add edx, ebp
add edx, ebx
lea ecx, [eax + edx*2 + 0x69f432]
mov edx, dword [esp + 0x6c]
movzx eax, word [edx]
cmp eax, 0x4000
mov dword [esp + 0x58], ecx
jge 0x40bacc
movzx edx, word [eax*2 + 0x4d50d4]
neg edx
mov dword [esp + 0x74], edx
jmp 0x40bade
add eax, eax
mov edx, 0x4e50d4
sub edx, eax
movzx eax, word [edx]
mov dword [esp + 0x74], eax
mov edx, eax
mov eax, dword [esp + 0x14]
movzx eax, word [eax]
cmp eax, 0x4000
jge 0x40bafc
movzx eax, word [eax*2 + 0x4d50d4]
neg eax
mov dword [esp + 0x1c], eax
jmp 0x40bb13
lea edx, [eax + eax]
mov eax, 0x4e50d4
sub eax, edx
movzx edx, word [eax]
mov dword [esp + 0x1c], edx
mov eax, edx
mov edx, dword [esp + 0x74]
push 0xb007
push eax
push edx
call fcn.004017a0
test eax, eax
jl 0x40bb48
mov ecx, 0x4000
sub ecx, eax
js 0x40bb3d
movzx ecx, word [ecx*2 + 0x4dd11a]
mov eax, 0x8000
sub eax, ecx
jmp 0x40bb57
xor ecx, ecx
mov eax, 0x8000
sub eax, ecx
jmp 0x40bb57
add eax, 0x4000
js 0x40bb5c
movzx eax, word [eax*2 + 0x4dd11a]
cmp eax, 1
jge 0x40bb63
mov eax, 1
jmp 0x40bb72
cmp eax, 0x7fff
mov dword [esp + 0x18], 0x7fff
jg 0x40bb76
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
push eax
call fcn.00404090
mov edx, dword [esp + 0x6c]
movzx edx, word [edx]
mov ecx, eax
neg ecx
sbb ecx, ecx
mov dword [esp + 0x20], eax
and ecx, 0xffffa02a
add ecx, 0x6feb
mov eax, edx
sub eax, ecx
mov ecx, dword [esp + 0x20]
imul eax, eax, 0x12c
sar eax, 0xf
sub edx, eax
add edx, ecx
cmp edx, 1
jge 0x40bbc2
mov eax, 1
jmp 0x40bbd1
cmp edx, 0x7fff
mov eax, edx
jle 0x40bbd1
mov eax, 0x7fff
mov edx, dword [esp + 0x6c]
mov word [edx], ax
mov eax, dword [esp + 0x14]
movzx edx, word [eax]
neg ecx
sbb ecx, ecx
and ecx, 0xffff9368
add ecx, 0x764c
mov eax, edx
sub eax, ecx
mov ecx, dword [esp + 0x20]
imul eax, eax, 0x891
sar eax, 0xf
sub edx, eax
add edx, ecx
cmp edx, 1
jge 0x40bc10
mov eax, 1
jmp 0x40bc1f
cmp edx, 0x7fff
mov eax, edx
jle 0x40bc1f
mov eax, 0x7fff
mov edx, dword [esp + 0x14]
mov word [edx], ax
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
push eax
mov eax, dword [esp + 0x78]
push 0x43a
push edx
push eax
push ecx
mov ecx, dword [esp + 0x6c]
call fcn.00401800
cmp dword [esp + 0x20], 0
je 0x40bc5a
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x54
ret 0x10
mov ecx, 0xa
cmp ecx, esi
sbb eax, eax
neg eax
mov edx, 5
cmp edx, edi
sbb ecx, ecx
mov edx, dword [esp + 0x2c]
neg ecx
lea ecx, [ecx + edx*2]
mov edx, dword [esp + 0x60]
mov edi, dword [esp + 0x70]
lea ecx, [eax + ecx*8]
add ecx, dword [esp + 0x30]
shr edi, 3
add ecx, dword [esp + 0x5c]
and edi, 1
add ecx, edx
add ecx, dword [esp + 0x34]
add ecx, ebp
add ecx, ebx
lea ecx, [edi + ecx*2]
mov edi, dword [esp + 0x10]
lea ecx, [edi + ecx*2 + 0x69f7f2]
mov dword [esp + 0x34], ecx
mov ecx, 7
cmp ecx, esi
sbb ecx, ecx
neg ecx
lea edi, [ecx + eax]
add edi, edx
add edi, dword [esp + 0x28]
mov edx, dword [esp + 0x10]
lea edx, [edx + edi*2 + 0x69f872]
mov edi, dword [esp + 0x48]
mov dword [esp + 0x30], edx
mov edx, 3
cmp edx, dword [esp + 0x38]
sbb edx, edx
neg edx
add edx, dword [esp + 0x3c]
add edx, dword [esp + 0x40]
add edx, dword [esp + 0x44]
lea edx, [edi + edx*4]
add edx, dword [esp + 0x4c]
mov edi, dword [esp + 0x50]
add edx, dword [esp + 0x24]
lea edx, [edi + edx*2]
mov edi, 4
cmp edi, esi
sbb edi, edi
neg edi
add edi, ecx
lea ecx, [edi + edx*8]
mov edx, dword [esp + 0x34]
add ecx, eax
movzx eax, word [edx]
add ecx, ebp
add ecx, ebx
add ecx, dword [esp + 0x54]
mov ebx, dword [esp + 0x10]
add ecx, dword [esp + 0x28]
cmp eax, 0x4000
lea ebp, [ebx + ecx*2 + 0x69f87c]
jge 0x40bd45
movzx ecx, word [eax*2 + 0x4d50d4]
neg ecx
mov dword [esp + 0x28], ecx
jmp 0x40bd57
add eax, eax
mov ecx, 0x4e50d4
sub ecx, eax
movzx edx, word [ecx]
mov dword [esp + 0x28], edx
mov ecx, edx
mov eax, dword [esp + 0x30]
movzx eax, word [eax]
cmp eax, 0x4000
jge 0x40bd75
movzx eax, word [eax*2 + 0x4d50d4]
neg eax
mov dword [esp + 0x6c], eax
jmp 0x40bd88
lea edx, [eax + eax]
mov eax, 0x4e50d4
sub eax, edx
movzx edx, word [eax]
mov dword [esp + 0x6c], edx
mov eax, edx
push 0xa818
push eax
push ecx
mov ecx, ebp
call fcn.004017a0
test eax, eax
jl 0x40bdbf
mov ecx, 0x4000
sub ecx, eax
js 0x40bdb4
movzx ecx, word [ecx*2 + 0x4dd11a]
mov eax, 0x8000
sub eax, ecx
jmp 0x40bdce
xor ecx, ecx
mov eax, 0x8000
sub eax, ecx
jmp 0x40bdce
add eax, 0x4000
js 0x40bdd3
movzx eax, word [eax*2 + 0x4dd11a]
cmp eax, 1
jge 0x40bdda
mov eax, 1
jmp 0x40bde9
cmp eax, 0x7fff
mov dword [esp + 0x74], 0x7fff
jg 0x40bded
mov dword [esp + 0x74], eax
mov eax, dword [esp + 0x74]
push eax
mov ecx, ebx
call fcn.00404090
mov ecx, dword [esp + 0x34]
push 0xa8
mov edi, eax
push 0x321
push edi
call fcn.00402710
mov ecx, dword [esp + 0x30]
push 0x1261
push 0x18ac
push edi
call fcn.00402710
mov ecx, dword [esp + 0x74]
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x28]
push ecx
push 0x6fc
push edx
push eax
push edi
mov ecx, ebp
call fcn.00401800
test edi, edi
je 0x40be4f
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x54
ret 0x10
movzx eax, word [ebx + esi*2 + 0x69fafc]
cmp eax, 1
lea ebp, [ebx + esi*2 + 0x69fafc]
jge 0x40be6a
mov eax, 1
jmp 0x40be76
cmp eax, 0x7fff
jle 0x40be76
mov eax, 0x7fff
push eax
mov ecx, ebx
call fcn.00404090
push 0x1b6
mov edi, eax
push 0x4d4
push edi
mov ecx, ebp
call fcn.00402710
test edi, edi
je 0x40bea5
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x54
ret 0x10
mov ecx, esi
shl ecx, 4
add ecx, dword [esp + 0x70]
movzx eax, word [ebx + ecx*2 + 0x69fb44]
cmp eax, 1
lea ebp, [ebx + ecx*2 + 0x69fb44]
jge 0x40bec9
mov eax, 1
jmp 0x40bed5
cmp eax, 0x7fff
jle 0x40bed5
mov eax, 0x7fff
push eax
mov ecx, ebx
call fcn.00404090
push 0x24
mov edi, eax
push 0x787
push edi
mov ecx, ebp
call fcn.00402710
test edi, edi
je 0x40bf01
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x54
ret 0x10
movzx eax, word [ebx + esi*2 + 0x69fb14]
cmp eax, 1
lea ebp, [ebx + esi*2 + 0x69fb14]
jge 0x40bf1c
mov eax, 1
jmp 0x40bf28
cmp eax, 0x7fff
jle 0x40bf28
mov eax, 0x7fff
push eax
mov ecx, ebx
call fcn.00404090
push 0x36
mov edi, eax
push 0x226
push edi
mov ecx, ebp
call fcn.00402710
test edi, edi
je 0x40bf54
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
add esp, 0x54
ret 0x10
movzx eax, word [ebx + esi*2 + 0x69fb2c]
cmp eax, 1
lea esi, [ebx + esi*2 + 0x69fb2c]
jge 0x40bf6f
mov eax, 1
jmp 0x40bf7b
cmp eax, 0x7fff
jle 0x40bf7b
mov eax, 0x7fff
push eax
mov ecx, ebx
call fcn.00404090
push 0x37a
mov edi, eax
push 0xb1
push edi
mov ecx, esi
call fcn.00402710
test edi, edi
jne 0x40bfaa
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x54
ret 0x10
push 1
mov ecx, ebx
call fcn.00404090
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0xffffff07
pop ebp
add eax, 0xff
pop ebx
add esp, 0x54
ret 0x10