Function at 0x18011abc0
Capabilities:
Reference sql statements

Disassembly:
mov qword [rsp + 0x10], rdx
push rbx
push rbp
push rdi
push r12
push r13
push r15
sub rsp, 0x88
mov eax, dword [rdx + 4]
mov ebx, dword [rdx + 8]
xor ebp, ebp
mov rdi, rcx
mov rcx, qword [rcx]
lea r12d, [rax - 1]
cmp dword [rcx + 0x80], 5
mov qword [rsp + 0x60], rcx
mov dword [rsp + 0xc0], r12d
sete bpl
xor r13d, r13d
mov qword [rsp + 0x48], r13
test eax, eax
je 0x18011b07a
mov r9d, dword [rdx]
mov r8, qword [rcx + 0x10]
mov rdx, qword [rcx + 8]
lea rcx, str.SELECT_segid__term___pgno__1____pgno1__FROM__Q._q_idx_WHERE_segid_d_ORDER_BY_1__2
mov qword [rsp + 0x80], rsi
call sym.sqlite.dll_sqlite3_mprintf
mov rsi, rax
cmp dword [rdi + 0x3c], r13d
jne 0x18011ac79
test rax, rax
je 0x18011ac72
mov rcx, qword [rdi]
lea rax, [rsp + 0x48]
mov qword [rsp + 0x30], r13
mov rcx, qword [rcx]
mov qword [rsp + 0x28], rax
mov r9d, 0x85
or r8d, 0xffffffff
mov rdx, rsi
mov qword [rsp + 0x20], r13
call fcn.180088380
mov r13, qword [rsp + 0x48]
mov dword [rdi + 0x3c], eax
jmp 0x18011ac79
mov dword [rdi + 0x3c], 7
mov rcx, rsi
call sym.sqlite.dll_sqlite3_free
cmp dword [rdi + 0x3c], 0
movsxd r11, ebp
mov qword [rsp + 0x50], r11
jne 0x18011b061
mov qword [rsp + 0x78], r14
mov rcx, r13
mov ebp, 1
lea rsi, [0x1801459a8]
call sym.sqlite.dll_sqlite3_step
cmp eax, 0x64
jne 0x18011b05c
test r13, r13
je 0x18011acfe
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011accd
call qword [0x1801729a0]
mov rcx, qword [r13 + 0xa0]
test rcx, rcx
je 0x18011ace9
cmp bp, word [r13 + 0xc0]
jae 0x18011ace9
add rcx, 0x38
jmp 0x18011ad01
mov rcx, qword [r13]
mov edx, 0x19
mov dword [rcx + 0x50], 0x19
call fcn.18000fb80
mov rcx, rsi
call sym.sqlite.dll_sqlite3_value_blob
mov r15, rax
test r13, r13
je 0x18011ad40
mov rcx, qword [r13]
mov edx, dword [r13 + 0x34]
cmp byte [rcx + 0x67], 0
jne 0x18011ad24
test edx, edx
jne 0x18011ad24
xor eax, eax
jmp 0x18011ad29
call fcn.18000c9c0
mov dword [r13 + 0x34], eax
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011ad40
call qword [0x1801729b0]
mov edx, ebp
mov rcx, r13
call sym.sqlite.dll_sqlite3_column_bytes
mov edx, 2
mov rcx, r13
mov r14d, eax
call sym.sqlite.dll_sqlite3_column_int
mov edx, 3
movsxd rsi, eax
mov rcx, r13
mov dword [rsp + 0xd0], esi
call sym.sqlite.dll_sqlite3_column_int
mov ebp, eax
mov dword [rsp + 0x40], eax
mov rax, qword [rsp + 0xc8]
cmp esi, dword [rax + 4]
jl 0x18011b042
movsxd rdx, dword [rax]
mov rcx, rdi
shl rdx, 0x25
add rdx, rsi
call fcn.18010db80
mov rsi, rax
test rax, rax
je 0x18011b05c
mov ecx, dword [rax + 8]
cmp ecx, 4
jl 0x18011b04d
mov r11d, dword [rax + 0xc]
cmp ecx, r11d
jl 0x18011b04d
jg 0x18011adee
test r14d, r14d
jne 0x18011ade2
mov rax, qword [rsp + 0x60]
cmp dword [rax + 0x80], 5
jne 0x18011ade2
cmp ecx, r11d
jne 0x18011ade2
cmp ecx, 4
je 0x18011ae8a
mov dword [rdi + 0x3c], 0x10b
jmp 0x18011ae8a
mov rcx, rax
call fcn.18010db00
mov r13, qword [rsi]
movzx ecx, byte [r13 + 1]
movzx edx, byte [r13]
movsxd rbp, eax
mov eax, 0x100
imul dx, ax
add dx, cx
movzx ecx, dx
cmp ecx, ebp
jge 0x18011ae6f
cmp ebp, r11d
jge 0x18011ae6f
lea rcx, [r13 + rbp]
lea rdx, [rsp + 0xd8]
call fcn.1801269c0
mov r12d, dword [rsp + 0xd8]
add ebp, eax
cmp r12d, r14d
mov eax, r14d
cmovl eax, r12d
test eax, eax
jle 0x18011ae5d
movsxd rcx, ebp
movsxd r8, eax
mov rdx, r15
add rcx, r13
call fcn.180137900
test eax, eax
jne 0x18011ae65
mov eax, r12d
sub eax, r14d
test eax, eax
mov r12d, dword [rsp + 0xc0]
jns 0x18011ae76
mov dword [rdi + 0x3c], 0x10b
mov rdx, rsi
mov rcx, rdi
call fcn.18011a680
mov ebp, dword [rsp + 0x40]
mov r13, qword [rsp + 0x48]
mov rcx, rsi
call sym.sqlite.dll_sqlite3_free
cmp dword [rdi + 0x3c], 0
jne 0x18011b05c
mov r14d, dword [rsp + 0xd0]
mov r15, qword [rsp + 0xc8]
lea r9d, [rbx + 1]
lea eax, [r14 - 1]
lea r8d, [r12 + 1]
mov rdx, r15
mov rcx, rdi
mov dword [rsp + 0x20], eax
call fcn.18011a3c0
cmp dword [rdi + 0x3c], 0
jne 0x18011b05c
test ebp, ebp
je 0x18011b02e
movsxd rbp, dword [r15]
mov r9d, r14d
xor edx, edx
mov rcx, rdi
mov r8d, ebp
mov r12d, r14d
xor ebx, ebx
call fcn.18010fe50
mov rcx, rdi
mov rdx, rax
mov rsi, rax
call fcn.18010faa0
test eax, eax
jne 0x18011b024
mov r14, qword [rsp + 0x50]
mov r13, rbp
shl r13, 0x25
lea ebx, [r12 + 1]
cmp ebx, dword [rsi + 0x1c]
jge 0x18011af72
mov r14d, 0x100
nop word [rax + rax]
movsxd rdx, ebx
mov rcx, rdi
add rdx, r13
call fcn.18010db80
test rax, rax
je 0x18011af66
mov rcx, qword [rax]
movzx edx, byte [rcx]
movzx ecx, byte [rcx + 1]
imul dx, r14w
add dx, cx
je 0x18011af5e
mov dword [rdi + 0x3c], 0x10b
mov rcx, rax
call sym.sqlite.dll_sqlite3_free
inc ebx
cmp ebx, dword [rsi + 0x1c]
jl 0x18011af30
mov r14, qword [rsp + 0x50]
movsxd r12, dword [rsi + 0x1c]
mov rcx, rdi
lea rdx, [r13 + r12]
call fcn.18010db80
mov rbp, rax
test rax, rax
je 0x18011affb
mov r8, qword [rax]
mov eax, 0x100
movzx ecx, byte [r8 + 1]
movzx edx, byte [r8]
imul dx, ax
add dx, cx
movzx ecx, dx
cmp ecx, dword [rbp + 0xc]
jge 0x18011afec
test r14, r14
je 0x18011afb4
test ecx, ecx
jle 0x18011aff3
mov r11, qword [rsi + 0x20]
add rcx, r8
movzx r8d, byte [rcx]
test r8b, r8b
js 0x18011afce
mov eax, r8d
mov qword [rsp + 0x58], rax
jmp 0x18011afdd
lea rdx, [rsp + 0x58]
call fcn.180126a70
mov rax, qword [rsp + 0x58]
cmp rax, r11
jl 0x18011afec
test r14, r14
jne 0x18011aff3
cmp rax, r11
je 0x18011aff3
mov dword [rdi + 0x3c], 0x10b
mov rcx, rbp
call sym.sqlite.dll_sqlite3_free
xor r8d, r8d
mov rdx, rsi
mov rcx, rdi
call fcn.18010f890
mov rdx, rsi
mov rcx, rdi
call fcn.18010faa0
test eax, eax
je 0x18011af14
mov r14d, dword [rsp + 0xd0]
mov rcx, rsi
call fcn.18010fd30
jmp 0x18011b032
mov ebx, dword [r15 + 8]
mov r13, qword [rsp + 0x48]
mov r12d, r14d
mov dword [rsp + 0xc0], r14d
cmp dword [rdi + 0x3c], 0
jne 0x18011b05c
jmp 0x18011ac98
mov rcx, rax
mov dword [rdi + 0x3c], 0x10b
call sym.sqlite.dll_sqlite3_free
mov r14, qword [rsp + 0x78]
mov rcx, r13
call sym.sqlite.dll_sqlite3_finalize
cmp dword [rdi + 0x3c], 0
mov rsi, qword [rsp + 0x80]
jne 0x18011b07a
mov dword [rdi + 0x3c], eax
add rsp, 0x88
pop r15
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret