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

Disassembly:
sub esp, 0x6c
push esi
mov esi, dword [esp + 0x74]
test esi, esi
je 0x100278b3
push esi
call sym.leptonlib.dll_numaGetRefcount
add esp, 4
cmp eax, 0x20
jne 0x100278b3
mov eax, dword [esp + 0x7c]
cmp eax, 2
jge 0x100278ba
xor eax, eax
pop esi
add esp, 0x6c
ret
mov ecx, dword [esp + 0x78]
add ecx, eax
cmp ecx, 0xff
jg 0x100278b3
push ebx
mov ebx, dword [esp + 0x84]
test ebx, ebx
jg 0x100278e0
mov ebx, 0x14
mov dword [esp + 0x84], ebx
push ebp
mov ebp, dword [esp + 0x8c]
test ebp, ebp
jg 0x100278f8
mov ebp, 0xf4
mov dword [esp + 0x8c], ebp
push edi
mov edi, dword [esp + 0x94]
test edi, edi
jg 0x10027910
mov edi, 0x14
mov dword [esp + 0x94], edi
push 0
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x20]
push eax
push esi
call sym.leptonlib.dll_pixGetDimensions
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
add esp, 0x10
cmp eax, ecx
jge 0x10027933
mov ecx, eax
mov eax, 0x51eb851f
imul ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 1
jge 0x1002794e
mov eax, 1
lea ecx, [esp + 0x58]
push ecx
lea edx, [esp + 0x58]
push edx
push eax
push edi
push ebp
push ebx
push esi
call sym.leptonlib.dll_pixColorFraction
fld dword [esp + 0x70]
fmul dword [esp + 0x74]
add esp, 0x1c
fcomp qword [0x101438a0]
fnstsw ax
test ah, 5
jp 0x100279af
push 0
push esi
call sym.leptonlib.dll_pixConvertTo8
mov ecx, dword [esp + 0x90]
push 1
push ecx
push eax
mov dword [esp + 0x3c], eax
call sym.leptonlib.dll_pixThresholdOn8bpp
lea edx, [esp + 0x3c]
push edx
mov esi, eax
call sym.leptonlib.dll_pixDestroy
add esp, 0x18
pop edi
pop ebp
pop ebx
mov eax, esi
pop esi
add esp, 0x6c
ret
push esi
push 0
call sym.leptonlib.dll_pixCopy
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x24]
push 8
push eax
push ecx
call sym.leptonlib.dll_pixCreate
mov edx, dword [esp + 0x40]
push edx
mov dword [esp + 0x40], eax
call sym.leptonlib.dll_pixGetData
mov edi, eax
mov eax, dword [esp + 0x40]
push eax
call sym.leptonlib.dll_pixGetData
mov ecx, dword [esp + 0x48]
mov ebp, eax
push ecx
mov dword [esp + 0x90], ebp
call sym.leptonlib.dll_dpixGetRefcount
mov edx, dword [esp + 0x48]
push edx
mov ebx, eax
call sym.leptonlib.dll_dpixGetRefcount
push 4
push 0x100
mov dword [esp + 0x7c], eax
call dword [sym.imp.MSVCR90.dll_calloc]
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0xb4]
add esp, 0x2c
xor ecx, ecx
dec eax
mov dword [esp + 0x4c], eax
mov esi, 0x80
mov eax, 0x80808081
imul esi
add edx, esi
add esi, dword [esp + 0x4c]
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x84]
lea eax, [eax + edx + 1]
mov edx, dword [esp + 0x44]
mov dword [edx + ecx*4], eax
inc ecx
cmp ecx, 0x100
jl 0x10027a30
cmp dword [esp + 0x1c], 0
mov dword [esp + 0x40], 0
jle 0x10027b5d
mov eax, dword [esp + 0x50]
lea ecx, [eax*4]
mov eax, dword [esp + 0x18]
lea edx, [ebx*4]
mov ebx, ebp
mov dword [esp + 0x80], ecx
mov dword [esp + 0x48], edx
mov ebp, edi
lea ebx, [ebx]
xor esi, esi
test eax, eax
jle 0x10027b3f
lea ebx, [ebx]
lea eax, [esp + 0x64]
push eax
mov eax, dword [ebp + esi*4]
lea ecx, [esp + 0x64]
push ecx
lea edx, [esp + 0x64]
push edx
push eax
call sym.leptonlib.dll_extractRGBValues
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x70]
add esp, 0x10
cmp eax, edx
mov ecx, eax
jl 0x10027adc
mov ecx, edx
mov edi, dword [esp + 0x64]
cmp ecx, edi
jl 0x10027ae6
mov ecx, edi
cmp eax, edx
jg 0x10027aec
mov eax, edx
cmp eax, edi
jg 0x10027af2
mov eax, edi
cmp eax, dword [esp + 0x8c]
jl 0x10027b11
cmp ecx, dword [esp + 0x90]
jg 0x10027b11
mov edx, eax
sub edx, ecx
cmp edx, dword [esp + 0x94]
jge 0x10027b32
add eax, ecx
mov ecx, dword [esp + 0x44]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [ecx + eax*4]
push edx
push esi
push ebx
mov dword [ebp + esi*4], 0
call sym.leptonlib.dll_l_setDataByte
add esp, 0xc
mov eax, dword [esp + 0x18]
inc esi
cmp esi, eax
jl 0x10027ab0
mov ecx, dword [esp + 0x40]
add ebp, dword [esp + 0x48]
add ebx, dword [esp + 0x80]
inc ecx
cmp ecx, dword [esp + 0x1c]
mov dword [esp + 0x40], ecx
jl 0x10027aa0
mov ebx, dword [esp + 0x84]
mov esi, dword [esp + 0x2c]
xor edi, edi
lea ebp, [ebx + 1]
mov dword [esp + 0x48], ebp
mov dword [esp + 0x6c], esi
cmp esi, edi
je 0x10027fb6
push esi
call sym.leptonlib.dll_numaGetRefcount
add esp, 4
cmp eax, 0x20
jne 0x10027fb6
lea eax, [ebp - 2]
cmp eax, 0xfe
ja 0x10027fb6
cmp ebp, 0x100
jg 0x10027fb6
push edi
lea ecx, [esp + 0x78]
push ecx
lea edx, [esp + 0x80]
push edx
push esi
call sym.leptonlib.dll_pixGetDimensions
push 1
push 5
push esi
call sym.leptonlib.dll_pixMedianCutHisto
add esp, 0x1c
mov edi, eax
xor ecx, ecx
xor eax, eax
cmp dword [edi + eax*4], 0
je 0x10027bd7
inc ecx
cmp ecx, ebp
jg 0x10027c17
inc eax
cmp eax, 0x8000
jl 0x10027bd0
push 5
push 0x8000
push edi
push 8
mov eax, esi
call fcn.10025990
push 5
push edi
push eax
push 8
push 0
push esi
call fcn.10025f80
push edi
mov esi, eax
call dword [sym.imp.MSVCR90.dll_free]
add esp, 0x2c
mov dword [esp + 0x14], esi
jmp 0x10027fba
push 1
push 5
mov eax, esi
call fcn.10026a30
push 5
mov esi, eax
push edi
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 + 0xa4], eax
call sym.leptonlib.dll_lheapAdd
fild dword [esp + 0x6c]
add esp, 0x24
mov dword [esp + 0x14], 1
fmul qword [0x101439f0]
xor ebp, ebp
call fcn.10140710
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x80]
push eax
call sym.leptonlib.dll_lheapRemove
push 5
mov esi, eax
push edi
push esi
call fcn.10025c20
add esp, 0x10
test eax, eax
jne 0x10027ca3
mov ecx, dword [esp + 0x80]
push esi
push ecx
call sym.leptonlib.dll_lheapAdd
add esp, 8
jmp 0x10027c71
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x34]
push eax
push esi
push edi
mov ebx, 5
call fcn.10026b90
mov ebx, dword [esp + 0x40]
add esp, 0x10
test ebx, ebx
je 0x10027d2c
cmp dword [ebx + 8], 1
jle 0x10027ccf
fild dword [ebx + 4]
fstp dword [ebx]
push esi
call dword [sym.imp.MSVCR90.dll_free]
mov ecx, dword [esp + 0x84]
push ebx
push ecx
call sym.leptonlib.dll_lheapAdd
mov eax, dword [esp + 0x40]
add esp, 0xc
test eax, eax
je 0x10027d13
mov esi, 1
cmp dword [eax + 8], esi
jle 0x10027cfe
fild dword [eax + 4]
fstp dword [eax]
mov edx, dword [esp + 0x80]
push eax
push edx
call sym.leptonlib.dll_lheapAdd
add esp, 8
add dword [esp + 0x14], esi
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x20]
jge 0x10027d2c
mov ecx, ebp
inc ebp
cmp ecx, 0x1388
jle 0x10027c71
push 2
push 0
mov dword [esp + 0x28], ebp
call sym.leptonlib.dll_lheapCreate
mov edx, dword [esp + 0x88]
push edx
mov dword [esp + 0x1c], eax
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
je 0x10027d81
mov ecx, dword [eax + 8]
imul ecx, dword [eax + 4]
mov dword [esp + 0x68], ecx
push eax
fild dword [esp + 0x6c]
fstp dword [eax]
mov edx, dword [esp + 0x14]
push edx
call sym.leptonlib.dll_lheapAdd
mov eax, dword [esp + 0x88]
push eax
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
jne 0x10027d51
lea ecx, [esp + 0x80]
push 1
push ecx
call sym.leptonlib.dll_lheapDestroy
add esp, 8
mov edx, dword [esp + 0x10]
push edx
call sym.leptonlib.dll_lheapRemove
push 5
mov ebp, eax
push edi
push ebp
call fcn.10025c20
add esp, 0x10
test eax, eax
jne 0x10027dbc
mov eax, dword [esp + 0x10]
push ebp
push eax
call sym.leptonlib.dll_lheapAdd
jmp 0x10027d90
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x34]
push edx
push ebp
push edi
mov ebx, 5
call fcn.10026b90
mov esi, dword [esp + 0x40]
add esp, 0x10
test esi, esi
je 0x10027e61
mov eax, dword [esi + 8]
cmp eax, 1
jle 0x10027df9
mov ecx, dword [esi + 4]
imul ecx, eax
mov dword [esp + 0x68], ecx
fild dword [esp + 0x68]
fstp dword [esi]
push ebp
call dword [sym.imp.MSVCR90.dll_free]
mov edx, dword [esp + 0x14]
push esi
push edx
call sym.leptonlib.dll_lheapAdd
mov eax, dword [esp + 0x40]
add esp, 0xc
test eax, eax
je 0x10027e40
mov ecx, dword [eax + 8]
cmp ecx, 1
jle 0x10027e2e
mov edx, dword [eax + 4]
imul edx, ecx
mov dword [esp + 0x68], edx
fild dword [esp + 0x68]
fstp dword [eax]
push eax
mov eax, dword [esp + 0x14]
push eax
call sym.leptonlib.dll_lheapAdd
add esp, 8
inc dword [esp + 0x14]
mov ecx, dword [esp + 0x14]
cmp ecx, dword [esp + 0x48]
jge 0x10027e61
mov eax, dword [esp + 0x20]
mov edx, eax
inc eax
cmp edx, 0x1388
mov dword [esp + 0x20], eax
jle 0x10027d93
push 2
push 0
call sym.leptonlib.dll_lheapCreate
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x18]
push eax
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
je 0x10027ea6
fild dword [eax + 4]
push eax
fstp dword [eax]
mov ecx, dword [esp + 0x84]
push ecx
call sym.leptonlib.dll_lheapAdd
mov edx, dword [esp + 0x18]
push edx
call sym.leptonlib.dll_lheapRemove
add esp, 0xc
test eax, eax
jne 0x10027e82
lea eax, [esp + 0x10]
push 1
push eax
call sym.leptonlib.dll_lheapDestroy
mov esi, dword [esp + 0x88]
mov ebp, ebx
push ebp
push edi
call fcn.100271f0
mov ecx, dword [esp + 0x7c]
push ebp
push edi
mov esi, eax
push esi
push 8
push 0
push ecx
call fcn.10025f80
fldz
add esp, 0x28
lea edx, [esp + 0x24]
push edx
push ecx
fstp dword [esp]
push esi
mov ebx, eax
call sym.leptonlib.dll_pixcmapGetRankIntensity
lea eax, [esp + 0x4c]
push eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x4c]
push ecx
lea edx, [esp + 0x4c]
push edx
push eax
push esi
call sym.leptonlib.dll_pixcmapGetColor
add esp, 0x20
cmp dword [esp + 0x38], ebp
jge 0x10027f2e
cmp dword [esp + 0x3c], ebp
jge 0x10027f2e
cmp dword [esp + 0x40], ebp
jge 0x10027f2e
mov ecx, dword [esp + 0x24]
push 0
push 0
push 0
push ecx
push esi
call sym.leptonlib.dll_pixcmapResetColor
add esp, 0x14
fld1
lea edx, [esp + 0x24]
push edx
push ecx
fstp dword [esp]
push esi
call sym.leptonlib.dll_pixcmapGetRankIntensity
lea eax, [esp + 0x4c]
push eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x4c]
push ecx
lea edx, [esp + 0x4c]
push edx
push eax
push esi
call sym.leptonlib.dll_pixcmapGetColor
mov eax, 0xfb
add esp, 0x20
cmp dword [esp + 0x38], eax
jle 0x10027f90
cmp dword [esp + 0x3c], eax
jle 0x10027f90
cmp dword [esp + 0x40], eax
jle 0x10027f90
mov ecx, dword [esp + 0x24]
push 0xff
push 0xff
push 0xff
push ecx
push esi
call sym.leptonlib.dll_pixcmapResetColor
add esp, 0x14
lea edx, [esp + 0x80]
push 1
push edx
call sym.leptonlib.dll_lheapDestroy
push edi
call dword [sym.imp.MSVCR90.dll_free]
mov dword [esp + 0x20], ebx
mov ebx, dword [esp + 0x90]
add esp, 0xc
jmp 0x10027fba
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x14]
push eax
call sym.leptonlib.dll_pixGetColormap
mov edi, eax
push edi
call sym.leptonlib.dll_ccbaGetCount
sub ebx, eax
inc ebx
mov eax, ebx
add esp, 8
test eax, eax
jle 0x10027ff4
mov esi, eax
lea ebx, [ebx]
push 0
push 0
push 0
push edi
call sym.leptonlib.dll_pixcmapAddColor
add esp, 0x10
sub esi, 1
jne 0x10027fe0
mov ebx, dword [esp + 0x88]
test ebx, ebx
jle 0x10028021
mov ebp, dword [esp + 0x4c]
xor esi, esi
mov eax, esi
cdq
idiv ebp
push eax
push eax
push eax
push edi
call sym.leptonlib.dll_pixcmapAddColor
add esp, 0x10
add esi, 0xff
sub ebx, 1
jne 0x10028005
mov esi, dword [esp + 0x14]
push esi
call sym.leptonlib.dll_pixGetData
push esi
mov ebx, eax
call sym.leptonlib.dll_dpixGetRefcount
xor ebp, ebp
add esp, 8
cmp dword [esp + 0x1c], ebp
jle 0x1002809e
mov ecx, dword [esp + 0x50]
mov edi, dword [esp + 0x70]
add eax, eax
add eax, eax
lea edx, [ecx*4]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x80], edx
xor esi, esi
test eax, eax
jle 0x10028088
push esi
push edi
call sym.leptonlib.dll_l_getDataByte
add esp, 8
test eax, eax
je 0x1002807f
push eax
push esi
push ebx
call sym.leptonlib.dll_l_setDataByte
add esp, 0xc
mov eax, dword [esp + 0x18]
inc esi
cmp esi, eax
jl 0x10028066
add ebx, dword [esp + 0x6c]
add edi, dword [esp + 0x80]
inc ebp
cmp ebp, dword [esp + 0x1c]
jl 0x10028060
mov esi, dword [esp + 0x14]
lea ecx, [esp + 0x2c]
push ecx
call sym.leptonlib.dll_pixDestroy
lea edx, [esp + 0x2c]
push edx
call sym.leptonlib.dll_pixDestroy
mov eax, dword [esp + 0x4c]
push eax
call dword [sym.imp.MSVCR90.dll_free]
add esp, 0xc
pop edi
pop ebp
pop ebx
mov eax, esi
pop esi
add esp, 0x6c
ret