Function at 0x4bd100
Capabilities:
Reference sql statements

Disassembly:
sub esp, 0x20
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 0x3c]
mov edx, dword [esi + 0x40]
mov dword [esp + 0x14], eax
or eax, 0x2800
mov dword [esi + 0xc], eax
mov eax, dword [esi + 8]
push ebx
push ebp
mov ebp, dword [eax + 4]
mov dword [esp + 0x20], ecx
mov ecx, dword [ebp + 4]
mov dword [esp + 0x24], edx
mov edx, dword [ecx]
movzx eax, byte [edx + 0xd]
mov dword [esp + 0xc], eax
push edi
mov eax, str.ATTACH__AS_vacuum_db_
mov ecx, esi
xor ebx, ebx
call fcn.004bce10
mov edi, eax
test edi, edi
jne 0x4bd389
mov ecx, dword [esi + 4]
mov edx, dword [esi + 8]
shl ecx, 4
mov ebx, dword [ecx + edx - 0xc]
lea eax, [ecx + edx]
lea ecx, [eax - 0x10]
mov edi, ebp
mov dword [esp + 0xc], ecx
mov dword [esp + 0x14], ebx
call fcn.00482530
mov eax, dword [ebp + 4]
movzx edx, word [eax + 0x16]
movzx edi, word [eax + 0x14]
sub edi, edx
cmp byte [ebp + 9], 0
mov dword [esp + 0x1c], edi
je 0x4bd1a2
add dword [ebp + 0xc], 0xffffffff
jne 0x4bd1a2
mov eax, dword [eax + 0x30]
test eax, eax
je 0x4bd19e
push eax
call dword [0x513bb8]
add esp, 4
mov byte [ebp + 0xa], 0
mov eax, dword [ebp + 4]
movzx eax, word [eax + 0x14]
push 0
push edi
push ebx
call fcn.00484270
add esp, 0xc
test eax, eax
jne 0x4bd380
cmp dword [esp + 0x10], eax
jne 0x4bd1d9
push eax
mov eax, dword [esi + 0x24]
push edi
push ebx
call fcn.00484270
add esp, 0xc
test eax, eax
jne 0x4bd380
cmp byte [esi + 0x1e], 0
jne 0x4bd380
mov eax, str.PRAGMA_vacuum_db.synchronousOFF
mov ecx, esi
call fcn.004bce10
mov edi, eax
test edi, edi
jne 0x4bd385
mov al, byte [esi + 0x21]
test al, al
jl 0x4bd205
movsx eax, al
jmp 0x4bd20c
mov eax, ebp
call fcn.00484410
push eax
mov eax, ebx
call fcn.004843a0
add esp, 4
mov eax, str.BEGIN_EXCLUSIVE_
mov ecx, esi
call fcn.004bce10
mov edi, eax
test edi, edi
jne 0x4bd385
push esi
mov eax, str.SELECT_CREATE_TABLE_vacuum_db.__substr_sql_14____FROM_sqlite_master_WHERE_typetable_AND_name_sqlite_sequence___AND_rootpage_0
call fcn.004bce70
mov edi, eax
add esp, 4
test edi, edi
jne 0x4bd385
push esi
mov eax, str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
call fcn.004bce70
mov edi, eax
add esp, 4
test edi, edi
jne 0x4bd385
push esi
mov eax, str.SELECT_CREATE_UNIQUE_INDEX_vacuum_db.__substr_sql_21____FROM_sqlite_master_WHERE_sql_LIKE_CREATE_UNIQUE_INDEX__
call fcn.004bce70
mov edi, eax
add esp, 4
test edi, edi
jne 0x4bd385
push esi
mov eax, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM___quote_name____FROM_sqlite_master_WHERE_type__table_AND_name_sqlite_sequence___AND_rootpage_0
call fcn.004bce70
mov edi, eax
add esp, 4
test edi, edi
jne 0x4bd385
push esi
mov eax, str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
call fcn.004bce70
mov edi, eax
add esp, 4
test edi, edi
jne 0x4bd385
push esi
mov eax, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM___quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
call fcn.004bce70
mov edi, eax
add esp, 4
test edi, edi
jne 0x4bd385
mov eax, str.INSERT_INTO_vacuum_db.sqlite_master___SELECT_type__name__tbl_name__rootpage__sql____FROM_sqlite_master___WHERE_typeview_OR_typetrigger______OR__typetable_AND_rootpage0_
mov ecx, esi
call fcn.004bce10
mov edi, eax
test edi, edi
jne 0x4bd385
mov dword [esp + 0x10], edi
jmp 0x4bd2e4
mov edi, dword [esp + 0x10]
movzx edx, byte [edi + 0x4f1a68]
lea ecx, [esp + 0x18]
push ecx
push edx
mov eax, ebp
call fcn.00489ac0
movzx eax, byte [edi + 0x4f1a69]
add eax, dword [esp + 0x20]
movzx ebx, byte [edi + 0x4f1a68]
push eax
mov eax, dword [esp + 0x20]
call fcn.00489b30
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x4bd385
mov eax, dword [esp + 0x10]
add eax, 2
cmp eax, 8
mov dword [esp + 0x10], eax
jl 0x4bd2e0
mov ecx, dword [esp + 0x14]
push ecx
mov ebx, ebp
call fcn.0048b560
mov edi, eax
add esp, 4
test edi, edi
jne 0x4bd385
mov ebx, dword [esp + 0x14]
mov eax, ebx
call fcn.00485580
mov edi, eax
test edi, edi
jne 0x4bd385
mov eax, ebx
call fcn.00484410
push eax
mov eax, ebp
call fcn.004843a0
mov edx, dword [ebx + 4]
mov ecx, dword [esp + 0x20]
movzx eax, word [edx + 0x14]
add esp, 4
push 1
push ecx
push ebp
call fcn.00484270
add esp, 0xc
mov edi, eax
jmp 0x4bd385
mov edi, 7
mov ebx, dword [esp + 0xc]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov dword [esi + 0xc], edx
mov dword [esi + 0x3c], eax
mov dword [esi + 0x40], ecx
mov byte [esi + 0x1c], 1
test ebx, ebx
je 0x4bd3b6
mov eax, dword [ebx + 4]
call fcn.00484050
xor eax, eax
mov dword [ebx + 4], eax
mov dword [ebx + 0xc], eax
push 0
mov ebx, esi
call fcn.004a0ca0
add esp, 4
mov eax, edi
pop edi
pop ebp
pop ebx
add esp, 0x20
ret