Function at 0x1008bba0
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xac
push ebx
mov ebx, eax
mov eax, 0x100af3b4
push esi
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov eax, dword [ebp + 8]
push edi
mov edi, dword [ebx + eax*4 + 0x38]
xor esi, esi
test edi, edi
mov dword [esp + 0x18], str.DELETE_FROM__Q._q_content_WHERE_rowid___
mov dword [esp + 0x1c], str.SELECT_NOT_EXISTS_SELECT_docid_FROM__Q._q_content_WHERE_rowid___
mov dword [esp + 0x20], str.DELETE_FROM__Q._q_content
mov dword [esp + 0x24], str.DELETE_FROM__Q._q_segments
mov dword [esp + 0x28], str.DELETE_FROM__Q._q_segdir
mov dword [esp + 0x2c], str.DELETE_FROM__Q._q_docsize
mov dword [esp + 0x30], str.DELETE_FROM__Q._q_stat
mov dword [esp + 0x34], str.SELECT__s_WHERE_rowid_
mov dword [esp + 0x38], str.SELECT__SELECT_max_idx__FROM__Q._q_segdir_WHERE_level______1
mov dword [esp + 0x3c], str.REPLACE_INTO__Q._q_segments_blockid__block__VALUES______
mov dword [esp + 0x40], str.SELECT_coalesce__SELECT_max_blockid__FROM__Q._q_segments___1__1_
mov dword [esp + 0x44], str.REPLACE_INTO__Q._q_segdir_VALUES_____________
mov dword [esp + 0x48], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____ORDER_BY_idx_ASC
mov dword [esp + 0x4c], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__ORDER_BY_level_DESC__idx_ASC
mov dword [esp + 0x50], str.SELECT_count___FROM__Q._q_segdir_WHERE_level___
mov dword [esp + 0x54], str.SELECT_max_level__FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [esp + 0x58], str.DELETE_FROM__Q._q_segdir_WHERE_level___
mov dword [esp + 0x5c], str.DELETE_FROM__Q._q_segments_WHERE_blockid_BETWEEN___AND__
mov dword [esp + 0x60], str.INSERT_INTO__Q._q_content_VALUES__s_
mov dword [esp + 0x64], str.DELETE_FROM__Q._q_docsize_WHERE_docid___
mov dword [esp + 0x68], str.REPLACE_INTO__Q._q_docsize_VALUES_____
mov dword [esp + 0x6c], str.SELECT_size_FROM__Q._q_docsize_WHERE_docid_
mov dword [esp + 0x70], str.SELECT_value_FROM__Q._q_stat_WHERE_id_
mov dword [esp + 0x74], str.REPLACE_INTO__Q._q_stat_VALUES_____
mov dword [esp + 0x80], str.DELETE_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [esp + 0x84], str.SELECT_DISTINCT_level____1024_____FROM__Q._q_segdir
mov dword [esp + 0x88], str.SELECT_level_FROM__Q._q_segdir_GROUP_BY_level_HAVING_count______ORDER_BY__level____1024__ASC_LIMIT_1
mov dword [esp + 0x8c], str.SELECT_2__total_1__leaves_end_block___start_block____FROM__Q._q_segdir_WHERE_level____AND_idx____
mov dword [esp + 0x90], str.DELETE_FROM__Q._q_segdir_WHERE_level____AND_idx___
mov dword [esp + 0x94], str.UPDATE__Q._q_segdir_SET_idx____WHERE_level__AND_idx_
mov dword [esp + 0x98], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____AND_idx___
mov dword [esp + 0x9c], str.UPDATE__Q._q_segdir_SET_start_block_____root___WHERE_level____AND_idx___
mov dword [esp + 0xa0], str.SELECT_1_FROM__Q._q_segments_WHERE_blockid__AND_block_IS_NULL
mov dword [esp + 0xa4], str.SELECT_idx_FROM__Q._q_segdir_WHERE_level__ORDER_BY_1_ASC
mov dword [esp + 0xa8], str.SELECT_max__level____1024___FROM__Q._q_segdir
mov dword [esp + 0xac], str.SELECT_level__idx__end_block_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND___ORDER_BY_level_DESC__idx_ASC
mov dword [esp + 0xb0], str.UPDATE_OR_FAIL__Q._q_segdir_SET_level_1_idx__WHERE_level__AND_idx_
mov dword [esp + 0xb4], str.UPDATE_OR_FAIL__Q._q_segdir_SET_level__WHERE_level_1
mov dword [esp + 0x10], edi
jne 0x1008bdc1
cmp eax, 0x12
jne 0x1008bd50
mov eax, dword [ebx + 0xdc]
mov ecx, dword [ebx + 0x14]
mov edx, dword [ebx + 0x10]
push eax
push ecx
push edx
push str.INSERT_INTO__Q._q_content_VALUES__s_
call sym.SQLite.Interop.dll_sqlite3_mprintf
add esp, 0x10
jmp 0x1008bd80
cmp eax, 7
jne 0x1008bd6b
mov eax, dword [ebx + 0xd8]
push eax
push str.SELECT__s_WHERE_rowid_
call sym.SQLite.Interop.dll_sqlite3_mprintf
add esp, 8
jmp 0x1008bd80
mov ecx, dword [ebx + 0x14]
mov edx, dword [ebx + 0x10]
mov eax, dword [esp + eax*4 + 0x18]
push ecx
push edx
push eax
call sym.SQLite.Interop.dll_sqlite3_mprintf
add esp, 0xc
mov ecx, eax
test ecx, ecx
mov dword [esp + 0x14], eax
jne 0x1008bd8f
lea esi, [eax + 7]
jmp 0x1008bdc1
mov eax, dword [ebx + 0xc]
push 0
push 0
push 1
push 0xffffffffffffffff
push ecx
lea esi, [esp + 0x24]
call fcn.1008ade0
mov ecx, dword [esp + 0x28]
add esp, 0x14
push ecx
mov esi, eax
call sym.SQLite.Interop.dll_sqlite3_free
mov edi, dword [esp + 0x14]
mov edx, dword [ebp + 8]
add esp, 4
mov dword [ebx + edx*4 + 0x38], edi
xor eax, eax
cmp dword [ebp + 0x10], eax
je 0x1008be00
cmp edi, eax
je 0x1008bdd6
movsx ecx, word [edi + 0x44]
mov dword [esp + 0x10], ecx
jmp 0x1008bdda
mov dword [esp + 0x10], eax
cmp esi, eax
jne 0x1008be0e
cmp eax, dword [esp + 0x10]
jge 0x1008be1c
mov edx, dword [ebp + 0x10]
lea ebx, [eax + 1]
mov eax, dword [edx + eax*4]
push eax
push ebx
push edi
call sym.SQLite.Interop.dll_sqlite3_bind_value
mov esi, eax
add esp, 0xc
test esi, esi
mov eax, ebx
je 0x1008bdde
mov ecx, dword [ebp + 0xc]
mov dword [ecx], edi
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 0xc]
mov dword [edx], edi
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov dword [eax], edi
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret