Function at 0x54d005
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, eax
push esi
mov esi, edx
push ebx
sub esp, 0x9c
cmp byte [edx + 0x55], 0
mov dword [ebp - 0x60], ecx
mov ecx, str.cannot_VACUUM_from_within_a_transaction
je 0x54d052
cmp dword [edx + 0xbc], 1
mov ecx, str.cannot_VACUUM___SQL_statements_in_progress
jg 0x54d052
mov eax, dword [edx + 0x3c]
cmp dword [ebp + 8], 0
mov dword [ebp - 0x5c], eax
je 0x54d080
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004cb3f6
cmp eax, 3
je 0x54d065
mov ecx, str.non_text_filename
mov edx, esi
mov eax, edi
mov ebx, 1
call fcn.004fb096
jmp 0x54d58a
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004f934d
mov edx, eax
mov eax, dword [esi + 0x3c]
and eax, 0xfffffffe
or eax, 6
mov dword [esi + 0x3c], eax
jmp 0x54d085
mov edx, 0x664020
mov eax, dword [esi + 0x20]
mov ebx, dword [esi + 0x6c]
mov ecx, dword [esi + 0x68]
mov dword [ebp - 0x80], eax
mov eax, dword [esi + 0x24]
mov dword [ebp - 0x8c], ebx
mov ebx, dword [esi + 0x74]
mov dword [ebp - 0x84], eax
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x90], ecx
mov ecx, dword [esi + 0x70]
mov dword [ebp - 0x70], eax
mov al, byte [esi + 0x5e]
mov dword [ebp - 0x94], ebx
mov ebx, dword [ebp - 0x60]
mov byte [ebp - 0x85], al
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x98], ecx
mov ecx, dword [ebp - 0x84]
shl ebx, 4
or eax, 6
mov byte [esi + 0x5e], 0
mov dword [esi + 0x18], eax
mov eax, dword [ebp - 0x80]
and ecx, 0xfffffffe
mov dword [esi + 0x24], ecx
and eax, 0xefffafff
mov dword [ebp - 0x6c], ebx
or eax, 0x201
mov dword [esi + 0x20], eax
mov eax, dword [esi + 0x10]
add eax, ebx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x60], eax
mov eax, dword [eax + 4]
mov dword [ebp - 0x68], ecx
mov eax, dword [eax]
mov dword [ebp - 0x7c], 1
cmp byte [eax + 0xc], 0
jne 0x54d128
cmp byte [eax + 0x10], 0
setne al
movzx eax, al
mov dword [ebp - 0x7c], eax
mov dword [esp + 0xc], edx
mov eax, dword [esi + 0x14]
mov dword [esp + 8], str.ATTACH__Q_AS_vacuum_db
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [ebp - 0x74], eax
call fcn.0054cfbd
mov dword [ebp - 0x64], 0
mov ebx, eax
mov eax, dword [ebp - 0x5c]
mov dword [esi + 0x3c], eax
test ebx, ebx
jne 0x54d500
mov eax, dword [ebp - 0x74]
shl eax, 4
add eax, dword [esi + 0x10]
cmp dword [ebp + 8], 0
mov dword [ebp - 0x64], eax
mov eax, dword [eax + 4]
mov dword [ebp - 0x5c], eax
je 0x54d1d5
mov eax, dword [eax + 4]
mov eax, dword [eax]
mov eax, dword [eax + 0x40]
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
cmp dword [eax], 0
je 0x54d1bc
lea edx, [ebp - 0x48]
call fcn.004727d1
test eax, eax
jne 0x54d1a4
cmp eax, dword [ebp - 0x48]
sbb eax, dword [ebp - 0x44]
jge 0x54d1bc
mov ecx, str.output_file_already_exists
mov edx, esi
mov eax, edi
mov ebx, 1
call fcn.004fb096
jmp 0x54d500
mov eax, dword [esi + 0x10]
mov ecx, dword [ebp - 0x6c]
mov edx, dword [esi + 0x20]
or dword [esi + 0x18], 8
movzx ebx, byte [eax + ecx + 8]
and edx, 0x38
or ebx, edx
jmp 0x54d1da
mov ebx, 1
mov eax, dword [ebp - 0x60]
or ebx, 0x20
call fcn.004f3b72
mov ecx, dword [ebp - 0x6c]
mov dword [ebp - 0x78], eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + ecx + 0xc]
mov edx, dword [eax + 0x50]
mov eax, dword [ebp - 0x5c]
call fcn.004f3f8d
mov eax, dword [ebp - 0x60]
xor edx, edx
call fcn.004f3ae6
mov edx, eax
mov eax, dword [ebp - 0x5c]
call fcn.004f3ae6
mov eax, dword [ebp - 0x5c]
mov edx, ebx
call fcn.004f3e0e
mov ecx, str.BEGIN
mov edx, edi
mov eax, esi
call fcn.0054ced4
mov ebx, eax
test eax, eax
jne 0x54d500
cmp dword [ebp + 8], 0
mov eax, 2
cmove ebx, eax
mov eax, dword [ebp - 0x60]
xor ecx, ecx
mov edx, ebx
call fcn.0051e63f
mov ebx, eax
test eax, eax
jne 0x54d500
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 4]
mov edx, dword [eax]
cmp byte [edx + 5], 5
jne 0x54d270
cmp dword [ebp + 8], 0
jne 0x54d270
mov dword [esi + 0x64], 0
mov edx, dword [eax + 0x24]
mov dword [esp], 0
mov ebx, 7
mov ecx, dword [ebp - 0x78]
mov eax, dword [ebp - 0x5c]
call fcn.004f66eb
test eax, eax
jne 0x54d500
cmp dword [ebp - 0x7c], 0
je 0x54d2a8
cmp byte [esi + 0x57], 0
mov ebx, 7
je 0x54d2cb
jmp 0x54d500
mov dword [esp], 0
mov edx, dword [esi + 0x64]
mov ebx, 7
mov ecx, dword [ebp - 0x78]
mov eax, dword [ebp - 0x5c]
call fcn.004f66eb
test eax, eax
je 0x54d298
jmp 0x54d500
movsx edx, byte [esi + 0x5a]
test dl, dl
jns 0x54d2dd
mov eax, dword [ebp - 0x60]
call fcn.004f3cd0
mov edx, eax
mov eax, dword [ebp - 0x5c]
call fcn.004f3c52
mov al, byte [ebp - 0x74]
mov dword [esp + 8], str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
mov dword [esp + 4], edi
mov byte [esi + 0xb0], al
mov eax, dword [ebp - 0x68]
mov dword [esp], esi
mov dword [esp + 0xc], eax
call fcn.0054cfbd
mov ebx, eax
test eax, eax
jne 0x54d500
mov eax, dword [ebp - 0x68]
mov dword [esp + 8], str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typeindex
mov dword [esp + 4], edi
mov dword [esp + 0xc], eax
mov dword [esp], esi
call fcn.0054cfbd
mov ebx, eax
test eax, eax
jne 0x54d500
mov eax, dword [ebp - 0x68]
mov byte [esi + 0xb0], 0
mov dword [esp + 8], str.SELECTINSERT_INTO_vacuum_db.quote_name__SELECTFROM__w_.quote_name_FROM_vacuum_db.sqlite_schema_WHERE_typetableAND_coalesce_rootpage_1__0
mov dword [esp + 0xc], eax
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.0054cfbd
and dword [esi + 0x18], 0xfffffffb
mov ebx, eax
test eax, eax
jne 0x54d500
mov eax, dword [ebp - 0x68]
mov dword [esp + 8], str.INSERT_INTO_vacuum_db.sqlite_schema_SELECTFROM___w_.sqlite_schema_WHERE_type_IN_view_trigger__OR_typetableAND_rootpage0_
mov dword [esp + 4], edi
mov dword [esp + 0xc], eax
mov dword [esp], esi
call fcn.0054cfbd
mov ebx, eax
test eax, eax
jne 0x54d500
movzx edx, byte [ebx + 0x669e68]
mov eax, dword [ebp - 0x60]
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x68], edx
call fcn.004f3db5
mov edx, dword [ebp - 0x68]
mov eax, dword [ebp - 0x5c]
movzx ecx, byte [ebx + 0x669e69]
add ecx, dword [ebp - 0x4c]
call fcn.0051ec45
mov edi, eax
test eax, eax
jne 0x54d4fe
add ebx, 2
cmp ebx, 0xa
jne 0x54d38d
cmp dword [ebp + 8], 0
je 0x54d3e6
mov eax, dword [ebp - 0x5c]
call fcn.00524b39
mov edi, eax
test eax, eax
je 0x54d4be
jmp 0x54d4fe
mov eax, dword [ebp - 0x60]
call fcn.004f394d
mov eax, dword [ebp - 0x5c]
call fcn.004f394d
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 4]
mov eax, dword [eax]
mov edi, dword [eax + 0x40]
cmp dword [edi], 0
je 0x54d43f
mov eax, dword [ebp - 0x5c]
mov edx, dword [eax + 4]
mov eax, dword [edx + 0x24]
mov ecx, dword [edx + 0x30]
mov ebx, eax
mul dword [edx + 0x30]
sar ebx, 0x1f
imul ecx, ebx
mov dword [ebp - 0x48], eax
mov eax, edi
add edx, ecx
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x44], edx
mov edx, 0xb
call fcn.00473c09
mov edi, eax
test eax, eax
je 0x54d43f
cmp eax, 0xc
jne 0x54d4a5
lea ebx, [ebp - 0x48]
xor eax, eax
mov ecx, 0xc
mov edi, ebx
rep stosd dword es:[edi], eax
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax]
mov dword [esp + 4], 0x7fffffff
mov dword [esp], ebx
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x38], 1
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0x44], eax
call fcn.00524b6a
mov eax, ebx
call fcn.00526404
mov edi, eax
test eax, eax
jne 0x54d492
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 4]
and word [eax + 0x18], 0xfffd
jmp 0x54d4a5
mov eax, dword [ebp - 0x44]
mov eax, dword [eax + 4]
mov eax, dword [eax]
cmp byte [eax + 0xc], 0
jne 0x54d4a5
call fcn.004dc14f
mov eax, dword [ebp - 0x5c]
call fcn.004e70b4
mov eax, dword [ebp - 0x60]
call fcn.004e70b4
test edi, edi
jne 0x54d4fe
jmp 0x54d3cf
xor ebx, ebx
cmp dword [ebp + 8], 0
jne 0x54d500
mov eax, dword [ebp - 0x5c]
call fcn.004f3cd0
mov edx, eax
mov eax, dword [ebp - 0x60]
call fcn.004f3c52
mov eax, dword [ebp - 0x5c]
call fcn.004f3b72
mov ecx, eax
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 4]
mov edx, dword [eax + 0x24]
mov eax, dword [ebp - 0x60]
mov dword [esp], 1
call fcn.004f66eb
mov ebx, eax
jmp 0x54d500
mov ebx, edi
mov eax, dword [ebp - 0x70]
mov edx, dword [ebp - 0x8c]
mov byte [esi + 0xb0], 0
xor ecx, ecx
mov dword [esp], 1
mov dword [esi + 0x18], eax
mov eax, dword [ebp - 0x80]
mov dword [esi + 0x6c], edx
mov edx, dword [ebp - 0x94]
mov dword [esi + 0x20], eax
mov eax, dword [ebp - 0x84]
mov dword [esi + 0x74], edx
or edx, 0xffffffff
mov dword [esi + 0x24], eax
mov eax, dword [ebp - 0x90]
mov dword [esi + 0x68], eax
mov eax, dword [ebp - 0x98]
mov dword [esi + 0x70], eax
mov al, byte [ebp - 0x85]
mov byte [esi + 0x5e], al
mov eax, dword [ebp - 0x60]
call fcn.004f66eb
cmp dword [ebp - 0x64], 0
mov byte [esi + 0x55], 1
je 0x54d583
mov eax, dword [ebp - 0x64]
mov eax, dword [eax + 4]
call fcn.00525cb6
mov eax, dword [ebp - 0x64]
mov dword [eax + 4], 0
mov dword [eax + 0xc], 0
mov eax, esi
call fcn.004f3a59
add esp, 0x9c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret