Function at 0x520e60
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x3c
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x54]
xor ebp, ebp
cmp byte [edi + 0x55], 0
jne 0x520eca
push ebp
push 0x28
push edi
call fcn.00503030
mov esi, eax
add esp, 0xc
test esi, esi
je 0x520ea7
movups xmm0, xmmword [str.cannot_VACUUM_from_within_a_transaction]
movups xmmword [esi], xmm0
movups xmm0, xmmword [0x6f02cc]
movups xmmword [esi + 0x10], xmm0
movq xmm0, qword [0x6f02dc]
movq qword [esi + 0x20], xmm0
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x520ebb
push eax
push edi
call fcn.00502f20
add esp, 8
pop edi
mov dword [ebx], esi
mov eax, 1
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
cmp dword [edi + 0xbc], 1
jle 0x520f3d
push 0
push 0x2b
push edi
call fcn.00503030
mov esi, eax
add esp, 0xc
test esi, esi
je 0x520f1a
movups xmm0, xmmword [str.cannot_VACUUM___SQL_statements_in_progress]
movups xmmword [esi], xmm0
movups xmm0, xmmword [0x6f02f4]
movups xmmword [esi + 0x10], xmm0
movq xmm0, qword [0x6f0304]
movq qword [esi + 0x20], xmm0
mov ax, word [0x6f030c]
mov word [esi + 0x28], ax
mov al, byte [0x6f030e]
mov byte [esi + 0x2a], al
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x520ebb
push eax
push edi
call fcn.00502f20
add esp, 8
mov dword [ebx], esi
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov ecx, dword [esp + 0x5c]
mov eax, dword [edi + 0x3c]
mov dword [esp + 0x1c], eax
test ecx, ecx
je 0x521006
movzx edx, word [ecx + 0x10]
mov eax, edx
and eax, 0x3f
cmp byte [eax + 0x6e9250], 3
je 0x520fb1
push 0
push 0x12
push edi
call fcn.00503030
mov esi, eax
add esp, 0xc
test esi, esi
je 0x520f8a
movups xmm0, xmmword [str.non_text_filename]
movups xmmword [esi], xmm0
mov cx, word [0x6f0320]
mov word [esi + 0x10], cx
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x520ebb
push eax
push edi
call fcn.00502f20
add esp, 8
mov dword [ebx], esi
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov eax, edx
and eax, 0x202
cmp eax, 0x202
jne 0x520fd6
cmp byte [ecx + 0x12], 1
jne 0x520fd6
mov edx, dword [ecx + 8]
mov ecx, dword [edi + 0x3c]
and ecx, 0xfffffffe
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x52100b
test dl, 1
je 0x520feb
mov ecx, dword [edi + 0x3c]
xor edx, edx
and ecx, 0xfffffffe
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x52100b
push 1
push ecx
call fcn.005463e0
mov ecx, dword [edi + 0x3c]
add esp, 8
and ecx, 0xfffffffe
mov edx, eax
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x52100b
mov edx, 0x774272
mov ecx, dword [edi + 0x20]
mov ebx, dword [edi + 0x24]
mov eax, dword [edi + 0x18]
mov esi, dword [edi + 0x68]
mov dword [esp + 0x38], ecx
and ecx, 0xefffafff
or ecx, 0x201
mov dword [esp + 0x28], ebx
mov bl, byte [edi + 0x5e]
mov dword [edi + 0x20], ecx
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x34], eax
or eax, 6
mov dword [edi + 0x18], eax
mov eax, dword [edi + 0x10]
mov dword [esp + 0x3c], esi
mov esi, dword [edi + 0x6c]
mov byte [esp + 0x54], bl
mov ebx, dword [esp + 0x28]
shl ecx, 4
and ebx, 0xfffffffe
mov dword [esp + 0x40], esi
mov esi, dword [edi + 0x70]
mov dword [edi + 0x24], ebx
mov byte [edi + 0x5e], 0
mov ebx, dword [ecx + eax]
mov dword [esp + 0x44], esi
mov esi, dword [edi + 0x74]
mov dword [esp + 0x48], esi
mov esi, dword [ecx + eax + 4]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], ebx
mov eax, dword [esi + 4]
mov eax, dword [eax]
cmp byte [eax + 0xc], 0
jne 0x521094
cmp byte [eax + 0x10], 0
mov dword [esp + 0x20], ebp
je 0x52109c
mov dword [esp + 0x20], 1
mov eax, dword [edi + 0x14]
push edx
push str.ATTACH__Q_AS_vacuum_db
push dword [esp + 0x58]
mov dword [esp + 0x30], eax
push edi
call fcn.004d31d0
mov ebx, eax
add esp, 0x10
mov eax, dword [esp + 0x1c]
mov dword [edi + 0x3c], eax
test ebx, ebx
jne 0x52140c
mov eax, dword [esp + 0x24]
shl eax, 4
add eax, dword [edi + 0x10]
mov dword [esp + 0x10], eax
mov ebp, dword [eax + 4]
mov dword [esp + 0x1c], ebp
cmp dword [esp + 0x5c], ebx
je 0x5211a6
mov eax, dword [ebp + 4]
xorps xmm0, xmm0
mov ebx, dword [esp + 0x18]
mov ecx, ebx
mov eax, dword [eax]
mov eax, dword [eax + 0x40]
movlpd qword [esp + 0x2c], xmm0
mov edx, dword [eax]
test edx, edx
je 0x52112a
lea ecx, [esp + 0x2c]
push ecx
push eax
mov eax, dword [edx + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x521144
cmp dword [esp + 0x30], eax
jg 0x521144
jl 0x521123
cmp dword [esp + 0x2c], eax
ja 0x521144
mov ecx, dword [esp + 0x58]
shl ecx, 4
mov eax, dword [edi + 0x10]
or dword [edi + 0x18], 8
mov dword [esp + 0x18], ecx
movzx ebx, byte [eax + ebx + 8]
mov eax, dword [edi + 0x20]
and eax, 0x38
or ebx, eax
jmp 0x5211ab
push 0
push 0x1b
push edi
mov ebx, 1
call fcn.00503030
mov ebp, eax
add esp, 0xc
test ebp, ebp
je 0x521187
movups xmm0, xmmword [str.output_file_already_exists]
movups xmmword [ebp], xmm0
movq xmm0, qword [0x6f034c]
movq qword [ebp + 0x10], xmm0
mov cx, word [0x6f0354]
mov word [ebp + 0x18], cx
mov al, byte [0x6f0356]
mov byte [ebp + 0x1a], al
mov eax, dword [esp + 0x50]
mov ecx, dword [eax]
test ecx, ecx
je 0x52119f
push ecx
push edi
call fcn.00502f20
mov eax, dword [esp + 0x58]
add esp, 8
mov dword [eax], ebp
jmp 0x521408
mov ebx, 1
push esi
call fcn.004fbe20
mov ecx, dword [edi + 0x10]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x1c]
mov ecx, dword [ecx + eax + 0xc]
push dword [ecx + 0x50]
push ebp
call fcn.004fdbe0
push 0
push esi
call fcn.004fddb0
push eax
push ebp
call fcn.004fddb0
or ebx, 0x20
push ebx
push ebp
call fcn.004fdd60
push str.BEGIN
push dword [esp + 0x78]
push edi
call fcn.004d3000
mov ebx, eax
add esp, 0x30
test ebx, ebx
jne 0x521408
cmp dword [esp + 0x5c], eax
mov ecx, 2
push eax
cmove eax, ecx
push eax
push esi
call fcn.004fae00
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x521408
mov eax, dword [esi + 4]
mov eax, dword [eax]
cmp byte [eax + 5], 5
jne 0x521233
cmp dword [esp + 0x5c], ebx
jne 0x521233
mov dword [edi + 0x64], ebx
mov eax, dword [esi + 4]
mov ebx, dword [esp + 0x2c]
push 0
push ebx
push dword [eax + 0x24]
push ebp
call fcn.004fdc80
add esp, 0x10
test eax, eax
jne 0x521403
cmp dword [esp + 0x20], eax
jne 0x52126d
push eax
push ebx
push dword [edi + 0x64]
push ebp
call fcn.004fdc80
add esp, 0x10
test eax, eax
jne 0x521403
cmp byte [edi + 0x57], 0
jne 0x521403
mov al, byte [edi + 0x5a]
test al, al
js 0x521283
movsx eax, al
jmp 0x52128c
push esi
call fcn.004fbd70
add esp, 4
push eax
push ebp
call fcn.004fdb60
push dword [esp + 0x1c]
mov ebp, dword [esp + 0x5c]
mov eax, dword [esp + 0x30]
push str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
push ebp
push edi
mov byte [edi + 0xb0], al
call fcn.004d31d0
mov ebx, eax
add esp, 0x18
test ebx, ebx
jne 0x521408
push dword [esp + 0x14]
push str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typeindex
push ebp
push edi
call fcn.004d31d0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x521408
push dword [esp + 0x14]
mov byte [edi + 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 ebp
push edi
call fcn.004d31d0
and dword [edi + 0x18], 0xfffffffb
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x521408
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 ebp
push edi
call fcn.004d31d0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x521408
xor ebp, ebp
cmp byte [esi + 9], 0
mov eax, dword [esi + 4]
movzx ebx, byte [ebp + 0x6e898c]
mov dword [esp + 0x2c], eax
je 0x52134b
inc dword [esi + 0xc]
cmp byte [esi + 0xa], 0
jne 0x52134b
push esi
call fcn.004cacd0
mov eax, dword [esp + 0x30]
add esp, 4
cmp ebx, 0xf
jne 0x52135a
mov eax, dword [eax]
mov ebx, dword [eax + 0x6c]
add ebx, dword [esi + 0x14]
jmp 0x521366
mov eax, dword [eax + 0xc]
mov eax, dword [eax + 0x38]
mov ebx, dword [eax + ebx*4 + 0x24]
bswap ebx
cmp byte [esi + 9], 0
je 0x52137b
add dword [esi + 0xc], 0xffffffff
jne 0x52137b
push esi
call fcn.00544110
add esp, 4
movzx eax, byte [ebp + 0x6e898d]
add eax, ebx
push eax
movzx eax, byte [ebp + 0x6e898c]
push eax
push dword [esp + 0x24]
call fcn.004fe680
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x521408
add ebp, 2
cmp ebp, 0xa
jl 0x521321
mov ebp, dword [esp + 0x1c]
cmp dword [esp + 0x5c], eax
jne 0x5213c5
push ebp
push esi
call fcn.004fb550
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x521408
push ebp
call fcn.004fb380
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x521408
cmp dword [esp + 0x5c], eax
jne 0x521408
push ebp
call fcn.004fbd70
push eax
push esi
call fcn.004fdb60
push ebp
call fcn.004fbe20
mov ecx, dword [ebp + 4]
push 1
push eax
push dword [ecx + 0x24]
push esi
call fcn.004fdc80
add esp, 0x20
mov ebx, eax
jmp 0x521408
mov ebx, 7
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x34]
mov dword [edi + 0x18], eax
mov eax, dword [esp + 0x38]
mov dword [edi + 0x20], eax
mov eax, dword [esp + 0x28]
mov dword [edi + 0x24], eax
mov eax, dword [esp + 0x3c]
mov dword [edi + 0x68], eax
mov eax, dword [esp + 0x40]
mov dword [edi + 0x6c], eax
mov eax, dword [esp + 0x44]
push 1
mov dword [edi + 0x70], eax
mov eax, dword [esp + 0x4c]
push 0
mov dword [edi + 0x74], eax
mov al, byte [esp + 0x5c]
push 0xffffffffffffffff
push esi
mov byte [edi + 0xb0], 0
mov byte [edi + 0x5e], al
call fcn.004fdc80
add esp, 0x10
mov byte [edi + 0x55], 1
test ebp, ebp
je 0x52147b
push dword [ebp + 4]
call fcn.004faf90
add esp, 4
mov dword [ebp + 4], 0
mov dword [ebp + 0xc], 0
push edi
call fcn.0051fd50
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret