Function at 0x50fa70
Capabilities:
Reference sql statements

Disassembly:
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov esi, ecx
xor edi, edi
cmp byte [esi + 0x47], 0
jne 0x50fa9c
mov edi, dword [esp + 0x44]
mov ebx, str.cannot_VACUUM_from_within_a_transaction
call fcn.004abbf0
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
cmp dword [esi + 0xa4], 1
jle 0x50fac0
mov edi, dword [esp + 0x44]
mov ebx, str.cannot_VACUUM___SQL_statements_in_progress
call fcn.004abbf0
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
movzx edx, word [esi + 0x18]
mov ecx, dword [esi + 0x1c]
or dword [esi + 0x18], 6
mov dword [esp + 0x34], ecx
mov dword [esp + 0x30], edx
mov edx, dword [esi + 0x5c]
and ecx, 0xffffaf7f
or ecx, 0x201
mov dword [esi + 0x1c], ecx
mov ecx, dword [esi + 0x10]
mov dword [esp + 0x38], edx
mov edx, dword [esi + 0x60]
shl eax, 4
mov dword [esp + 0x3c], edx
mov dl, byte [esi + 0x50]
mov byte [esi + 0x50], 0
mov ebx, dword [eax + ecx + 4]
mov dword [esp + 0x28], eax
add eax, ecx
mov byte [esp + 0x17], dl
mov edx, dword [eax]
mov eax, dword [ebx + 4]
mov ecx, dword [eax]
mov eax, dword [esi + 0x14]
mov dword [esp + 0x18], edx
movzx edx, byte [ecx + 0xc]
mov ecx, dword [esp + 0x44]
push str.ATTACHAS_vacuum_db
push ecx
push esi
mov dword [esp + 0x38], edx
mov dword [esp + 0x2c], eax
call fcn.0050f850
mov ebp, eax
add esp, 0xc
test ebp, ebp
jne 0x50fd8c
mov eax, dword [esp + 0x20]
shl eax, 4
add eax, dword [esi + 0x10]
mov edi, dword [eax + 4]
mov dword [esp + 0x1c], eax
mov eax, edi
call fcn.004c2360
mov eax, ebx
call fcn.004c1030
mov edx, dword [esi + 0x10]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + edx + 0xc]
mov edx, dword [ecx + 0x50]
push edx
mov eax, edi
call fcn.004c0e10
add esp, 4
push ebp
mov eax, ebx
call fcn.004c0e60
add esp, 4
push eax
mov eax, edi
call fcn.004c0e60
add esp, 4
push 0x21
mov eax, edi
call fcn.004c0f00
mov eax, dword [esp + 0x48]
add esp, 4
push str.BEGIN
push eax
push esi
call fcn.0050f850
mov ebp, eax
add esp, 0xc
test ebp, ebp
jne 0x50fd88
push eax
push 2
push ebx
call fcn.004c1610
mov ebp, eax
add esp, 0xc
test ebp, ebp
jne 0x50fd88
mov ecx, dword [ebx + 4]
mov edx, dword [ecx]
cmp byte [edx + 5], 5
jne 0x50fbe1
mov dword [esi + 0x54], eax
mov eax, dword [ebx + 4]
mov ebp, dword [esp + 0x24]
mov eax, dword [eax + 0x20]
push 0
push ebp
mov ecx, edi
call fcn.004c0f50
add esp, 8
test eax, eax
jne 0x50fd83
cmp dword [esp + 0x2c], eax
jne 0x50fc1d
push eax
mov eax, dword [esi + 0x54]
push ebp
mov ecx, edi
call fcn.004c0f50
add esp, 8
test eax, eax
jne 0x50fd83
cmp byte [esi + 0x49], 0
jne 0x50fd83
mov al, byte [esi + 0x4c]
test al, al
jl 0x50fc33
movsx eax, al
jmp 0x50fc3a
mov eax, ebx
call fcn.004c11b0
push eax
mov eax, edi
call fcn.004c1130
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x48]
mov cl, byte [esp + 0x24]
add esp, 4
push edx
push str.SELECT_sql_FROM___w_.sqlite_master_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
push eax
mov eax, esi
mov byte [esi + 0x9c], cl
call fcn.0050f950
mov ebp, eax
add esp, 0xc
test ebp, ebp
jne 0x50fd88
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x44]
push ecx
push str.SELECT_sql_FROM___w_.sqlite_master_WHERE_typeindex
push edx
mov eax, esi
call fcn.0050f950
mov ebp, eax
add esp, 0xc
test ebp, ebp
jne 0x50fd88
mov ecx, dword [esp + 0x44]
mov byte [esi + 0x9c], al
mov eax, dword [esp + 0x18]
push eax
push str.SELECTINSERT_INTO_vacuum_db.quote_name__SELECTFROM__w_.quote_name_FROM_vacuum_db.sqlite_master_WHERE_typetableAND_coalesce_rootpage_1__0
push ecx
mov eax, esi
call fcn.0050f950
and dword [esi + 0x18], 0xfffffffb
mov ebp, eax
add esp, 0xc
test ebp, ebp
jne 0x50fd88
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x44]
push edx
push str.INSERT_INTO_vacuum_db.sqlite_master_SELECTFROM___w_.sqlite_master_WHERE_type_IN_view_trigger__OR_typetableAND_rootpage0_
push eax
mov eax, esi
call fcn.0050f950
mov ebp, eax
add esp, 0xc
test ebp, ebp
jne 0x50fd88
mov dword [esp + 0x18], ebp
jmp 0x50fcf4
mov ebp, dword [esp + 0x18]
movzx edx, byte [ebp + 0x5e535c]
lea ecx, [esp + 0x2c]
push ecx
push edx
mov eax, ebx
call fcn.004c7dd0
movzx eax, byte [ebp + 0x5e535d]
add eax, dword [esp + 0x34]
movzx ecx, byte [ebp + 0x5e535c]
push eax
push ecx
mov eax, edi
call fcn.004c7e30
mov ebp, eax
add esp, 0x10
test ebp, ebp
jne 0x50fd88
mov eax, dword [esp + 0x18]
add eax, 2
cmp eax, 0xa
mov dword [esp + 0x18], eax
jl 0x50fcf0
mov eax, edi
call fcn.004ca590
mov ebp, eax
test ebp, ebp
jne 0x50fd88
mov eax, edi
call fcn.004c2360
mov ebp, eax
test ebp, ebp
jne 0x50fd88
mov eax, edi
call fcn.004c11b0
push eax
mov eax, ebx
call fcn.004c1130
mov ecx, dword [esp + 0x28]
mov edx, dword [edi + 4]
mov eax, dword [edx + 0x20]
add esp, 4
push 1
push ecx
mov ecx, ebx
call fcn.004c0f50
add esp, 8
mov ebp, eax
jmp 0x50fd88
mov ebp, 7
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x34]
movzx edx, word [esp + 0x30]
mov ecx, dword [esp + 0x38]
mov dword [esi + 0x1c], eax
mov al, byte [esp + 0x17]
mov dword [esi + 0x18], edx
mov edx, dword [esp + 0x3c]
mov dword [esi + 0x5c], ecx
mov byte [esi + 0x50], al
push 1
push 0xffffffffffffffff
mov eax, 0xffffffff
mov ecx, ebx
mov byte [esi + 0x9c], 0
mov dword [esi + 0x60], edx
call fcn.004c0f50
xor ebx, ebx
add esp, 8
mov byte [esi + 0x47], 1
cmp edi, ebx
je 0x50fde2
mov eax, dword [edi + 4]
call fcn.004c0d20
mov dword [edi + 4], ebx
mov dword [edi + 0xc], ebx
mov eax, esi
call fcn.004ebfc0
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x30
ret