Function at 0x477370
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov eax, dword [0x519008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, edx
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp + 8]
push edi
mov dword [ebp - 0x30], edx
cmp byte [esi + 0x4f], 0
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x34], 0
jne 0x4773c6
push str.cannot_VACUUM_from_within_a_transaction
mov edx, esi
call fcn.004eca80
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403d8c
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0xac], 1
jle 0x4773f4
push str.cannot_VACUUM___SQL_statements_in_progress
mov edx, esi
call fcn.004eca80
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403d8c
mov esp, ebp
pop ebp
ret
mov edi, dword [esi + 0x3c]
mov dword [ebp - 0xc], edi
test ebx, ebx
je 0x47748a
movzx edx, word [ebx + 8]
mov eax, edx
and eax, 0x3f
cmp byte [eax + 0x50a370], 3
je 0x477439
push str.non_text_filename
mov edx, esi
call fcn.004eca80
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403d8c
mov esp, ebp
pop ebp
ret
mov eax, edx
and eax, 0x202
cmp eax, 0x202
jne 0x47745d
cmp byte [ebx + 0xa], 1
jne 0x47745d
mov edx, dword [ebx + 0x10]
mov eax, edi
and eax, 0xfffffffe
or eax, 6
mov dword [esi + 0x3c], eax
jmp 0x47748f
test dl, 1
je 0x477471
mov eax, edi
xor edx, edx
and eax, 0xfffffffe
or eax, 6
mov dword [esi + 0x3c], eax
jmp 0x47748f
mov dl, 1
mov ecx, ebx
call fcn.004c8f40
mov edx, eax
mov eax, dword [esi + 0x3c]
and eax, 0xfffffffe
or eax, 6
mov dword [esi + 0x3c], eax
jmp 0x47748f
mov edx, 0x503d60
mov eax, dword [esi + 0x18]
mov edi, dword [esi + 0x24]
mov ebx, dword [esi + 0x20]
mov ecx, dword [esi + 0x64]
mov dword [ebp - 0x38], eax
or eax, 6
mov dword [esi + 0x24], edi
mov dword [esi + 0x18], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x3c], ebx
and ebx, 0xefffaf7f
mov dword [ebp - 0x40], edi
or ebx, 0x201
mov edi, dword [ebp - 0x30]
mov dword [ebp - 0x44], ecx
mov ecx, dword [esi + 0x68]
shl edi, 4
mov dword [esi + 0x20], ebx
mov dword [ebp - 0x48], ecx
mov cl, byte [esi + 0x58]
mov byte [esi + 0x58], 0
mov ebx, dword [edi + eax]
mov dword [ebp - 0x20], ebx
mov ebx, dword [edi + eax + 4]
push edx
mov byte [ebp - 0x16], cl
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebx + 4]
push str.ATTACH__Q_AS_vacuum_db
push ecx
push esi
mov eax, dword [eax]
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x28], ebx
mov al, byte [eax + 0xc]
mov byte [ebp - 0x15], al
mov eax, dword [esi + 0x14]
mov dword [ebp - 0x2c], eax
call fcn.00477940
mov edi, eax
add esp, 0x10
mov eax, dword [ebp - 0xc]
mov dword [esi + 0x3c], eax
test edi, edi
jne 0x4777d5
mov eax, dword [ebp - 0x2c]
shl eax, 4
add eax, dword [esi + 0x10]
cmp dword [ebp - 0x24], 0
mov dword [ebp - 0x34], eax
mov edi, dword [eax + 4]
mov dword [ebp - 0x1c], edi
je 0x47758d
mov eax, dword [edi + 4]
mov eax, dword [eax]
mov eax, dword [eax + 0x3c]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
mov ecx, dword [eax]
test ecx, ecx
je 0x477589
lea edx, [ebp - 0x10]
push edx
push eax
mov eax, dword [ecx + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x47756d
cmp dword [ebp - 0xc], eax
jl 0x477589
jg 0x47756d
cmp dword [ebp - 0x10], eax
jbe 0x477589
mov ecx, dword [ebp - 0x14]
mov edx, esi
push str.output_file_already_exists
mov edi, 1
call fcn.004eca80
add esp, 4
jmp 0x4777d5
or dword [esi + 0x18], 8
mov cl, byte [ebx + 9]
test cl, cl
je 0x4775a7
inc dword [ebx + 0xc]
cmp byte [ebx + 0xa], 0
jne 0x4775a7
mov ecx, ebx
call fcn.004d7980
mov cl, byte [ebx + 9]
mov eax, dword [ebx + 4]
mov edx, dword [eax + 0x20]
sub edx, dword [eax + 0x24]
mov dword [ebp - 0xc], edx
test cl, cl
je 0x4775c4
add dword [ebx + 0xc], 0xffffffff
jne 0x4775c4
mov ecx, ebx
call fcn.004d7a40
mov eax, dword [esi + 0x10]
mov ecx, edi
mov edx, dword [ebp - 0x30]
mov edx, dword [edx + eax + 0xc]
mov edx, dword [edx + 0x50]
call fcn.004d4cb0
xor edx, edx
mov ecx, ebx
call fcn.004d4c00
mov edx, eax
mov ecx, edi
call fcn.004d4c00
mov edx, 0x21
mov ecx, edi
call fcn.004d4af0
mov edx, dword [ebp - 0x14]
mov ecx, esi
push str.BEGIN
call fcn.004779d0
mov edi, eax
add esp, 4
test edi, edi
jne 0x4777d5
mov edx, dword [ebp - 0x24]
mov ecx, ebx
neg edx
push eax
sbb edx, edx
and edx, 0xfffffffe
add edx, 2
call fcn.004d4060
mov edi, eax
add esp, 4
test edi, edi
jne 0x4777d5
mov edx, dword [ebx + 4]
mov eax, dword [edx]
cmp byte [eax + 5], 5
jne 0x477645
mov dword [esi + 0x5c], edi
mov edx, dword [ebx + 4]
mov edi, dword [ebp - 0x1c]
mov ecx, edi
mov edx, dword [edx + 0x20]
push 0
push dword [ebp - 0xc]
call fcn.004d4a20
add esp, 8
test eax, eax
jne 0x4777cb
cmp byte [ebp - 0x15], al
jne 0x477680
mov edx, dword [esi + 0x5c]
mov ecx, edi
push eax
push dword [ebp - 0xc]
call fcn.004d4a20
add esp, 8
test eax, eax
jne 0x4777cb
cmp byte [esi + 0x51], 0
jne 0x4777cb
mov al, byte [esi + 0x54]
test al, al
js 0x477696
movsx eax, al
jmp 0x47769d
mov ecx, ebx
call fcn.004d4830
mov edx, eax
mov ecx, edi
call fcn.004d4880
push dword [ebp - 0x20]
mov eax, dword [ebp - 0x2c]
push str.SELECT_sql_FROM___w_.sqlite_master_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
push dword [ebp - 0x14]
mov byte [esi + 0xa4], al
push esi
call fcn.00477940
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x4777d5
push dword [ebp - 0x20]
push str.SELECT_sql_FROM___w_.sqlite_master_WHERE_typeindex
push dword [ebp - 0x14]
push esi
call fcn.00477940
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x4777d5
push dword [ebp - 0x20]
mov byte [esi + 0xa4], al
push str.SELECTINSERT_INTO_vacuum_db.quote_name__SELECTFROM__w_.quote_name_FROM_vacuum_db.sqlite_master_WHERE_typetableAND_coalesce_rootpage_1__0
push dword [ebp - 0x14]
push esi
call fcn.00477940
and dword [esi + 0x18], 0xfffffffb
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x4777d5
push dword [ebp - 0x20]
push str.INSERT_INTO_vacuum_db.sqlite_master_SELECTFROM___w_.sqlite_master_WHERE_type_IN_view_trigger__OR_typetableAND_rootpage0_
push dword [ebp - 0x14]
push esi
call fcn.00477940
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x4777d5
xor ebx, ebx
movzx edx, byte [ebx + 0x5051d4]
lea eax, [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
push eax
call fcn.004cca40
movzx eax, byte [ebx + 0x5051d5]
add esp, 4
add eax, dword [ebp - 0x2c]
movzx edx, byte [ebx + 0x5051d4]
mov ecx, dword [ebp - 0x1c]
push eax
call fcn.004cc990
mov edi, eax
add esp, 4
test edi, edi
jne 0x4777d2
add ebx, 2
cmp ebx, 0xa
jl 0x477733
mov ebx, dword [ebp - 0x28]
cmp dword [ebp - 0x24], eax
jne 0x47778c
mov edx, dword [ebp - 0x1c]
mov ecx, ebx
call fcn.004ca3b0
mov edi, eax
test edi, edi
jne 0x4777d5
mov ecx, dword [ebp - 0x1c]
call fcn.004d32f0
mov edi, eax
test edi, edi
jne 0x4777d5
cmp dword [ebp - 0x24], eax
jne 0x4777d5
mov edi, dword [ebp - 0x1c]
mov ecx, edi
call fcn.004d4830
mov edx, eax
mov ecx, ebx
call fcn.004d4880
mov eax, dword [edi + 4]
mov ecx, ebx
push 1
push dword [ebp - 0xc]
mov edx, dword [eax + 0x20]
call fcn.004d4a20
add esp, 8
mov edi, eax
jmp 0x4777d5
mov edi, 7
jmp 0x4777d5
mov ebx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x38]
or edx, 0xffffffff
mov dword [esi + 0x18], eax
mov ecx, ebx
mov eax, dword [ebp - 0x3c]
mov dword [esi + 0x20], eax
mov eax, dword [ebp - 0x40]
mov dword [esi + 0x24], eax
mov eax, dword [ebp - 0x44]
mov dword [esi + 0x64], eax
mov eax, dword [ebp - 0x48]
mov dword [esi + 0x68], eax
mov al, byte [ebp - 0x16]
push 1
push 0xffffffffffffffff
mov byte [esi + 0xa4], 0
mov byte [esi + 0x58], al
call fcn.004d4a20
mov ebx, dword [ebp - 0x34]
add esp, 8
mov byte [esi + 0x4f], 1
test ebx, ebx
je 0x477832
mov ecx, dword [ebx + 4]
call fcn.004d4d30
mov dword [ebx + 4], 0
mov dword [ebx + 0xc], 0
mov ecx, esi
call fcn.004a1440
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00403d8c
mov esp, ebp
pop ebp
ret