Function at 0x140118a40
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
mov qword [rcx + 0x18], rdx
mov rsi, rcx
mov r12, rdx
mov rdi, r8
mov ecx, dword [rsp + 0x110]
mov rbp, r9
test ecx, ecx
je 0x140118b84
mov rcx, rdx
xor ebx, ebx
lea r13, str._a_d
call sym.sqlite3_str_new
mov r9, rbp
mov r8, rdi
lea rdx, str.CREATE_TABLE___w_.__w_rowid__rowid_INTEGER_PRIMARY_KEY_nodeno
mov rcx, rax
mov r14, rax
call sym.sqlite3_str_appendf
cmp byte [rsi + 0x29], 0
je 0x140118ac1
nop dword [rax]
mov r8d, ebx
mov rdx, r13
mov rcx, r14
add ebx, 1
call sym.sqlite3_str_appendf
movzx eax, byte [rsi + 0x29]
cmp eax, ebx
jg 0x140118aa8
mov r9, rbp
mov r8, rdi
lea rdx, str.__CREATE_TABLE___w_.__w_node__nodeno_INTEGER_PRIMARY_KEY_data__
mov rcx, r14
call sym.sqlite3_str_appendf
mov r9, rbp
mov r8, rdi
mov rcx, r14
lea rdx, str.CREATE_TABLE___w_.__w_parent__nodeno_INTEGER_PRIMARY_KEY_parentnode__
call sym.sqlite3_str_appendf
mov eax, dword [rsi + 0x20]
mov r9, rbp
mov r8, rdi
lea rdx, str.INSERT_INTO___w_.__w_node_VALUES_1_zeroblob__d__
mov rcx, r14
mov dword [rsp + 0x20], eax
call sym.sqlite3_str_appendf
test r14, r14
je 0x140118e47
lea rax, [0x14014ebc0]
cmp r14, rax
je 0x140118e47
mov rax, qword [r14 + 8]
test rax, rax
je 0x140118f78
mov edx, dword [r14 + 0x18]
mov byte [rax + rdx], 0
mov edx, dword [r14 + 0x14]
test edx, edx
jne 0x140118f48
mov rbx, qword [r14 + 8]
mov rcx, r14
call sym.sqlite3_free
test rbx, rbx
je 0x140118e47
xor r9d, r9d
xor r8d, r8d
mov rcx, r12
mov rdx, rbx
mov qword [rsp + 0x20], 0
call sym.sqlite3_exec
mov rcx, rbx
mov r14d, eax
call sym.sqlite3_free
test r14d, r14d
jne 0x140118e4d
lea rax, [rsi + 0x78]
mov rdx, qword [rsi + 0x30]
xor r9d, r9d
mov rcx, r12
mov qword [rsp + 0x60], rax
lea rax, [rsi + 0x80]
lea r8, str.sqlite_stat1
mov qword [rsp + 0x68], rax
lea rax, [rsi + 0x88]
mov qword [rsp + 0x70], rax
lea rax, [rsi + 0x90]
mov qword [rsp + 0x78], rax
lea rax, [rsi + 0x98]
mov qword [rsp + 0x80], rax
lea rax, [rsi + 0xa0]
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov qword [rsp + 0x88], rax
lea rax, [rsi + 0xa8]
mov qword [rsp + 0x90], rax
lea rax, [rsi + 0xb0]
mov qword [rsp + 0x98], rax
call sym.sqlite3_table_column_metadata
mov r14d, eax
test eax, eax
je 0x140118dd0
mov qword [rsi + 0x50], 0x100000
cmp eax, 1
je 0x140118ea0
cmp byte [rsi + 0x29], 0
je 0x140118e4d
cmp r14d, 7
je 0x140118e47
mov r8, rbp
mov rdx, rdi
lea rcx, str.SELECT__FROM___w_.__w_rowid__WHERE_rowid_1
call sym.sqlite3_mprintf
mov qword [rsi + 0x60], rax
test rax, rax
je 0x140118e47
mov rcx, r12
xor ebx, ebx
call sym.sqlite3_str_new
mov r9, rbp
mov r8, rdi
lea rdx, str.UPDATE___w_.__w_rowid_SET
mov rcx, rax
mov r13, rax
lea rbp, str.a_d__d
call sym.sqlite3_str_appendf
cmp byte [rsi + 0x29], 0
lea rdi, str.a_dcoalesce___d_a_d_
je 0x140118d1f
movzx eax, byte [rsi + 0x2a]
lea r9d, [rbx + 2]
cmp eax, ebx
jle 0x140118d06
mov dword [rsp + 0x20], ebx
mov r8d, ebx
mov rdx, rdi
mov rcx, r13
add ebx, 1
call sym.sqlite3_str_appendf
movzx eax, byte [rsi + 0x29]
cmp eax, ebx
jle 0x140118d1f
mov eax, dword [r13 + 0x18]
lea edx, [rax + 1]
cmp edx, dword [r13 + 0x10]
jae 0x140118fa8
add rax, qword [r13 + 8]
mov dword [r13 + 0x18], edx
lea r9d, [rbx + 2]
mov byte [rax], 0x2c
movzx eax, byte [rsi + 0x2a]
cmp eax, ebx
jg 0x140118cc1
mov r8d, ebx
mov rdx, rbp
mov rcx, r13
add ebx, 1
call sym.sqlite3_str_appendf
movzx eax, byte [rsi + 0x29]
cmp eax, ebx
jg 0x140118cde
lea rdx, str._WHERE_rowid_1
mov rcx, r13
call sym.sqlite3_str_appendf
test r13, r13
je 0x140118e47
lea rax, [0x14014ebc0]
cmp r13, rax
je 0x140118e47
mov rax, qword [r13 + 8]
test rax, rax
je 0x140118fc2
mov edx, dword [r13 + 0x18]
mov byte [rax + rdx], 0
mov eax, dword [r13 + 0x14]
test eax, eax
je 0x140118d6f
test byte [r13 + 0x1d], 4
je 0x140118fcf
mov rbx, qword [r13 + 8]
mov rcx, r13
call sym.sqlite3_free
test rbx, rbx
je 0x140118e47
add rsi, 0xb8
mov rcx, r12
mov r9d, 0x85
mov rdx, rbx
mov qword [rsp + 0x30], 0
mov r8d, 0xffffffff
mov qword [rsp + 0x28], rsi
mov qword [rsp + 0x20], 0
call sym.sqlite3LockAndPrepare
mov rcx, rbx
mov r14d, eax
call sym.sqlite3_free
jmp 0x140118e4d
mov rdx, qword [rsi + 0x30]
mov r8, qword [rsi + 0x38]
lea rcx, str.SELECT_stat_FROM__Q.sqlite_stat1_WHERE_tbl___q_rowid
call sym.sqlite3_mprintf
mov rbx, rax
test rax, rax
je 0x140118f68
lea rax, [rsp + 0x58]
mov r9d, pe_nt_image_headers64
mov rdx, rbx
mov rcx, r12
mov qword [rsp + 0x30], 0
mov r8d, 0xffffffff
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0
call sym.sqlite3LockAndPrepare
mov r14d, eax
test eax, eax
je 0x140118e64
mov rcx, rbx
call sym.sqlite3_free
mov qword [rsi + 0x50], 0x64
jmp 0x140118c4c
xor ecx, ecx
call sym.sqlite3_free
mov r14d, 7
mov eax, r14d
add rsp, 0xa8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r13, qword [rsp + 0x58]
mov r15d, 0x64
mov rcx, r13
call sym.sqlite3_step
cmp eax, 0x64
je 0x140118f85
mov rcx, r13
call sym.sqlite3_finalize
mov rcx, rbx
mov r14d, eax
call sym.sqlite3_free
mov qword [rsi + 0x50], r15
test r14d, r14d
jne 0x140118c4c
xor r15d, r15d
lea r13, str.INSERT_OR_REPLACE_INTO__q._q_node_VALUES__1___2_
cmp r15, 3
je 0x140118f2c
mov rcx, qword [r13 + r15*8]
mov r8, rbp
mov rdx, rdi
call sym.sqlite3_mprintf
mov rbx, rax
test rax, rax
je 0x140118e40
mov qword [rsp + 0x30], 0
mov rax, qword [rsp + r15*8 + 0x60]
mov rdx, rbx
mov r9d, 0x85
mov qword [rsp + 0x20], 0
mov r8d, 0xffffffff
mov rcx, r12
mov qword [rsp + 0x28], rax
call sym.sqlite3LockAndPrepare
mov rcx, rbx
mov r14d, eax
call sym.sqlite3_free
lea edx, [r15 + 1]
cmp edx, 7
setle cl
test r14d, r14d
sete dl
add r15, 1
test cl, dl
je 0x140118c4c
cmp r15, 3
jne 0x140118eb0
cmp byte [rsi + 0x29], 0
lea rcx, str.INSERT_INTO__w_.__w_rowid__rowid_nodeno_VALUES__1__2_ON_CONFLICT_rowid_DO_UPDATE_SET_nodenoexcluded.nodeno
jne 0x140118eb5
jmp 0x140118eb0
test byte [r14 + 0x1d], 4
jne 0x140118b41
mov rcx, r14
call sym.strAccumFinishRealloc
mov rbx, rax
jmp 0x140118b45
mov qword [rsi + 0x50], 0x64
jmp 0x140118e47
mov rcx, r14
call sym.sqlite3_free
jmp 0x140118e47
xor edx, edx
mov rcx, r13
call sym.sqlite3_column_int64
mov edx, 0x64
cmp rax, rdx
cmovge rdx, rax
mov r15, rdx
jmp 0x140118e80
mov r8d, 1
lea rdx, [0x14015fb8a]
mov rcx, r13
call sym.enlargeAndAppend
jmp 0x140118cb5
mov rcx, r13
call sym.sqlite3_free
jmp 0x140118e47
mov rcx, r13
call sym.strAccumFinishRealloc
mov rbx, rax
jmp 0x140118d73