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

Disassembly:
sub esp, 0x3c
push edi
mov edi, dword [esp + 0x44]
test edi, edi
je 0x10027888
push edi
call sym.leptonlib.dll_numaGetRefcount
add esp, 4
cmp eax, 0x20
jne 0x10027888
mov eax, dword [esp + 0x50]
lea ecx, [eax - 2]
cmp ecx, 0xfe
ja 0x10027888
mov ecx, dword [esp + 0x4c]
test ecx, ecx
je 0x100272f8
cmp ecx, 1
je 0x100272e5
cmp ecx, 2
je 0x100272e5
cmp ecx, 4
je 0x100272e5
cmp ecx, 8
jne 0x10027888
test ecx, ecx
jle 0x100272f8
mov edx, 1
shl edx, cl
cmp eax, edx
jg 0x10027888
push ebx
mov ebx, dword [esp + 0x58]
test ebx, ebx
jne 0x10027308
mov ebx, 5
jmp 0x10027314
lea eax, [ebx - 5]
cmp eax, 1
ja 0x10027880
push esi
mov esi, dword [esp + 0x60]
test esi, esi
jg 0x10027322
mov esi, 0xa
push 0
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x3c]
push edx
push edi
call sym.leptonlib.dll_pixGetDimensions
add esp, 0x10
cmp dword [esp + 0x64], 0
je 0x100273ab
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x38]
cmp eax, ecx
jge 0x1002734c
mov ecx, eax
mov eax, 0x51eb851f
imul ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 1
jge 0x10027367
mov eax, 1
lea ecx, [esp + 0x40]
push ecx
lea edx, [esp + 0x40]
push edx
push eax
push 0x14
push 0xf4
push 0x14
push edi
call sym.leptonlib.dll_pixColorFraction
fld dword [esp + 0x58]
fmul dword [esp + 0x5c]
add esp, 0x1c
fcomp qword [0x10143870]
fnstsw ax
test ah, 5
jp 0x100273ab
push 1
push edi
call sym.leptonlib.dll_pixConvertTo8
add esp, 8
pop esi
pop ebx
pop edi
add esp, 0x3c
ret
cmp esi, 1
jne 0x100273b4
mov edi, esi
jmp 0x100273f1
mov eax, dword [esp + 0x34]
imul eax, dword [esp + 0x38]
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
fdiv qword [0x101439f8]
call sub.MSVCR90.dll__CIsqrt
call fcn.10140710
mov edi, eax
cmp esi, edi
mov eax, esi
jl 0x100273df
mov eax, edi
cmp eax, 1
jge 0x100273eb
mov edi, 1
jmp 0x100273f1
cmp esi, edi
jge 0x100273f1
mov edi, esi
mov ecx, dword [esp + 0x4c]
push ebp
push edi
push ebx
push ecx
call sym.leptonlib.dll_pixMedianCutHisto
mov ebp, eax
lea ecx, [ebx + ebx*2]
mov eax, 1
shl eax, cl
add esp, 0xc
xor esi, esi
xor ecx, ecx
test eax, eax
jle 0x10027428
cmp dword [ebp + ecx*4], 0
je 0x1002741d
inc esi
cmp esi, dword [esp + 0x5c]
jg 0x10027498
inc ecx
cmp ecx, eax
jl 0x10027415
cmp dword [esp + 0x58], 0
jne 0x10027460
cmp esi, 2
jg 0x1002743e
mov dword [esp + 0x58], 1
jmp 0x10027460
cmp esi, 4
jg 0x1002744d
mov dword [esp + 0x58], 2
jmp 0x10027460
xor edx, edx
cmp esi, 0x10
setg dl
lea edx, [edx*4 + 4]
mov dword [esp + 0x58], edx
mov esi, dword [esp + 0x58]
mov edi, dword [esp + 0x50]
push ebx
push eax
push ebp
push esi
mov eax, edi
call fcn.10025990
push ebx
push ebp
push eax
mov eax, dword [esp + 0x70]
push esi
push eax
push edi
call fcn.10025f80
push ebp
mov esi, eax
call dword [sym.imp.MSVCR90.dll_free]
add esp, 0x2c
pop ebp
mov eax, esi
pop esi
pop ebx
pop edi
add esp, 0x3c
ret
cmp dword [esp + 0x54], 0
jne 0x100274b4
cmp edi, 1
jg 0x100274b4
mov eax, dword [esp + 0x50]
push edi
push ebx
call fcn.10026a30
add esp, 8
jmp 0x100274cf
mov ecx, ebx
mov eax, 1
shl eax, cl
dec eax
push eax
push 0
push eax
push 0
push eax
push 0
call fcn.10025d80
add esp, 0x18
push ebx
mov esi, eax
push ebp
push esi
call fcn.10025c20
mov ecx, esi
mov dword [esi + 4], eax
call fcn.10025d50
push 2
push 0
mov dword [esi + 8], eax
call sym.leptonlib.dll_lheapCreate
push esi
push eax
mov dword [esp + 0x2c], eax
call sym.leptonlib.dll_lheapAdd
fild dword [esp + 0x78]
add esp, 0x1c
mov dword [esp + 0x18], 1
fmul qword [0x101439f0]
mov dword [esp + 0x20], 0
call fcn.10140710
mov dword [esp + 0x48], eax
mov ecx, dword [esp + 0x10]
push ecx
call sym.leptonlib.dll_lheapRemove
push ebx
mov esi, eax
push ebp
push esi
call fcn.10025c20
add esp, 0x10
test eax, eax
jne 0x1002754b
mov edx, dword [esp + 0x10]
push esi
push edx
call sym.leptonlib.dll_lheapAdd
add esp, 8
jmp 0x10027520
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x28]
push ecx
push esi
push ebp
call fcn.10026b90
mov edi, dword [esp + 0x34]
add esp, 0x10
test edi, edi
je 0x100275d1
cmp dword [edi + 8], 1
jle 0x10027572
fild dword [edi + 4]
fstp dword [edi]
push esi
call dword [sym.imp.MSVCR90.dll_free]
mov edx, dword [esp + 0x14]
push edi
push edx
call sym.leptonlib.dll_lheapAdd
mov eax, dword [esp + 0x34]
add esp, 0xc
test eax, eax
je 0x100275b0
mov esi, 1
cmp dword [eax + 8], esi
jle 0x1002759e
fild dword [eax + 4]
fstp dword [eax]
push eax
mov eax, dword [esp + 0x14]
push eax
call sym.leptonlib.dll_lheapAdd
add esp, 8
add dword [esp + 0x18], esi
mov ecx, dword [esp + 0x18]
cmp ecx, dword [esp + 0x48]
jge 0x100275d1
mov eax, dword [esp + 0x20]
mov edx, eax
inc eax
cmp edx, 0x1388
mov dword [esp + 0x20], eax
jle 0x10027520
push 2
push 0
call sym.leptonlib.dll_lheapCreate
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x18]
push eax
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
je 0x1002761d
nop
mov ecx, dword [eax + 8]
imul ecx, dword [eax + 4]
mov dword [esp + 0x48], ecx
push eax
fild dword [esp + 0x4c]
fstp dword [eax]
mov edx, dword [esp + 0x18]
push edx
call sym.leptonlib.dll_lheapAdd
mov eax, dword [esp + 0x18]
push eax
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
jne 0x100275f0
lea ecx, [esp + 0x10]
push 1
push ecx
call sym.leptonlib.dll_lheapDestroy
add esp, 8
lea esp, [esp]
mov edx, dword [esp + 0x14]
push edx
call sym.leptonlib.dll_lheapRemove
push ebx
mov edi, eax
push ebp
push edi
call fcn.10025c20
add esp, 0x10
test eax, eax
jne 0x10027658
mov eax, dword [esp + 0x14]
push edi
push eax
call sym.leptonlib.dll_lheapAdd
jmp 0x10027629
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x28]
push edx
push edi
push ebp
call fcn.10026b90
mov esi, dword [esp + 0x34]
add esp, 0x10
test esi, esi
je 0x100276f8
mov eax, dword [esi + 8]
cmp eax, 1
jle 0x10027690
mov ecx, dword [esi + 4]
imul ecx, eax
mov dword [esp + 0x48], ecx
fild dword [esp + 0x48]
fstp dword [esi]
push edi
call dword [sym.imp.MSVCR90.dll_free]
mov edx, dword [esp + 0x18]
push esi
push edx
call sym.leptonlib.dll_lheapAdd
mov eax, dword [esp + 0x34]
add esp, 0xc
test eax, eax
je 0x100276d7
mov ecx, dword [eax + 8]
cmp ecx, 1
jle 0x100276c5
mov edx, dword [eax + 4]
imul edx, ecx
mov dword [esp + 0x48], edx
fild dword [esp + 0x48]
fstp dword [eax]
push eax
mov eax, dword [esp + 0x18]
push eax
call sym.leptonlib.dll_lheapAdd
add esp, 8
inc dword [esp + 0x18]
mov ecx, dword [esp + 0x18]
cmp ecx, dword [esp + 0x5c]
jge 0x100276f8
mov eax, dword [esp + 0x20]
mov edx, eax
inc eax
cmp edx, 0x1388
mov dword [esp + 0x20], eax
jle 0x10027630
push 2
push 0
call sym.leptonlib.dll_lheapCreate
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1c]
push eax
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
je 0x10027737
fild dword [eax + 4]
push eax
fstp dword [eax]
mov ecx, dword [esp + 0x14]
push ecx
call sym.leptonlib.dll_lheapAdd
mov edx, dword [esp + 0x1c]
push edx
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
jne 0x10027716
lea eax, [esp + 0x14]
push 1
push eax
call sym.leptonlib.dll_lheapDestroy
mov esi, dword [esp + 0x18]
push ebx
push ebp
call fcn.100271f0
mov esi, eax
mov eax, dword [esp + 0x68]
add esp, 0x10
test eax, eax
jne 0x1002778d
push esi
call sym.leptonlib.dll_ccbaGetCount
add esp, 4
cmp eax, 2
jg 0x10027770
mov eax, 1
jmp 0x1002778d
cmp eax, 4
jg 0x1002777c
mov eax, 2
jmp 0x1002778d
xor ecx, ecx
cmp eax, 0x10
setg cl
lea ecx, [ecx*4 + 4]
mov eax, ecx
mov edx, dword [esp + 0x54]
push ebx
push ebp
push esi
push eax
mov eax, dword [esp + 0x60]
push edx
push eax
call fcn.10025f80
fldz
add esp, 0x18
lea ecx, [esp + 0x1c]
push ecx
push ecx
fstp dword [esp]
push esi
mov edi, eax
call sym.leptonlib.dll_pixcmapGetRankIntensity
lea edx, [esp + 0x40]
push edx
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x40]
push ecx
push edx
push esi
call sym.leptonlib.dll_pixcmapGetColor
mov eax, 5
add esp, 0x20
cmp dword [esp + 0x2c], eax
jge 0x100277fe
cmp dword [esp + 0x30], eax
jge 0x100277fe
cmp dword [esp + 0x34], eax
jge 0x100277fe
mov eax, dword [esp + 0x1c]
push 0
push 0
push 0
push eax
push esi
call sym.leptonlib.dll_pixcmapResetColor
add esp, 0x14
fld1
lea ecx, [esp + 0x1c]
push ecx
push ecx
fstp dword [esp]
push esi
call sym.leptonlib.dll_pixcmapGetRankIntensity
lea edx, [esp + 0x40]
push edx
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x40]
push ecx
push edx
push esi
call sym.leptonlib.dll_pixcmapGetColor
mov eax, 0xfb
add esp, 0x20
cmp dword [esp + 0x2c], eax
jle 0x10027860
cmp dword [esp + 0x30], eax
jle 0x10027860
cmp dword [esp + 0x34], eax
jle 0x10027860
mov eax, dword [esp + 0x1c]
push 0xff
push 0xff
push 0xff
push eax
push esi
call sym.leptonlib.dll_pixcmapResetColor
add esp, 0x14
lea ecx, [esp + 0x10]
push 1
push ecx
call sym.leptonlib.dll_lheapDestroy
push ebp
call dword [sym.imp.MSVCR90.dll_free]
add esp, 0xc
pop ebp
pop esi
pop ebx
mov eax, edi
pop edi
add esp, 0x3c
ret
pop ebx
xor eax, eax
pop edi
add esp, 0x3c
ret
xor eax, eax
pop edi
add esp, 0x3c
ret