Function at 0x180079960
Capabilities:
Reference sql statements

Disassembly:
mov qword [rsp + 8], rbx
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
mov dword [rsp + 0x10], edx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 7]
sub rsp, 0xb0
xor r13d, r13d
mov ebx, r9d
mov rsi, r8
mov r15, rcx
mov dword [rbp - 0x51], 0x10
mov r14d, r13d
mov edi, r13d
mov dword [rbp - 0x61], r13d
call sym.sqlite3.dll_sqlite3_initialize
test eax, eax
jne 0x18007a10a
mov ecx, 0x80
call fcn.180007030
mov r12, rax
mov qword [rbp - 0x69], rax
test rax, rax
je 0x18007a10a
mov r9d, dword [rbp + 0x67]
mov r8d, ebx
mov rdx, rsi
mov rcx, r15
mov qword [rsp + 0x20], rax
call fcn.180080a40
mov esi, eax
test eax, eax
jne 0x18007a02b
cmp qword [r12], r13
mov rdi, qword [r15 + 0xa0]
mov eax, 1
cmovne r14d, eax
mov esi, r13d
mov qword [rbp - 0x59], rdi
mov dword [rbp - 0x5d], r14d
test rdi, rdi
jne 0x180079a72
mov r8, qword [r15 + 0x28]
mov rdx, qword [r15 + 0x20]
lea rcx, str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_ORDER_BY_level_DESC__idx_ASC
call sym.sqlite3.dll_sqlite3_mprintf
mov rbx, rax
test rax, rax
jne 0x180079a34
lea esi, [rdi + 7]
jmp 0x180079a72
mov rcx, qword [r15 + 0x18]
lea rax, [rbp - 0x59]
mov qword [rsp + 0x30], r13
mov qword [rsp + 0x28], rax
mov r9d, 1
or r8d, 0xffffffff
mov rdx, rbx
mov qword [rsp + 0x20], r13
call fcn.180055990
mov rcx, rbx
mov esi, eax
call sym.sqlite3.dll_sqlite3_free
mov rdi, qword [rbp - 0x59]
mov qword [r15 + 0xa0], rdi
movsxd rax, r14d
mov qword [rbp - 0x49], rax
mov ebx, 4
test esi, esi
jne 0x180079f7e
mov rcx, rdi
call sym.sqlite3.dll_sqlite3_step
mov esi, eax
cmp eax, 0x64
jne 0x180079f7e
mov qword [rbp - 0x59], r13
test rdi, rdi
je 0x180079afa
cmp qword [rdi + 0x48], r13
je 0x180079ad4
cmp bx, word [rdi + 0x50]
jae 0x180079ad4
mov rax, qword [rdi]
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079ac0
call qword [0x1800ac468]
mov rbx, qword [rdi + 0x48]
lea rsi, [0x180098458]
add rbx, 0xe0
jmp 0x180079b04
mov rax, qword [rdi]
test rax, rax
je 0x180079afa
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079aeb
call qword [0x1800ac468]
mov rcx, qword [rdi]
xor r8d, r8d
lea edx, [r8 + 0x19]
call fcn.180009b90
lea rsi, [0x180098458]
mov rbx, rsi
test byte [rbx + 0x24], 0x10
jne 0x180079b24
mov dl, 1
mov rcx, rbx
call fcn.180020db0
test rax, rax
jne 0x180079b24
mov r14d, r13d
mov r12d, 0x4000
jmp 0x180079b38
mov r14d, dword [rbx + 0x20]
mov r12d, 0x4000
test word [rbx + 0x24], r12w
je 0x180079b38
add r14d, dword [rbx]
test rdi, rdi
je 0x180079bef
mov rbx, qword [rdi]
mov ecx, dword [rdi + 0x90]
test rbx, rbx
je 0x180079b7a
cmp byte [rbx + 0x2a], r13b
jne 0x180079b5d
cmp ecx, 0xc0a
jne 0x180079b75
xor r8d, r8d
mov rcx, rbx
lea edx, [r8 + 7]
call fcn.180009b90
mov byte [rbx + 0x2a], r13b
mov ecx, 7
mov eax, dword [rbx + 0x24]
jmp 0x180079b7f
mov eax, 0xff
and eax, ecx
mov dword [rdi + 0x90], eax
mov rax, qword [rdi]
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079b99
call qword [0x1800ac478]
cmp qword [rdi + 0x48], r13
je 0x180079bc9
mov eax, 4
cmp ax, word [rdi + 0x50]
jae 0x180079bc9
mov rax, qword [rdi]
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079bbc
call qword [0x1800ac468]
mov rbx, qword [rdi + 0x48]
add rbx, 0xe0
jmp 0x180079bf2
mov rax, qword [rdi]
test rax, rax
je 0x180079bef
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079be0
call qword [0x1800ac468]
mov rcx, qword [rdi]
xor r8d, r8d
lea edx, [r8 + 0x19]
call fcn.180009b90
mov rbx, rsi
movzx eax, word [rbx + 0x24]
test al, 0x12
je 0x180079c54
test r12w, ax
je 0x180079c40
mov edx, dword [rbx]
mov eax, 1
mov rcx, rbx
add edx, dword [rbx + 0x20]
mov r8d, eax
test edx, edx
cmovle edx, eax
call fcn.18001f970
test eax, eax
jne 0x180079c40
movsxd rcx, dword [rbx + 0x20]
movsxd r8, dword [rbx]
xor edx, edx
add rcx, qword [rbx + 0x18]
call fcn.18008c4a0
mov r11d, dword [rbx]
mov eax, 0xbdff
add dword [rbx + 0x20], r11d
and word [rbx + 0x24], ax
mov r12, qword [rbx + 0x18]
mov eax, 0xfffd
and word [rbx + 0x24], ax
or word [rbx + 0x24], 0x10
jmp 0x180079c61
mov dl, 1
mov rcx, rbx
call fcn.180020db0
mov r12, rax
test rdi, rdi
je 0x180079d15
mov rbx, qword [rdi]
mov ecx, dword [rdi + 0x90]
test rbx, rbx
je 0x180079ca3
cmp byte [rbx + 0x2a], r13b
jne 0x180079c86
cmp ecx, 0xc0a
jne 0x180079c9e
xor r8d, r8d
mov rcx, rbx
lea edx, [r8 + 7]
call fcn.180009b90
mov byte [rbx + 0x2a], r13b
mov ecx, 7
mov eax, dword [rbx + 0x24]
jmp 0x180079ca8
mov eax, 0xff
and eax, ecx
mov dword [rdi + 0x90], eax
mov rax, qword [rdi]
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079cc2
call qword [0x1800ac478]
cmp qword [rdi + 0x48], r13
je 0x180079cef
mov eax, 1
cmp ax, word [rdi + 0x50]
jae 0x180079cef
mov rax, qword [rdi]
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079ce5
call qword [0x1800ac468]
mov rcx, qword [rdi + 0x48]
add rcx, 0x38
jmp 0x180079d18
mov rax, qword [rdi]
test rax, rax
je 0x180079d15
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079d06
call qword [0x1800ac468]
mov rcx, qword [rdi]
xor r8d, r8d
lea edx, [r8 + 0x19]
call fcn.180009b90
mov rcx, rsi
call fcn.18001ff10
mov rsi, rax
test rdi, rdi
je 0x180079d7d
mov rbx, qword [rdi]
mov ecx, dword [rdi + 0x90]
test rbx, rbx
je 0x180079d5e
cmp byte [rbx + 0x2a], r13b
jne 0x180079d41
cmp ecx, 0xc0a
jne 0x180079d59
xor r8d, r8d
mov rcx, rbx
lea edx, [r8 + 7]
call fcn.180009b90
mov byte [rbx + 0x2a], r13b
mov ecx, 7
mov eax, dword [rbx + 0x24]
jmp 0x180079d63
mov eax, 0xff
and eax, ecx
mov dword [rdi + 0x90], eax
mov rax, qword [rdi]
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079d7d
call qword [0x1800ac478]
mov rcx, r15
test rsi, rsi
jne 0x180079db2
mov edx, dword [rbp - 0x61]
lea rax, [rbp - 0x59]
xor r9d, r9d
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], r14d
xor r8d, r8d
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x20], r13
call fcn.180080810
mov esi, eax
jmp 0x180079ef5
mov r8d, dword [rbp + 0x5f]
mov rdx, qword [rbp + 0x57]
lea rax, [rbp - 0x21]
mov qword [rsp + 0x28], rax
mov r9, r12
mov dword [rsp + 0x20], r14d
call fcn.180077960
mov esi, eax
test eax, eax
jne 0x180079e75
test rdi, rdi
je 0x180079e32
cmp qword [rdi + 0x48], r13
je 0x180079e0c
mov eax, 2
cmp ax, word [rdi + 0x50]
jae 0x180079e0c
mov rax, qword [rdi]
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079e02
call qword [0x1800ac468]
mov rcx, qword [rdi + 0x48]
add rcx, 0x70
jmp 0x180079e39
mov rax, qword [rdi]
test rax, rax
je 0x180079e32
mov rcx, qword [rax + 0x58]
test rcx, rcx
je 0x180079e23
call qword [0x1800ac468]
mov rcx, qword [rdi]
xor r8d, r8d
lea edx, [r8 + 0x19]
call fcn.180009b90
lea rcx, [0x180098458]
call fcn.18001ff10
mov rcx, rdi
mov rbx, rax
call fcn.1800263d0
mov r8, qword [rbp - 0x21]
mov edx, dword [rbp - 0x61]
lea r11, [rbp - 0x59]
mov r9, rbx
mov qword [rsp + 0x38], r11
mov dword [rsp + 0x30], r13d
mov rcx, r15
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], r13
call fcn.180080810
mov esi, eax
mov rcx, qword [r15 + 0xd0]
mov qword [rbp - 0x41], rcx
test rcx, rcx
jne 0x180079ee8
mov r8, qword [r15 + 0x28]
mov rdx, qword [r15 + 0x20]
lea rcx, str.SELECT_block_FROM__Q._q_segments_WHERE_blockid___
call sym.sqlite3.dll_sqlite3_mprintf
mov r12, rax
test rax, rax
jne 0x180079ea6
lea ebx, [rax + 7]
jmp 0x180079ef0
mov rcx, qword [r15 + 0x18]
lea rax, [rbp - 0x41]
mov qword [rsp + 0x30], r13
mov qword [rsp + 0x28], rax
mov r9d, 1
or r8d, 0xffffffff
mov rdx, r12
mov qword [rsp + 0x20], r13
call fcn.180055990
mov rcx, r12
mov ebx, eax
call sym.sqlite3.dll_sqlite3_free
mov rcx, qword [rbp - 0x41]
mov qword [r15 + 0xd0], rcx
test ebx, ebx
jne 0x180079ef0
call sym.sqlite3.dll_sqlite3_reset
mov ebx, r13d
test esi, esi
cmove esi, ebx
mov rbx, qword [rbp - 0x59]
inc dword [rbp - 0x61]
mov r14d, dword [rbp - 0x5d]
test rbx, rbx
je 0x180079f5c
mov r12d, dword [rbp - 0x51]
cmp r14d, r12d
jne 0x180079f41
add r12d, 0x10
mov dword [rbp - 0x51], r12d
call sym.sqlite3.dll_sqlite3_initialize
test eax, eax
jne 0x180079f65
lea edx, [r12*8]
mov r12, qword [rbp - 0x69]
mov rcx, r12
call fcn.180007440
test rax, rax
je 0x180079f69
mov r12, rax
mov qword [rbp - 0x69], rax
jmp 0x180079f45
mov r12, qword [rbp - 0x69]
mov rax, qword [rbp - 0x49]
inc r14d
mov qword [r12 + rax*8], rbx
inc rax
mov dword [rbp - 0x5d], r14d
jmp 0x180079a75
mov r12, qword [rbp - 0x69]
jmp 0x180079a79
mov r12, qword [rbp - 0x69]
mov rdx, rbx
mov rcx, r15
call fcn.1800807a0
mov esi, 7
jmp 0x18007a02b
cmp esi, 0x65
jne 0x18007a016
mov r8d, dword [rbp + 0x4f]
mov ecx, dword [rbp + 0x6f]
xor eax, eax
cmp r8d, dword [r15 + 0x30]
mov qword [rbp - 0x39], rax
mov qword [rbp - 0x31], rax
mov qword [rbp - 0x29], rax
mov edx, r13d
mov dword [rbp - 0x39], ecx
cmovl edx, ebx
neg dword [rbp + 0x67]
mov dword [rbp - 0xd], r8d
sbb eax, eax
lea r9, [rbp - 0x19]
mov r8d, r14d
and eax, 8
or edx, eax
test ecx, ecx
mov eax, r13d
setne al
mov rcx, r15
or edx, eax
mov rax, qword [rbp + 0x57]
mov qword [rbp - 0x19], rax
mov eax, dword [rbp + 0x5f]
or edx, 2
mov dword [rbp - 0x11], eax
lea rax, [rbp - 0x39]
mov dword [rbp - 9], edx
mov qword [rsp + 0x28], rax
lea rax, [0x180079880]
mov rdx, r12
mov qword [rsp + 0x20], rax
call fcn.1800825e0
mov esi, eax
test eax, eax
jne 0x18007a01c
mov rcx, qword [rbp + 0x7f]
mov rax, qword [rbp - 0x31]
mov qword [rcx], rax
mov rcx, qword [rbp + 0x77]
mov eax, dword [rbp - 0x29]
mov dword [rcx], eax
mov r12, qword [rbp - 0x69]
jmp 0x18007a02b
mov rcx, qword [rbp - 0x31]
call sym.sqlite3.dll_sqlite3_free
mov r12, qword [rbp - 0x69]
jmp 0x18007a02b
mov rcx, rdi
call sym.sqlite3.dll_sqlite3_reset
movsxd rdi, r14d
test r14d, r14d
jle 0x18007a094
nop dword [rax + rax]
mov rbx, qword [r12 + r13*8]
test rbx, rbx
je 0x18007a08c
mov rcx, qword [rbx + 0x18]
test rcx, rcx
je 0x18007a074
call sym.sqlite3.dll_sqlite3_reset
movsxd r8, dword [r15 + 0xe0]
mov rax, qword [rbx + 0x18]
mov rdx, qword [r15 + 0xf0]
mov qword [rdx + r8*8], rax
inc dword [r15 + 0xe0]
cmp qword [rbx + 0x30], 0
jne 0x18007a084
mov rcx, qword [rbx + 0x40]
call sym.sqlite3.dll_sqlite3_free
mov rcx, rbx
call sym.sqlite3.dll_sqlite3_free
inc r13
cmp r13, rdi
jl 0x18007a040
test r12, r12
je 0x18007a106
cmp dword [0x1800ac3f0], 0
je 0x18007a0fd
mov rcx, qword [0x1800af828]
test rcx, rcx
je 0x18007a0b4
call qword [0x1800ac468]
mov rcx, r12
call qword [0x1800ac420]
mov ecx, dword [0x1800af7c0]
neg eax
add ecx, eax
mov eax, dword [0x1800af7e4]
cmp ecx, eax
mov dword [0x1800af7c0], ecx
cmovg eax, ecx
mov rcx, r12
mov dword [0x1800af7e4], eax
call qword [0x1800ac410]
mov rcx, qword [0x1800af828]
test rcx, rcx
je 0x18007a106
call qword [0x1800ac478]
mov eax, esi
jmp 0x18007a10f
mov rcx, r12
call qword [0x1800ac410]
mov eax, esi
jmp 0x18007a10f
mov eax, 7
mov rbx, qword [rsp + 0xf0]
add rsp, 0xb0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret