Function at 0x497550
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push esi
mov esi, ecx
cmp byte [esi + 0x4f], 0
push edi
mov edi, eax
mov dword [ebp - 0x20], 0
jne 0x497587
mov eax, dword [ebp + 8]
push str.cannot_VACUUM_from_within_a_transaction
push eax
mov eax, esi
call fcn.00432b20
add esp, 8
pop edi
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0xb0], 1
jle 0x4975ae
mov ecx, dword [ebp + 8]
push str.cannot_VACUUM___SQL_statements_in_progress
push ecx
mov eax, esi
call fcn.00432b20
add esp, 8
pop edi
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov edx, dword [esi + 0x3c]
mov dword [ebp - 0x10], edx
test eax, eax
je 0x497600
movzx ecx, word [eax + 8]
and ecx, 0x3f
cmp byte [ecx + 0x4e0858], 3
je 0x4975e9
mov edx, dword [ebp + 8]
push str.non_text_filename
push edx
mov eax, esi
call fcn.00432b20
add esp, 8
pop edi
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
push eax
call fcn.004354b0
mov ecx, dword [esi + 0x3c]
and ecx, 0xfffffffe
add esp, 4
or ecx, 6
mov dword [esi + 0x3c], ecx
jmp 0x497605
mov eax, 0x4de410
mov edx, dword [esi + 0x24]
mov ecx, dword [esi + 0x20]
push ebx
mov ebx, dword [esi + 0x18]
mov dword [esi + 0x24], edx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x1c], ebx
mov ebx, dword [esi + 0x64]
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x38], ecx
or ecx, 0x201
mov dword [esi + 0x20], ecx
mov ecx, dword [esi + 0x24]
and dword [esi + 0x20], 0xefffaf7f
or edx, 6
mov dword [esi + 0x18], edx
mov edx, dword [esi + 0x10]
mov dword [ebp - 0x2c], ebx
mov ebx, dword [esi + 0x68]
mov dword [esi + 0x24], ecx
mov dword [ebp - 0x30], ebx
mov bl, byte [esi + 0x58]
mov byte [esi + 0x58], 0
shl edi, 4
lea ecx, [edi + edx]
mov edx, dword [ecx]
mov byte [ebp - 1], bl
mov ebx, dword [ecx + 4]
mov ecx, dword [ebx + 4]
mov dword [ebp - 0xc], edx
mov edx, dword [ecx]
movzx ecx, byte [edx + 0xc]
mov edx, dword [esi + 0x14]
push eax
mov eax, dword [ebp + 8]
push str.ATTACH__Q_AS_vacuum_db
push eax
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x18], edx
call fcn.004974c0
mov ecx, dword [ebp - 0x10]
mov edi, eax
xor edx, edx
add esp, 0xc
mov dword [esi + 0x3c], ecx
cmp edi, edx
jne 0x497923
mov eax, dword [ebp - 0x18]
shl eax, 4
add eax, dword [esi + 0x10]
mov edi, dword [eax + 4]
mov dword [ebp - 0x20], eax
mov dword [ebp - 8], edi
cmp dword [ebp + 0xc], edx
je 0x497703
mov eax, dword [edi + 4]
mov ecx, dword [eax]
mov eax, dword [ecx + 0x3c]
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], edx
mov ecx, dword [eax]
cmp ecx, edx
je 0x4976ff
lea edx, [ebp - 0x14]
push edx
push eax
mov eax, dword [ecx + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x4976e2
cmp dword [ebp - 0x10], eax
jl 0x4976ff
jg 0x4976e2
cmp dword [ebp - 0x14], eax
jbe 0x4976ff
mov ecx, dword [ebp + 8]
push str.output_file_already_exists
push ecx
mov eax, esi
mov edi, 1
call fcn.00432b20
add esp, 8
jmp 0x497923
or dword [esi + 0x18], 8
mov eax, ebx
call fcn.0042aea0
mov edx, dword [esi + 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + edx + 0xc]
mov edx, dword [ecx + 0x50]
push edx
mov eax, edi
call fcn.0042adb0
push 0
mov eax, ebx
call fcn.0042ae00
push eax
mov eax, edi
call fcn.0042ae00
push 0x21
mov eax, edi
call fcn.0042ae50
mov eax, dword [ebp + 8]
push str.BEGIN
push eax
push esi
call fcn.004973d0
mov edi, eax
add esp, 0x1c
test edi, edi
jne 0x497923
mov ecx, dword [ebp + 0xc]
neg ecx
sbb ecx, ecx
and ecx, 0xfffffffe
push eax
add ecx, 2
push ecx
push ebx
call fcn.00471210
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x497923
mov edx, dword [ebx + 4]
mov eax, dword [edx]
cmp byte [eax + 5], 5
jne 0x497788
mov dword [esi + 0x5c], edi
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebx + 4]
mov edi, dword [ebp - 8]
mov eax, dword [ecx + 0x20]
push 0
push edx
push edi
call fcn.00463920
add esp, 0xc
test eax, eax
jne 0x49791e
cmp dword [ebp - 0x28], eax
jne 0x4977c6
push eax
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [esi + 0x5c]
push edi
call fcn.00463920
add esp, 0xc
test eax, eax
jne 0x49791e
cmp byte [esi + 0x51], 0
jne 0x49791e
mov al, byte [esi + 0x54]
test al, al
js 0x4977dc
movsx eax, al
jmp 0x4977e3
mov eax, ebx
call fcn.0042b020
push eax
mov eax, edi
call fcn.0042afa0
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp + 8]
mov cl, byte [ebp - 0x18]
push edx
push str.SELECT_sql_FROM___w_.sqlite_master_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
push eax
mov byte [esi + 0xa4], cl
call fcn.004974c0
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x497923
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp + 8]
push ecx
push str.SELECT_sql_FROM___w_.sqlite_master_WHERE_typeindex
push edx
call fcn.004974c0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x497923
mov ecx, dword [ebp + 8]
mov byte [esi + 0xa4], al
mov eax, dword [ebp - 0xc]
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
call fcn.004974c0
and dword [esi + 0x18], 0xfffffffb
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x497923
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp + 8]
push edx
push str.INSERT_INTO_vacuum_db.sqlite_master_SELECTFROM___w_.sqlite_master_WHERE_type_IN_view_trigger__OR_typetableAND_rootpage0_
push eax
call fcn.004974c0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x497923
mov dword [ebp - 0xc], edi
jmp 0x497883
mov edi, dword [ebp - 0xc]
movzx edx, byte [edi + 0x4e1564]
lea ecx, [ebp - 0x28]
push ecx
push edx
mov eax, ebx
call fcn.0042b190
movzx eax, byte [edi + 0x4e1565]
add eax, dword [ebp - 0x28]
movzx ecx, byte [edi + 0x4e1564]
mov edx, dword [ebp - 8]
push eax
push ecx
push edx
call fcn.00434780
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x497923
mov eax, dword [ebp - 0xc]
add eax, 2
mov dword [ebp - 0xc], eax
cmp eax, 0xa
jl 0x497880
cmp dword [ebp + 0xc], edi
jne 0x4978e0
mov eax, dword [ebp - 8]
push ebx
call fcn.004824a0
mov edi, eax
add esp, 4
test edi, edi
jne 0x497923
mov eax, dword [ebp - 8]
call fcn.0047b5c0
mov edi, eax
test edi, edi
jne 0x497923
cmp dword [ebp + 0xc], eax
jne 0x497923
mov edi, dword [ebp - 8]
mov eax, edi
call fcn.0042b020
push eax
mov eax, ebx
call fcn.0042afa0
mov ecx, dword [ebp - 0x10]
mov eax, dword [edi + 4]
mov eax, dword [eax + 0x20]
push 1
push ecx
push ebx
call fcn.00463920
add esp, 0x10
mov edi, eax
jmp 0x497923
mov edi, 7
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x1c]
mov dword [esi + 0x20], eax
mov eax, dword [ebp - 0x30]
push 1
mov dword [esi + 0x18], edx
mov edx, dword [ebp - 0x2c]
mov dword [esi + 0x24], ecx
mov cl, byte [ebp - 1]
mov dword [esi + 0x68], eax
push 0xffffffffffffffff
push ebx
or eax, 0xffffffff
mov byte [esi + 0xa4], 0
mov dword [esi + 0x64], edx
mov byte [esi + 0x58], cl
call fcn.00463920
mov ebx, dword [ebp - 0x20]
add esp, 0xc
mov byte [esi + 0x4f], 1
test ebx, ebx
je 0x497979
mov eax, dword [ebx + 4]
call fcn.004800c0
xor eax, eax
mov dword [ebx + 4], eax
mov dword [ebx + 0xc], eax
mov eax, esi
call fcn.0045dd70
pop ebx
mov eax, edi
pop edi
pop esi
mov esp, ebp
pop ebp
ret