Function at 0x18011a260
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 0x18011a71a
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 0x18011a319
test rax, rax
je 0x18011a312
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.1800873e0
mov r13, qword [rsp + 0x48]
mov dword [rdi + 0x3c], eax
jmp 0x18011a319
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 0x18011a701
mov qword [rsp + 0x78], r14
mov rcx, r13
mov ebp, 1
lea rsi, [0x1801446b8]
call sym.sqlite.dll_sqlite3_step
cmp eax, 0x64
jne 0x18011a6fc
test r13, r13
je 0x18011a39e
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011a36d
call qword [0x1801719a0]
mov rcx, qword [r13 + 0xa0]
test rcx, rcx
je 0x18011a389
cmp bp, word [r13 + 0xc0]
jae 0x18011a389
add rcx, 0x38
jmp 0x18011a3a1
mov rcx, qword [r13]
mov edx, 0x19
mov dword [rcx + 0x50], 0x19
call fcn.18000ecd0
mov rcx, rsi
call sym.sqlite.dll_sqlite3_value_blob
mov r15, rax
test r13, r13
je 0x18011a3e0
mov rcx, qword [r13]
mov edx, dword [r13 + 0x34]
cmp byte [rcx + 0x67], 0
jne 0x18011a3c4
test edx, edx
jne 0x18011a3c4
xor eax, eax
jmp 0x18011a3c9
call fcn.18000bb10
mov dword [r13 + 0x34], eax
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011a3e0
call qword [0x1801719b0]
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 0x18011a6e2
movsxd rdx, dword [rax]
mov rcx, rdi
shl rdx, 0x25
add rdx, rsi
call fcn.18010d220
mov rsi, rax
test rax, rax
je 0x18011a6fc
mov ecx, dword [rax + 8]
cmp ecx, 4
jl 0x18011a6ed
mov r11d, dword [rax + 0xc]
cmp ecx, r11d
jl 0x18011a6ed
jg 0x18011a48e
test r14d, r14d
jne 0x18011a482
mov rax, qword [rsp + 0x60]
cmp dword [rax + 0x80], 5
jne 0x18011a482
cmp ecx, r11d
jne 0x18011a482
cmp ecx, 4
je 0x18011a52a
mov dword [rdi + 0x3c], 0x10b
jmp 0x18011a52a
mov rcx, rax
call fcn.18010d1a0
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 0x18011a50f
cmp ebp, r11d
jge 0x18011a50f
lea rcx, [r13 + rbp]
lea rdx, [rsp + 0xd8]
call fcn.180125a40
mov r12d, dword [rsp + 0xd8]
add ebp, eax
cmp r12d, r14d
mov eax, r14d
cmovl eax, r12d
test eax, eax
jle 0x18011a4fd
movsxd rcx, ebp
movsxd r8, eax
mov rdx, r15
add rcx, r13
call fcn.180136a90
test eax, eax
jne 0x18011a505
mov eax, r12d
sub eax, r14d
test eax, eax
mov r12d, dword [rsp + 0xc0]
jns 0x18011a516
mov dword [rdi + 0x3c], 0x10b
mov rdx, rsi
mov rcx, rdi
call fcn.180119d20
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 0x18011a6fc
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.180119a60
cmp dword [rdi + 0x3c], 0
jne 0x18011a6fc
test ebp, ebp
je 0x18011a6ce
movsxd rbp, dword [r15]
mov r9d, r14d
xor edx, edx
mov rcx, rdi
mov r8d, ebp
mov r12d, r14d
xor ebx, ebx
call fcn.18010f4f0
mov rcx, rdi
mov rdx, rax
mov rsi, rax
call fcn.18010f140
test eax, eax
jne 0x18011a6c4
mov r14, qword [rsp + 0x50]
mov r13, rbp
shl r13, 0x25
lea ebx, [r12 + 1]
cmp ebx, dword [rsi + 0x1c]
jge 0x18011a612
mov r14d, 0x100
nop word [rax + rax]
movsxd rdx, ebx
mov rcx, rdi
add rdx, r13
call fcn.18010d220
test rax, rax
je 0x18011a606
mov rcx, qword [rax]
movzx edx, byte [rcx]
movzx ecx, byte [rcx + 1]
imul dx, r14w
add dx, cx
je 0x18011a5fe
mov dword [rdi + 0x3c], 0x10b
mov rcx, rax
call sym.sqlite.dll_sqlite3_free
inc ebx
cmp ebx, dword [rsi + 0x1c]
jl 0x18011a5d0
mov r14, qword [rsp + 0x50]
movsxd r12, dword [rsi + 0x1c]
mov rcx, rdi
lea rdx, [r13 + r12]
call fcn.18010d220
mov rbp, rax
test rax, rax
je 0x18011a69b
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 0x18011a68c
test r14, r14
je 0x18011a654
test ecx, ecx
jle 0x18011a693
mov r11, qword [rsi + 0x20]
add rcx, r8
movzx r8d, byte [rcx]
test r8b, r8b
js 0x18011a66e
mov eax, r8d
mov qword [rsp + 0x58], rax
jmp 0x18011a67d
lea rdx, [rsp + 0x58]
call fcn.180125af0
mov rax, qword [rsp + 0x58]
cmp rax, r11
jl 0x18011a68c
test r14, r14
jne 0x18011a693
cmp rax, r11
je 0x18011a693
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.18010ef30
mov rdx, rsi
mov rcx, rdi
call fcn.18010f140
test eax, eax
je 0x18011a5b4
mov r14d, dword [rsp + 0xd0]
mov rcx, rsi
call fcn.18010f3d0
jmp 0x18011a6d2
mov ebx, dword [r15 + 8]
mov r13, qword [rsp + 0x48]
mov r12d, r14d
mov dword [rsp + 0xc0], r14d
cmp dword [rdi + 0x3c], 0
jne 0x18011a6fc
jmp 0x18011a338
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 0x18011a71a
mov dword [rdi + 0x3c], eax
add rsp, 0x88
pop r15
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret