Function at 0x525380
Capabilities:
Reference sql statements

Disassembly:
sub esp, 0x20
push esi
push edi
mov edi, ecx
xor ecx, ecx
mov esi, eax
mov dword [esp + 0x10], ecx
cmp byte [esi + 0x3f], cl
jne 0x5253ad
push str.cannot_VACUUM_from_within_a_transaction
push edi
call fcn.004cbbc0
add esp, 8
pop edi
mov eax, 1
pop esi
add esp, 0x20
ret
cmp dword [esi + 0x94], 1
jle 0x5253cf
push str.cannot_VACUUM___SQL_statements_in_progress
push edi
call fcn.004cbbc0
add esp, 8
pop edi
mov eax, 1
pop esi
add esp, 0x20
ret
mov eax, dword [esi + 0x18]
mov edx, dword [esi + 0x50]
mov dword [esp + 0x18], eax
and eax, 0xfff5ffff
or eax, 0x202800
cmp byte [esi + 0x40], 2
mov dword [esp + 0x1c], edx
mov edx, dword [esi + 0x54]
mov dword [esi + 0x18], eax
mov eax, dword [esi + 0x10]
mov dword [esp + 0x20], edx
mov edx, dword [esi + 0xb0]
mov dword [esi + 0xb0], ecx
push ebx
mov ebx, dword [eax + 4]
mov ecx, dword [ebx + 4]
mov dword [esp + 0x28], edx
mov edx, dword [ecx]
movzx eax, byte [edx + 0xf]
mov ecx, dword [esi + 0x14]
mov dword [esp + 0x18], eax
push ebp
mov dword [esp + 0x14], ecx
mov eax, str.ATTACH_:memory:_AS_vacuum_db_
je 0x52542d
mov eax, str.ATTACH__AS_vacuum_db_
push edi
call fcn.005251f0
mov ebp, eax
mov eax, dword [esi + 0x14]
add esp, 4
cmp eax, dword [esp + 0x14]
jle 0x525451
mov ecx, dword [esi + 0x10]
mov edx, eax
shl edx, 4
lea edx, [edx + ecx - 0x10]
mov dword [esp + 0x18], edx
test ebp, ebp
jne 0x525684
mov ecx, dword [esi + 0x10]
shl eax, 4
mov eax, dword [eax + ecx - 0xc]
mov dword [esp + 0x10], eax
call fcn.005119a0
mov eax, ebx
call fcn.004cef30
mov dword [esp + 0x14], eax
push edi
mov eax, str.PRAGMA_vacuum_db.synchronousOFF
call fcn.005251f0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
push edi
mov eax, str.BEGIN_
call fcn.005251f0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
push 2
push ebx
call fcn.00506440
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x525684
mov edx, dword [ebx + 4]
mov eax, dword [edx]
cmp byte [eax + 5], 5
jne 0x5254ca
mov dword [esi + 0x48], ebp
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x14]
mov eax, dword [ecx + 0x20]
mov ebp, dword [esp + 0x10]
push 0
push edx
push eax
mov eax, ebp
call fcn.004cee70
add esp, 0xc
test eax, eax
jne 0x52567f
cmp dword [esp + 0x1c], eax
jne 0x525510
mov ecx, dword [esi + 0x48]
push eax
mov eax, dword [esp + 0x18]
push eax
push ecx
mov eax, ebp
call fcn.004cee70
add esp, 0xc
test eax, eax
jne 0x52567f
cmp byte [esi + 0x41], 0
jne 0x52567f
mov al, byte [esi + 0x43]
test al, al
jl 0x525526
movsx eax, al
jmp 0x52552d
mov eax, ebx
call fcn.004cf0b0
push eax
mov eax, ebp
call fcn.004cf030
push edi
mov eax, str.SELECT_CREATE_TABLE_vacuum_db.__substr_sql_14____FROM_sqlite_master_WHERE_typetable_AND_name_sqlite_sequence___AND_coalesce_rootpage_1__0
call fcn.00525260
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x525684
push edi
mov eax, str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
call fcn.00525260
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
push edi
mov eax, str.SELECT_CREATE_UNIQUE_INDEX_vacuum_db.__substr_sql_21____FROM_sqlite_master_WHERE_sql_LIKE_CREATE_UNIQUE_INDEX__
call fcn.00525260
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
or dword [esi + 0x18], 0x8000000
push edi
mov eax, 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
call fcn.00525260
and dword [esi + 0x18], 0xf7ffffff
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
push edi
mov eax, str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
call fcn.00525260
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
push edi
mov eax, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM_main.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
call fcn.00525260
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
push edi
mov eax, 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_
call fcn.005251f0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
xor edi, edi
lea ecx, [ecx]
movzx eax, byte [edi + 0x58ba88]
lea edx, [esp + 0x1c]
push edx
push eax
mov eax, ebx
call fcn.004cf220
movzx ecx, byte [edi + 0x58ba89]
add ecx, dword [esp + 0x24]
movzx edx, byte [edi + 0x58ba88]
mov eax, dword [esp + 0x18]
push ecx
push edx
call fcn.00501530
mov ebp, eax
add esp, 0x10
test ebp, ebp
jne 0x525684
add edi, 2
cmp edi, 0xa
jl 0x5255f0
mov edi, dword [esp + 0x10]
push ebx
mov eax, edi
call fcn.0051a0e0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x525684
mov eax, edi
call fcn.005119a0
mov ebp, eax
test ebp, ebp
jne 0x525684
mov eax, edi
call fcn.004cf0b0
push eax
mov eax, ebx
call fcn.004cf030
mov eax, dword [edi + 4]
mov ecx, dword [esp + 0x18]
mov eax, dword [eax + 0x20]
push 1
push ecx
push eax
mov eax, ebx
call fcn.004cee70
add esp, 0x10
mov ebp, eax
jmp 0x525684
mov ebp, 7
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
push 1
mov dword [esi + 0x18], edx
mov edx, dword [esp + 0x30]
mov dword [esi + 0x50], eax
push 0xffffffffffffffff
push 0xffffffffffffffff
mov eax, ebx
mov dword [esi + 0x54], ecx
mov dword [esi + 0xb0], edx
call fcn.004cee70
mov edi, dword [esp + 0x24]
xor ebx, ebx
add esp, 0xc
mov byte [esi + 0x3f], 1
cmp edi, ebx
je 0x5256cf
mov eax, dword [edi + 4]
call fcn.00515da0
mov dword [edi + 4], ebx
mov dword [edi + 0xc], ebx
mov edi, esi
call fcn.004dc470
mov eax, ebp
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x20
ret