Function at 0x14012ad30
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
mov r14, qword [rsp + 0xf8]
mov rbx, qword [rsp + 0xf0]
lea rdi, [r14 + 0x10]
mov eax, r14d
and rdi, 0xfffffffffffffff8
sub eax, edi
mov rbp, rcx
mov dword [rsp + 0xe0], r8d
mov r12, rdx
lea ecx, [rax + 0x80]
xor eax, eax
mov dword [rsp + 0xe8], r9d
shr ecx, 3
mov qword [r14 + 8], 0
mov qword [r14 + 0x78], 0
rep stosq qword [rdi], rax
mov qword [r14], rbx
mov rsi, qword [rbp + 0x70]
test rsi, rsi
je 0x14012b3d0
mov eax, dword [rbp + 0x3c]
test eax, eax
je 0x14012adc0
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
movsxd r8, dword [rbx]
mov edx, 1
mov rcx, rsi
mov edi, 1
call sym.sqlite3_bind_int64
mov r8, r12
mov edx, 2
mov rcx, rsi
mov dword [rsp + 0x28], 0
movsxd r9, dword [rsp + 0xe0]
mov qword [rsp + 0x20], 0
call sym.bindText
mov rcx, rsi
call sym.sqlite3_step
mov dword [rsp + 0x50], 0
cmp eax, 0x64
je 0x14012b400
mov rcx, rsi
call sym.sqlite3_reset
mov edx, 1
mov rcx, rsi
mov dword [rbp + 0x3c], eax
call sym.vdbeUnbind
test eax, eax
jne 0x14012ae45
mov rax, qword [rsi]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x14012ae45
call qword [0x14014ef10]
mov eax, dword [rbx + 4]
cmp eax, edi
jle 0x14012ae56
mov dword [rsp + 0x50], 0
mov edi, eax
sub edi, 1
mov eax, dword [rsp + 0xe8]
mov rdx, r14
mov rcx, rbp
mov dword [r14 + 0xc], edi
and eax, 8
mov dword [rsp + 0x54], eax
call sym.fts5SegIterNextPage
mov rax, qword [r14 + 0x10]
mov qword [rsp + 0x58], rax
test rax, rax
je 0x14012af88
mov rax, qword [rsp + 0x58]
lea rdx, [rsp + 0x78]
mov dword [rsp + 0x70], 0
mov dword [rsp + 0x74], 0
mov ecx, dword [rax + 0xc]
mov rbx, qword [rax]
mov edi, dword [rax + 8]
mov rsi, rcx
add rcx, rbx
call sym.sqlite3Fts5GetVarint32
mov r9d, dword [rsp + 0x78]
mov dword [rsp + 0x6c], r9d
cmp edi, r9d
jb 0x14012b128
add esi, eax
lea rax, [rsp + 0x74]
xor r15d, r15d
xor r10d, r10d
mov qword [rsp + 0x48], rax
lea r13, [rsp + 0x70]
mov qword [rsp + 0xd0], rbp
mov ebp, esi
mov esi, r15d
mov r15, r13
mov ecx, r9d
lea eax, [r9 + 1]
add rcx, rbx
mov dword [rsp + 0x6c], eax
movzx edx, byte [rcx]
mov dword [rsp + 0x74], edx
test dl, dl
js 0x14012b230
cmp r10d, esi
jb 0x14012b2e0
cmp esi, r10d
je 0x14012b260
cmp ebp, edi
jae 0x14012b470
mov ecx, ebp
mov rdx, r15
add rcx, rbx
call sym.sqlite3Fts5GetVarint32
mov r13d, dword [rsp + 0x70]
add r13d, dword [rsp + 0x78]
mov dword [rsp + 0x78], r13d
add ebp, eax
cmp r13d, edi
jae 0x14012b120
mov ecx, r13d
lea r9d, [r13 + 1]
add rcx, rbx
mov dword [rsp + 0x6c], r9d
movzx r10d, byte [rcx]
mov dword [rsp + 0x70], r10d
test r10b, r10b
jns 0x14012aef0
mov rdx, r15
call sym.sqlite3Fts5GetVarint32
mov r10d, dword [rsp + 0x70]
lea r9d, [rax + r13]
jmp 0x14012aef0
mov ebx, dword [rsp + 0xe8]
mov eax, dword [r14 + 8]
mov r15d, dword [rbp + 0x3c]
and ebx, 0x100
mov edx, eax
test r15d, r15d
jne 0x14012b140
mov r10d, dword [rsp + 0x54]
test r10d, r10d
jne 0x14012b1f8
mov edx, eax
mov rcx, qword [r14 + 0x10]
or edx, 1
mov dword [r14 + 8], edx
test rcx, rcx
je 0x14012b140
mov esi, dword [rsp + 0xe8]
and esi, 2
je 0x14012b420
mov r9d, dword [rsp + 0x50]
or eax, 3
mov dword [r14 + 8], eax
mov edx, eax
test r9d, r9d
jne 0x14012b42e
mov rax, qword [r14 + 0x58]
test rax, rax
je 0x14012b00d
mov rdx, qword [rbp]
cmp dword [rdx + 0x88], 4
je 0x14012b620
mov rdx, qword [r14 + 0x10]
mov r12d, dword [r14 + 0xc]
mov r9d, 0xd
mov eax, 4
cmp dword [r14 + 0x38], r12d
jne 0x14012b02e
mov eax, dword [r14 + 0x3c]
lea r9d, [rax + 9]
add eax, 1
mov r10, qword [rdx]
cdqe
nop word cs:[rax + rax]
movzx ecx, byte [r10 + rax - 1]
mov r8, rax
shr cl, 7
cmp r9d, eax
setg r11b
add rax, 1
test cl, r11b
jne 0x14012b040
movsxd r8, r8d
mov eax, dword [rdx + 0xc]
mov qword [r14 + 0x20], r8
cmp dword [r14 + 0x44], eax
jl 0x14012b4fd
mov r15d, dword [rbp + 0x3c]
mov rdi, qword [r14]
add r12d, 1
test r15d, r15d
jne 0x14012b4fd
mov dword [rsp + 0x38], ebx
movsxd rsi, r12d
xor r13d, r13d
mov qword [rsp + 0xf8], r14
jmp 0x14012b0d7
mov r8, qword [rax]
cmp word [r8], 0
je 0x14012b0b6
mov r8, r13
mov r15d, r12d
mov r13, rax
mov rcx, r8
call sym.sqlite3_free
cmp r14d, ebx
jg 0x14012b573
mov ecx, dword [rbp + 0x3c]
add r12d, 1
add rsi, 1
test ecx, ecx
jne 0x14012b573
cmp r12d, dword [rdi + 8]
jg 0x14012b573
movsxd rdx, dword [rdi]
mov rcx, rbp
shl rdx, 0x25
add rdx, rsi
call sym.fts5DataRead
mov rcx, rax
test rax, rax
je 0x14012b0c4
mov r14d, dword [rax + 8]
cmp r14d, 3
jle 0x14012b10d
mov ebx, dword [rax + 0xc]
cmp r14d, ebx
jge 0x14012b0a0
mov dword [rbp + 0x3c], 0x10b
call sym.sqlite3_free
jmp 0x14012b0c4
mov rbp, qword [rsp + 0xd0]
mov ebx, dword [rsp + 0xe8]
mov edx, dword [r14 + 8]
mov dword [rbp + 0x3c], 0x10b
and ebx, 0x100
and edx, 2
lea rax, [sym.fts5SegIterNext_Reverse]
jne 0x14012b166
mov rax, qword [rbp]
lea rdx, [sym.fts5SegIterNext]
cmp dword [rax + 0x60], 1
lea rax, [sym.fts5SegIterNext_None]
cmovne rax, rdx
mov qword [r14 + 0x30], rax
test ebx, ebx
jne 0x14012adab
mov rax, qword [r14]
mov ebx, dword [rax + 0x20]
test ebx, ebx
jle 0x14012adab
lea edx, [rbx*8 + 0x10]
lea rcx, [rbp + 0x3c]
movsxd rdx, edx
call sym.sqlite3Fts5MallocZero
test rax, rax
je 0x14012adab
mov dword [rax + 4], ebx
mov dword [rax], 1
mov qword [r14 + 0x28], rax
jmp 0x14012adab
mov esi, dword [rax + 0xc]
mov edi, dword [rax + 8]
mov rbx, qword [rax]
cmp esi, edi
jl 0x14012b50d
mov rdx, r14
mov rcx, rbp
call sym.fts5SegIterNextPage
mov rax, qword [r14 + 0x10]
test rax, rax
jne 0x14012b1b0
mov ebx, dword [rsp + 0xe8]
mov eax, dword [r14 + 8]
mov r11d, dword [rbp + 0x3c]
and ebx, 0x100
mov edx, eax
test r11d, r11d
jne 0x14012b140
nop dword [rax]
test ebx, ebx
jne 0x14012afb6
test al, 2
jne 0x14012b4be
mov rax, qword [rbp]
cmp dword [rax + 0x60], 1
je 0x14012b5c8
lea rax, [sym.fts5SegIterNext]
mov qword [r14 + 0x30], rax
jmp 0x14012b172
mov rdx, qword [rsp + 0x48]
mov dword [rsp + 0x44], r10d
mov dword [rsp + 0x38], r9d
call sym.sqlite3Fts5GetVarint32
mov r9d, dword [rsp + 0x38]
mov r10d, dword [rsp + 0x44]
add eax, r9d
mov dword [rsp + 0x6c], eax
jmp 0x14012af0d
mov r11d, dword [rsp + 0xe0]
mov r10d, dword [rsp + 0x74]
sub r11d, esi
cmp r11d, r10d
cmova r11d, r10d
test r11d, r11d
je 0x14012b56c
mov r13d, dword [rsp + 0x6c]
xor eax, eax
jmp 0x14012b29c
add eax, 1
cmp r11d, eax
je 0x14012b3c0
lea r8d, [rsi + rax]
lea edx, [r13 + rax]
mov rcx, r8
movzx r8d, byte [r12 + r8]
cmp byte [rbx + rdx], r8b
je 0x14012b290
mov esi, ecx
cmp dword [rsp + 0xe0], esi
je 0x14012b5fa
cmp eax, r10d
jae 0x14012af1f
add eax, dword [rsp + 0x6c]
mov edx, esi
movzx eax, byte [rbx + rax]
cmp byte [r12 + rdx], al
jae 0x14012af1f
nop
mov edx, dword [rsp + 0x54]
mov esi, ebp
mov r10d, dword [rsp + 0x74]
mov rbp, qword [rsp + 0xd0]
test edx, edx
je 0x14012b484
mov edx, dword [rsp + 0x6c]
mov r13d, edx
mov eax, r10d
mov ecx, edi
add rax, r13
cmp rax, rcx
jg 0x14012b128
test r10d, r10d
je 0x14012b128
lea eax, [rdx + r10]
mov r8d, dword [rsp + 0x70]
lea r15, [rbp + 0x3c]
mov r9, r12
movd xmm1, eax
mov qword [r14 + 0x20], rax
lea rdx, [r14 + 0x60]
mov rcx, r15
movd xmm0, dword [r14 + 0xc]
mov dword [r14 + 0x68], 0
mov qword [rsp + 0x38], rdx
punpckldq xmm0, xmm1
mov dword [rsp + 0x44], r10d
movq qword [r14 + 0x38], xmm0
call sym.sqlite3Fts5BufferAppendBlob
mov r8d, dword [rsp + 0x44]
mov rdx, qword [rsp + 0x38]
mov rcx, r15
lea r9, [rbx + r13]
call sym.sqlite3Fts5BufferAppendBlob
cmp esi, edi
jb 0x14012b66d
mov rax, qword [r14 + 0x10]
mov eax, dword [rax + 8]
add eax, 1
mov dword [r14 + 0x44], eax
mov dword [r14 + 0x40], esi
mov rdx, r14
mov rcx, rbp
call sym.fts5SegIterLoadRowid
mov ebx, dword [rbp + 0x3c]
test ebx, ebx
je 0x14012b5d8
mov ebx, dword [rsp + 0xe8]
mov edx, dword [r14 + 8]
and ebx, 0x100
jmp 0x14012b140
add esi, eax
jmp 0x14012b2b5
mov rax, qword [rbp]
lea rcx, str.SELECT_pgno_FROM__q._q_idx_WHERE_segid__AND_term___ORDER_BY_term_DESC_LIMIT_1
mov rdx, qword [rax + 8]
mov r8, qword [rax + 0x10]
call sym.sqlite3_mprintf
lea rdx, [rbp + 0x70]
mov rcx, rbp
mov r8, rax
call sym.fts5IndexPrepareStmt
mov rsi, qword [rbp + 0x70]
jmp 0x14012ada4
xor edx, edx
mov rcx, rsi
call sym.sqlite3_column_int
movsxd rdi, eax
and eax, 1
mov dword [rsp + 0x50], eax
sar rdi, 1
jmp 0x14012ae17
mov r8d, dword [rsp + 0x50]
test r8d, r8d
je 0x14012b140
mov rax, qword [r14]
mov r9d, dword [r14 + 0x38]
and edx, 2
mov r8d, dword [rax]
cmp r9d, dword [r14 + 0xc]
jne 0x14012b44a
mov eax, dword [rcx + 0xc]
cmp dword [r14 + 0x44], eax
jl 0x14012b456
mov rcx, rbp
call sym.fts5DlidxIterInit
mov qword [r14 + 0x58], rax
test esi, esi
jne 0x14012aff3
mov edx, dword [r14 + 8]
jmp 0x14012b140
mov eax, dword [rsp + 0x54]
mov rbp, qword [rsp + 0xd0]
test eax, eax
jne 0x14012b1c1
mov rcx, qword [rsp + 0x58]
call sym.sqlite3_free
mov ebx, dword [rsp + 0xe8]
mov esi, dword [rbp + 0x3c]
mov qword [r14 + 0x10], 0
mov edx, dword [r14 + 8]
and ebx, 0x100
test esi, esi
jne 0x14012b140
or edx, 1
mov dword [r14 + 8], edx
jmp 0x14012b140
lea rax, [sym.fts5SegIterNext_Reverse]
mov qword [r14 + 0x30], rax
jmp 0x14012b172
movzx eax, ax
lea rdx, [r14 + 0x70]
lea rcx, [rsi + rax]
call sym.sqlite3Fts5GetVarint
movzx eax, al
add eax, r12d
cdqe
mov qword [r14 + 0x20], rax
mov eax, dword [r13 + 8]
cmp edi, eax
jl 0x14012b68f
add eax, 1
mov dword [r14 + 0x44], eax
mov rdx, r14
mov rcx, rbp
call sym.fts5SegIterReverseInitPage
jmp 0x14012b45e
mov ecx, esi
lea rdx, [rsp + 0x6c]
add rcx, rbx
call sym.sqlite3Fts5GetVarint32
mov r15d, dword [rsp + 0x6c]
cmp r15d, 3
jbe 0x14012b128
mov edx, r15d
movsxd rcx, esi
cmp rdx, rcx
jge 0x14012b128
add esi, eax
lea rax, [rsp + 0x74]
lea rcx, [rbx + rdx]
mov dword [rsp + 0x70], 0
mov rdx, rax
mov dword [rsp + 0x78], r15d
call sym.sqlite3Fts5GetVarint32
mov r10d, dword [rsp + 0x74]
lea edx, [rax + r15]
mov dword [rsp + 0x6c], edx
jmp 0x14012b2ff
xor eax, eax
jmp 0x14012b2b5
mov ebx, dword [rsp + 0x38]
mov r14, qword [rsp + 0xf8]
mov edi, r15d
test r13, r13
je 0x14012b4fd
mov rcx, qword [r14 + 0x10]
call sym.sqlite3_free
mov rsi, qword [r13]
mov dword [r14 + 0xc], edi
mov qword [r14 + 0x10], r13
movsxd rdi, dword [r13 + 0xc]
movzx eax, word [rsi]
rol ax, 8
movzx r12d, ax
cmp r12d, edi
jle 0x14012b4ce
mov dword [rbp + 0x3c], 0x10b
mov edx, dword [r14 + 8]
jmp 0x14012b140
lea rax, [sym.fts5SegIterNext_None]
mov qword [r14 + 0x30], rax
jmp 0x14012b172
mov rcx, qword [rbp]
mov rdx, r14
call sym.fts5SegIterLoadNPos.part.0.isra.0
mov ebx, dword [rsp + 0xe8]
mov eax, dword [r14 + 8]
and ebx, 0x100
jmp 0x14012afa8
mov r13d, dword [rsp + 0x54]
mov esi, ebp
mov rbp, qword [rsp + 0xd0]
test r13d, r13d
jne 0x14012b2fb
cmp eax, r10d
je 0x14012b2fb
jmp 0x14012b484
mov edi, dword [rax + 0x1c]
mov rax, qword [r14]
mov rcx, rbp
movsxd rdx, dword [rax]
movsxd rax, edi
shl rdx, 0x25
add rdx, rax
call sym.fts5DataRead
mov r13, rax
test rax, rax
je 0x14012b4fd
mov eax, dword [rax + 8]
cmp eax, 3
jle 0x14012b659
cmp eax, dword [r13 + 0xc]
jge 0x14012b58b
mov dword [rbp + 0x3c], 0x10b
mov rcx, r13
call sym.sqlite3_free
jmp 0x14012b4fd
mov ecx, esi
lea rdx, [rsp + 0x7c]
add rcx, rbx
call sym.sqlite3Fts5GetVarint32
add esi, eax
mov eax, dword [rsp + 0x7c]
add eax, dword [rsp + 0x78]
mov dword [r14 + 0x44], eax
jmp 0x14012b38e
lea rdx, [rsp + 0x7c]
lea rcx, [rsi + rdi]
call sym.sqlite3Fts5GetVarint32
mov eax, dword [rsp + 0x7c]
mov dword [r14 + 0x44], eax
jmp 0x14012b4fd