Function at 0x180110de0
Capabilities:
Reference sql statements

Disassembly:
mov qword [rsp + 8], rbx
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
mov rbx, qword [rsp + 0x98]
mov r12d, r9d
mov rsi, rcx
and r12d, 8
xor edx, edx
mov r8d, 0x88
mov rcx, rbx
mov r14d, r9d
mov ebp, 1
mov dword [rsp + 0x88], r12d
xor r15d, r15d
call fcn.18012d640
mov rax, qword [rsp + 0x90]
mov qword [rbx], rax
cmp qword [rsi + 0x68], r15
jne 0x180110e72
mov rdx, qword [rsi]
lea rcx, str.SELECT_pgno_FROM__q._q_idx_WHERE_segid__AND_term___ORDER_BY_term_DESC_LIMIT_1
mov r8, qword [rdx + 0x10]
mov rdx, qword [rdx + 8]
call sym.sqlite.dll_sqlite3_mprintf
lea rdx, [rsi + 0x68]
mov rcx, rsi
mov r8, rax
call fcn.18010d3b0
mov rax, qword [rsp + 0x90]
mov rdi, qword [rsi + 0x68]
cmp dword [rsi + 0x3c], r15d
jne 0x18011105a
movsxd r8, dword [rax]
mov edx, ebp
mov rcx, rdi
call sym.sqlite.dll_sqlite3_bind_int64
mov edx, ebp
mov rcx, rdi
call fcn.18003cbe0
test eax, eax
jne 0x180110f01
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x180110eef
mov rcx, qword [rdi + 0x80]
movsxd r8, dword [rsp + 0x80]
xor r9d, r9d
mov rdx, rax
add rcx, 0x38
mov qword [rsp + 0x20], r15
call fcn.180033410
mov r12d, eax
test eax, eax
je 0x180110ee7
mov rcx, qword [rdi]
mov edx, eax
mov dword [rcx + 0x50], eax
call fcn.18000ecd0
mov rcx, qword [rdi]
mov edx, r12d
call fcn.18000bb10
mov r12d, dword [rsp + 0x88]
mov rax, qword [rdi]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x180110f01
call qword [0x1801719b0]
mov rcx, rdi
call sym.sqlite.dll_sqlite3_step
cmp eax, 0x64
jne 0x180110f25
xor edx, edx
mov rcx, rdi
call sym.sqlite.dll_sqlite3_column_int
movsxd r15, eax
mov rbp, r15
sar rbp, 1
and r15d, 1
mov rcx, rdi
call sym.sqlite.dll_sqlite3_reset
mov edx, 1
mov rcx, rdi
mov dword [rsi + 0x3c], eax
call fcn.18003cbe0
test eax, eax
jne 0x180110f53
mov rax, qword [rdi]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x180110f53
call qword [0x1801719b0]
mov rax, qword [rsp + 0x90]
mov eax, dword [rax + 4]
cmp ebp, eax
jge 0x180110f67
mov ebp, eax
xor r15d, r15d
lea eax, [rbp - 1]
mov rdx, rbx
mov rcx, rsi
mov dword [rbx + 0xc], eax
call fcn.18010f650
cmp qword [rbx + 0x10], 0
je 0x180110f9d
mov eax, dword [rsp + 0x80]
mov r9, qword [rsp + 0x78]
mov r8, rbx
mov edx, r12d
mov rcx, rsi
mov dword [rsp + 0x20], eax
call fcn.180110850
cmp dword [rsi + 0x3c], 0
jne 0x180111003
test r12d, r12d
jne 0x180111003
or dword [rbx + 8], 1
mov rcx, qword [rbx + 0x10]
mov eax, dword [rbx + 8]
test rcx, rcx
je 0x180111003
and r14d, 2
je 0x180110fc4
or eax, 2
mov dword [rbx + 8], eax
test r15d, r15d
je 0x180110ff3
mov edx, dword [rbx + 8]
mov rax, qword [rbx]
mov r9d, dword [rbx + 0x40]
mov r8d, dword [rax]
and edx, 2
cmp r9d, dword [rbx + 0xc]
jne 0x180110fe7
mov eax, dword [rcx + 0xc]
cmp dword [rbx + 0x4c], eax
jl 0x180110ff3
mov rcx, rsi
call fcn.18010f4f0
mov qword [rbx + 0x60], rax
test r14d, r14d
je 0x180111003
mov rdx, rbx
mov rcx, rsi
call fcn.1801105c0
test byte [rbx + 8], 2
je 0x180111016
lea rax, [0x18010ff30]
mov qword [rbx + 0x38], rax
jmp 0x180111033
mov rax, qword [rsi]
lea rdx, [0x1801101f0]
lea rcx, [0x18010fff0]
cmp dword [rax + 0x5c], 1
cmove rdx, rcx
mov qword [rbx + 0x38], rdx
mov rax, qword [rbx]
movsxd rdi, dword [rax + 0x20]
test edi, edi
jle 0x18011105a
mov rdx, rdi
lea rcx, [rsi + 0x3c]
shl rdx, 4
call fcn.1801054b0
test rax, rax
je 0x18011105a
mov qword [rbx + 0x28], rax
mov dword [rbx + 0x30], edi
mov rbx, qword [rsp + 0x70]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret