Function at 0x4a7a98
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xb8
cmp byte [rdx + 0x65], 0
movsxd r13, r8d
mov rdi, rcx
mov r14, rdx
lea r8, str.cannot_VACUUM_from_within_a_transaction
mov r12, r9
je 0x4a7af7
cmp dword [rdx + 0xd8], 1
lea r8, str.cannot_VACUUM___SQL_statements_in_progress
jg 0x4a7af7
test r9, r9
mov ebx, dword [rdx + 0x4c]
je 0x4a7b28
mov eax, dword [r9 + 0x14]
lea rdx, [0x004ed140]
and eax, 0x3f
cmp byte [rdx + rax], 3
je 0x4a7b0d
lea r8, str.non_text_filename
mov rdx, r14
mov rcx, rdi
mov r15d, 1
call sym.sqlite3SetString
jmp 0x4a8004
mov rcx, r9
call sym.sqlite3_value_text
mov r9, rax
mov eax, dword [r14 + 0x4c]
and eax, 0xfffffffe
or eax, 6
mov dword [r14 + 0x4c], eax
jmp 0x4a7b2f
lea r9, [0x004e0719]
mov rax, qword [r14 + 0x30]
shl r13, 5
mov rcx, r14
xor ebp, ebp
movabs rdx, 0xfffffffeefffafff
lea r8, str.ATTACH__Q_AS_vacuum_db
mov qword [rsp + 0x30], rax
mov eax, dword [r14 + 0x2c]
and rdx, qword [rsp + 0x30]
mov dword [rsp + 0x38], eax
mov rax, qword [r14 + 0x78]
or rdx, 0x201
mov qword [r14 + 0x30], rdx
mov rdx, rdi
mov qword [rsp + 0x40], rax
mov rax, qword [r14 + 0x80]
mov qword [rsp + 0x48], rax
mov al, byte [r14 + 0x6e]
mov byte [r14 + 0x6e], 0
mov byte [rsp + 0x57], al
mov eax, dword [rsp + 0x38]
or eax, 6
mov dword [r14 + 0x2c], eax
mov rax, qword [r14 + 0x20]
add rax, r13
mov rsi, qword [rax]
mov qword [rsp + 0x28], rsi
mov rsi, qword [rax + 8]
mov rax, qword [rsi + 8]
mov rax, qword [rax]
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x58], rax
mov eax, dword [r14 + 0x28]
mov dword [rsp + 0x3c], eax
call sym.execSqlF
mov dword [r14 + 0x4c], ebx
test eax, eax
mov r15d, eax
jne 0x4a7f8f
movsxd rbp, dword [rsp + 0x3c]
shl rbp, 5
add rbp, qword [r14 + 0x20]
test r12, r12
mov rbx, qword [rbp + 8]
je 0x4a7c5a
mov rax, qword [rbx + 8]
mov rax, qword [rax]
mov rcx, qword [rax + 0x48]
mov qword [rsp + 0x68], 0
cmp qword [rcx], 0
je 0x4a7c3c
lea rdx, [rsp + 0x68]
call sym.sqlite3OsFileSize
test eax, eax
jne 0x4a7c1f
cmp qword [rsp + 0x68], 0
jle 0x4a7c3c
lea r8, str.output_file_already_exists
mov rdx, r14
mov rcx, rdi
call sym.sqlite3SetString
mov r15d, 1
jmp 0x4a7f8f
mov rax, qword [r14 + 0x20]
mov edx, dword [r14 + 0x30]
or dword [r14 + 0x2c], 8
movzx r8d, byte [rax + r13 + 0x10]
and edx, 0x38
or r8d, edx
mov r15d, r8d
jmp 0x4a7c60
mov r15d, 1
mov rcx, rsi
call sym.sqlite3BtreeGetRequestedReserve
mov rcx, rbx
mov dword [rsp + 0x50], eax
mov rax, qword [r14 + 0x20]
mov rax, qword [rax + r13 + 0x18]
mov edx, dword [rax + 0x74]
call sym.sqlite3BtreeSetCacheSize
xor edx, edx
mov rcx, rsi
call sym.sqlite3BtreeSetSpillSize
mov rcx, rbx
mov edx, eax
call sym.sqlite3BtreeSetSpillSize
mov rax, qword [rbx + 8]
mov rdx, qword [rbx]
mov rcx, qword [rax]
mov qword [rax + 8], rdx
mov edx, r15d
or edx, 0x20
call sym.sqlite3PagerSetFlags
lea r8, str.BEGIN
mov rdx, rdi
mov rcx, r14
call sym.execSql
test eax, eax
mov r15d, eax
jne 0x4a7f8f
test r12, r12
mov eax, 2
mov rcx, rsi
cmove r15d, eax
xor r8d, r8d
mov edx, r15d
call sym.sqlite3BtreeBeginTrans
test eax, eax
mov r15d, eax
jne 0x4a7f8f
mov rax, qword [rsi + 8]
mov rdx, qword [rax]
cmp byte [rdx + 9], 5
jne 0x4a7d09
test r12, r12
jne 0x4a7d09
mov dword [r14 + 0x74], 0
mov edx, dword [rax + 0x34]
xor r9d, r9d
mov rcx, rbx
mov r15d, 7
mov r8d, dword [rsp + 0x50]
call sym.sqlite3BtreeSetPageSize
test eax, eax
jne 0x4a7f8f
movabs rax, 0xff000000ff
test qword [rsp + 0x58], rax
je 0x4a7d4d
cmp byte [r14 + 0x67], 0
mov r15d, 7
je 0x4a7d70
jmp 0x4a7f8f
mov edx, dword [r14 + 0x74]
xor r9d, r9d
mov rcx, rbx
mov r15d, 7
mov r8d, dword [rsp + 0x50]
call sym.sqlite3BtreeSetPageSize
test eax, eax
je 0x4a7d3b
jmp 0x4a7f8f
movsx eax, byte [r14 + 0x6a]
test al, al
jns 0x4a7d81
mov rcx, rsi
call sym.sqlite3BtreeGetAutoVacuum
mov edx, eax
mov rcx, rbx
call sym.sqlite3BtreeSetAutoVacuum
mov al, byte [rsp + 0x3c]
mov rdx, rdi
mov rcx, r14
mov r9, qword [rsp + 0x28]
lea r8, str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
mov byte [r14 + 0xc4], al
call sym.execSqlF
test eax, eax
mov r15d, eax
jne 0x4a7f8f
mov r9, qword [rsp + 0x28]
lea r8, str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typeindex
mov rdx, rdi
mov rcx, r14
call sym.execSqlF
test eax, eax
mov r15d, eax
jne 0x4a7f8f
mov r9, qword [rsp + 0x28]
lea r8, str.SELECTINSERT_INTO_vacuum_db.quote_name__SELECTFROM__w_.quote_name_FROM_vacuum_db.sqlite_schema_WHERE_typetableAND_coalesce_rootpage_1__0
mov rdx, rdi
mov rcx, r14
mov byte [r14 + 0xc4], 0
call sym.execSqlF
and dword [r14 + 0x2c], 0xfffffffb
test eax, eax
mov r15d, eax
jne 0x4a7f8f
mov r9, qword [rsp + 0x28]
lea r8, str.INSERT_INTO_vacuum_db.sqlite_schema_SELECTFROM___w_.sqlite_schema_WHERE_type_IN_view_trigger__OR_typetableAND_rootpage0_
mov rdx, rdi
mov rcx, r14
call sym.execSqlF
test eax, eax
mov r15d, eax
jne 0x4a7f8f
lea rdi, [0x004eb0b8]
lea r13, [rsp + 0x64]
movzx r11d, byte [rdi]
mov r8, r13
mov rcx, rsi
mov edx, r11d
call sym.sqlite3BtreeGetMeta
movzx r8d, byte [rdi + 1]
mov rcx, rbx
add r8d, dword [rsp + 0x64]
mov edx, r11d
call sym.sqlite3BtreeUpdateMeta
test eax, eax
mov r15d, eax
jne 0x4a7f8f
lea rax, [0x004eb0c2]
add rdi, 2
cmp rax, rdi
jne 0x4a7e37
test r12, r12
jne 0x4a7f46
mov rax, qword [rsi + 8]
lea r13, [rsp + 0x68]
mov rdx, qword [rsi]
mov rcx, qword [rbx]
mov qword [rax + 8], rdx
mov rdx, qword [rbx + 8]
mov rax, qword [rax]
mov qword [rdx + 8], rcx
mov rcx, qword [rax + 0x48]
cmp qword [rcx], 0
je 0x4a7ed7
movsxd rax, dword [rdx + 0x34]
mov r8, r13
mov edx, dword [rdx + 0x40]
imul rax, rdx
mov edx, 0xb
mov qword [rsp + 0x68], rax
call sym.sqlite3OsFileControl
cmp eax, 0xc
mov r15d, eax
je 0x4a7ed7
test eax, eax
jne 0x4a7f8f
xor eax, eax
mov ecx, 0x12
mov rdi, r13
rep stosd dword [rdi], eax
mov edx, 0x7fffffff
mov rcx, r13
mov rax, qword [rbx]
mov qword [rsp + 0x90], rbx
mov qword [rsp + 0x70], rsi
mov dword [rsp + 0x80], 1
mov qword [rsp + 0x88], rax
call sym.sqlite3_backup_step
mov rcx, r13
call sym.sqlite3_backup_finish
test eax, eax
mov r15d, eax
jne 0x4a7f2d
mov rax, qword [rsi + 8]
and word [rax + 0x28], 0xfffd
jmp 0x4a7f46
mov rax, qword [rsp + 0x70]
mov rax, qword [rax + 8]
mov rcx, qword [rax]
cmp byte [rcx + 0x10], 0
jne 0x4a7f8f
call sym.pager_reset
jmp 0x4a7f8f
mov rcx, rbx
call sym.sqlite3BtreeCommit
test eax, eax
mov r15d, eax
jne 0x4a7f8f
test r12, r12
jne 0x4a7f8f
mov rcx, rbx
call sym.sqlite3BtreeGetAutoVacuum
mov rcx, rsi
mov edx, eax
call sym.sqlite3BtreeSetAutoVacuum
mov rcx, rbx
call sym.sqlite3BtreeGetRequestedReserve
mov r9d, 1
mov rcx, rsi
mov r8d, eax
mov rax, qword [rbx + 8]
mov edx, dword [rax + 0x34]
call sym.sqlite3BtreeSetPageSize
mov r15d, eax
mov eax, dword [rsp + 0x38]
xor r8d, r8d
or edx, 0xffffffff
mov r9d, 1
mov byte [r14 + 0xc4], 0
mov rcx, rsi
mov dword [r14 + 0x2c], eax
mov rax, qword [rsp + 0x30]
mov qword [r14 + 0x30], rax
mov rax, qword [rsp + 0x40]
mov qword [r14 + 0x78], rax
mov rax, qword [rsp + 0x48]
mov qword [r14 + 0x80], rax
mov al, byte [rsp + 0x57]
mov byte [r14 + 0x6e], al
call sym.sqlite3BtreeSetPageSize
test rbp, rbp
mov byte [r14 + 0x65], 1
je 0x4a7ffc
mov rcx, qword [rbp + 8]
call sym.sqlite3BtreeClose
mov qword [rbp + 8], 0
mov qword [rbp + 0x18], 0
mov rcx, r14
call sym.sqlite3ResetAllSchemasOfConnection
mov eax, r15d
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret