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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x9c
mov ebx, dword [eax]
mov dword [esp + 0x40], eax
movzx eax, byte [eax + 0x29]
mov dword [esp + 0x74], edx
mov word [esp + 0x70], dx
mov dword [esp + 0x68], ebx
mov ebx, dword [ebx]
cmp eax, 1
mov byte [esp + 0x73], al
mov dword [esp + 0x5c], eax
mov dword [esp + 0x6c], ebx
jle 0x665b4186
xor ebx, ebx
cmp eax, 2
setne bl
lea ebx, [ebx + ebx*4 + 5]
mov dword [esp + 0x38], ebx
cmp word [esp + 0x74], 0
mov eax, dword [esp + 0x40]
mov eax, dword [eax + 8]
je 0x665b4177
test eax, eax
je 0x665b4177
mov eax, dword [eax]
lea esi, [eax + eax]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x5c]
lea edx, [eax*8 + 0x40]
mov eax, dword [esp + 0x6c]
imul edx, ebx
add edx, esi
mov ecx, edx
sar ecx, 0x1f
call sym._sqlite3DbMallocRaw
mov ecx, eax
mov dword [esp + 0x64], eax
mov eax, 7
test ecx, ecx
je 0x665b416c
shl ebx, 5
lea eax, [ecx + ebx]
lea edx, [eax + 4]
mov dword [esp + 0x54], eax
mov dword [eax], 0
mov dword [eax + 0x1c], 0
and edx, 0xfffffffc
sub eax, edx
mov ecx, eax
xor eax, eax
add ecx, 0x20
and ecx, 0xfffffffc
mov dword [edx + eax], 0
add eax, 4
cmp eax, ecx
jb 0x665b3c96
mov eax, dword [esp + 0x5c]
add ebx, dword [esp + 0x54]
shl eax, 2
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x38]
mov edx, ebx
lea edi, [eax + eax]
shl eax, 6
mov ecx, eax
mov eax, dword [esp + 0x64]
add ecx, eax
mov dword [eax + 0x18], edx
add eax, 0x20
add edx, dword [esp + 0x60]
cmp ecx, eax
jne 0x665b3cc7
imul edi, dword [esp + 0x60]
mov edx, dword [esp + 0x3c]
test edx, edx
lea eax, [ebx + edi]
mov dword [esp + 0x50], eax
jne 0x665b435a
mov ebx, dword [esp + 0x68]
mov eax, 0x30
mov dword [esp + 0x50], 0
cmp dword [ebx + 0x1a8], 0x30
cmovbe eax, dword [ebx + 0x1a8]
mov ebx, dword [esp + 0x54]
mov word [ebx + 0x10], ax
mov edi, dword [esp + 0x5c]
test edi, edi
je 0x665b4072
mov eax, dword [esp + 0x64]
mov dword [esp + 0x4c], 1
xor ebx, ebx
mov ecx, dword [esp + 0x4c]
xor esi, esi
mov dword [esp + 0x58], 0
mov word [esp + 0x46], bx
mov word [esp + 0x44], si
mov dword [esp + 0x2c], eax
movsx eax, word [esp + 0x70]
mov dword [esp + 0x28], 0
mov dword [esp + 0x78], eax
sar eax, 0x1f
test ecx, ecx
mov dword [esp + 0x7c], eax
jle 0x665b420a
mov eax, dword [esp + 0x58]
mov dword [esp + 0x20], 0
mov dword [esp + 0x34], 0
shl eax, 2
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x54]
mov dword [esp + 0x14], eax
lea esi, [esi]
mov eax, dword [esp + 0x40]
mov edi, dword [eax + 0x10]
test edi, edi
je 0x665b41bb
nop
mov ecx, dword [esp + 0x14]
movzx eax, byte [ecx + 0x16]
mov dword [esp + 0x88], 0
mov dword [esp + 0x8c], 0
mov ebx, dword [ecx]
mov esi, dword [ecx + 4]
mov edx, ebx
mov byte [esp + 0x18], al
not edx
mov eax, edx
mov edx, esi
and eax, dword [edi]
not edx
and edx, dword [edi + 4]
or edx, eax
jne 0x665b41b0
mov ebp, dword [edi + 8]
mov ecx, dword [edi + 0xc]
mov edx, ebx
and edx, ebp
mov dword [esp + 0x1c], ecx
mov eax, edx
mov edx, esi
and edx, ecx
or edx, eax
jne 0x665b41b0
mov ecx, dword [esp + 0x14]
movsx eax, word [edi + 0x12]
or ebx, ebp
movzx edx, word [ecx + 0x10]
mov word [esp + 0x24], dx
add dx, word [edi + 0x14]
movsx edx, dx
call sym._sqlite3LogEstAdd
mov ecx, dword [esp + 0x14]
cwde
movsx edx, word [ecx + 0x14]
call sym._sqlite3LogEstAdd
mov ecx, dword [esp + 0x1c]
movzx edx, word [esp + 0x24]
add dx, word [edi + 0x16]
mov word [esp + 0x30], ax
or esi, ecx
cmp byte [esp + 0x18], 0
mov word [esp + 0x32], dx
js 0x665b4263
mov eax, dword [esp + 0x14]
mov edx, dword [eax + 0xc]
mov eax, dword [eax + 8]
mov dword [esp + 0x8c], edx
mov dword [esp + 0x88], eax
movsx eax, byte [esp + 0x18]
movzx ecx, word [esp + 0x30]
cmp dword [esp + 0x3c], eax
mov word [esp + 0x1c], cx
jle 0x665b3e9e
mov ecx, dword [esp + 0x50]
lea ebp, [ecx + eax*2]
movzx edx, word [ebp]
test dx, dx
je 0x665b42ae
movsx eax, word [esp + 0x30]
movsx edx, dx
call sym._sqlite3LogEstAdd
mov word [esp + 0x1c], ax
mov ecx, dword [esp + 0x20]
test ecx, ecx
jle 0x665b4254
mov ebp, dword [esp + 0x2c]
xor eax, eax
mov dword [esp + 0x24], edi
jmp 0x665b3ece
add eax, 1
add ebp, 0x20
cmp eax, ecx
je 0x665b4214
mov edi, dword [ebp + 4]
mov edx, dword [ebp]
xor edi, esi
xor edx, ebx
or edi, edx
jne 0x665b3ec0
movzx edx, byte [esp + 0x18]
xor dl, byte [ebp + 0x16]
js 0x665b3ec0
cmp eax, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
jge 0x665b4218
movzx eax, word [esp + 0x1c]
cmp ax, word [ebp + 0x12]
jg 0x665b41b0
je 0x665b42f5
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x48]
mov eax, dword [esi]
or eax, dword [edi + 8]
mov dword [ebp], eax
mov eax, dword [esi + 4]
or eax, dword [edi + 0xc]
mov dword [ebp + 4], eax
mov eax, dword [esp + 0x88]
mov edx, dword [esp + 0x8c]
mov dword [ebp + 8], eax
movzx eax, word [esp + 0x32]
mov dword [ebp + 0xc], edx
mov word [ebp + 0x10], ax
movzx eax, word [esp + 0x1c]
mov word [ebp + 0x12], ax
movzx eax, word [esp + 0x30]
mov word [ebp + 0x14], ax
movzx eax, byte [esp + 0x18]
mov byte [ebp + 0x16], al
mov eax, dword [ebp + 0x18]
mov edx, dword [esi + 0x18]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._memcpy
mov esi, dword [esp + 0x38]
cmp dword [esp + 0x20], esi
mov eax, dword [ebp + 0x18]
mov dword [eax + ebx], edi
jl 0x665b41b0
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x28], 0
movzx ebx, word [eax + 0x12]
movzx ecx, word [eax + 0x10]
add eax, 0x20
cmp esi, 1
mov word [esp + 0x44], bx
mov word [esp + 0x46], cx
je 0x665b41b0
mov edx, 1
mov ebp, ecx
mov dword [esp + 0x18], edi
jmp 0x665b3fd8
movzx ebp, word [eax + 0x14]
mov ebx, ecx
mov dword [esp + 0x28], edx
add edx, 1
add eax, 0x20
cmp esi, edx
je 0x665b41a0
movzx ecx, word [eax + 0x12]
cmp cx, bx
jg 0x665b3fc0
jne 0x665b3fca
movzx edi, word [eax + 0x14]
cmp di, bp
jle 0x665b3fca
mov ebp, edi
jmp 0x665b3fc4
mov edx, dword [esp + 0x4c]
test edx, edx
je 0x665b43b5
cmp dword [esp + 0x4c], 1
je 0x665b4459
mov ebx, dword [esp + 0x2c]
mov edx, dword [esp + 0x4c]
mov eax, ebx
shl edx, 5
mov ecx, ebx
add eax, 0x20
add edx, ebx
movzx esi, word [eax + 0x12]
cmp word [ecx + 0x12], si
cmovg ecx, eax
add eax, 0x20
cmp edx, eax
jne 0x665b401b
mov dword [esp + 0x54], ecx
mov eax, dword [esp + 0x40]
mov ebx, dword [esp + 0x54]
xor ecx, ecx
add eax, 0x320
mov edx, dword [ebx + 0x18]
mov esi, dword [esp + 0x40]
add eax, 0x50
mov edx, dword [edx + ecx]
add ecx, 4
mov dword [eax - 0x50], edx
movzx edx, byte [edx + 0x10]
mov byte [eax - 0x64], dl
lea edx, [edx + edx*8]
shl edx, 3
add edx, dword [esi + 4]
mov edx, dword [edx + 0x34]
mov dword [eax - 0x8c], edx
cmp dword [esp + 0x60], ecx
jne 0x665b4040
mov eax, dword [esp + 0x40]
movzx eax, word [eax + 0x22]
mov word [esp + 0x14], ax
and ax, 0x600
cmp ax, 0x400
je 0x665b43e6
mov eax, dword [esp + 0x40]
mov edx, dword [eax + 8]
test edx, edx
je 0x665b414d
movzx ebx, word [eax + 0x22]
test bh, 2
je 0x665b432e
mov eax, dword [esp + 0x54]
movsx eax, byte [eax + 0x16]
cmp eax, dword [edx]
je 0x665b43a8
and bh, 8
je 0x665b414d
mov esi, dword [esp + 0x40]
movsx eax, byte [esi + 0x24]
cmp eax, dword [edx]
jne 0x665b414d
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x665b414d
mov ecx, dword [esp + 0x54]
lea eax, [esp + 0x88]
mov ebx, dword [esp + 0x60]
mov dword [esp + 0x88], 0
mov dword [esp + 0x8c], 0
mov dword [esp + 0xc], eax
mov eax, dword [ecx + 0x18]
mov eax, dword [eax + ebx - 4]
mov dword [esp], 0
mov dword [esp + 8], eax
movzx eax, byte [esp + 0x73]
sub eax, 1
movzx eax, ax
mov dword [esp + 4], eax
mov eax, esi
call sym._wherePathSatisfiesOrderBy
mov edx, dword [esi + 8]
movsx eax, al
cmp eax, dword [edx]
jne 0x665b414d
mov ebx, dword [esp + 0x40]
mov eax, dword [esp + 0x88]
mov edx, dword [esp + 0x8c]
mov byte [ebx + 0x25], 1
mov dword [ebx + 0x18], eax
mov dword [ebx + 0x1c], edx
mov eax, dword [esp + 0x54]
mov ebx, dword [esp + 0x40]
mov edx, dword [esp + 0x64]
movzx eax, word [eax + 0x10]
mov word [ebx + 0x20], ax
mov eax, dword [esp + 0x6c]
call sym._sqlite3DbFree
xor eax, eax
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
ret
xor esi, esi
mov dword [esp + 0x3c], 0
jmp 0x665b3c3c
mov ebx, 1
mov dword [esp + 0x38], 1
jmp 0x665b3c18
mov edi, dword [esp + 0x18]
mov word [esp + 0x44], bx
mov word [esp + 0x46], bp
nop
mov edi, dword [edi + 0x34]
test edi, edi
jne 0x665b3da0
add dword [esp + 0x34], 1
add dword [esp + 0x14], 0x20
mov eax, dword [esp + 0x34]
cmp eax, dword [esp + 0x4c]
jne 0x665b3d90
mov eax, dword [esp + 0x20]
mov dword [esp + 0x4c], eax
add dword [esp + 0x58], 1
mov eax, dword [esp + 0x58]
cmp dword [esp + 0x5c], eax
je 0x665b3ff0
mov ecx, dword [esp + 0x4c]
mov eax, dword [esp + 0x54]
mov esi, dword [esp + 0x2c]
test ecx, ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x54], esi
jg 0x665b3d6a
mov dword [esp + 0x4c], 0
jmp 0x665b41db
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
cmp dword [esp + 0x38], esi
jg 0x665b4254
movzx esi, word [esp + 0x44]
cmp word [esp + 0x1c], si
jg 0x665b41b0
jne 0x665b4244
movzx ebx, word [esp + 0x46]
cmp word [esp + 0x30], bx
jge 0x665b41b0
mov ebp, dword [esp + 0x28]
shl ebp, 5
add ebp, dword [esp + 0x2c]
jmp 0x665b3f09
mov eax, dword [esp + 0x20]
mov ebp, eax
add eax, 1
mov dword [esp + 0x20], eax
jmp 0x665b4248
mov ebp, dword [esp + 0x40]
lea eax, [esp + 0x88]
mov ecx, dword [esp + 0x14]
mov edx, dword [ebp + 8]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 8], edi
mov dword [esp + 4], eax
movzx eax, word [ebp + 0x22]
mov dword [esp], eax
mov eax, ebp
call sym._wherePathSatisfiesOrderBy
test al, al
mov byte [esp + 0x18], al
jns 0x665b3e63
movzx eax, word [esp + 0x30]
mov word [esp + 0x1c], ax
jmp 0x665b3e9e
mov edx, dword [esp + 0x3c]
mov ecx, edx
sub ecx, eax
imul eax, ecx, 0x64
mov ecx, edx
cdq
idiv ecx
cdq
call sym._sqlite3LogEst
mov ecx, eax
xor eax, eax
cmp word [esp + 0x70], 0xa
jg 0x665b4314
movzx edx, word [esp + 0x70]
lea edx, [ecx + edx - 0x42]
mov ecx, dword [esp + 0x40]
add eax, edx
lea edx, [eax + 0x10]
add eax, 0x20
test byte [ecx + 0x23], 4
cmovne edx, eax
mov word [ebp], dx
jmp 0x665b3e8c
movzx eax, word [esp + 0x32]
cmp ax, word [ebp + 0x10]
jl 0x665b3f09
mov edi, dword [edi + 0x34]
test edi, edi
jne 0x665b3da0
jmp 0x665b41bb
mov eax, dword [esp + 0x78]
mov edx, dword [esp + 0x7c]
mov dword [esp + 0x1c], ecx
call sym._sqlite3LogEst
mov ecx, dword [esp + 0x1c]
sub eax, 0x21
jmp 0x665b42d0
mov esi, dword [esp + 0x54]
mov ecx, 0
movzx eax, byte [esi + 0x16]
test al, al
cmovs eax, ecx
mov ecx, dword [esp + 0x40]
mov byte [ecx + 0x24], al
mov eax, esi
mov esi, dword [esi + 8]
mov edi, dword [eax + 0xc]
mov dword [ecx + 0x18], esi
mov dword [ecx + 0x1c], edi
jmp 0x665b40b9
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._memset
mov esi, dword [esp + 0x68]
mov eax, 0x30
mov ebp, dword [esp + 0x5c]
movzx ebx, byte [esp + 0x3c]
cmp dword [esi + 0x1a8], 0x30
cmovbe eax, dword [esi + 0x1a8]
mov esi, dword [esp + 0x54]
test ebp, ebp
mov word [esi + 0x10], ax
mov eax, 0xffffffff
cmove eax, ebx
mov byte [esi + 0x16], al
jmp 0x665b3d14
mov eax, dword [esp + 0x40]
mov byte [eax + 0x28], 2
jmp 0x665b40b9
mov eax, dword [esp + 0x68]
mov dword [esp + 4], str.no_query_solution
mov dword [esp], eax
call sym._sqlite3ErrorMsg
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x64]
call sym._sqlite3DbFree
add esp, 0x9c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [esp + 0x40]
cmp byte [ebx + 0x28], 0
jne 0x665b408d
cmp word [esp + 0x74], 0
je 0x665b408d
mov ecx, dword [esp + 0x54]
lea eax, [esp + 0x88]
mov edx, dword [ebx + 0xc]
mov esi, dword [esp + 0x60]
mov dword [esp + 0xc], eax
mov eax, dword [ecx + 0x18]
mov eax, dword [eax + esi - 4]
mov dword [esp], 0x200
mov dword [esp + 8], eax
movzx eax, byte [esp + 0x73]
sub eax, 1
movzx eax, ax
mov dword [esp + 4], eax
mov eax, ebx
call sym._wherePathSatisfiesOrderBy
mov edx, dword [ebx + 0xc]
movsx eax, al
cmp eax, dword [edx]
jne 0x665b408d
mov eax, dword [esp + 0x40]
mov byte [eax + 0x28], 2
jmp 0x665b408d
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x54], eax
jmp 0x665b4031