Function at 0x541f10
Capabilities:
Reference sql statements

Disassembly:
sub esp, 0x38
push ebp
push esi
mov esi, dword [esp + 0x48]
xor ebp, ebp
cmp byte [esi + 0x55], 0
jne 0x541f3e
push str.cannot_VACUUM_from_within_a_transaction
push esi
push dword [esp + 0x4c]
call fcn.00545720
add esp, 0xc
mov eax, 1
pop esi
pop ebp
add esp, 0x38
ret
cmp dword [esi + 0xbc], 1
jle 0x541f4e
push str.cannot_VACUUM___SQL_statements_in_progress
jmp 0x541f26
mov ecx, dword [esp + 0x50]
mov eax, dword [esi + 0x3c]
mov dword [esp + 0x1c], eax
test ecx, ecx
je 0x541f8d
movzx eax, word [ecx + 8]
and eax, 0x3f
cmp byte [eax + 0x59e748], 3
je 0x541f74
push str.non_text_filename
jmp 0x541f26
push ecx
call fcn.004c13f0
mov ecx, dword [esi + 0x3c]
add esp, 4
and ecx, 0xfffffffe
mov edx, eax
or ecx, 6
mov dword [esi + 0x3c], ecx
jmp 0x541f92
mov edx, section..rdata
mov eax, dword [esi + 0x20]
mov ecx, dword [esi + 0x24]
push ebx
mov ebx, dword [esi + 0x18]
mov dword [esp + 0x2c], ebx
or ebx, 6
mov dword [esi + 0x18], ebx
mov ebx, dword [esp + 0x50]
mov dword [esp + 0x30], eax
or eax, 0x201
mov dword [esi + 0x20], eax
mov eax, dword [esi + 0x10]
and dword [esi + 0x20], 0xefffafff
mov dword [esp + 0x28], ecx
mov cl, byte [esi + 0x5e]
shl ebx, 4
mov byte [esp + 0x4c], cl
mov ecx, dword [esp + 0x28]
mov dword [esi + 0x24], ecx
and dword [esi + 0x24], 0xfffffffe
mov byte [esi + 0x5e], 0
mov ecx, dword [ebx + eax]
mov dword [esp + 0x50], ebx
mov ebx, dword [ebx + eax + 4]
push edi
mov edi, dword [esi + 0x68]
mov dword [esp + 0x38], edi
mov eax, dword [ebx + 4]
mov edi, dword [esi + 0x6c]
mov dword [esp + 0x3c], edi
mov edi, dword [esi + 0x70]
mov eax, dword [eax]
mov dword [esp + 0x40], edi
mov edi, dword [esi + 0x74]
mov dword [esp + 0x44], edi
cmp byte [eax + 0xc], 0
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], ebx
jne 0x542022
cmp byte [eax + 0x10], 0
mov dword [esp + 0x1c], ebp
je 0x54202a
mov dword [esp + 0x1c], 1
mov eax, dword [esi + 0x14]
push edx
push str.ATTACH__Q_AS_vacuum_db
push dword [esp + 0x54]
mov dword [esp + 0x2c], eax
push esi
call fcn.004e6d50
mov edi, eax
add esp, 0x10
mov eax, dword [esp + 0x24]
mov dword [esi + 0x3c], eax
test edi, edi
jne 0x5422e7
mov eax, dword [esp + 0x20]
shl eax, 4
add eax, dword [esi + 0x10]
mov dword [esp + 0x10], eax
mov ebp, dword [eax + 4]
cmp dword [esp + 0x58], edi
je 0x5420c3
mov eax, dword [ebp + 4]
mov eax, dword [eax]
mov eax, dword [eax + 0x40]
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
mov ecx, dword [eax]
test ecx, ecx
je 0x5420bf
lea edx, [esp + 0x24]
push edx
push eax
mov eax, dword [ecx + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x5420a2
cmp dword [esp + 0x28], eax
jl 0x5420bf
jg 0x5420a2
cmp dword [esp + 0x24], eax
jbe 0x5420bf
mov eax, dword [esp + 0x4c]
mov edi, 1
push str.output_file_already_exists
push esi
push eax
call fcn.00545720
add esp, 0xc
jmp 0x5422e3
or dword [esi + 0x18], 8
push ebx
call fcn.0051b010
mov ecx, dword [esi + 0x10]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x58]
mov ecx, dword [eax + ecx + 0xc]
push dword [ecx + 0x50]
push ebp
call fcn.0051cf30
push 0
push ebx
call fcn.0051d110
push eax
push ebp
call fcn.0051d110
push 0x21
push ebp
call fcn.0051d0c0
mov eax, dword [esp + 0x70]
push str.BEGIN
push eax
push esi
call fcn.004e6c70
mov edi, eax
add esp, 0x30
test edi, edi
jne 0x5422e3
push eax
mov eax, dword [esp + 0x5c]
neg eax
sbb eax, eax
and eax, 0xfffffffe
add eax, 2
push eax
push ebx
call fcn.00519de0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x5422e3
mov eax, dword [ebx + 4]
mov eax, dword [eax]
cmp byte [eax + 5], 5
jne 0x54214c
cmp dword [esp + 0x58], edi
jne 0x54214c
mov dword [esi + 0x64], edi
mov eax, dword [ebx + 4]
mov edi, dword [esp + 0x24]
push 0
push edi
push dword [eax + 0x24]
push ebp
call fcn.0051cfe0
add esp, 0x10
test eax, eax
jne 0x5422d8
cmp dword [esp + 0x1c], eax
jne 0x542186
push eax
push edi
push dword [esi + 0x64]
push ebp
call fcn.0051cfe0
add esp, 0x10
test eax, eax
jne 0x5422d8
cmp byte [esi + 0x57], 0
jne 0x5422d8
mov al, byte [esi + 0x5a]
test al, al
js 0x54219c
movsx eax, al
jmp 0x5421a5
push ebx
call fcn.0051af20
add esp, 4
push eax
push ebp
call fcn.0051cec0
push dword [esp + 0x1c]
mov eax, dword [esp + 0x2c]
push str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
push dword [esp + 0x5c]
mov byte [esi + 0xb0], al
push esi
call fcn.004e6d50
mov edi, eax
add esp, 0x18
test edi, edi
jne 0x5422e3
push dword [esp + 0x14]
push str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typeindex
push dword [esp + 0x54]
push esi
call fcn.004e6d50
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x5422e3
push dword [esp + 0x14]
mov byte [esi + 0xb0], al
push str.SELECTINSERT_INTO_vacuum_db.quote_name__SELECTFROM__w_.quote_name_FROM_vacuum_db.sqlite_schema_WHERE_typetableAND_coalesce_rootpage_1__0
push dword [esp + 0x54]
push esi
call fcn.004e6d50
and dword [esi + 0x18], 0xfffffffb
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x5422e3
push dword [esp + 0x14]
push str.INSERT_INTO_vacuum_db.sqlite_schema_SELECTFROM___w_.sqlite_schema_WHERE_type_IN_view_trigger__OR_typetableAND_rootpage0_
push dword [esp + 0x54]
push esi
call fcn.004e6d50
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x5422e3
xor ebx, ebx
lea eax, [esp + 0x20]
push eax
movzx eax, byte [ebx + 0x59ecbc]
push eax
push dword [esp + 0x20]
call fcn.0051afa0
movzx eax, byte [ebx + 0x59ecbd]
add eax, dword [esp + 0x2c]
push eax
movzx eax, byte [ebx + 0x59ecbc]
push eax
push ebp
call fcn.0051da80
mov edi, eax
add esp, 0x18
test edi, edi
jne 0x5422df
add ebx, 2
cmp ebx, 0xa
jl 0x542242
mov ebx, dword [esp + 0x18]
cmp dword [esp + 0x58], eax
jne 0x54229d
push ebp
push ebx
call fcn.0051a590
mov edi, eax
add esp, 8
test edi, edi
jne 0x5422e3
push ebp
call fcn.0051a3e0
mov edi, eax
add esp, 4
test edi, edi
jne 0x5422e3
cmp dword [esp + 0x58], eax
jne 0x5422e3
push ebp
call fcn.0051af20
push eax
push ebx
call fcn.0051cec0
mov eax, dword [ebp + 4]
push 1
push dword [esp + 0x34]
push dword [eax + 0x24]
push ebx
call fcn.0051cfe0
add esp, 0x1c
mov edi, eax
jmp 0x5422e3
mov edi, 7
jmp 0x5422e3
mov ebx, dword [esp + 0x18]
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x30]
mov dword [esi + 0x18], eax
mov eax, dword [esp + 0x34]
mov dword [esi + 0x20], eax
mov eax, dword [esp + 0x2c]
mov dword [esi + 0x24], eax
mov eax, dword [esp + 0x38]
mov dword [esi + 0x68], eax
mov eax, dword [esp + 0x3c]
mov dword [esi + 0x6c], eax
mov eax, dword [esp + 0x40]
push 1
mov dword [esi + 0x70], eax
mov eax, dword [esp + 0x48]
push 0
mov dword [esi + 0x74], eax
mov al, byte [esp + 0x58]
push 0xffffffffffffffff
push ebx
mov byte [esi + 0xb0], 0
mov byte [esi + 0x5e], al
call fcn.0051cfe0
add esp, 0x10
mov byte [esi + 0x55], 1
test ebp, ebp
je 0x542356
push dword [ebp + 4]
call fcn.0051a210
add esp, 4
mov dword [ebp + 4], 0
mov dword [ebp + 0xc], 0
push esi
call fcn.00540da0
add esp, 4
mov eax, edi
pop edi
pop ebx
pop esi
pop ebp
add esp, 0x38
ret