Function at 0x4589b0
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
and eax, 0xffbfffff
or eax, 0x2800
mov dword [esi + 0xc], eax
mov eax, dword [esi + 8]
push ebx
push ebp
push edi
mov edi, dword [eax + 4]
mov dword [esp + 0x24], ecx
mov ecx, dword [edi + 4]
mov dword [esp + 0x28], edx
mov edx, dword [ecx]
movzx eax, byte [edx + 0xd]
mov dword [esp + 0x18], eax
mov eax, str.ATTACH__AS_vacuum_db_
mov ecx, esi
xor ebx, ebx
call fcn.00458720
mov ebp, eax
test ebp, ebp
jne 0x458c2b
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 eax, ebx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], ebx
call fcn.00416650
call fcn.00422c60
mov eax, dword [edi + 4]
movzx edx, word [eax + 0x16]
movzx ebp, word [eax + 0x14]
sub ebp, edx
cmp byte [edi + 9], 0
mov dword [esp + 0x1c], ebp
je 0x458a5c
add dword [edi + 0xc], 0xffffffff
jne 0x458a5c
mov eax, dword [eax + 0x30]
test eax, eax
je 0x458a58
push eax
call dword [0x4df778]
add esp, 4
mov byte [edi + 0xa], 0
mov eax, dword [edi + 4]
movzx eax, word [eax + 0x14]
push 0
push ebp
push eax
push ebx
call fcn.00415300
add esp, 0x10
test eax, eax
jne 0x458c22
cmp dword [esp + 0x18], eax
jne 0x458a95
mov ecx, dword [esi + 0x24]
push eax
push ebp
push ecx
push ebx
call fcn.00415300
add esp, 0x10
test eax, eax
jne 0x458c22
cmp byte [esi + 0x1e], 0
jne 0x458c22
mov eax, str.PRAGMA_vacuum_db.synchronousOFF
mov ecx, esi
call fcn.00458720
mov ebp, eax
test ebp, ebp
jne 0x458c27
mov al, byte [esi + 0x21]
test al, al
jl 0x458ac1
movsx eax, al
jmp 0x458ac8
mov eax, edi
call fcn.004154b0
push eax
mov eax, ebx
call fcn.00415440
add esp, 4
mov eax, str.BEGIN_EXCLUSIVE_
mov ecx, esi
call fcn.00458720
mov ebp, eax
test ebp, ebp
jne 0x458c27
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.004587a0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x458c27
push esi
mov eax, str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
call fcn.004587a0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x458c27
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.004587a0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x458c27
push esi
mov eax, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM_main.__quote_name____FROM_main.sqlite_master_WHERE_type__table_AND_name_sqlite_sequence___AND_rootpage_0
call fcn.004587a0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x458c27
push esi
mov eax, str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
call fcn.004587a0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x458c27
push esi
mov eax, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM_main.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
call fcn.004587a0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x458c27
mov eax, str.INSERT_INTO_vacuum_db.sqlite_master___SELECT_type__name__tbl_name__rootpage__sql____FROM_main.sqlite_master___WHERE_typeview_OR_typetrigger______OR__typetable_AND_rootpage0_
mov ecx, esi
call fcn.00458720
mov ebp, eax
test ebp, ebp
jne 0x458c27
xor ebx, ebx
movzx eax, byte [ebx + 0x4c6a4c]
lea edx, [esp + 0x18]
push edx
push eax
mov eax, edi
call fcn.0041ab20
movzx ecx, byte [ebx + 0x4c6a4d]
add ecx, dword [esp + 0x20]
movzx edx, byte [ebx + 0x4c6a4c]
mov eax, dword [esp + 0x1c]
push ecx
push edx
call fcn.0041ab80
mov ebp, eax
add esp, 0x10
test ebp, ebp
jne 0x458c27
add ebx, 2
cmp ebx, 8
jl 0x458b91
mov ebx, dword [esp + 0x14]
push ebx
push edi
call fcn.00456330
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x458c27
mov eax, ebx
call fcn.00416650
mov ebp, eax
test ebp, ebp
jne 0x458c27
mov eax, ebx
call fcn.004154b0
push eax
mov eax, edi
call fcn.00415440
mov eax, dword [ebx + 4]
movzx eax, word [eax + 0x14]
mov ecx, dword [esp + 0x20]
add esp, 4
push 1
push ecx
push eax
push edi
call fcn.00415300
add esp, 0x10
mov ebp, eax
jmp 0x458c27
mov ebp, 7
mov ebx, dword [esp + 0x10]
test ebx, ebx
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
je 0x458c58
mov eax, dword [ebx + 4]
call fcn.004150d0
xor eax, eax
mov dword [ebx + 4], eax
mov dword [ebx + 0xc], eax
push 0
push esi
call fcn.004251e0
add esp, 8
pop edi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x20
ret