Function at 0x505766
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push edi
mov edi, dword [ebp + 0xc]
xor eax, eax
mov dword [ebp - 0xc], eax
cmp byte [edi + 0x3e], al
jne 0x505793
push str.cannot_VACUUM_from_within_a_transaction
push edi
push dword [ebp + 8]
call fcn.0050718c
xor eax, eax
add esp, 0xc
inc eax
jmp 0x505ab5
cmp dword [edi + 0x8c], 1
jle 0x5057a3
push str.cannot_VACUUM___SQL_statements_in_progress
jmp 0x50577f
mov eax, dword [edi + 0x18]
mov ecx, dword [edi + 0x50]
mov dword [ebp - 0x14], eax
and eax, 0xfff5ffff
or eax, 0x202800
mov dword [ebp - 0x18], ecx
mov ecx, dword [edi + 0x54]
mov dword [edi + 0x18], eax
mov eax, dword [edi + 0x10]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [edi + 0xa4]
and dword [edi + 0xa4], 0
mov eax, dword [eax + 4]
cmp byte [edi + 0x3f], 2
mov dword [ebp - 8], eax
push ebx
mov eax, dword [eax + 4]
mov dword [ebp - 0x20], ecx
mov ecx, str.ATTACH__AS_vacuum_db_
push esi
mov esi, dword [edi + 0x14]
mov eax, dword [eax]
movzx eax, byte [eax + 0xf]
mov dword [ebp - 0x10], eax
mov eax, str.ATTACH_:memory:_AS_vacuum_db_
cmovne eax, ecx
push eax
push dword [ebp + 8]
push edi
call fcn.004e37a4
mov ecx, dword [edi + 0x14]
add esp, 0xc
mov ebx, eax
cmp ecx, esi
jle 0x505823
mov eax, dword [edi + 0x10]
mov edx, ecx
shl edx, 4
add eax, 0xfffffff0
add eax, edx
mov dword [ebp - 0xc], eax
test ebx, ebx
jne 0x505a61
mov eax, dword [edi + 0x10]
add ecx, ecx
mov eax, dword [eax + ecx*8 - 0xc]
push eax
mov dword [ebp + 0xc], eax
call fcn.004f3544
mov esi, dword [ebp - 8]
push esi
call fcn.004f3b61
mov eax, dword [esi + 4]
push esi
mov ecx, dword [eax + 0x20]
sub ecx, dword [eax + 0x24]
mov dword [ebp - 4], ecx
call fcn.004f42d1
push str.PRAGMA_vacuum_db.synchronousOFF
push dword [ebp + 8]
push edi
call fcn.004e37a4
mov ebx, eax
add esp, 0x18
test ebx, ebx
jne 0x505a64
push str.BEGIN_
push dword [ebp + 8]
push edi
call fcn.004e37a4
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x505a64
push 2
push esi
call fcn.004f31ad
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
jne 0x505a64
mov eax, dword [esi + 4]
mov eax, dword [eax]
cmp byte [eax + 5], 5
jne 0x5058b0
and dword [edi + 0x48], ebx
mov eax, dword [esi + 4]
mov ebx, dword [ebp + 0xc]
push 0
push dword [ebp - 4]
push dword [eax + 0x20]
push ebx
call fcn.004f50ff
add esp, 0x10
test eax, eax
jne 0x505a5c
cmp dword [ebp - 0x10], eax
jne 0x5058ec
push eax
push dword [ebp - 4]
push dword [edi + 0x48]
push ebx
call fcn.004f50ff
add esp, 0x10
test eax, eax
jne 0x505a5c
cmp byte [edi + 0x40], 0
jne 0x505a5c
mov al, byte [edi + 0x42]
test al, al
js 0x505902
movsx eax, al
jmp 0x505909
push esi
call fcn.004f3c0b
pop ecx
push eax
push ebx
call fcn.004f5084
push str.SELECT_CREATE_TABLE_vacuum_db.__substr_sql_14____FROM_sqlite_master_WHERE_typetable_AND_name_sqlite_sequence___AND_coalesce_rootpage_1__0
push dword [ebp + 8]
push edi
call fcn.004e372a
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x505a64
push str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
push dword [ebp + 8]
push edi
call fcn.004e372a
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x505a64
push str.SELECT_CREATE_UNIQUE_INDEX_vacuum_db.__substr_sql_21____FROM_sqlite_master_WHERE_sql_LIKE_CREATE_UNIQUE_INDEX__
push dword [ebp + 8]
push edi
call fcn.004e372a
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x505a64
push 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
push dword [ebp + 8]
push edi
call fcn.004e372a
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x505a64
push str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
push dword [ebp + 8]
push edi
call fcn.004e372a
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x505a64
push str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM_main.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
push dword [ebp + 8]
push edi
call fcn.004e372a
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x505a64
push 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_
push dword [ebp + 8]
push edi
call fcn.004e37a4
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x505a64
mov dword [ebp - 8], ebx
lea eax, [ebp - 0x10]
push eax
movzx eax, byte [ebx + 0x5e6240]
push eax
push esi
call fcn.004f3c58
movzx eax, byte [ebx + 0x5e6241]
add eax, dword [ebp - 0x10]
push eax
movzx eax, byte [ebx + 0x5e6240]
push eax
push dword [ebp + 0xc]
call fcn.004f529f
mov ebx, eax
add esp, 0x18
test ebx, ebx
jne 0x505a64
mov ebx, dword [ebp - 8]
add ebx, 2
mov dword [ebp - 8], ebx
cmp ebx, 0xa
jl 0x5059d0
push dword [ebp + 0xc]
push esi
call fcn.004f3641
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
jne 0x505a64
push dword [ebp + 0xc]
call fcn.004f3544
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x505a64
mov ebx, dword [ebp + 0xc]
push ebx
call fcn.004f3c0b
push eax
push esi
call fcn.004f5084
mov eax, dword [ebx + 4]
push 1
push dword [ebp - 4]
push dword [eax + 0x20]
push esi
call fcn.004f50ff
add esp, 0x1c
mov ebx, eax
jmp 0x505a64
push 7
pop ebx
jmp 0x505a64
mov esi, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
mov dword [edi + 0x18], eax
mov eax, dword [ebp - 0x18]
push 1
mov dword [edi + 0x50], eax
mov eax, dword [ebp - 0x1c]
push 0xffffffffffffffff
mov dword [edi + 0x54], eax
mov eax, dword [ebp - 0x20]
push 0xffffffffffffffff
push esi
mov dword [edi + 0xa4], eax
call fcn.004f50ff
mov esi, dword [ebp - 0xc]
add esp, 0x10
mov byte [edi + 0x3e], 1
test esi, esi
je 0x505aaa
push dword [esi + 4]
call fcn.004f3402
and dword [esi + 4], 0
and dword [esi + 0xc], 0
pop ecx
push edi
call fcn.00504d8b
pop ecx
pop esi
mov eax, ebx
pop ebx
pop edi
mov esp, ebp
pop ebp
ret