Function at 0x4f39c0
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 0x4f3a2a
push ebp
push 0x28
push edi
call fcn.004d5b60
mov esi, eax
add esp, 0xc
test esi, esi
je 0x4f3a07
movups xmm0, xmmword [str.cannot_VACUUM_from_within_a_transaction]
movups xmmword [esi], xmm0
movups xmm0, xmmword [0x5789f4]
movups xmmword [esi + 0x10], xmm0
movq xmm0, qword [0x578a04]
movq qword [esi + 0x20], xmm0
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x4f3a1b
push eax
push edi
call fcn.004d5a50
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 0x4f3a9d
push 0
push 0x2b
push edi
call fcn.004d5b60
mov esi, eax
add esp, 0xc
test esi, esi
je 0x4f3a7a
movups xmm0, xmmword [str.cannot_VACUUM___SQL_statements_in_progress]
movups xmmword [esi], xmm0
movups xmm0, xmmword [0x578a1c]
movups xmmword [esi + 0x10], xmm0
movq xmm0, qword [0x578a2c]
movq qword [esi + 0x20], xmm0
mov ax, word [0x578a34]
mov word [esi + 0x28], ax
mov al, byte [0x578a36]
mov byte [esi + 0x2a], al
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x4f3a1b
push eax
push edi
call fcn.004d5a50
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 0x4f3b66
movzx edx, word [ecx + 0x10]
mov eax, edx
and eax, 0x3f
cmp byte [eax + 0x571a38], 3
je 0x4f3b11
push 0
push 0x12
push edi
call fcn.004d5b60
mov esi, eax
add esp, 0xc
test esi, esi
je 0x4f3aea
movups xmm0, xmmword [str.non_text_filename]
movups xmmword [esi], xmm0
mov cx, word [0x578a48]
mov word [esi + 0x10], cx
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx]
test eax, eax
je 0x4f3a1b
push eax
push edi
call fcn.004d5a50
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 0x4f3b36
cmp byte [ecx + 0x12], 1
jne 0x4f3b36
mov edx, dword [ecx + 8]
mov ecx, dword [edi + 0x3c]
and ecx, 0xfffffffe
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x4f3b6b
test dl, 1
je 0x4f3b4b
mov ecx, dword [edi + 0x3c]
xor edx, edx
and ecx, 0xfffffffe
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x4f3b6b
push 1
push ecx
call fcn.00518f50
mov ecx, dword [edi + 0x3c]
add esp, 8
and ecx, 0xfffffffe
mov edx, eax
or ecx, 6
mov dword [edi + 0x3c], ecx
jmp 0x4f3b6b
mov edx, 0x5853d0
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 0x4f3bf4
cmp byte [eax + 0x10], 0
mov dword [esp + 0x20], ebp
je 0x4f3bfc
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.004a5cf0
mov ebx, eax
add esp, 0x10
mov eax, dword [esp + 0x1c]
mov dword [edi + 0x3c], eax
test ebx, ebx
jne 0x4f3f6c
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 0x4f3d06
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 0x4f3c8a
lea ecx, [esp + 0x2c]
push ecx
push eax
mov eax, dword [edx + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x4f3ca4
cmp dword [esp + 0x30], eax
jg 0x4f3ca4
jl 0x4f3c83
cmp dword [esp + 0x2c], eax
ja 0x4f3ca4
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 0x4f3d0b
push 0
push 0x1b
push edi
mov ebx, 1
call fcn.004d5b60
mov ebp, eax
add esp, 0xc
test ebp, ebp
je 0x4f3ce7
movups xmm0, xmmword [str.output_file_already_exists]
movups xmmword [ebp], xmm0
movq xmm0, qword [0x578a74]
movq qword [ebp + 0x10], xmm0
mov cx, word [0x578a7c]
mov word [ebp + 0x18], cx
mov al, byte [0x578a7e]
mov byte [ebp + 0x1a], al
mov eax, dword [esp + 0x50]
mov ecx, dword [eax]
test ecx, ecx
je 0x4f3cff
push ecx
push edi
call fcn.004d5a50
mov eax, dword [esp + 0x58]
add esp, 8
mov dword [eax], ebp
jmp 0x4f3f68
mov ebx, 1
push esi
call fcn.004ce950
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.004d0710
push 0
push esi
call fcn.004d08e0
push eax
push ebp
call fcn.004d08e0
or ebx, 0x20
push ebx
push ebp
call fcn.004d0890
push str.BEGIN
push dword [esp + 0x78]
push edi
call fcn.004a5b20
mov ebx, eax
add esp, 0x30
test ebx, ebx
jne 0x4f3f68
cmp dword [esp + 0x5c], eax
mov ecx, 2
push eax
cmove eax, ecx
push eax
push esi
call fcn.004cd930
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x4f3f68
mov eax, dword [esi + 4]
mov eax, dword [eax]
cmp byte [eax + 5], 5
jne 0x4f3d93
cmp dword [esp + 0x5c], ebx
jne 0x4f3d93
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.004d07b0
add esp, 0x10
test eax, eax
jne 0x4f3f63
cmp dword [esp + 0x20], eax
jne 0x4f3dcd
push eax
push ebx
push dword [edi + 0x64]
push ebp
call fcn.004d07b0
add esp, 0x10
test eax, eax
jne 0x4f3f63
cmp byte [edi + 0x57], 0
jne 0x4f3f63
mov al, byte [edi + 0x5a]
test al, al
js 0x4f3de3
movsx eax, al
jmp 0x4f3dec
push esi
call fcn.004ce8a0
add esp, 4
push eax
push ebp
call fcn.004d0690
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.004a5cf0
mov ebx, eax
add esp, 0x18
test ebx, ebx
jne 0x4f3f68
push dword [esp + 0x14]
push str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typeindex
push ebp
push edi
call fcn.004a5cf0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4f3f68
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.004a5cf0
and dword [edi + 0x18], 0xfffffffb
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4f3f68
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.004a5cf0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4f3f68
xor ebp, ebp
cmp byte [esi + 9], 0
mov eax, dword [esi + 4]
movzx ebx, byte [ebp + 0x571174]
mov dword [esp + 0x2c], eax
je 0x4f3eab
inc dword [esi + 0xc]
cmp byte [esi + 0xa], 0
jne 0x4f3eab
push esi
call fcn.0049d7c0
mov eax, dword [esp + 0x30]
add esp, 4
cmp ebx, 0xf
jne 0x4f3eba
mov eax, dword [eax]
mov ebx, dword [eax + 0x6c]
add ebx, dword [esi + 0x14]
jmp 0x4f3ec6
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 0x4f3edb
add dword [esi + 0xc], 0xffffffff
jne 0x4f3edb
push esi
call fcn.00516c80
add esp, 4
movzx eax, byte [ebp + 0x571175]
add eax, ebx
push eax
movzx eax, byte [ebp + 0x571174]
push eax
push dword [esp + 0x24]
call fcn.004d11b0
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x4f3f68
add ebp, 2
cmp ebp, 0xa
jl 0x4f3e81
mov ebp, dword [esp + 0x1c]
cmp dword [esp + 0x5c], eax
jne 0x4f3f25
push ebp
push esi
call fcn.004ce080
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4f3f68
push ebp
call fcn.004cdeb0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4f3f68
cmp dword [esp + 0x5c], eax
jne 0x4f3f68
push ebp
call fcn.004ce8a0
push eax
push esi
call fcn.004d0690
push ebp
call fcn.004ce950
mov ecx, dword [ebp + 4]
push 1
push eax
push dword [ecx + 0x24]
push esi
call fcn.004d07b0
add esp, 0x20
mov ebx, eax
jmp 0x4f3f68
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.004d07b0
add esp, 0x10
mov byte [edi + 0x55], 1
test ebp, ebp
je 0x4f3fdb
push dword [ebp + 4]
call fcn.004cdac0
add esp, 4
mov dword [ebp + 4], 0
mov dword [ebp + 0xc], 0
push edi
call fcn.004f28b0
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret