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

Disassembly:
mov edx, dword [esp + 0x20]
sub esp, 0x64
test edx, edx
je 0x10003355
mov ecx, dword [esp + 0x88]
test ecx, ecx
je 0x10003355
mov eax, dword [esp + 0x8c]
test eax, eax
je 0x10003355
push ebx
mov ebx, dword [esp + 0x6c]
mov dword [eax], 0
mov dword [ecx], 0
mov dword [edx], 0
test ebx, ebx
je 0x10002dc6
push ebx
call sym.leptonlib.dll_numaGetRefcount
add esp, 4
cmp eax, 0x20
je 0x10002dd0
mov eax, 1
pop ebx
add esp, 0x64
ret
push ebp
mov ebp, dword [esp + 0x74]
test ebp, ebp
je 0x10002df2
push ebp
call sym.leptonlib.dll_numaGetRefcount
add esp, 4
cmp eax, 1
je 0x10002df2
pop ebp
mov eax, 1
pop ebx
add esp, 0x64
ret
push esi
mov esi, dword [esp + 0x80]
cmp esi, 4
push edi
jl 0x10003348
mov edi, dword [esp + 0x88]
cmp edi, 4
jl 0x10003348
mov ecx, esi
imul ecx, edi
cmp dword [esp + 0x90], ecx
jle 0x10002e37
mov eax, 0x55555556
imul ecx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x90], eax
mov dword [esp + 0x5c], 0
test ebp, ebp
je 0x10002e8f
push ebp
push 0
call sym.leptonlib.dll_pixInvert
lea ecx, [esp + 0x28]
push ecx
push eax
mov dword [esp + 0x70], eax
call sym.leptonlib.dll_pixZero
lea edx, [esp + 0x70]
push edx
call sym.leptonlib.dll_pixDestroy
add esp, 0x14
cmp dword [esp + 0x20], 0
jne 0x10003348
lea eax, [esp + 0x20]
push eax
push ebp
call sym.leptonlib.dll_pixZero
add esp, 8
cmp dword [esp + 0x20], 0
jne 0x10002e8f
mov dword [esp + 0x5c], 1
mov eax, dword [esp + 0x80]
test eax, eax
je 0x10002ea2
push eax
call sym.leptonlib.dll_boxClone
jmp 0x10002ea8
push ebx
call sym.leptonlib.dll_pixConvertRGBToGrayFast
mov ecx, dword [esp + 0x90]
add esp, 4
push ecx
push eax
mov dword [esp + 0x4c], eax
call sym.leptonlib.dll_pixThresholdToBinary
push 0
push 0x10142248
push eax
mov dword [esp + 0x78], eax
call sym.leptonlib.dll_pixMorphSequence
lea edx, [esp + 0x58]
push edx
mov dword [esp + 0x54], eax
call sym.leptonlib.dll_pixDestroy
lea eax, [esp + 0x7c]
push eax
call sym.leptonlib.dll_pixDestroy
push ebx
call sym.leptonlib.dll_pixGetWidth
push ebx
mov ebp, eax
call sym.leptonlib.dll_pixGetHeight
mov ecx, eax
lea eax, [esi + ebp - 1]
cdq
idiv esi
push 8
mov dword [esp + 0x80], ecx
mov esi, eax
lea eax, [ecx + edi - 1]
cdq
idiv edi
mov edi, eax
push edi
push esi
call sym.leptonlib.dll_pixCreate
push 8
push edi
push esi
mov dword [esp + 0x4c], eax
call sym.leptonlib.dll_pixCreate
push 8
push edi
push esi
mov dword [esp + 0x5c], eax
call sym.leptonlib.dll_pixCreate
mov dword [esp + 0x60], eax
mov eax, ebp
cdq
idiv dword [esp + 0xcc]
mov edi, dword [esp + 0xd0]
add esp, 0x48
push ebx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x5c]
cdq
idiv edi
mov ebp, eax
mov dword [esp + 0x6c], ebp
call sym.leptonlib.dll_dpixGetRefcount
push ebx
mov dword [esp + 0x54], eax
call sym.leptonlib.dll_pixGetData
mov ecx, dword [esp + 0x44]
push ecx
mov ebx, eax
call sym.leptonlib.dll_dpixGetRefcount
mov edx, dword [esp + 0x48]
push edx
mov dword [esp + 0x58], eax
call sym.leptonlib.dll_pixGetData
xor ecx, ecx
xor esi, esi
add esp, 0x10
cmp ebp, ecx
mov dword [esp + 0x58], esi
jle 0x10003115
mov edx, dword [esp + 0x48]
imul edx, edi
add edx, edx
add edx, edx
mov dword [esp + 0x70], edx
mov edx, dword [esp + 0x4c]
imul edx, edi
add edx, edx
add edx, edx
mov dword [esp + 0x6c], edx
mov dword [esp + 0x38], eax
mov dword [esp + 0x34], ebx
mov edi, edi
xor edi, edi
cmp dword [esp + 0x1c], ecx
mov dword [esp + 0x54], edi
jle 0x100030fc
xor edx, edx
mov dword [esp + 0x30], edx
jmp 0x10002fe0
mov eax, dword [esp + 0x88]
xor ebp, ebp
xor ebx, ebx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x28], ecx
test eax, eax
jle 0x1000308e
mov ecx, dword [esp + 0x38]
mov edi, edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x50], eax
lea esp, [esp]
xor esi, esi
cmp dword [esp + 0x84], esi
jle 0x1000306f
jmp 0x10003020
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x24]
add edx, esi
push edx
push eax
call sym.leptonlib.dll_l_getDataBit
add esp, 8
test eax, eax
jne 0x10003065
mov edx, dword [esp + 0x34]
lea ecx, [edi + esi]
mov eax, dword [edx + ecx*4]
mov edx, eax
mov ecx, eax
shr edx, 0x10
shr eax, 8
shr ecx, 0x18
and edx, 0xff
add dword [esp + 0x28], edx
and eax, 0xff
add dword [esp + 0x2c], eax
add ebp, ecx
inc ebx
inc esi
cmp esi, dword [esp + 0x84]
jl 0x10003020
mov eax, dword [esp + 0x48]
add edi, dword [esp + 0x4c]
add eax, eax
add eax, eax
add dword [esp + 0x24], eax
sub dword [esp + 0x50], 1
jne 0x10003010
mov esi, dword [esp + 0x58]
mov edi, dword [esp + 0x54]
cmp ebx, dword [esp + 0x90]
jl 0x100030d4
mov eax, ebp
cdq
idiv ebx
push eax
mov eax, dword [esp + 0x14]
push esi
push edi
push eax
call sym.leptonlib.dll_pixSetPixel
mov eax, dword [esp + 0x38]
cdq
idiv ebx
mov ecx, dword [esp + 0x24]
push eax
push esi
push edi
push ecx
call sym.leptonlib.dll_pixSetPixel
mov eax, dword [esp + 0x4c]
cdq
idiv ebx
mov edx, dword [esp + 0x38]
push eax
push esi
push edi
push edx
call sym.leptonlib.dll_pixSetPixel
add esp, 0x30
mov edx, dword [esp + 0x30]
add edx, dword [esp + 0x84]
inc edi
xor ecx, ecx
cmp edi, dword [esp + 0x1c]
mov dword [esp + 0x54], edi
mov dword [esp + 0x30], edx
jl 0x10002fe0
mov ebp, dword [esp + 0x68]
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x70]
add dword [esp + 0x34], edx
add dword [esp + 0x38], eax
inc esi
cmp esi, ebp
mov dword [esp + 0x58], esi
jl 0x10002fc0
lea ecx, [esp + 0x3c]
push ecx
call sym.leptonlib.dll_pixDestroy
mov ebx, dword [esp + 0x80]
add esp, 4
test ebx, ebx
je 0x10003227
push ebx
call sym.leptonlib.dll_pixGetWidth
push ebx
mov dword [esp + 0x74], eax
call sym.leptonlib.dll_pixGetHeight
push ebx
mov dword [esp + 0x7c], eax
call sym.leptonlib.dll_pixGetData
push ebx
mov esi, eax
call sym.leptonlib.dll_dpixGetRefcount
add esp, 0x10
xor edi, edi
mov ecx, eax
test ebp, ebp
jle 0x10003227
mov eax, dword [esp + 0x88]
cdq
sub eax, edx
mov edx, ecx
imul edx, dword [esp + 0x88]
sar eax, 1
add edx, edx
mov dword [esp + 0x34], eax
add edx, edx
imul eax, ecx
lea eax, [esi + eax*4]
mov dword [esp + 0x58], edx
mov dword [esp + 0x38], eax
mov edi, edi
mov ecx, dword [esp + 0x34]
cmp ecx, dword [esp + 0x70]
jge 0x10003227
xor esi, esi
cmp dword [esp + 0x1c], esi
jle 0x1000320f
mov eax, dword [esp + 0x84]
cdq
sub eax, edx
mov ebx, eax
sar ebx, 1
cmp ebx, dword [esp + 0x6c]
jge 0x10003207
mov edx, dword [esp + 0x38]
push ebx
push edx
call sym.leptonlib.dll_l_getDataBit
add esp, 8
test eax, eax
je 0x100031f9
mov eax, dword [esp + 0x10]
push 0
push edi
push esi
push eax
call sym.leptonlib.dll_pixSetPixel
mov ecx, dword [esp + 0x24]
push 0
push edi
push esi
push ecx
call sym.leptonlib.dll_pixSetPixel
mov edx, dword [esp + 0x38]
push 0
push edi
push esi
push edx
call sym.leptonlib.dll_pixSetPixel
add esp, 0x30
add ebx, dword [esp + 0x84]
inc esi
cmp esi, dword [esp + 0x1c]
jl 0x100031b4
mov edx, dword [esp + 0x58]
mov ebx, dword [esp + 0x7c]
mov eax, dword [esp + 0x88]
add dword [esp + 0x38], edx
add dword [esp + 0x34], eax
inc edi
cmp edi, ebp
jl 0x10003190
mov esi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x10]
push 2
push ebp
push esi
push ecx
call sym.leptonlib.dll_pixFillMapHoles
add esp, 0x10
test eax, eax
jne 0x10003327
mov edx, dword [esp + 0x14]
push 2
push ebp
push esi
push edx
call sym.leptonlib.dll_pixFillMapHoles
add esp, 0x10
test eax, eax
jne 0x10003327
mov eax, dword [esp + 0x18]
push 2
push ebp
push esi
push eax
call sym.leptonlib.dll_pixFillMapHoles
add esp, 0x10
test eax, eax
jne 0x10003327
test ebx, ebx
je 0x100032f6
cmp dword [esp + 0x5c], eax
je 0x100032f6
fild dword [esp + 0x88]
sub esp, 8
fld1
fld st(0)
fdivrp st(2)
fxch st(1)
fstp dword [esp + 0x78]
fld dword [esp + 0x78]
fstp dword [esp + 4]
fidiv dword [esp + 0x8c]
fstp dword [esp + 0x78]
fld dword [esp + 0x78]
fstp dword [esp]
push ebx
call sym.leptonlib.dll_pixScaleBySampling
mov ecx, dword [esp + 0x1c]
push 2
push eax
push ecx
mov dword [esp + 0x58], eax
call sym.leptonlib.dll_pixSmoothConnectedRegions
mov edx, dword [esp + 0x58]
mov eax, dword [esp + 0x2c]
push 2
push edx
push eax
call sym.leptonlib.dll_pixSmoothConnectedRegions
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x3c]
push 2
push ecx
push edx
call sym.leptonlib.dll_pixSmoothConnectedRegions
lea eax, [esp + 0x70]
push eax
call sym.leptonlib.dll_pixDestroy
add esp, 0x34
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x94]
mov eax, dword [esp + 0x14]
mov dword [edx], ecx
mov ecx, dword [esp + 0x98]
mov edx, dword [esp + 0x18]
pop edi
mov dword [ecx], eax
mov eax, dword [esp + 0x98]
pop esi
pop ebp
mov dword [eax], edx
xor eax, eax
pop ebx
add esp, 0x64
ret
lea ecx, [esp + 0x10]
push ecx
call sym.leptonlib.dll_pixDestroy
lea edx, [esp + 0x18]
push edx
call sym.leptonlib.dll_pixDestroy
lea eax, [esp + 0x20]
push eax
call sym.leptonlib.dll_pixDestroy
add esp, 0xc
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x64
ret
mov eax, 1
add esp, 0x64
ret