Function at 0x4a704c
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
mov eax, dword [rcx + 0x40]
test eax, eax
mov r13, rcx
mov ebp, edx
mov dword [rsp + 0x30], eax
mov r15, r8
mov r12, r9
jne 0x4a738b
cmp qword [rcx + 0x20], 0
je 0x4a70a3
mov rcx, qword [r13 + 0x20]
mov r8, r12
mov edx, 1
call sym.sqlite3_bind_int64
mov rcx, qword [r13 + 0x20]
call sym.sqlite3_step
cmp eax, 0x64
je 0x4a70c7
xor r9d, r9d
xor ebx, ebx
jmp 0x4a7113
mov r9, qword [rcx + 0x10]
lea rdx, str.SELECT_data_FROM__Q._q_node_WHERE_nodeno_
mov r8, qword [rcx + 8]
call sym.rtreeCheckPrepare
cmp dword [r13 + 0x40], 0
mov qword [r13 + 0x20], rax
je 0x4a707d
jmp 0x4a738b
mov rcx, qword [r13 + 0x20]
xor edx, edx
call sym.sqlite3_column_bytes
mov rcx, qword [r13 + 0x20]
xor edx, edx
mov dword [rsp + 0x34], eax
call sym.sqlite3_column_blob
movsxd r14, dword [rsp + 0x34]
mov rsi, rax
mov rcx, r14
call sym.sqlite3_malloc64
mov r9d, dword [rsp + 0x34]
test rax, rax
mov rbx, rax
jne 0x4a710b
mov dword [r13 + 0x40], 7
xor r9d, r9d
jmp 0x4a7113
mov rdi, rax
mov rcx, r14
rep movsb byte [rdi], byte [rsi]
mov rcx, qword [r13 + 0x20]
mov dword [rsp + 0x34], r9d
call sym.sqlite3_reset
cmp dword [r13 + 0x40], 0
mov r9d, dword [rsp + 0x34]
jne 0x4a7131
mov dword [r13 + 0x40], eax
cmp dword [r13 + 0x40], 0
jne 0x4a715f
test rbx, rbx
jne 0x4a7168
lea rdx, str.Node__lld_missing_from_database
mov r8, r12
mov rcx, r13
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.rtreeCheckAppendMsg
test rbx, rbx
je 0x4a738b
cmp r9d, 3
jg 0x4a7185
lea rdx, str.Node__lld_is_too_small___d_bytes_
mov r8, r12
mov rcx, r13
call sym.rtreeCheckAppendMsg
jmp 0x4a7373
test r15, r15
jne 0x4a71b2
movzx ebp, byte [rbx]
movzx eax, byte [rbx + 1]
shl ebp, 8
add ebp, eax
cmp ebp, 0x28
jle 0x4a71b2
lea rdx, str.Rtree_depth_out_of_range___d_
mov r8d, ebp
mov rcx, r13
call sym.rtreeCheckAppendMsg
jmp 0x4a7373
movzx r14d, byte [rbx + 2]
movzx eax, byte [rbx + 3]
shl r14d, 8
add eax, r14d
mov dword [rsp + 0x3c], eax
mov eax, dword [r13 + 0x1c]
inc eax
imul eax, dword [rsp + 0x3c]
lea eax, [rax*8 + 3]
cmp eax, r9d
jge 0x4a71e9
lea eax, [rbp - 1]
mov dword [rsp + 0x4c], eax
jmp 0x4a72a5
mov dword [rsp + 0x20], r9d
mov r9d, dword [rsp + 0x3c]
mov r8, r12
mov rcx, r13
lea rdx, str.Node__lld_is_too_small_for_cell_count_of__d___d_bytes_
call sym.rtreeCheckAppendMsg
jmp 0x4a7373
mov edx, dword [r14 + rdi*8 + 8]
cmp dword [r13 + 0x18], 0
bswap edx
mov dword [rsp + 0x34], edx
mov edx, dword [r14 + rdi*8 + 0xc]
bswap edx
mov dword [rsp + 0x38], edx
je 0x4a72de
cmp dword [rsp + 0x34], edx
setg dl
test dl, dl
je 0x4a725c
mov r9d, dword [rsp + 0x30]
mov r8d, r11d
mov qword [rsp + 0x20], r12
mov rcx, r13
lea rdx, str.Dimension__d_of_cell__d_on_node__lld_is_corrupt
mov dword [rsp + 0x48], r11d
call sym.rtreeCheckAppendMsg
mov r11d, dword [rsp + 0x48]
test r15, r15
jne 0x4a72f1
inc rdi
cmp dword [r13 + 0x1c], edi
mov r11d, edi
jg 0x4a720a
test ebp, ebp
mov r9, r12
mov r8, rsi
je 0x4a735d
xor edx, edx
mov rcx, r13
call sym.rtreeCheckMapping
mov r8, qword [rsp + 0x40]
mov r9, rsi
mov rcx, r13
mov edx, dword [rsp + 0x4c]
call sym.rtreeCheckNode
inc dword [r13 + 0x3c]
inc dword [rsp + 0x30]
mov esi, dword [rsp + 0x3c]
cmp dword [rsp + 0x30], esi
je 0x4a7373
mov eax, dword [r13 + 0x1c]
xor edi, edi
inc eax
imul eax, dword [rsp + 0x30]
lea eax, [rax*8 + 4]
cdqe
lea r14, [rbx + rax]
mov rsi, qword [r14]
lea rax, [r14 + 8]
mov qword [rsp + 0x40], rax
bswap rsi
jmp 0x4a7268
movss xmm0, dword [rsp + 0x34]
comiss xmm0, dword [rsp + 0x38]
seta dl
jmp 0x4a7232
mov edx, dword [r15 + rdi*8]
mov ecx, dword [r15 + rdi*8 + 4]
cmp dword [r13 + 0x18], 0
bswap edx
bswap ecx
mov dword [rsp + 0x48], ecx
jne 0x4a7316
movd xmm0, edx
comiss xmm0, dword [rsp + 0x34]
ja 0x4a733c
jmp 0x4a732b
mov ecx, dword [rsp + 0x48]
cmp dword [rsp + 0x38], ecx
jg 0x4a733c
cmp dword [rsp + 0x34], edx
jl 0x4a733c
jmp 0x4a7265
movss xmm0, dword [rsp + 0x38]
comiss xmm0, dword [rsp + 0x48]
jbe 0x4a7265
mov r9d, dword [rsp + 0x30]
mov qword [rsp + 0x20], r12
mov r8d, r11d
mov rcx, r13
lea rdx, str.Dimension__d_of_cell__d_on_node__lld_is_corrupt_relative_to_parent
call sym.rtreeCheckAppendMsg
jmp 0x4a7265
mov edx, 1
mov rcx, r13
call sym.rtreeCheckMapping
inc dword [r13 + 0x38]
jmp 0x4a72a1
mov rcx, rbx
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.sqlite3_free
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret