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

Disassembly:
push ebp
mov ebp, eax
push edi
push esi
push ebx
sub esp, 0x8c
mov eax, dword [eax]
mov dword [esp + 0x3c], ecx
mov ecx, dword [ebp + 8]
mov dword [esp + 0x48], eax
mov eax, dword [ebp + 0x14]
mov ebx, dword [ecx + 0x60]
mov edi, dword [esp + 0xa0]
mov dword [esp + 0x38], edx
mov dword [esp + 0x4c], eax
mov edx, dword [esp + 0xac]
mov eax, dword [ebp + 0x1c]
mov dword [esp + 0x34], edi
mov dword [esp + 0x50], eax
lea eax, [edx + 1]
imul eax, dword [ecx + 8]
add eax, dword [ebp + 0xc]
movsx esi, word [ebx + eax*2]
add esi, dword [ecx + 0x64]
movzx eax, byte [esi]
cmp edx, 0xffffffff
je 0x4026f3
movzx ecx, byte [esi + eax]
add ecx, 0xc
cmp ecx, dword [esp + 0x34]
jge 0x4026f3
mov edi, dword [esp + 0x3c]
cmp edi, 2
jg 0x402958
mov edi, dword [esp + 0x34]
mov dword [esp + 0x44], ebp
mov ebx, 6
xor ecx, ecx
sub edi, 1
mov dword [esp + 0x40], edi
mov ebp, edi
lea esi, [esi]
nop
lea edx, [ecx + eax + 1]
sar edx, 1
movzx edi, byte [esi + edx]
cmp ebp, edi
cmovle eax, edx
cmovg ecx, edx
sub ebx, 1
jne 0x402710
mov ebp, dword [esp + 0x44]
movzx edx, byte [esi + eax]
mov dword [esp + 0x44], eax
sub edx, dword [esp + 0x40]
test ecx, ecx
jne 0x402808
cmp edx, dword [esp + 0x34]
jge 0x402830
test eax, eax
je 0x402830
movzx ecx, byte [esi + eax]
mov edx, dword [ebp + 0x20]
add ecx, 1
sub edx, ecx
mov dword [ebp + 0x20], edx
jns 0x402784
lea esi, [esi]
add edx, ecx
mov dword [ebp + 0x20], edx
sub eax, 1
je 0x402830
movzx ecx, byte [esi + eax]
add ecx, 1
sub edx, ecx
mov dword [ebp + 0x20], edx
js 0x402768
cmp eax, 7
jle 0x40279b
mov edx, eax
sar eax, 3
and edx, 7
lea ecx, [eax - 1]
add edx, 8
mov eax, edx
shl eax, cl
mov ebx, dword [esp + 0x48]
test ebx, ebx
je 0x402908
mov edx, dword [ebp + 0x2c]
mov esi, dword [esp + 0x50]
fld dword [esp + 0xb0]
mov dword [esp + 0x20], edx
mov edx, dword [ebp + 4]
mov dword [esp + 0x14], esi
mov esi, dword [esp + 0xa4]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x10], esi
mov esi, dword [esp + 0x4c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], esi
mov dword [esp], eax
fstp dword [esp + 0x18]
call dbg.alg_quant
mov ebx, eax
add esp, 0x8c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
movzx edi, byte [esi + ecx]
mov dword [esp + 0x34], edi
mov edi, dword [esp + 0x40]
sub edi, dword [esp + 0x34]
cmp edi, edx
jg 0x402749
mov dword [esp + 0x44], ecx
mov eax, ecx
jmp 0x402751
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x4027f5
movzx ecx, byte [esp + 0xa4]
mov eax, 1
shl eax, cl
sub eax, 1
mov ecx, eax
and ecx, dword [esp + 0xb4]
mov dword [esp + 0xb4], ecx
je 0x402b46
mov edx, dword [esp + 0xa8]
test edx, edx
je 0x402cd9
mov eax, dword [esp + 0x3c]
test eax, eax
jle 0x4028cd
mov eax, dword [ebp + 0x28]
mov esi, dword [esp + 0x38]
mov dword [esp + 0x34], ecx
xor edx, edx
mov ecx, dword [esp + 0x3c]
mov edi, dword [esp + 0xa8]
jmp 0x402894
fstp st(0)
mov edx, ebx
imul eax, eax, 0x19660d
fld dword [0x41e208]
lea ebx, [edx + 1]
fld dword [0x41e204]
add eax, 0x3c6ef35f
test ah, 0x80
fcmovne st(0), st(1)
fstp st(1)
fadd dword [edi + edx*4]
fst dword [esi + edx*4]
cmp ecx, ebx
jne 0x402890
mov dword [ebp + 0x28], eax
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
fstp dword [eax + edx*4]
mov ebx, ecx
mov eax, dword [ebp + 0x2c]
fld dword [esp + 0xb0]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x3c]
fstp dword [esp + 8]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call dbg.renormalise_vector
add esp, 0x8c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [esp + 0x50]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x3c]
mov esi, dword [esp + 0xa4]
mov dword [esp + 0x14], ebx
mov ebx, dword [esp + 0x4c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x38]
fld dword [esp + 0xb0]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebx
mov dword [esp], eax
fstp dword [esp + 0x18]
call dbg.alg_unquant
add esp, 0x8c
mov ebx, eax
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
sar edi, 1
mov eax, dword [esp + 0x38]
mov dword [esp + 0x34], edi
shl edi, 2
add eax, edi
cmp dword [esp + 0xa4], 1
mov dword [esp + 0x48], eax
lea eax, [edx - 1]
mov dword [esp + 0x3c], eax
je 0x402c26
mov eax, dword [esp + 0xa4]
mov ebx, dword [esp + 0x3c]
mov dword [esp + 0x18], 0
lea edx, [esp + 0x68]
mov ecx, dword [esp + 0x38]
add eax, 1
mov dword [esp + 0x14], ebx
sar eax, 1
mov esi, eax
mov dword [esp + 0x40], eax
lea eax, [esp + 0xb4]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0xa4]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], eax
lea eax, [esp + 0xa0]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x48]
mov dword [esp], eax
mov eax, ebp
call dbg.compute_theta
fild dword [esp + 0x6c]
fld dword [0x41e20c]
mov eax, dword [esp + 0x78]
cmp dword [esp + 0xa4], 1
mov edx, dword [esp + 0x74]
mov esi, dword [esp + 0x7c]
fmul st(1), st(0)
fild dword [esp + 0x70]
mov dword [esp + 0x58], eax
fmulp st(1)
jle 0x402a1c
test eax, 0x3fff
jne 0x402cc0
mov eax, dword [esp + 0xa0]
mov ecx, eax
sub ecx, edx
mov edx, ecx
shr edx, 0x1f
add edx, ecx
movzx ecx, byte [esp + 0x40]
sar edx, 1
cmp edx, eax
mov ebx, edx
cmovg ebx, eax
xor edx, edx
test ebx, ebx
cmovs ebx, edx
add edi, dword [esp + 0xa8]
sub eax, ebx
mov edx, eax
mov eax, dword [ebp + 0x20]
mov dword [esp + 0x44], edx
sub eax, esi
mov esi, dword [esp + 0xa8]
mov dword [esp + 0x4c], eax
mov dword [ebp + 0x20], eax
xor eax, eax
test esi, esi
mov esi, dword [esp + 0xb4]
cmove edi, eax
mov eax, esi
sar eax, cl
mov ecx, dword [esp + 0xa4]
mov dword [esp + 0x50], eax
sar ecx, 1
mov dword [esp + 0x54], ecx
cmp ebx, edx
jl 0x402b70
mov ecx, dword [esp + 0x3c]
fstp dword [esp + 0x5c]
mov edx, dword [esp + 0x38]
mov eax, ebp
fmul dword [esp + 0xb0]
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], ecx
mov esi, dword [esp + 0x40]
mov ecx, dword [esp + 0xa8]
mov dword [esp], ebx
mov dword [esp + 4], esi
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x34]
fstp dword [esp + 0x10]
call dbg.quant_partition
fld dword [esp + 0x5c]
mov esi, eax
mov eax, dword [esp + 0x4c]
sub eax, dword [ebp + 0x20]
sub ebx, eax
cmp ebx, 0x18
jle 0x402af9
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x58]
lea eax, [edx + ebx - 0x18]
test ecx, ecx
cmove eax, edx
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x50]
fmul dword [esp + 0xb0]
mov dword [esp + 8], edi
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x48]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x40]
fstp dword [esp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x44]
mov dword [esp], eax
mov eax, ebp
call dbg.quant_partition
movzx ecx, byte [esp + 0x54]
shl eax, cl
or eax, esi
mov ebx, eax
jmp 0x4027f5
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], 0
shl eax, 2
mov dword [esp + 8], eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sym._memset
jmp 0x4027f5
fxch st(1)
mov eax, dword [esp + 0x50]
fstp dword [esp + 0x5c]
fmul dword [esp + 0xb0]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x48]
mov dword [esp + 8], edi
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x40]
fstp dword [esp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x44]
mov dword [esp], eax
mov eax, ebp
call dbg.quant_partition
mov edx, dword [esp + 0x44]
movzx ecx, byte [esp + 0x54]
mov edi, eax
mov eax, dword [esp + 0x4c]
sub eax, dword [ebp + 0x20]
sub edx, eax
shl edi, cl
fld dword [esp + 0x5c]
cmp edx, 0x18
jle 0x402be1
lea eax, [ebx + edx - 0x18]
cmp dword [esp + 0x58], 0x4000
cmovne ebx, eax
mov eax, dword [esp + 0x3c]
fmul dword [esp + 0xb0]
mov dword [esp], ebx
mov ebx, edi
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0xa8]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
fstp dword [esp + 0x10]
mov dword [esp + 4], eax
mov eax, ebp
call dbg.quant_partition
or ebx, eax
jmp 0x4027f5
mov eax, dword [esp + 0xb4]
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], 1
mov ecx, dword [esp + 0x38]
mov edx, eax
add eax, eax
mov dword [esp + 0xc], 1
and edx, 1
or eax, edx
lea edx, [esp + 0x68]
mov dword [esp + 0xb4], eax
lea eax, [esp + 0xb4]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x14], eax
lea eax, [esp + 0xa0]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x48]
mov dword [esp], eax
mov eax, ebp
call dbg.compute_theta
fild dword [esp + 0x6c]
fld dword [0x41e20c]
mov dword [esp + 0x40], 1
mov eax, dword [esp + 0x78]
mov edx, dword [esp + 0x74]
mov esi, dword [esp + 0x7c]
fmul st(1), st(0)
fild dword [esp + 0x70]
mov dword [esp + 0x58], eax
fmulp st(1)
jmp 0x402a1c
cmp eax, 0x2000
jle 0x402d2b
mov ecx, 4
mov eax, edx
sub ecx, ebx
sar eax, cl
sub edx, eax
jmp 0x402a1c
mov esi, dword [esp + 0x3c]
test esi, esi
jle 0x402d4b
mov ebx, dword [esp + 0x38]
mov edx, dword [ebp + 0x28]
mov ecx, ebx
lea ebx, [ebx + esi*4]
jmp 0x402cf2
fstp st(0)
imul edx, edx, 0x19660d
add ecx, 4
add edx, 0x3c6ef35f
mov esi, edx
sar esi, 0x14
mov dword [esp + 0x34], esi
fild dword [esp + 0x34]
fst dword [ecx - 4]
cmp ebx, ecx
jne 0x402cf0
mov ebx, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
mov dword [ebp + 0x28], edx
fstp dword [esi + ebx*4 - 4]
mov ebx, eax
jmp 0x4028cf
mov eax, dword [esp + 0x34]
mov ecx, 5
sub ecx, dword [esp + 0x3c]
shl eax, 3
sar eax, cl
add eax, edx
xor edx, edx
test eax, eax
cmovle edx, eax
jmp 0x402a1c
mov ebx, eax
jmp 0x4028cf