Function at 0x4b9c87
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xb8
xor esi, esi
mov eax, dword [rcx + 0x34]
movsxd rdi, dword [rsp + 0x130]
test eax, eax
mov r13, rdx
mov rbx, rcx
mov dword [rsp + 0x110], r8d
mov edx, dword [rsp + 0x138]
jne 0x4b9cf2
test edi, edi
jns 0x4b9cdc
cmp qword [rcx + 0x18], 0
mov esi, dword [r13 + 0x10]
je 0x4b9cd8
xor eax, eax
and r8b, 0x40
sete al
add esi, eax
jmp 0x4b9cf2
movsxd rax, edi
mov esi, edx
inc rax
shl rax, 4
add rax, r13
cmp dword [rax + 0xc], edx
cmovle esi, dword [rax + 0xc]
mov edx, esi
mov rcx, rbx
mov qword [rsp + 0x118], r9
call sym.fts5MultiIterAlloc
mov rbp, rax
mov rax, qword [rsp + 0x140]
test rbp, rbp
mov qword [rax], rbp
je 0x4ba8de
mov eax, dword [rsp + 0x110]
mov r9, qword [rsp + 0x118]
and eax, 2
mov dword [rsp + 0x50], eax
setne al
movzx eax, al
mov qword [rbp + 0x30], r9
mov dword [rbp + 0x44], eax
mov eax, dword [rsp + 0x110]
shr eax, 4
and eax, 1
test byte [rsp + 0x110], 0x20
mov byte [rbp + 0x48], al
jne 0x4b9d64
lea rcx, [rbx + 0x34]
mov rdx, rbp
call sym.fts5IterSetOutputCb
mov eax, dword [rbx + 0x34]
test eax, eax
mov dword [rsp + 0x44], eax
jne 0x4ba88f
test edi, edi
jns 0x4ba7a2
movsxd rax, dword [r13 + 0x14]
mov r14, qword [rbx + 0x18]
shl rax, 4
lea rax, [r13 + rax + 0x18]
test r14, r14
mov qword [rsp + 0x70], rax
je 0x4ba040
mov esi, dword [rsp + 0x110]
and esi, 0x40
jne 0x4ba040
cmp qword [rsp + 0x120], 0
lea rax, [rbp + 0x60]
mov dword [rsp + 0x9c], 0
mov qword [rsp + 0x38], rax
mov qword [rsp + 0xa0], 0
je 0x4b9de5
mov edi, dword [rsp + 0x110]
and edi, 8
je 0x4b9e89
mov r8d, dword [rsp + 0x128]
lea r9, [r14 + 0x18]
mov rcx, r14
mov qword [rsp + 0xa8], 0
mov rdx, qword [rsp + 0x120]
call sym.fts5HashEntrySort
mov rcx, qword [rbx + 0x18]
lea rdx, [rsp + 0xa0]
mov dword [rbx + 0x34], eax
lea r9, [rsp + 0x9c]
lea r8, [rsp + 0xa8]
call sym.sqlite3Fts5HashScanEntry
mov rdi, qword [rsp + 0xa0]
test rdi, rdi
je 0x4b9e4f
xor eax, eax
or rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
mov rax, rcx
not rax
lea esi, [rax - 1]
cmp qword [rsp + 0xa8], 0
je 0x4ba02b
lea rcx, [rbx + 0x34]
mov edx, 0x10
call sym.sqlite3Fts5MallocZero
test rax, rax
mov r12, rax
je 0x4ba02b
mov rax, qword [rsp + 0xa8]
mov qword [r12], rax
jmp 0x4b9faa
mov eax, dword [rsp + 0x128]
mov r8d, dword [r14 + 0x14]
lea edx, [rax - 1]
mov eax, 0xd
movsxd rdx, edx
test edx, edx
js 0x4b9ec1
mov rsi, qword [rsp + 0x120]
lea ecx, [rax*8]
movzx r9d, byte [rsi + rdx]
dec rdx
xor ecx, r9d
xor eax, ecx
jmp 0x4b9e9f
xor edx, edx
movsxd rsi, dword [rsp + 0x128]
div r8d
mov rax, qword [r14 + 0x20]
mov r15, qword [rax + rdx*8]
test r15, r15
je 0x4b9f0a
mov r12d, dword [r15 + 0x1c]
lea eax, [r12 + 1]
cmp dword [rsp + 0x128], eax
jne 0x4b9f05
mov rdx, qword [rsp + 0x120]
lea rcx, [r15 + 0x30]
mov r8, rsi
call sym.memcmp
test eax, eax
je 0x4b9f0f
mov r15, qword [r15]
jmp 0x4b9ed6
xor r12d, r12d
jmp 0x4b9f7e
mov eax, dword [r15 + 0x18]
lea edx, [r12 + 0x32]
mov dword [rsp + 0x48], edx
sub eax, edx
lea ecx, [rax + 0x1a]
mov dword [rsp + 0x44], eax
movsxd rcx, ecx
call sym.sqlite3_malloc64
mov edx, dword [rsp + 0x48]
test rax, rax
mov r12, rax
je 0x4ba8c9
lea rax, [r12 + 0x10]
movsxd rsi, edx
movsxd rcx, dword [rsp + 0x44]
mov r8d, 0x10
mov rdi, rax
add rsi, r15
sub r8d, edx
rep movsb byte [rdi], byte [rsi]
movsxd r8, r8d
mov rcx, r14
mov rdx, r15
add r8, r12
call sym.fts5HashAddPoslistSize.isra.486
mov edi, dword [rsp + 0x44]
lea r14d, [rdi + rax]
xor edi, edi
mov dword [rsp + 0x9c], r14d
test r12, r12
mov dword [rbx + 0x34], edi
je 0x4b9f8f
lea rax, [r12 + 0x10]
mov qword [r12], rax
mov rax, qword [rsp + 0x120]
mov esi, dword [rsp + 0x128]
mov qword [rsp + 0xa0], rax
or dword [rbp + 0x68], 1
test r12, r12
je 0x4ba02b
mov r9, qword [rsp + 0xa0]
lea rdx, [rbp + 0xb8]
mov r8d, esi
lea rcx, [rbx + 0x34]
call sym.sqlite3Fts5BufferSet
mov rcx, qword [r12]
lea rdx, [rbp + 0xc8]
mov eax, dword [rsp + 0x9c]
mov dword [r12 + 0xc], eax
mov dword [r12 + 8], eax
mov qword [rbp + 0x70], r12
call sym.sqlite3Fts5GetVarint
cmp dword [rsp + 0x50], 0
movzx eax, al
mov qword [rbp + 0x80], rax
mov eax, dword [r12 + 8]
mov dword [rbp + 0x9c], eax
je 0x4ba01e
or dword [rbp + 0x68], 2
mov rcx, rbx
mov rdx, qword [rsp + 0x38]
call sym.fts5SegIterReverseInitPage
jmp 0x4ba02b
mov rdx, qword [rsp + 0x38]
mov rcx, rbx
call sym.fts5SegIterLoadNPos
mov rdx, qword [rsp + 0x38]
mov rcx, rbx
call sym.fts5SegIterSetNext.isra.274
mov dword [rsp + 0x44], 1
lea rax, [r13 + 0x18]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x98]
mov qword [rsp + 0x68], rax
mov rdi, qword [rsp + 0x70]
cmp qword [rsp + 0x48], rdi
jae 0x4ba790
mov rax, qword [rsp + 0x48]
movsxd r10, dword [rsp + 0x44]
mov eax, dword [rax + 4]
imul r10, r10, 0x78
mov dword [rsp + 0x54], eax
dec eax
mov dword [rsp + 0x58], eax
cdqe
imul rax, rax, 0xc
lea r14, [rbp + r10]
mov qword [rsp + 0x60], rax
lea rax, [rsp + 0xa0]
mov qword [rsp + 0x88], rax
cmp dword [rsp + 0x58], 0
js 0x4ba772
mov rax, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x60]
add rsi, qword [rax + 8]
lea rax, [r14 + 0x60]
cmp qword [rsp + 0x120], 0
mov qword [rsp + 0x38], rax
jne 0x4ba0e1
mov r8, rax
mov rdx, rsi
mov rcx, rbx
call sym.fts5SegIterInit
jmp 0x4ba75f
lea rdx, [r14 + 0x68]
xor eax, eax
mov ecx, 0x1c
mov rdi, rdx
rep stosd dword [rdi], eax
mov qword [r14 + 0x60], rsi
cmp qword [rbx + 0x60], 0
jne 0x4ba122
mov rax, qword [rbx]
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, [rbx + 0x60]
mov rcx, rbx
mov r8, rax
call sym.fts5IndexPrepareStmt
cmp dword [rbx + 0x34], 0
jne 0x4ba75f
mov rdi, qword [rbx + 0x60]
mov edx, 1
mov r8d, dword [rsi]
mov rcx, rdi
call sym.sqlite3_bind_int
mov r9d, dword [rsp + 0x128]
mov edx, 2
mov rcx, rdi
mov r8, qword [rsp + 0x120]
mov qword [rsp + 0x20], 0
call sym.sqlite3_bind_blob
mov rcx, rdi
call sym.sqlite3_step
cmp eax, 0x64
jne 0x4ba18b
xor edx, edx
mov rcx, rdi
call sym.sqlite3_column_int
movsxd r13, eax
and eax, 1
sar r13, 1
mov r12d, eax
jmp 0x4ba194
xor r12d, r12d
mov r13d, 1
mov rcx, rdi
call sym.sqlite3_reset
mov edx, 2
mov rcx, rdi
mov dword [rbx + 0x34], eax
call sym.sqlite3_bind_null
mov eax, dword [rsi + 4]
cmp eax, r13d
jle 0x4ba1ba
xor r12d, r12d
mov r13d, eax
mov eax, dword [rsp + 0x110]
lea rdx, [r14 + 0x60]
dec r13d
mov rcx, rbx
mov dword [r14 + 0x6c], r13d
and eax, 8
mov dword [rsp + 0x5c], eax
call sym.fts5SegIterNextPage
mov rax, qword [r14 + 0x70]
test rax, rax
je 0x4ba53f
mov rdi, qword [rax]
mov dword [rsp + 0x98], 0
mov r13d, dword [rax + 8]
mov dword [rsp + 0x9c], 0
mov ecx, dword [rax + 0xc]
mov rdx, qword [rsp + 0x88]
mov rsi, rcx
add rcx, rdi
call sym.sqlite3Fts5GetVarint32
mov edx, dword [rsp + 0xa0]
cmp r13d, edx
mov dword [rsp + 0x94], edx
jb 0x4ba344
add esi, eax
xor r15d, r15d
lea rax, [rsp + 0x9c]
mov qword [rsp + 0x80], rax
jmp 0x4ba275
lea edx, [rax + 1]
mov ecx, eax
mov r10d, dword [rsp + 0x78]
add rcx, rdi
mov dword [rsp + 0x94], edx
movzx r8d, byte [rcx]
test r8b, r8b
mov dword [rsp + 0x98], r8d
js 0x4ba399
mov r15d, r10d
mov ecx, dword [rsp + 0x94]
lea edx, [rcx + 1]
mov rax, rcx
add rcx, rdi
mov dword [rsp + 0x94], edx
movzx r8d, byte [rcx]
test r8b, r8b
mov dword [rsp + 0x9c], r8d
jns 0x4ba2b8
mov rdx, qword [rsp + 0x80]
mov dword [rsp + 0x94], eax
call sym.sqlite3Fts5GetVarint32
add dword [rsp + 0x94], eax
cmp dword [rsp + 0x98], r15d
jb 0x4ba8a8
mov r10d, r15d
jne 0x4ba307
mov ecx, dword [rsp + 0x128]
mov eax, dword [rsp + 0x9c]
mov r9d, dword [rsp + 0x94]
sub ecx, r15d
cmp ecx, eax
cmova ecx, eax
xor edx, edx
mov dword [rsp + 0x78], ecx
cmp dword [rsp + 0x78], edx
lea r10d, [r15 + rdx]
jne 0x4ba350
cmp dword [rsp + 0x128], r10d
je 0x4ba36d
cmp eax, edx
ja 0x4ba37a
cmp r13d, esi
mov dword [rsp + 0x78], r10d
jbe 0x4ba3bb
mov rdx, qword [rsp + 0x68]
mov ecx, esi
add rcx, rdi
call sym.sqlite3Fts5GetVarint32
add esi, eax
mov eax, dword [rsp + 0x98]
add eax, dword [rsp + 0xa0]
cmp r13d, eax
mov dword [rsp + 0xa0], eax
ja 0x4ba249
mov dword [rbx + 0x34], 0x10b
jmp 0x4ba53f
mov rcx, qword [rsp + 0x120]
lea r8d, [r9 + rdx]
mov r11d, r10d
mov cl, byte [rcx + r11]
cmp byte [rdi + r8], cl
jne 0x4ba2f9
inc edx
jmp 0x4ba2ef
cmp eax, edx
jne 0x4ba8a8
jmp 0x4ba44f
mov rcx, qword [rsp + 0x120]
add edx, r9d
mov eax, r10d
mov al, byte [rcx + rax]
cmp byte [rdi + rdx], al
jbe 0x4ba307
jmp 0x4ba8a8
mov rdx, qword [rsp + 0x68]
mov dword [rsp + 0x94], eax
call sym.sqlite3Fts5GetVarint32
mov r10d, dword [rsp + 0x78]
add dword [rsp + 0x94], eax
jmp 0x4ba272
cmp dword [rsp + 0x5c], 0
je 0x4ba8b3
mov rdx, qword [rsp + 0x38]
mov rcx, rbx
call sym.fts5SegIterNextPage
mov rax, qword [r14 + 0x70]
test rax, rax
je 0x4ba53f
mov esi, dword [rax + 0xc]
cmp esi, dword [rax + 8]
jge 0x4ba3c6
mov rdi, qword [rax]
lea rdx, [rsp + 0x94]
mov ecx, esi
add rcx, rdi
call sym.sqlite3Fts5GetVarint32
mov edx, dword [rsp + 0x94]
cmp edx, 3
jbe 0x4ba344
mov r8, qword [r14 + 0x70]
mov ecx, edx
movsxd r9, dword [r8 + 0xc]
cmp rcx, r9
jge 0x4ba344
mov dword [rsp + 0xa0], edx
add rcx, rdi
add esi, eax
mov r13d, dword [r8 + 8]
lea rdx, [rsp + 0x9c]
mov dword [rsp + 0x98], 0
call sym.sqlite3Fts5GetVarint32
add dword [rsp + 0x94], eax
mov r8d, dword [rsp + 0x9c]
mov ecx, dword [rsp + 0x94]
mov rdx, r8
mov rax, rcx
add rcx, r8
mov r8d, r13d
cmp rcx, r8
jg 0x4ba344
test edx, edx
je 0x4ba344
lea ecx, [rax + rdx]
mov eax, dword [r14 + 0x6c]
mov r9, qword [rsp + 0x120]
lea r10, [rbx + 0x34]
mov qword [r14 + 0x80], rcx
mov r8d, dword [rsp + 0x98]
lea r15, [r14 + 0xb8]
mov qword [rsp + 0x78], r10
mov dword [r14 + 0x94], ecx
mov rdx, r15
mov rcx, r10
mov dword [r14 + 0x90], eax
call sym.sqlite3Fts5BufferSet
mov eax, dword [rsp + 0x94]
mov rdx, r15
mov r10, qword [rsp + 0x78]
mov r8d, dword [rsp + 0x9c]
lea r9, [rdi + rax]
mov rcx, r10
call sym.sqlite3Fts5BufferAppendBlob
cmp r13d, esi
ja 0x4ba4f5
mov rax, qword [r14 + 0x70]
mov eax, dword [rax + 8]
inc eax
jmp 0x4ba517
lea rdx, [rsp + 0xa8]
mov ecx, esi
add rcx, rdi
call sym.sqlite3Fts5GetVarint32
add esi, eax
mov eax, dword [rsp + 0xa8]
add eax, dword [rsp + 0xa0]
mov rdx, qword [rsp + 0x38]
mov rcx, rbx
mov dword [r14 + 0x9c], eax
mov dword [r14 + 0x98], esi
call sym.fts5SegIterLoadRowid
mov rdx, qword [rsp + 0x38]
mov rcx, rbx
call sym.fts5SegIterLoadNPos
mov edi, dword [rsp + 0x5c]
or edi, dword [rbx + 0x34]
jne 0x4ba752
mov eax, dword [r14 + 0x68]
mov rcx, qword [r14 + 0x70]
mov edx, eax
or edx, 1
test rcx, rcx
mov dword [r14 + 0x68], edx
je 0x4ba752
cmp dword [rsp + 0x50], 0
je 0x4ba587
or eax, 3
test r12d, r12d
mov dword [r14 + 0x68], eax
jne 0x4ba590
mov rax, qword [r14 + 0xb0]
test rax, rax
jne 0x4ba5d3
jmp 0x4ba603
test r12d, r12d
je 0x4ba752
mov edx, dword [r14 + 0x68]
mov rax, qword [r14 + 0x60]
mov r9d, dword [r14 + 0x90]
and edx, 2
cmp r9d, dword [r14 + 0x6c]
mov r8d, dword [rax]
jne 0x4ba5b7
mov eax, dword [rcx + 0xc]
cmp dword [r14 + 0x9c], eax
jl 0x4ba5c6
mov rcx, rbx
call sym.fts5DlidxIterInit
mov qword [r14 + 0xb0], rax
cmp dword [rsp + 0x50], 0
je 0x4ba752
jmp 0x4ba579
mov rdx, qword [rbx]
cmp dword [rdx + 0x80], 4
jne 0x4ba603
mov edi, dword [rax + 0x1c]
mov rcx, rbx
mov rax, qword [r14 + 0x60]
movsxd rdx, dword [rax]
movsxd rax, edi
shl rdx, 0x25
add rdx, rax
call sym.fts5LeafRead
mov r15, rax
jmp 0x4ba6d1
mov esi, dword [r14 + 0x6c]
mov eax, 4
cmp dword [r14 + 0x90], esi
mov r8, qword [r14 + 0x70]
jne 0x4ba620
mov eax, dword [r14 + 0x94]
mov r12, qword [r8]
lea r11d, [rax + 9]
inc eax
cdqe
mov cl, byte [r12 + rax - 1]
movsxd rdx, eax
shr cl, 7
cmp r11d, eax
setg r9b
inc rax
test cl, r9b
jne 0x4ba62b
mov eax, dword [r8 + 0xc]
mov qword [r14 + 0x80], rdx
cmp dword [r14 + 0x9c], eax
jl 0x4ba745
mov r13, qword [r14 + 0x60]
inc esi
xor r15d, r15d
movsxd r12, esi
cmp dword [rbx + 0x34], 0
jne 0x4ba6d1
cmp esi, dword [r13 + 8]
jg 0x4ba6d1
movsxd rdx, dword [r13]
mov rcx, rbx
shl rdx, 0x25
add rdx, r12
call sym.fts5LeafRead
test rax, rax
je 0x4ba6ca
mov edx, dword [rax + 0xc]
mov rcx, qword [rax]
mov dword [rsp + 0x5c], edx
mov edx, dword [rax + 8]
mov dword [rsp + 0x78], edx
movzx edx, byte [rcx]
movzx ecx, byte [rcx + 1]
shl edx, 8
add dx, cx
je 0x4ba6b8
mov rdx, r15
mov edi, esi
mov r15, rax
mov rax, rdx
mov rcx, rax
call sym.sqlite3_free
mov ecx, dword [rsp + 0x78]
cmp dword [rsp + 0x5c], ecx
jl 0x4ba6d1
inc esi
inc r12
jmp 0x4ba669
test r15, r15
je 0x4ba745
mov rcx, qword [r14 + 0x70]
call sym.sqlite3_free
mov rcx, qword [r15]
mov qword [r14 + 0x70], r15
mov dword [r14 + 0x6c], edi
movzx eax, byte [rcx]
movzx edx, byte [rcx + 1]
shl eax, 8
add eax, edx
movzx esi, ax
cmp esi, dword [r15 + 0xc]
jle 0x4ba708
mov dword [rbx + 0x34], 0x10b
jmp 0x4ba752
lea rdx, [r14 + 0xc8]
movzx eax, ax
add rcx, rax
call sym.sqlite3Fts5GetVarint
movzx eax, al
add eax, esi
cdqe
mov qword [r14 + 0x80], rax
mov eax, dword [r15 + 8]
cmp dword [r15 + 0xc], eax
jl 0x4ba736
inc eax
jmp 0x4ba73e
mov rcx, r15
call sym.fts5LeafFirstTermOff
mov dword [r14 + 0x9c], eax
mov rdx, qword [rsp + 0x38]
mov rcx, rbx
call sym.fts5SegIterReverseInitPage
mov rdx, qword [rsp + 0x38]
mov rcx, rbx
call sym.fts5SegIterSetNext.isra.274
dec dword [rsp + 0x58]
add r14, 0x78
sub qword [rsp + 0x60], 0xc
jmp 0x4ba0a1
cmp dword [rsp + 0x54], 0
mov eax, 0
cmovns eax, dword [rsp + 0x54]
add qword [rsp + 0x48], 0x10
add dword [rsp + 0x44], eax
jmp 0x4ba056
cmp dword [rbx + 0x34], 0
jne 0x4ba88f
mov eax, dword [rbp + 0x40]
lea esi, [rax - 1]
jmp 0x4ba7eb
lea r14, [rbp + 0x60]
dec esi
inc rdi
movsxd r12, esi
shl rdi, 4
imul r12, r12, 0xc
test esi, esi
js 0x4ba790
mov rdx, qword [r13 + rdi + 0x10]
mov r8, r14
mov rcx, rbx
dec esi
add r14, 0x78
add rdx, r12
sub r12, 0xc
call sym.fts5SegIterInit
jmp 0x4ba7b6
mov edx, esi
mov rcx, rbp
call sym.fts5MultiIterDoCompare
test eax, eax
mov edi, eax
jne 0x4ba7f1
dec esi
test esi, esi
jg 0x4ba7d9
jmp 0x4ba824
cmp dword [rbx + 0x34], 0
jne 0x4ba811
movsxd r9, eax
xor r8d, r8d
mov rcx, rbx
imul r9, r9, 0x78
lea rdx, [rbp + r9 + 0x60]
call qword [rbp + r9 + 0x88]
mov r9d, esi
mov r8d, edi
mov rdx, rbp
mov rcx, rbx
call sym.fts5MultiIterAdvanced
jmp 0x4ba7e9
mov rax, qword [rbp + 0x58]
movzx eax, word [rax + 4]
mov rdx, rax
imul rax, rax, 0x78
add rax, rbp
mov rcx, qword [rax + 0x70]
test rcx, rcx
sete byte [rbp + 0x14]
cmp byte [rbp + 0x48], 0
mov r8, qword [rax + 0xc8]
mov qword [rbp + 0x50], r8
je 0x4ba879
cmp dword [rbx + 0x34], 0
jne 0x4ba879
test rcx, rcx
je 0x4ba879
cmp dword [rax + 0xd0], 0
jne 0x4ba87e
xor r9d, r9d
xor r8d, r8d
mov rdx, rbp
mov rcx, rbx
call sym.fts5MultiIterNext
jmp 0x4ba8de
test rcx, rcx
je 0x4ba8de
imul rdx, rdx, 0x78
mov rcx, rbp
lea rdx, [rbp + rdx + 0x60]
call qword [rbp + 0x38]
jmp 0x4ba8de
mov rcx, rbp
call sym.fts5MultiIterFree
mov rax, qword [rsp + 0x140]
mov qword [rax], 0
jmp 0x4ba8de
cmp dword [rsp + 0x5c], 0
jne 0x4ba44f
mov rcx, qword [r14 + 0x70]
call sym.sqlite3_free
mov qword [r14 + 0x70], 0
jmp 0x4ba53f
mov dword [rsp + 0x9c], 0
mov edi, 7
jmp 0x4b9f7e
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret