Function at 0x521914
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc8
xor eax, eax
push ebx
push esi
push edi
mov ebx, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
cmp byte [ebx + 0x3e], 0
jne 0x521947
push str.cannot_VACUUM_from_within_a_transaction
push ebx
push edi
call fcn.004ddcb4
add esp, 0xc
mov eax, 1
jmp 0x521cd4
cmp dword [ebx + 0x8c], 1
jle 0x521969
push str.cannot_VACUUM___SQL_statements_in_progress
push ebx
push edi
call fcn.004ddcb4
add esp, 0xc
mov eax, 1
jmp 0x521cd4
mov edx, dword [ebx + 0x18]
mov dword [ebp - 0xc], edx
mov ecx, dword [ebx + 0x50]
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebx + 0x54]
mov dword [ebp - 0x14], ecx
mov eax, dword [ebx + 0xa0]
mov dword [ebp - 0x18], eax
or dword [ebx + 0x18], 0x100500
and dword [ebx + 0x18], 0xfffaffff
xor edx, edx
mov dword [ebx + 0xa0], edx
mov ecx, dword [ebx + 0x10]
mov eax, dword [ecx + 4]
mov dword [ebp - 4], eax
mov edx, dword [ebp - 4]
push edx
call fcn.004f2d14
pop ecx
push eax
call fcn.004e8fa0
pop ecx
mov dword [ebp - 0x20], eax
mov ecx, dword [ebx + 0x14]
mov dword [ebp - 0x28], ecx
push ebx
call fcn.0052da9c
pop ecx
test eax, eax
je 0x5219cf
mov eax, str.ATTACH_:memory:_AS_vacuum_db_
jmp 0x5219d4
mov eax, str.ATTACH__AS_vacuum_db_
push eax
push edi
push ebx
call fcn.005217f4
add esp, 0xc
mov esi, eax
mov eax, dword [ebx + 0x14]
cmp eax, dword [ebp - 0x28]
jle 0x5219f7
mov edx, eax
shl edx, 4
add edx, dword [ebx + 0x10]
add edx, 0xfffffff0
mov dword [ebp - 0x1c], edx
test esi, esi
jne 0x521c77
shl eax, 4
mov ecx, dword [ebx + 0x10]
mov ecx, dword [ecx + eax - 0xc]
mov dword [ebp - 8], ecx
mov eax, dword [ebp - 8]
push eax
call fcn.004ee954
pop ecx
mov edx, dword [ebp - 4]
push edx
call fcn.004ed8e0
pop ecx
mov dword [ebp - 0x24], eax
cmp dword [ebx + 0x48], 0
je 0x521a47
lea ecx, [ebp - 0x2c]
push ecx
lea eax, [ebp - 0x30]
push eax
push 0
push ebx
call fcn.005441c4
add esp, 0x10
cmp dword [ebp - 0x2c], 0
je 0x521a47
xor edx, edx
mov dword [ebx + 0x48], edx
push str.PRAGMA_vacuum_db.synchronousOFF
push edi
push ebx
call fcn.005217f4
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
push str.BEGIN_
push edi
push ebx
call fcn.005217f4
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
push 2
mov eax, dword [ebp - 4]
push eax
call fcn.004ede38
add esp, 8
mov esi, eax
test esi, esi
jne 0x521c77
mov eax, dword [ebp - 4]
push eax
call fcn.004f2d14
pop ecx
push eax
call fcn.004e94f0
pop ecx
cmp eax, 5
jne 0x521aac
xor edx, edx
mov dword [ebx + 0x48], edx
push 0
mov ecx, dword [ebp - 0x24]
push ecx
mov ecx, dword [ebp - 4]
push ecx
call fcn.004ed8bc
pop ecx
push eax
mov eax, dword [ebp - 8]
push eax
call fcn.004ed828
add esp, 0x10
test eax, eax
jne 0x521af3
cmp dword [ebp - 0x20], 0
jne 0x521aed
push 0
mov edx, dword [ebp - 0x24]
push edx
mov ecx, dword [ebx + 0x48]
push ecx
mov eax, dword [ebp - 8]
push eax
call fcn.004ed828
add esp, 0x10
test eax, eax
jne 0x521af3
cmp byte [ebx + 0x40], 0
je 0x521afd
mov esi, 7
jmp 0x521c77
cmp byte [ebx + 0x42], 0
jl 0x521b09
movsx eax, byte [ebx + 0x42]
jmp 0x521b13
mov edx, dword [ebp - 4]
push edx
call fcn.004ed9f8
pop ecx
push eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.004ed988
add esp, 8
push str.SELECT_CREATE_TABLE_vacuum_db.__substr_sql_14____FROM_sqlite_master_WHERE_typetable_AND_name_sqlite_sequence___AND_rootpage_0
push edi
push ebx
call fcn.00521860
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
push str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
push edi
push ebx
call fcn.00521860
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
push str.SELECT_CREATE_UNIQUE_INDEX_vacuum_db.__substr_sql_21____FROM_sqlite_master_WHERE_sql_LIKE_CREATE_UNIQUE_INDEX__
push edi
push ebx
call fcn.00521860
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
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_rootpage_0
push edi
push ebx
call fcn.00521860
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
push str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
push edi
push ebx
call fcn.00521860
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
push str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM_main.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
push edi
push ebx
call fcn.00521860
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
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 edi
push ebx
call fcn.005217f4
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
xor eax, eax
mov edi, 0x56d7cf
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x34]
push eax
xor edx, edx
mov dl, byte [edi]
push edx
mov ecx, dword [ebp - 4]
push ecx
call fcn.004f2b54
add esp, 0xc
xor ecx, ecx
mov cl, byte [edi + 1]
add ecx, dword [ebp - 0x34]
push ecx
xor eax, eax
mov al, byte [edi]
push eax
mov edx, dword [ebp - 8]
push edx
call fcn.004f2b8c
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x521c77
add dword [ebp - 0x38], 2
add edi, 2
cmp dword [ebp - 0x38], 0xa
jl 0x521bd9
mov eax, dword [ebp - 8]
push eax
mov edx, dword [ebp - 4]
push edx
call fcn.004f475c
add esp, 8
mov esi, eax
test esi, esi
jne 0x521c77
mov eax, dword [ebp - 8]
push eax
call fcn.004ee954
pop ecx
mov esi, eax
test esi, esi
jne 0x521c77
mov eax, dword [ebp - 8]
push eax
call fcn.004ed9f8
pop ecx
push eax
mov edx, dword [ebp - 4]
push edx
call fcn.004ed988
add esp, 8
push 1
mov ecx, dword [ebp - 0x24]
push ecx
mov ecx, dword [ebp - 8]
push ecx
call fcn.004ed8bc
pop ecx
push eax
mov eax, dword [ebp - 4]
push eax
call fcn.004ed828
add esp, 0x10
mov esi, eax
mov eax, dword [ebp - 0xc]
mov dword [ebx + 0x18], eax
mov edx, dword [ebp - 0x10]
mov dword [ebx + 0x50], edx
mov ecx, dword [ebp - 0x14]
mov dword [ebx + 0x54], ecx
mov ecx, dword [ebp - 0x18]
mov dword [ebx + 0xa0], ecx
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
mov eax, dword [ebp - 4]
push eax
call fcn.004ed828
add esp, 0x10
mov byte [ebx + 0x3e], 1
cmp dword [ebp - 0x1c], 0
je 0x521ccb
mov edx, dword [ebp - 0x1c]
mov ecx, dword [edx + 4]
push ecx
call fcn.004ed6b0
pop ecx
mov eax, dword [ebp - 0x1c]
xor edx, edx
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0x1c]
xor eax, eax
mov dword [ecx + 0xc], eax
push ebx
call fcn.0050ac34
pop ecx
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret