Function at 0x100662c0
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
mov dword [ebp - 0x18], eax
or eax, 0x2800
mov dword [esi + 0xc], eax
mov eax, dword [esi + 8]
push ebx
mov dword [ebp - 0x1c], ecx
push edi
mov edi, dword [eax + 4]
mov ecx, dword [edi + 4]
mov dword [ebp - 0x20], edx
mov edx, dword [ecx]
mov eax, dword [edx + 0x38]
xor ecx, ecx
cmp dword [eax], ecx
mov eax, str.ATTACH__AS_vacuum_db_
sete cl
mov dword [ebp - 0x10], 0
mov dword [ebp - 8], ecx
mov ecx, esi
call fcn.10065f20
mov ebx, eax
test ebx, ebx
jne 0x1006654b
mov eax, dword [esi + 4]
lea edx, [eax + eax*2]
mov eax, dword [esi + 8]
lea eax, [eax + edx*8]
mov edx, dword [eax - 0x14]
lea ecx, [eax - 0x18]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 4], edx
call fcn.10025aa0
mov eax, dword [edi + 4]
movzx ecx, word [eax + 0x16]
movzx ebx, word [eax + 0x14]
sub ebx, ecx
cmp byte [edi + 9], 0
mov dword [ebp - 0xc], ebx
je 0x10066364
dec dword [edi + 0xc]
jne 0x10066364
mov eax, dword [eax + 0x30]
test eax, eax
je 0x10066360
push eax
call dword [0x100a6698]
add esp, 4
mov byte [edi + 0xa], 0
mov edx, dword [edi + 4]
movzx eax, word [edx + 0x14]
push 0
push ebx
mov ebx, dword [ebp - 4]
push eax
call fcn.10027a60
add esp, 0xc
test eax, eax
jne 0x10066546
cmp dword [ebp - 8], eax
jne 0x100663a0
mov ecx, dword [esi + 0x24]
push eax
mov eax, dword [ebp - 0xc]
push eax
push ecx
call fcn.10027a60
add esp, 0xc
test eax, eax
jne 0x10066546
cmp byte [esi + 0x1e], 0
jne 0x10066546
mov eax, str.PRAGMA_vacuum_db.synchronousOFF
mov ecx, esi
call fcn.10065f20
mov ebx, eax
test ebx, ebx
jne 0x1006654b
mov al, byte [esi + 0x21]
test al, al
js 0x100663cc
movsx eax, al
jmp 0x100663d3
mov eax, edi
call fcn.10027c10
push eax
mov eax, dword [ebp - 4]
call fcn.10027b90
add esp, 4
mov eax, str.BEGIN_EXCLUSIVE_
mov ecx, esi
call fcn.10065f20
mov ebx, eax
test ebx, ebx
jne 0x1006654b
push str.SELECT_CREATE_TABLE_vacuum_db.__substr_sql_14____FROM_sqlite_master_WHERE_typetable_AND_name_sqlite_sequence___AND_rootpage_0
push esi
call fcn.10065ff0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1006654b
push str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
push esi
call fcn.10065ff0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1006654b
push str.SELECT_CREATE_UNIQUE_INDEX_vacuum_db.__substr_sql_21____FROM_sqlite_master_WHERE_sql_LIKE_CREATE_UNIQUE_INDEX__
push esi
call fcn.10065ff0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1006654b
push 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
push esi
call fcn.10065ff0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1006654b
push str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
push esi
call fcn.10065ff0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1006654b
push str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM___quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
push esi
call fcn.10065ff0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1006654b
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.10065f20
mov ebx, eax
test ebx, ebx
jne 0x1006654b
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
movzx ebx, byte [eax + 0x1009a2b0]
lea edx, [ebp - 0x14]
push edx
mov eax, edi
call fcn.1002ee30
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x1006654b
mov eax, dword [ebp - 8]
movzx ecx, byte [eax + 0x1009a2b1]
add ecx, dword [ebp - 0x14]
movzx edx, byte [eax + 0x1009a2b0]
mov eax, dword [ebp - 4]
push ecx
push edx
call fcn.1002efa0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1006654b
mov eax, dword [ebp - 8]
add eax, 2
mov dword [ebp - 8], eax
cmp eax, 8
jl 0x1006649e
mov ebx, dword [ebp - 4]
push edi
call fcn.10031370
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x1006654b
mov eax, dword [ebp - 4]
call fcn.10028da0
mov ebx, eax
test ebx, ebx
jne 0x1006654b
mov ebx, dword [ebp - 4]
mov eax, ebx
call fcn.10027c10
push eax
mov eax, edi
call fcn.10027b90
mov eax, dword [ebx + 4]
movzx eax, word [eax + 0x14]
mov ecx, dword [ebp - 0xc]
add esp, 4
push 1
push ecx
push eax
mov ebx, edi
call fcn.10027a60
add esp, 0xc
mov ebx, eax
jmp 0x1006654b
mov ebx, 7
mov edi, dword [ebp - 0x10]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
mov dword [esi + 0xc], edx
mov dword [esi + 0x44], eax
mov dword [esi + 0x48], ecx
mov byte [esi + 0x1c], 1
test edi, edi
je 0x10066578
mov eax, dword [edi + 4]
call fcn.10027830
xor eax, eax
mov dword [edi + 4], eax
mov dword [edi + 0x14], eax
push 0
mov eax, esi
call fcn.10047d80
add esp, 4
pop edi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret