Function at 0x180111060
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.18012da30
mov rax, qword [rsp + 0x90]
mov qword [rbx], rax
cmp qword [rsi + 0x68], r15
jne 0x1801110f2
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.18010d630
mov rax, qword [rsp + 0x90]
mov rdi, qword [rsi + 0x68]
cmp dword [rsi + 0x3c], r15d
jne 0x1801112da
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.18003ce60
test eax, eax
jne 0x180111181
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x18011116f
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.1800336f0
mov r12d, eax
test eax, eax
je 0x180111167
mov rcx, qword [rdi]
mov edx, eax
mov dword [rcx + 0x50], eax
call fcn.18000ee70
mov rcx, qword [rdi]
mov edx, r12d
call fcn.18000bcb0
mov r12d, dword [rsp + 0x88]
mov rax, qword [rdi]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x180111181
call qword [0x1801719b0]
mov rcx, rdi
call sym.sqlite.dll_sqlite3_step
cmp eax, 0x64
jne 0x1801111a5
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.18003ce60
test eax, eax
jne 0x1801111d3
mov rax, qword [rdi]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x1801111d3
call qword [0x1801719b0]
mov rax, qword [rsp + 0x90]
mov eax, dword [rax + 4]
cmp ebp, eax
jge 0x1801111e7
mov ebp, eax
xor r15d, r15d
lea eax, [rbp - 1]
mov rdx, rbx
mov rcx, rsi
mov dword [rbx + 0xc], eax
call fcn.18010f8d0
cmp qword [rbx + 0x10], 0
je 0x18011121d
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.180110ad0
cmp dword [rsi + 0x3c], 0
jne 0x180111283
test r12d, r12d
jne 0x180111283
or dword [rbx + 8], 1
mov rcx, qword [rbx + 0x10]
mov eax, dword [rbx + 8]
test rcx, rcx
je 0x180111283
and r14d, 2
je 0x180111244
or eax, 2
mov dword [rbx + 8], eax
test r15d, r15d
je 0x180111273
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 0x180111267
mov eax, dword [rcx + 0xc]
cmp dword [rbx + 0x4c], eax
jl 0x180111273
mov rcx, rsi
call fcn.18010f770
mov qword [rbx + 0x60], rax
test r14d, r14d
je 0x180111283
mov rdx, rbx
mov rcx, rsi
call fcn.180110840
test byte [rbx + 8], 2
je 0x180111296
lea rax, [0x1801101b0]
mov qword [rbx + 0x38], rax
jmp 0x1801112b3
mov rax, qword [rsi]
lea rdx, [0x180110470]
lea rcx, [0x180110270]
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 0x1801112da
mov rdx, rdi
lea rcx, [rsi + 0x3c]
shl rdx, 4
call fcn.180105730
test rax, rax
je 0x1801112da
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