Function at 0x5c8390
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 0x5c83fa
push ebp
push 0x28
push edi
call fcn.005a9cf0
mov esi, eax
add esp, 0xc
test esi, esi
je 0x5c83d7
movups xmm0, xmmword [str.cannot_VACUUM_from_within_a_transaction]
movups xmmword [esi], xmm0
movups xmm0, xmmword [0x6929ac]
movups xmmword [esi + 0x10], xmm0
movq xmm0, qword [0x6929bc]
movq qword [esi + 0x20], xmm0
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x5c83eb
push eax
push edi
call fcn.005a9be0
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 0x5c846d
push 0
push 0x2b
push edi
call fcn.005a9cf0
mov esi, eax
add esp, 0xc
test esi, esi
je 0x5c844a
movups xmm0, xmmword [str.cannot_VACUUM___SQL_statements_in_progress]
movups xmmword [esi], xmm0
movups xmm0, xmmword [0x6929d4]
movups xmmword [esi + 0x10], xmm0
movq xmm0, qword [0x6929e4]
movq qword [esi + 0x20], xmm0
mov ax, word [0x6929ec]
mov word [esi + 0x28], ax
mov al, byte [0x6929ee]
mov byte [esi + 0x2a], al
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x5c83eb
push eax
push edi
call fcn.005a9be0
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 0x5c8536
movzx edx, word [ecx + 0x10]
mov eax, edx
and eax, 0x3f
cmp byte [eax + 0x68b830], 3
je 0x5c84e1
push 0
push 0x12
push edi
call fcn.005a9cf0
mov esi, eax
add esp, 0xc
test esi, esi
je 0x5c84ba
movups xmm0, xmmword [str.non_text_filename]
movups xmmword [esi], xmm0
mov cx, word [0x692a00]
mov word [esi + 0x10], cx
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x5c83eb
push eax
push edi
call fcn.005a9be0
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 0x5c8506
cmp byte [ecx + 0x12], 1
jne 0x5c8506
mov edx, dword [ecx + 8]
mov ecx, dword [edi + 0x3c]
and ecx, 0xfffffffe
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x5c853b
test dl, 1
je 0x5c851b
mov ecx, dword [edi + 0x3c]
xor edx, edx
and ecx, 0xfffffffe
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x5c853b
push 1
push ecx
call fcn.005ee490
mov ecx, dword [edi + 0x3c]
add esp, 8
and ecx, 0xfffffffe
mov edx, eax
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x5c853b
mov edx, 0x6a5e52
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 0x5c85c4
cmp byte [eax + 0x10], 0
mov dword [esp + 0x20], ebp
je 0x5c85cc
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.005768d0
mov ebx, eax
add esp, 0x10
mov eax, dword [esp + 0x1c]
mov dword [edi + 0x3c], eax
test ebx, ebx
jne 0x5c893c
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 0x5c86d6
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 0x5c865a
lea ecx, [esp + 0x2c]
push ecx
push eax
mov eax, dword [edx + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x5c8674
cmp dword [esp + 0x30], eax
jg 0x5c8674
jl 0x5c8653
cmp dword [esp + 0x2c], eax
ja 0x5c8674
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 [ebx + eax + 8]
mov eax, dword [edi + 0x20]
and eax, 0x38
or ebx, eax
jmp 0x5c86db
push 0
push 0x1b
push edi
mov ebx, 1
call fcn.005a9cf0
mov ebp, eax
add esp, 0xc
test ebp, ebp
je 0x5c86b7
movups xmm0, xmmword [str.output_file_already_exists]
movups xmmword [ebp], xmm0
movq xmm0, qword [0x692a2c]
movq qword [ebp + 0x10], xmm0
mov cx, word [0x692a34]
mov word [ebp + 0x18], cx
mov al, byte [0x692a36]
mov byte [ebp + 0x1a], al
mov eax, dword [esp + 0x50]
mov ecx, dword [eax]
test ecx, ecx
je 0x5c86cf
push ecx
push edi
call fcn.005a9be0
mov eax, dword [esp + 0x58]
add esp, 8
mov dword [eax], ebp
jmp 0x5c8938
mov ebx, 1
push esi
call fcn.005a2990
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.005a47b0
push 0
push esi
call fcn.005a4980
push eax
push ebp
call fcn.005a4980
or ebx, 0x20
push ebx
push ebp
call fcn.005a4930
push str.BEGIN
push dword [esp + 0x78]
push edi
call fcn.005766f0
mov ebx, eax
add esp, 0x30
test ebx, ebx
jne 0x5c8938
cmp dword [esp + 0x5c], eax
mov ecx, 2
push eax
cmove eax, ecx
push eax
push esi
call fcn.005a1970
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x5c8938
mov eax, dword [esi + 4]
mov eax, dword [eax]
cmp byte [eax + 5], 5
jne 0x5c8763
cmp dword [esp + 0x5c], ebx
jne 0x5c8763
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.005a4850
add esp, 0x10
test eax, eax
jne 0x5c8933
cmp dword [esp + 0x20], eax
jne 0x5c879d
push eax
push ebx
push dword [edi + 0x64]
push ebp
call fcn.005a4850
add esp, 0x10
test eax, eax
jne 0x5c8933
cmp byte [edi + 0x57], 0
jne 0x5c8933
mov al, byte [edi + 0x5a]
test al, al
js 0x5c87b3
movsx eax, al
jmp 0x5c87bc
push esi
call fcn.005a28e0
add esp, 4
push eax
push ebp
call fcn.005a4730
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.005768d0
mov ebx, eax
add esp, 0x18
test ebx, ebx
jne 0x5c8938
push dword [esp + 0x14]
push str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typeindex
push ebp
push edi
call fcn.005768d0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x5c8938
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.005768d0
and dword [edi + 0x18], 0xfffffffb
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x5c8938
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.005768d0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x5c8938
xor ebp, ebp
cmp byte [esi + 9], 0
mov eax, dword [esi + 4]
movzx ebx, byte [ebp + 0x68af94]
mov dword [esp + 0x2c], eax
je 0x5c887b
inc dword [esi + 0xc]
cmp byte [esi + 0xa], 0
jne 0x5c887b
push esi
call fcn.0056df20
mov eax, dword [esp + 0x30]
add esp, 4
cmp ebx, 0xf
jne 0x5c888a
mov eax, dword [eax]
mov ebx, dword [eax + 0x6c]
add ebx, dword [esi + 0x14]
jmp 0x5c8896
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 0x5c88ab
add dword [esi + 0xc], 0xffffffff
jne 0x5c88ab
push esi
call fcn.005ebdb0
add esp, 4
movzx eax, byte [ebp + 0x68af95]
add eax, ebx
push eax
movzx eax, byte [ebp + 0x68af94]
push eax
push dword [esp + 0x24]
call fcn.005a5280
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x5c8938
add ebp, 2
cmp ebp, 0xa
jl 0x5c8851
mov ebp, dword [esp + 0x1c]
cmp dword [esp + 0x5c], eax
jne 0x5c88f5
push ebp
push esi
call fcn.005a20c0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x5c8938
push ebp
call fcn.005a1ef0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x5c8938
cmp dword [esp + 0x5c], eax
jne 0x5c8938
push ebp
call fcn.005a28e0
push eax
push esi
call fcn.005a4730
push ebp
call fcn.005a2990
mov ecx, dword [ebp + 4]
push 1
push eax
push dword [ecx + 0x24]
push esi
call fcn.005a4850
add esp, 0x20
mov ebx, eax
jmp 0x5c8938
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.005a4850
add esp, 0x10
mov byte [edi + 0x55], 1
test ebp, ebp
je 0x5c89ab
push dword [ebp + 4]
call fcn.005a1b00
add esp, 4
mov dword [ebp + 4], 0
mov dword [ebp + 0xc], 0
push edi
call fcn.005c7170
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret