Function at 0x18011b1f0
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 0x18011b6aa
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 0x18011b2a9
test rax, rax
je 0x18011b2a2
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.180088370
mov r13, qword [rsp + 0x48]
mov dword [rdi + 0x3c], eax
jmp 0x18011b2a9
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 0x18011b691
mov qword [rsp + 0x78], r14
mov rcx, r13
mov ebp, 1
lea rsi, [0x1801459b8]
call sym.sqlite.dll_sqlite3_step
cmp eax, 0x64
jne 0x18011b68c
test r13, r13
je 0x18011b32e
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011b2fd
call qword [0x1801729a0]
mov rcx, qword [r13 + 0xa0]
test rcx, rcx
je 0x18011b319
cmp bp, word [r13 + 0xc0]
jae 0x18011b319
add rcx, 0x38
jmp 0x18011b331
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 0x18011b370
mov rcx, qword [r13]
mov edx, dword [r13 + 0x34]
cmp byte [rcx + 0x67], 0
jne 0x18011b354
test edx, edx
jne 0x18011b354
xor eax, eax
jmp 0x18011b359
call fcn.18000c9c0
mov dword [r13 + 0x34], eax
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011b370
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 0x18011b672
movsxd rdx, dword [rax]
mov rcx, rdi
shl rdx, 0x25
add rdx, rsi
call fcn.18010e1b0
mov rsi, rax
test rax, rax
je 0x18011b68c
mov ecx, dword [rax + 8]
cmp ecx, 4
jl 0x18011b67d
mov r11d, dword [rax + 0xc]
cmp ecx, r11d
jl 0x18011b67d
jg 0x18011b41e
test r14d, r14d
jne 0x18011b412
mov rax, qword [rsp + 0x60]
cmp dword [rax + 0x80], 5
jne 0x18011b412
cmp ecx, r11d
jne 0x18011b412
cmp ecx, 4
je 0x18011b4ba
mov dword [rdi + 0x3c], 0x10b
jmp 0x18011b4ba
mov rcx, rax
call fcn.18010e130
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 0x18011b49f
cmp ebp, r11d
jge 0x18011b49f
lea rcx, [r13 + rbp]
lea rdx, [rsp + 0xd8]
call fcn.1801269d0
mov r12d, dword [rsp + 0xd8]
add ebp, eax
cmp r12d, r14d
mov eax, r14d
cmovl eax, r12d
test eax, eax
jle 0x18011b48d
movsxd rcx, ebp
movsxd r8, eax
mov rdx, r15
add rcx, r13
call fcn.180137910
test eax, eax
jne 0x18011b495
mov eax, r12d
sub eax, r14d
test eax, eax
mov r12d, dword [rsp + 0xc0]
jns 0x18011b4a6
mov dword [rdi + 0x3c], 0x10b
mov rdx, rsi
mov rcx, rdi
call fcn.18011acb0
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 0x18011b68c
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.18011a9f0
cmp dword [rdi + 0x3c], 0
jne 0x18011b68c
test ebp, ebp
je 0x18011b65e
movsxd rbp, dword [r15]
mov r9d, r14d
xor edx, edx
mov rcx, rdi
mov r8d, ebp
mov r12d, r14d
xor ebx, ebx
call fcn.180110480
mov rcx, rdi
mov rdx, rax
mov rsi, rax
call fcn.1801100d0
test eax, eax
jne 0x18011b654
mov r14, qword [rsp + 0x50]
mov r13, rbp
shl r13, 0x25
lea ebx, [r12 + 1]
cmp ebx, dword [rsi + 0x1c]
jge 0x18011b5a2
mov r14d, 0x100
nop word [rax + rax]
movsxd rdx, ebx
mov rcx, rdi
add rdx, r13
call fcn.18010e1b0
test rax, rax
je 0x18011b596
mov rcx, qword [rax]
movzx edx, byte [rcx]
movzx ecx, byte [rcx + 1]
imul dx, r14w
add dx, cx
je 0x18011b58e
mov dword [rdi + 0x3c], 0x10b
mov rcx, rax
call sym.sqlite.dll_sqlite3_free
inc ebx
cmp ebx, dword [rsi + 0x1c]
jl 0x18011b560
mov r14, qword [rsp + 0x50]
movsxd r12, dword [rsi + 0x1c]
mov rcx, rdi
lea rdx, [r13 + r12]
call fcn.18010e1b0
mov rbp, rax
test rax, rax
je 0x18011b62b
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 0x18011b61c
test r14, r14
je 0x18011b5e4
test ecx, ecx
jle 0x18011b623
mov r11, qword [rsi + 0x20]
add rcx, r8
movzx r8d, byte [rcx]
test r8b, r8b
js 0x18011b5fe
mov eax, r8d
mov qword [rsp + 0x58], rax
jmp 0x18011b60d
lea rdx, [rsp + 0x58]
call fcn.180126a80
mov rax, qword [rsp + 0x58]
cmp rax, r11
jl 0x18011b61c
test r14, r14
jne 0x18011b623
cmp rax, r11
je 0x18011b623
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.18010fec0
mov rdx, rsi
mov rcx, rdi
call fcn.1801100d0
test eax, eax
je 0x18011b544
mov r14d, dword [rsp + 0xd0]
mov rcx, rsi
call fcn.180110360
jmp 0x18011b662
mov ebx, dword [r15 + 8]
mov r13, qword [rsp + 0x48]
mov r12d, r14d
mov dword [rsp + 0xc0], r14d
cmp dword [rdi + 0x3c], 0
jne 0x18011b68c
jmp 0x18011b2c8
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 0x18011b6aa
mov dword [rdi + 0x3c], eax
add rsp, 0x88
pop r15
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret