Function at 0x180052998
Capabilities:
Reference sql statements

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
xor r12d, r12d
mov rsi, rdx
mov r13, rcx
cmp byte [rdx + 0x4e], r12b
jne 0x1800529c1
mov eax, 1
jmp 0x180052d15
cmp dword [rdx + 0x9c], 1
jg 0x1800529b7
mov eax, dword [rdx + 0x2c]
mov ecx, dword [rdx + 0x60]
mov ebx, dword [rdx + 0x28]
mov dword [rsp + 0x88], eax
and eax, 0xfff5ffff
mov dword [rsp + 0x20], ecx
mov ecx, dword [rdx + 0x64]
or eax, 0x202800
lea r8, str.ATTACH_:memory:_AS_vacuum_db_
mov dword [rdx + 0x2c], eax
mov rax, qword [rdx + 0x20]
mov dword [rsp + 0x24], ecx
mov rcx, qword [rdx + 0xb8]
and qword [rdx + 0xb8], r12
mov r14, qword [rax + 8]
mov rax, qword [r14 + 8]
cmp byte [rdx + 0x4f], 2
mov qword [rsp + 0x28], rcx
mov rcx, qword [rax]
mov rdx, r13
movzx eax, byte [rcx + 0x13]
mov rcx, rsi
mov dword [rsp + 0x78], eax
lea rax, str.ATTACH__AS_vacuum_db_
cmovne r8, rax
call fcn.180052894
mov edi, eax
movsxd rax, dword [rsi + 0x28]
cmp eax, ebx
jle 0x180052a55
lea ecx, [rax - 1]
movsxd r12, ecx
shl r12, 5
add r12, qword [rsi + 0x20]
test edi, edi
jne 0x180052cb4
mov rcx, rax
mov rax, qword [rsi + 0x20]
shl rcx, 5
mov r15, qword [rcx + rax - 0x18]
mov rcx, r15
call fcn.180017368
mov rcx, r14
call fcn.180014070
mov r11, qword [r14 + 8]
mov rcx, r14
mov ebx, dword [r11 + 0x30]
sub ebx, dword [r11 + 0x34]
mov dword [rsp + 0x80], ebx
call fcn.18001412c
lea r8, str.PRAGMA_vacuum_db.synchronousOFF
mov rdx, r13
mov rcx, rsi
call fcn.180052894
mov edi, eax
test eax, eax
jne 0x180052cb4
lea r8, str.BEGIN_
mov rdx, r13
mov rcx, rsi
call fcn.180052894
mov edi, eax
test eax, eax
jne 0x180052cb4
lea edx, [rax + 2]
mov rcx, r14
call fcn.1800162fc
mov edi, eax
test eax, eax
jne 0x180052cb4
mov rax, qword [r14 + 8]
mov rcx, qword [rax]
cmp byte [rcx + 9], 5
jne 0x180052af5
and dword [rsi + 0x58], edi
mov rax, qword [r14 + 8]
xor r9d, r9d
mov r8d, ebx
mov edx, dword [rax + 0x30]
mov rcx, r15
call fcn.180015d98
test eax, eax
jne 0x180052caf
cmp dword [rsp + 0x78], eax
jne 0x180052b31
mov edx, dword [rsi + 0x58]
xor r9d, r9d
mov r8d, ebx
mov rcx, r15
call fcn.180015d98
test eax, eax
jne 0x180052caf
cmp byte [rsi + 0x50], 0
jne 0x180052caf
mov al, byte [rsi + 0x52]
test al, al
js 0x180052b47
movsx eax, al
jmp 0x180052b4f
mov rcx, r14
call fcn.180015f28
mov edx, eax
mov rcx, r15
call fcn.180015eb0
lea r8, str.SELECT_CREATE_TABLE_vacuum_db.__substr_sql_14____FROM_sqlite_master_WHERE_typetable_AND_name_sqlite_sequence___AND_coalesce_rootpage_1__0
mov rdx, r13
mov rcx, rsi
call fcn.1800528fc
mov edi, eax
test eax, eax
jne 0x180052cb4
lea r8, str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
mov rdx, r13
mov rcx, rsi
call fcn.1800528fc
mov edi, eax
test eax, eax
jne 0x180052cb4
lea r8, str.SELECT_CREATE_UNIQUE_INDEX_vacuum_db.__substr_sql_21____FROM_sqlite_master_WHERE_sql_LIKE_CREATE_UNIQUE_INDEX__
mov rdx, r13
mov rcx, rsi
call fcn.1800528fc
mov edi, eax
test eax, eax
jne 0x180052cb4
lea r8, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM_main.__quote_name____FROM_main.sqlite_master_WHERE_type__table_AND_name_sqlite_sequence___AND_coalesce_rootpage_1__0
mov rdx, r13
mov rcx, rsi
call fcn.1800528fc
mov edi, eax
test eax, eax
jne 0x180052cb4
lea r8, str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
mov rdx, r13
mov rcx, rsi
call fcn.1800528fc
mov edi, eax
test eax, eax
jne 0x180052cb4
lea r8, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM_main.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
mov rdx, r13
mov rcx, rsi
call fcn.1800528fc
mov edi, eax
test eax, eax
jne 0x180052cb4
lea r8, str.INSERT_INTO_vacuum_db.sqlite_master___SELECT_type__name__tbl_name__rootpage__sql____FROM_main.sqlite_master___WHERE_typeview_OR_typetrigger______OR__typetable_AND_rootpage0_
mov rdx, r13
mov rcx, rsi
call fcn.180052894
mov edi, eax
test eax, eax
jne 0x180052cb4
xor ebx, ebx
lea rdi, [0x180066410]
lea r8, [rsp + 0x78]
mov rcx, r14
movzx edx, byte [rbx + rdi]
call fcn.18001bdc0
movzx r8d, byte [rbx + rdi + 1]
movzx edx, byte [rbx + rdi]
add r8d, dword [rsp + 0x78]
mov rcx, r15
call fcn.18001be3c
mov edi, eax
test eax, eax
jne 0x180052cb4
add rbx, 2
cmp rbx, 0xa
jl 0x180052c1f
mov rdx, r15
mov rcx, r14
call fcn.18001d938
mov edi, eax
test eax, eax
jne 0x180052cb4
mov rcx, r15
call fcn.180017368
mov edi, eax
test eax, eax
jne 0x180052cb4
mov rcx, r15
call fcn.180015f28
mov rcx, r14
mov edx, eax
call fcn.180015eb0
mov r11, qword [r15 + 8]
mov r8d, dword [rsp + 0x80]
mov edx, dword [r11 + 0x30]
lea r9d, [rdi + 1]
mov rcx, r14
call fcn.180015d98
mov edi, eax
jmp 0x180052cb4
mov edi, 7
mov eax, dword [rsp + 0x88]
or edx, 0xffffffff
mov r9d, 1
mov dword [rsi + 0x2c], eax
mov eax, dword [rsp + 0x20]
mov r8d, edx
mov dword [rsi + 0x60], eax
mov eax, dword [rsp + 0x24]
mov rcx, r14
mov dword [rsi + 0x64], eax
mov rax, qword [rsp + 0x28]
mov qword [rsi + 0xb8], rax
call fcn.180015d98
mov byte [rsi + 0x4e], 1
test r12, r12
je 0x180052d0b
mov rcx, qword [r12 + 8]
call fcn.180015b78
and qword [r12 + 8], 0
and qword [r12 + 0x18], 0
mov rcx, rsi
call fcn.180034f4c
mov eax, edi
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret