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

Disassembly:
sub esp, 0x50
push ebx
mov ebx, ecx
mov ecx, dword [esp + 0x5c]
mov eax, dword [ebx + 0x3ccadc]
lea eax, [ecx + eax*2]
push ebp
mov dword [ebx + 0x3ccadc], eax
and eax, 0xf
push esi
mov esi, dword [ebx + 0x3ccad8]
shr esi, 3
mov edx, 0x20
cmp edx, esi
sbb ecx, ecx
neg ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x18], eax
mov ecx, 0x19
cmp ecx, esi
sbb ecx, ecx
neg ecx
mov dword [esp + 0x3c], ecx
mov edx, 0x17
cmp edx, esi
sbb ebp, ebp
mov edx, dword [esp + 0x68]
and eax, 1
neg ebp
shr edx, 2
mov dword [esp + 0x10], eax
push edi
mov edi, dword [esp + 0x70]
mov ecx, edx
and ecx, 3
mov dword [esp + 0x3c], ecx
mov eax, 0xb
cmp eax, edi
sbb ecx, ecx
neg ecx
lea eax, [ecx*8]
sub eax, ecx
mov ecx, 0x1a
cmp ecx, esi
sbb ecx, ecx
neg ecx
add eax, ecx
mov ecx, 0x16
cmp ecx, esi
sbb ecx, ecx
neg ecx
add ecx, ebp
mov dword [esp + 0x5c], ebp
mov ebp, 0x13
cmp ebp, esi
sbb ebp, ebp
add ecx, eax
mov eax, dword [esp + 0x3c]
neg ebp
add ebp, ecx
add ebp, dword [esp + 0x40]
mov dword [esp + 0x68], 0
add ebp, dword [esp + 0x2c]
lea ecx, [eax + ebp*4]
mov eax, dword [esp + 0x14]
lea eax, [eax + ecx*2]
add eax, eax
mov ecx, 7
cmp ecx, edi
mov dword [esp + 0x4c], eax
sbb eax, eax
neg eax
mov ecx, 5
cmp ecx, edi
sbb ecx, ecx
neg ecx
mov dword [esp + 0x18], ecx
mov ecx, 3
cmp ecx, edi
sbb ecx, ecx
mov dword [esp + 0x20], eax
neg ecx
mov dword [esp + 0x34], ecx
mov ecx, 2
cmp ecx, edi
sbb ecx, ecx
xor ebp, ebp
neg ecx
cmp ebp, edi
sbb ebp, ebp
neg ebp
mov dword [esp + 0x30], ebp
add ebp, ecx
add ebp, dword [esp + 0x34]
and edx, 1
add ebp, dword [esp + 0x18]
mov dword [esp + 0x48], ecx
add ebp, eax
mov eax, dword [esp + 0x6c]
and eax, 3
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x1c]
and eax, 0xf
mov dword [esp + 0x50], ebp
mov dword [esp + 0x44], edx
mov dword [esp + 0x38], eax
lea ebx, [ebx]
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x4c]
and eax, 1
cmp esi, 0x22
lea ecx, [eax + edx]
mov dword [esp + 0x70], ecx
mov ecx, 0x22
ja 0x40f7ce
mov ecx, esi
movzx edx, byte [ecx + 0x4150b4]
mov ecx, dword [esp + 0x50]
lea ecx, [ecx + ecx*2]
lea edx, [edx + ecx*4]
mov ecx, dword [esp + 0x28]
lea edx, [ecx + edx*4]
shl edx, 4
add edx, dword [esp + 0x38]
cmp esi, 0x22
lea ecx, [eax + edx*2]
mov dword [esp + 0x10], ecx
mov ecx, 0x22
ja 0x40f800
mov ecx, esi
movzx edx, byte [ecx + 0x414f40]
mov ecx, dword [esp + 0x20]
mov ebp, ecx
shl ebp, 4
add ebp, ecx
mov ecx, dword [esp + 0x44]
add edx, ebp
lea edx, [ecx + edx*2]
mov ecx, dword [esp + 0x70]
shl edx, 4
add edx, dword [esp + 0x38]
lea eax, [eax + edx*2 + 0x1e8a50]
lea ebp, [ebx + eax*2]
movzx eax, word [ebx + ecx*2 + 0x3ccae0]
cmp eax, 0x4000
mov dword [esp + 0x58], ebp
jge 0x40f84f
movzx ecx, word [eax*2 + 0x4d50d4]
neg ecx
jmp 0x40f85c
lea edx, [eax + eax]
mov eax, 0x4e50d4
sub eax, edx
movzx ecx, word [eax]
mov edx, dword [esp + 0x10]
movzx eax, word [ebx + edx*2 + 0x3ccca0]
cmp eax, 0x4000
jge 0x40f87b
movzx edx, word [eax*2 + 0x4d50d4]
neg edx
jmp 0x40f887
add eax, eax
mov edx, 0x4e50d4
sub edx, eax
movzx edx, word [edx]
movzx eax, word [ebp]
sub ecx, edx
sub eax, 0x4000
imul eax, ecx
test eax, eax
mov dword [esp + 0x54], ecx
jl 0x40f8a8
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x40f8b4
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
add ecx, edx
imul ecx, ecx, 0xe0c9
test ecx, ecx
jl 0x40f8cb
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x40f8d7
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
test eax, eax
jl 0x40f900
mov ecx, 0x4000
sub ecx, eax
js 0x40f8f5
movzx ecx, word [ecx*2 + 0x4dd11a]
mov eax, 0x8000
sub eax, ecx
jmp 0x40f913
xor ecx, ecx
mov eax, 0x8000
sub eax, ecx
jmp 0x40f913
add eax, 0x4000
js 0x40f911
movzx eax, word [eax*2 + 0x4dd11a]
jmp 0x40f913
xor eax, eax
mov ecx, dword [esp + 0x68]
lea edx, [ecx*8 + 8]
cmp dword [esp + 0x64], edx
sbb ebp, ebp
add ebp, 1
cmp eax, 1
jge 0x40f933
mov eax, 1
jmp 0x40f942
cmp eax, 0x7fff
mov dword [esp + 0x24], 0x7fff
jg 0x40f946
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x24]
push ebp
push eax
mov ecx, ebx
call fcn.004040e0
cmp dword [esp + 0x68], 0
mov eax, ebp
jne 0x40f9db
mov ecx, dword [esp + 0x70]
movzx ecx, word [ebx + ecx*2 + 0x3ccae0]
neg eax
sbb eax, eax
and eax, 0xffffb7fe
mov edx, ecx
add eax, 0x6401
sub edx, eax
imul edx, edx, 0x504
sar edx, 0xf
sub ecx, edx
add ecx, ebp
cmp ecx, 1
jge 0x40f993
mov eax, 1
jmp 0x40f9a2
cmp ecx, 0x7fff
mov eax, ecx
jle 0x40f9a2
mov eax, 0x7fff
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x10]
mov word [ebx + ecx*2 + 0x3ccae0], ax
movzx ecx, word [ebx + edx*2 + 0x3ccca0]
mov eax, ebp
neg eax
sbb eax, eax
and eax, 0xffff9c46
add eax, 0x71dd
mov edx, ecx
sub edx, eax
lea eax, [edx + edx*2]
shl eax, 6
sar eax, 0xf
sub ecx, eax
jmp 0x40fa58
mov edx, dword [esp + 0x70]
movzx ecx, word [ebx + edx*2 + 0x3ccae0]
neg eax
sbb eax, eax
and eax, 0xffffa70e
mov edx, ecx
add eax, 0x6c79
sub edx, eax
imul edx, edx, 0x7ff
sar edx, 0xf
sub ecx, edx
add ecx, ebp
cmp ecx, 1
jge 0x40fa12
mov eax, 1
jmp 0x40fa21
cmp ecx, 0x7fff
mov eax, ecx
jle 0x40fa21
mov eax, 0x7fff
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x10]
mov word [ebx + ecx*2 + 0x3ccae0], ax
movzx ecx, word [ebx + edx*2 + 0x3ccca0]
mov eax, ebp
neg eax
sbb eax, eax
and eax, 0xffffb5e6
add eax, 0x650d
mov edx, ecx
sub edx, eax
imul edx, edx, 0xfb
sar edx, 0xf
sub ecx, edx
add ecx, ebp
cmp ecx, 1
jge 0x40fa66
mov eax, 1
jmp 0x40fa75
cmp ecx, 0x7fff
mov eax, ecx
jle 0x40fa75
mov eax, 0x7fff
mov ecx, dword [esp + 0x10]
mov word [ebx + ecx*2 + 0x3ccca0], ax
mov edx, ebp
shl edx, 0xf
mov eax, 0x8000
sub eax, edx
sub eax, dword [esp + 0x24]
imul eax, dword [esp + 0x54]
test eax, eax
jl 0x40faa5
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x40fab1
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
imul ecx, ecx, 0x1416
test ecx, ecx
jl 0x40fac6
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x40fad2
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
mov ecx, dword [esp + 0x58]
add word [ecx], ax
test ebp, ebp
je 0x40faf1
mov eax, dword [esp + 0x68]
add eax, 1
cmp eax, 2
mov dword [esp + 0x68], eax
jb 0x40f7b0
mov eax, dword [esp + 0x68]
test eax, eax
mov dword [esp + 0x68], 1
jne 0x40fea1
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x2c]
lea edx, [eax + ecx*4]
mov eax, dword [esp + 0x14]
lea eax, [eax + edx*2 + 0x3d25a]
add eax, eax
add eax, eax
add eax, eax
mov ecx, 6
cmp ecx, edi
mov dword [esp + 0x58], eax
sbb eax, eax
neg eax
mov edx, 1
cmp edx, edi
sbb ecx, ecx
neg ecx
xor edx, edx
cmp edx, esi
sbb edx, edx
neg edx
mov ebp, 4
cmp ebp, edi
sbb ebp, ebp
neg ebp
add ebp, ecx
add ebp, eax
add ebp, dword [esp + 0x30]
mov dword [esp + 0x6c], ecx
add ebp, dword [esp + 0x48]
mov ecx, 0x1f
add ebp, dword [esp + 0x34]
mov dword [esp + 0x70], edx
add ebp, dword [esp + 0x18]
cmp ecx, esi
sbb ecx, ecx
neg ecx
lea ecx, [ecx + ebp*8]
mov ebp, 0x1e
cmp ebp, esi
sbb ebp, ebp
neg ebp
add ecx, ebp
mov ebp, 0x1d
cmp ebp, esi
sbb ebp, ebp
neg ebp
add ecx, ebp
mov ebp, 4
cmp ebp, esi
sbb ebp, ebp
neg ebp
add ebp, edx
mov edx, 2
cmp edx, esi
sbb edx, edx
add ebp, ecx
mov ecx, dword [esp + 0x28]
neg edx
add edx, ebp
add edx, dword [esp + 0x40]
lea ecx, [ecx + edx*4 + 0x1178c]
add ecx, ecx
add ecx, ecx
mov dword [esp + 0x54], ecx
mov edx, 9
cmp edx, edi
sbb ecx, ecx
neg ecx
add ecx, dword [esp + 0x6c]
mov edx, 0x18
add ecx, eax
add ecx, dword [esp + 0x30]
add ecx, dword [esp + 0x18]
add ecx, dword [esp + 0x20]
cmp edx, esi
sbb eax, eax
neg eax
mov edx, 0xd
lea ecx, [eax + ecx*8]
cmp edx, esi
sbb eax, eax
neg eax
add ecx, eax
mov edx, 0xa
cmp edx, esi
sbb eax, eax
neg eax
add ecx, eax
mov edx, 9
cmp edx, esi
sbb eax, eax
neg eax
add eax, dword [esp + 0x70]
mov edx, 1
cmp edx, esi
sbb edx, edx
neg edx
add eax, ecx
add edx, eax
add edx, dword [esp + 0x5c]
mov eax, dword [esp + 0x44]
lea ecx, [eax + edx*2 + 0x3d5ea]
mov eax, dword [esp + 0x1c]
mov edx, eax
shr edx, 1
xor edx, eax
mov esi, eax
and edx, 3
shr esi, 1
xor edx, esi
lea ecx, [edx + ecx*8]
lea edx, [ebx + ecx*2]
mov dword [esp + 0x6c], edx
jmp 0x40fc64
mov eax, dword [esp + 0x1c]
movzx eax, byte [eax + 0x4150d8]
mov ecx, dword [esp + 0x68]
add eax, dword [esp + 0x54]
mov edx, dword [esp + 0x58]
add edx, ecx
lea ebp, [ebx + edx*2]
lea edx, [eax*8]
sub edx, eax
movzx eax, byte [ecx + 0x4150e8]
add edx, eax
movzx eax, word [ebp]
cmp eax, 0x4000
lea ecx, [ebx + edx*2]
mov dword [esp + 0x70], ecx
jge 0x40fcac
movzx eax, word [eax*2 + 0x4d50d4]
neg eax
jmp 0x40fcb9
lea edx, [eax + eax]
mov eax, 0x4e50d4
sub eax, edx
movzx eax, word [eax]
movzx ecx, word [ecx]
cmp ecx, 0x4000
jge 0x40fcd0
movzx edx, word [ecx*2 + 0x4d50d4]
neg edx
jmp 0x40fcdc
add ecx, ecx
mov edx, 0x4e50d4
sub edx, ecx
movzx edx, word [edx]
mov ecx, eax
mov eax, dword [esp + 0x6c]
movzx eax, word [eax]
sub ecx, edx
sub eax, 0x4000
imul eax, ecx
test eax, eax
mov dword [esp + 0x5c], ecx
jl 0x40fd02
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x40fd0e
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
add ecx, edx
imul ecx, ecx, 0xc21b
test ecx, ecx
jl 0x40fd25
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x40fd31
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
test eax, eax
jl 0x40fd5a
mov ecx, 0x4000
sub ecx, eax
js 0x40fd4f
movzx ecx, word [ecx*2 + 0x4dd11a]
mov eax, 0x8000
sub eax, ecx
jmp 0x40fd6d
xor ecx, ecx
mov eax, 0x8000
sub eax, ecx
jmp 0x40fd6d
add eax, 0x4000
js 0x40fd6b
movzx eax, word [eax*2 + 0x4dd11a]
jmp 0x40fd6d
xor eax, eax
mov esi, dword [esp + 0x64]
add esi, esi
mov dword [esp + 0x64], esi
shr esi, 3
and esi, 1
cmp eax, 1
jge 0x40fd89
mov eax, 1
jmp 0x40fd95
cmp eax, 0x7fff
mov edi, 0x7fff
jg 0x40fd97
mov edi, eax
push esi
push edi
mov ecx, ebx
call fcn.004040e0
movzx ecx, word [ebp]
mov eax, esi
neg eax
sbb eax, eax
and eax, 0xffff8606
mov edx, ecx
add eax, 0x7cfd
sub edx, eax
imul edx, edx, 0x277
sar edx, 0xf
sub ecx, edx
add ecx, esi
cmp ecx, 1
jge 0x40fdd1
mov eax, 1
jmp 0x40fde0
cmp ecx, 0x7fff
mov eax, ecx
jle 0x40fde0
mov eax, 0x7fff
mov edx, dword [esp + 0x70]
mov word [ebp], ax
movzx ecx, word [edx]
mov eax, esi
neg eax
sbb eax, eax
and eax, 0xffffc4ee
add eax, 0x5d89
mov ebp, ecx
sub ebp, eax
imul ebp, ebp, 0x12b
sar ebp, 0xf
mov eax, esi
sub eax, ebp
add eax, ecx
cmp eax, 1
jge 0x40fe1a
mov eax, 1
jmp 0x40fe26
cmp eax, 0x7fff
jle 0x40fe26
mov eax, 0x7fff
mov word [edx], ax
mov ecx, esi
shl ecx, 0xf
mov eax, 0x8000
sub eax, ecx
sub eax, edi
imul eax, dword [esp + 0x5c]
test eax, eax
jl 0x40fe4b
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x40fe57
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
shl ecx, 9
js 0x40fe67
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x40fe73
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x68]
add word [ecx], ax
lea eax, [esi + edx*2]
cmp eax, 8
mov dword [esp + 0x68], eax
jb 0x40fc60
pop edi
pop esi
sub eax, 8
pop ebp
mov dword [ebx + 0x3ccad8], eax
pop ebx
add esp, 0x50
ret 0x10
cmp eax, 1
jne 0x4101ee
mov edx, dword [esp + 0x28]
mov ebp, dword [esp + 0x14]
mov eax, 0x1f
cmp eax, esi
sbb ecx, ecx
neg ecx
lea eax, [edx + ecx*4]
lea eax, [ebp + eax*2]
lea ecx, [eax*8]
sub ecx, eax
mov dword [esp + 0x5c], ecx
mov ecx, 9
cmp ecx, edi
sbb eax, eax
neg eax
mov edx, 8
cmp edx, edi
sbb ecx, ecx
neg ecx
add ecx, eax
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x6c]
mov edx, ecx
and edx, 7
mov dword [esp + 0x54], edx
mov edx, dword [esp + 0x1c]
shr edx, 1
and edx, 0xfffffffe
mov dword [esp + 0x50], edx
mov edx, 0xa
cmp edx, edi
sbb edx, edx
neg edx
add edx, eax
add edx, dword [esp + 0x18]
shr ecx, 3
add edx, dword [esp + 0x20]
and ecx, 1
mov dword [esp + 0x4c], edx
mov dword [esp + 0x6c], ecx
jmp 0x40ff34
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x68]
movzx edx, byte [eax + 0x414f64]
add edx, dword [esp + 0x5c]
cmp esi, 0x22
mov dword [esp + 0x48], edx
mov eax, 0x22
ja 0x40ff53
mov eax, esi
movzx ecx, byte [eax + 0x4150f0]
mov eax, dword [esp + 0x58]
mov edi, eax
shl edi, 4
add edi, eax
mov eax, dword [esp + 0x54]
add ecx, edi
lea ecx, [eax + ecx*8]
lea eax, [ebp + ecx*8]
add eax, dword [esp + 0x50]
lea ecx, [eax*8]
sub ecx, eax
mov eax, dword [esp + 0x68]
movzx eax, byte [eax + 0x415114]
add ecx, eax
cmp esi, 0x22
mov dword [esp + 0x44], ecx
mov eax, 0x22
ja 0x40ff9c
mov eax, esi
mov edi, dword [esp + 0x4c]
movzx eax, byte [eax + 0x414f6c]
imul edi, edi, 0xb
add eax, edi
mov edi, dword [esp + 0x6c]
lea eax, [edi + eax*2 + 0x10cae0]
lea eax, [ebp + eax*2]
lea ebp, [ebx + eax*2]
movzx eax, word [ebx + edx*2 + 0x3d96a0]
cmp eax, 0x4000
mov dword [esp + 0x3c], ebp
jge 0x40ffdd
movzx edi, word [eax*2 + 0x4d50d4]
neg edi
jmp 0x40ffea
lea edx, [eax + eax]
mov eax, 0x4e50d4
sub eax, edx
movzx edi, word [eax]
movzx eax, word [ebx + ecx*2 + 0x3d9780]
cmp eax, 0x4000
jge 0x410005
movzx edx, word [eax*2 + 0x4d50d4]
neg edx
jmp 0x410012
lea ecx, [eax + eax]
mov edx, 0x4e50d4
sub edx, ecx
movzx edx, word [edx]
movzx eax, word [ebp]
mov ecx, edi
sub ecx, edx
sub eax, 0x4000
imul eax, ecx
test eax, eax
mov dword [esp + 0x40], ecx
jl 0x410035
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x410041
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
add ecx, edx
imul ecx, ecx, 0xb083
test ecx, ecx
jl 0x410058
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x410064
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
test eax, eax
jl 0x41008d
mov ecx, 0x4000
sub ecx, eax
js 0x410082
movzx ecx, word [ecx*2 + 0x4dd11a]
mov eax, 0x8000
sub eax, ecx
jmp 0x4100a0
xor ecx, ecx
mov eax, 0x8000
sub eax, ecx
jmp 0x4100a0
add eax, 0x4000
js 0x41009e
movzx eax, word [eax*2 + 0x4dd11a]
jmp 0x4100a0
xor eax, eax
mov edi, dword [esp + 0x64]
add edi, edi
mov dword [esp + 0x64], edi
shr edi, 3
and edi, 1
cmp eax, 1
jge 0x4100bc
mov eax, 1
jmp 0x4100c8
cmp eax, 0x7fff
jle 0x4100c8
mov eax, 0x7fff
push edi
push eax
mov ecx, ebx
mov dword [esp + 0x78], eax
call fcn.004040e0
mov edx, dword [esp + 0x48]
movzx ecx, word [ebx + edx*2 + 0x3d96a0]
mov eax, edi
neg eax
sbb eax, eax
and eax, 0xffff8146
mov ebp, ecx
add eax, 0x7f5d
sub ebp, eax
imul ebp, ebp, 0x1ad
sar ebp, 0xf
sub ecx, ebp
add ecx, edi
cmp ecx, 1
jge 0x41010e
mov ecx, 1
jmp 0x41011b
cmp ecx, 0x7fff
mov eax, 0x7fff
jg 0x41011d
mov eax, ecx
mov word [ebx + edx*2 + 0x3d96a0], ax
mov edx, dword [esp + 0x44]
movzx ecx, word [ebx + edx*2 + 0x3d9780]
mov eax, edi
neg eax
sbb eax, eax
and eax, 0xffffcbc0
mov ebp, ecx
add eax, 0x5a20
sub ebp, eax
imul ebp, ebp, 0x7d
sar ebp, 0xf
sub ecx, ebp
add ecx, edi
cmp ecx, 1
jge 0x41015b
mov ecx, 1
jmp 0x410168
cmp ecx, 0x7fff
mov eax, 0x7fff
jg 0x41016a
mov eax, ecx
mov word [ebx + edx*2 + 0x3d9780], ax
mov ecx, edi
shl ecx, 0xf
mov eax, 0x8000
sub eax, ecx
sub eax, dword [esp + 0x70]
imul eax, dword [esp + 0x40]
test eax, eax
jl 0x410196
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x4101a2
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
imul ecx, ecx, 0x107
test ecx, ecx
jl 0x4101b7
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x4101c3
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x68]
add word [ecx], ax
lea eax, [edi + edx*2]
cmp eax, 8
mov dword [esp + 0x68], eax
jb 0x40ff30
pop edi
pop esi
pop ebp
mov dword [ebx + 0x3ccad8], eax
pop ebx
add esp, 0x50
ret 0x10
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x2c]
sub dword [esp + 0x64], 0x10
mov ecx, eax
shr ecx, 3
and ecx, 1
mov dword [esp + 0x6c], ecx
lea ecx, [ecx + edx*2]
mov edx, dword [esp + 0x14]
lea ecx, [edx + ecx*2]
imul ecx, ecx, 0xff
mov dword [esp + 0x5c], ecx
mov ecx, 6
cmp ecx, edi
sbb edx, edx
neg edx
mov ecx, 4
cmp ecx, edi
sbb ecx, ecx
add edx, dword [esp + 0x30]
shr eax, 1
and eax, 1
neg ecx
add ecx, edx
add ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x18]
add ecx, dword [esp + 0x34]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x1c]
and eax, 7
mov dword [esp + 0x50], eax
add ecx, edx
mov eax, 9
cmp eax, edi
sbb eax, eax
neg eax
add eax, dword [esp + 0x20]
mov dword [esp + 0x58], ecx
mov dword [esp + 0x4c], eax
mov ecx, dword [esp + 0x68]
movzx eax, byte [ecx + 0x414f90]
add eax, dword [esp + 0x5c]
cmp esi, 0x22
mov dword [esp + 0x70], eax
mov eax, 0x22
ja 0x41028f
mov eax, esi
movzx edx, byte [eax + 0x41511c]
mov eax, dword [esp + 0x58]
lea eax, [eax + eax*4]
lea edx, [edx + eax*4]
mov eax, dword [esp + 0x54]
lea edx, [eax + edx*2]
mov eax, dword [esp + 0x50]
lea ebp, [eax + edx*8]
movzx edx, byte [ecx + 0x415140]
imul ebp, ebp, 0xff
add ebp, edx
cmp esi, 0x22
mov eax, 0x22
ja 0x4102c9
mov eax, esi
movzx edx, byte [eax + 0x415090]
mov eax, dword [esp + 0x4c]
mov edi, eax
shl edi, 4
sub edi, eax
mov eax, dword [esp + 0x6c]
add edx, edi
lea edx, [eax + edx*2]
mov eax, dword [esp + 0x70]
movzx eax, word [ebx + eax*2 + 0x432d38]
shl edx, 4
add edx, dword [esp + 0x38]
shl edx, 8
add edx, ecx
cmp eax, 0x4000
lea edi, [ebx + edx*2 + 0x54aba8]
mov dword [esp + 0x44], edi
jge 0x41031a
movzx ecx, word [eax*2 + 0x4d50d4]
neg ecx
jmp 0x410327
lea ecx, [eax + eax]
mov edx, 0x4e50d4
sub edx, ecx
movzx ecx, word [edx]
movzx eax, word [ebx + ebp*2 + 0x433d28]
cmp eax, 0x4000
jge 0x410342
movzx edx, word [eax*2 + 0x4d50d4]
neg edx
jmp 0x41034e
add eax, eax
mov edx, 0x4e50d4
sub edx, eax
movzx edx, word [edx]
movzx eax, word [edi]
sub ecx, edx
sub eax, 0x4000
imul eax, ecx
test eax, eax
mov dword [esp + 0x48], ecx
jl 0x41036e
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x41037a
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
add ecx, edx
imul ecx, ecx, 0xfc35
test ecx, ecx
jl 0x410391
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x41039d
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
test eax, eax
jl 0x4103c6
mov ecx, 0x4000
sub ecx, eax
js 0x4103bb
movzx ecx, word [ecx*2 + 0x4dd11a]
mov eax, 0x8000
sub eax, ecx
jmp 0x4103d9
xor ecx, ecx
mov eax, 0x8000
sub eax, ecx
jmp 0x4103d9
add eax, 0x4000
js 0x4103d7
movzx eax, word [eax*2 + 0x4dd11a]
jmp 0x4103d9
xor eax, eax
mov edi, dword [esp + 0x64]
add edi, edi
mov dword [esp + 0x64], edi
shr edi, 8
and edi, 1
cmp eax, 1
jge 0x4103f5
mov eax, 1
jmp 0x410404
cmp eax, 0x7fff
mov dword [esp + 0x34], 0x7fff
jg 0x410408
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x34]
push edi
push eax
mov ecx, ebx
call fcn.004040e0
mov ecx, dword [esp + 0x70]
movzx ecx, word [ebx + ecx*2 + 0x432d38]
mov eax, edi
neg eax
sbb eax, eax
and eax, 0xffff8ab6
mov edx, ecx
add eax, 0x7aa5
sub edx, eax
imul edx, edx, 0x7ab
sar edx, 0xf
sub ecx, edx
add ecx, edi
cmp ecx, 1
jge 0x41044e
mov eax, 1
jmp 0x41045d
cmp ecx, 0x7fff
mov eax, ecx
jle 0x41045d
mov eax, 0x7fff
mov ecx, dword [esp + 0x70]
mov word [ebx + ecx*2 + 0x432d38], ax
movzx ecx, word [ebx + ebp*2 + 0x433d28]
mov eax, edi
neg eax
sbb eax, eax
and eax, 0xffffc592
mov edx, ecx
add eax, 0x5d37
sub edx, eax
imul edx, edx, 0x209
sar edx, 0xf
sub ecx, edx
add ecx, edi
cmp ecx, 1
jge 0x41049e
mov eax, 1
jmp 0x4104ad
cmp ecx, 0x7fff
mov eax, ecx
jle 0x4104ad
mov eax, 0x7fff
mov word [ebx + ebp*2 + 0x433d28], ax
mov ecx, edi
shl ecx, 0xf
mov eax, 0x8000
sub eax, ecx
sub eax, dword [esp + 0x34]
imul eax, dword [esp + 0x48]
test eax, eax
jl 0x4104d9
lea ecx, [eax + 0x4000]
sar ecx, 0xf
jmp 0x4104e5
mov ecx, 0x4000
sub ecx, eax
sar ecx, 0xf
neg ecx
imul ecx, ecx, 0xf38
test ecx, ecx
jl 0x4104fa
lea eax, [ecx + 0x4000]
sar eax, 0xf
jmp 0x410506
mov eax, 0x4000
sub eax, ecx
sar eax, 0xf
neg eax
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x68]
add word [ecx], ax
lea eax, [edi + edx*2]
cmp eax, 0x100
mov dword [esp + 0x68], eax
jb 0x410270
pop edi
pop esi
sub eax, 0xf0
pop ebp
mov dword [ebx + 0x3ccad8], eax
pop ebx
add esp, 0x50
ret 0x10