Function at 0x18011a4e0
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 0x18011a99a
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 0x18011a599
test rax, rax
je 0x18011a592
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.180087650
mov r13, qword [rsp + 0x48]
mov dword [rdi + 0x3c], eax
jmp 0x18011a599
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 0x18011a981
mov qword [rsp + 0x78], r14
mov rcx, r13
mov ebp, 1
lea rsi, [0x180144708]
call sym.sqlite.dll_sqlite3_step
cmp eax, 0x64
jne 0x18011a97c
test r13, r13
je 0x18011a61e
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011a5ed
call qword [0x1801719a0]
mov rcx, qword [r13 + 0xa0]
test rcx, rcx
je 0x18011a609
cmp bp, word [r13 + 0xc0]
jae 0x18011a609
add rcx, 0x38
jmp 0x18011a621
mov rcx, qword [r13]
mov edx, 0x19
mov dword [rcx + 0x50], 0x19
call fcn.18000ee70
mov rcx, rsi
call sym.sqlite.dll_sqlite3_value_blob
mov r15, rax
test r13, r13
je 0x18011a660
mov rcx, qword [r13]
mov edx, dword [r13 + 0x34]
cmp byte [rcx + 0x67], 0
jne 0x18011a644
test edx, edx
jne 0x18011a644
xor eax, eax
jmp 0x18011a649
call fcn.18000bcb0
mov dword [r13 + 0x34], eax
mov rax, qword [r13]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x18011a660
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 0x18011a962
movsxd rdx, dword [rax]
mov rcx, rdi
shl rdx, 0x25
add rdx, rsi
call fcn.18010d4a0
mov rsi, rax
test rax, rax
je 0x18011a97c
mov ecx, dword [rax + 8]
cmp ecx, 4
jl 0x18011a96d
mov r11d, dword [rax + 0xc]
cmp ecx, r11d
jl 0x18011a96d
jg 0x18011a70e
test r14d, r14d
jne 0x18011a702
mov rax, qword [rsp + 0x60]
cmp dword [rax + 0x80], 5
jne 0x18011a702
cmp ecx, r11d
jne 0x18011a702
cmp ecx, 4
je 0x18011a7aa
mov dword [rdi + 0x3c], 0x10b
jmp 0x18011a7aa
mov rcx, rax
call fcn.18010d420
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 0x18011a78f
cmp ebp, r11d
jge 0x18011a78f
lea rcx, [r13 + rbp]
lea rdx, [rsp + 0xd8]
call fcn.180125cc0
mov r12d, dword [rsp + 0xd8]
add ebp, eax
cmp r12d, r14d
mov eax, r14d
cmovl eax, r12d
test eax, eax
jle 0x18011a77d
movsxd rcx, ebp
movsxd r8, eax
mov rdx, r15
add rcx, r13
call fcn.180134af0
test eax, eax
jne 0x18011a785
mov eax, r12d
sub eax, r14d
test eax, eax
mov r12d, dword [rsp + 0xc0]
jns 0x18011a796
mov dword [rdi + 0x3c], 0x10b
mov rdx, rsi
mov rcx, rdi
call fcn.180119fa0
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 0x18011a97c
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.180119ce0
cmp dword [rdi + 0x3c], 0
jne 0x18011a97c
test ebp, ebp
je 0x18011a94e
movsxd rbp, dword [r15]
mov r9d, r14d
xor edx, edx
mov rcx, rdi
mov r8d, ebp
mov r12d, r14d
xor ebx, ebx
call fcn.18010f770
mov rcx, rdi
mov rdx, rax
mov rsi, rax
call fcn.18010f3c0
test eax, eax
jne 0x18011a944
mov r14, qword [rsp + 0x50]
mov r13, rbp
shl r13, 0x25
lea ebx, [r12 + 1]
cmp ebx, dword [rsi + 0x1c]
jge 0x18011a892
mov r14d, 0x100
nop word [rax + rax]
movsxd rdx, ebx
mov rcx, rdi
add rdx, r13
call fcn.18010d4a0
test rax, rax
je 0x18011a886
mov rcx, qword [rax]
movzx edx, byte [rcx]
movzx ecx, byte [rcx + 1]
imul dx, r14w
add dx, cx
je 0x18011a87e
mov dword [rdi + 0x3c], 0x10b
mov rcx, rax
call sym.sqlite.dll_sqlite3_free
inc ebx
cmp ebx, dword [rsi + 0x1c]
jl 0x18011a850
mov r14, qword [rsp + 0x50]
movsxd r12, dword [rsi + 0x1c]
mov rcx, rdi
lea rdx, [r13 + r12]
call fcn.18010d4a0
mov rbp, rax
test rax, rax
je 0x18011a91b
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 0x18011a90c
test r14, r14
je 0x18011a8d4
test ecx, ecx
jle 0x18011a913
mov r11, qword [rsi + 0x20]
add rcx, r8
movzx r8d, byte [rcx]
test r8b, r8b
js 0x18011a8ee
mov eax, r8d
mov qword [rsp + 0x58], rax
jmp 0x18011a8fd
lea rdx, [rsp + 0x58]
call fcn.180125d70
mov rax, qword [rsp + 0x58]
cmp rax, r11
jl 0x18011a90c
test r14, r14
jne 0x18011a913
cmp rax, r11
je 0x18011a913
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.18010f1b0
mov rdx, rsi
mov rcx, rdi
call fcn.18010f3c0
test eax, eax
je 0x18011a834
mov r14d, dword [rsp + 0xd0]
mov rcx, rsi
call fcn.18010f650
jmp 0x18011a952
mov ebx, dword [r15 + 8]
mov r13, qword [rsp + 0x48]
mov r12d, r14d
mov dword [rsp + 0xc0], r14d
cmp dword [rdi + 0x3c], 0
jne 0x18011a97c
jmp 0x18011a5b8
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 0x18011a99a
mov dword [rdi + 0x3c], eax
add rsp, 0x88
pop r15
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret