Function at 0x5b6c3a0
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xbc
mov eax, dword [0x5c51004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
mov eax, edx
mov edx, dword [ebp + 8]
push esi
mov esi, ecx
mov dword [ebp - 0xb8], ebx
lea ecx, [eax + 0xf]
mov dword [ebp - 0xb0], edx
mov ebx, dword [esi + ecx*4]
lea ecx, [esi + ecx*4]
push edi
xor edi, edi
mov dword [ebp - 0xa8], str.DELETE_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0xa4], str.SELECT_NOT_EXISTS_SELECT_docid_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0xa0], str.DELETE_FROM__Q._q_content
mov dword [ebp - 0x9c], str.DELETE_FROM__Q._q_segments
mov dword [ebp - 0x98], str.DELETE_FROM__Q._q_segdir
mov dword [ebp - 0x94], str.DELETE_FROM__Q._q_docsize
mov dword [ebp - 0x90], str.DELETE_FROM__Q._q_stat
mov dword [ebp - 0x8c], str.SELECT__s_WHERE_rowid_
mov dword [ebp - 0x88], str.SELECT__SELECT_max_idx__FROM__Q._q_segdir_WHERE_level______1
mov dword [ebp - 0x84], str.REPLACE_INTO__Q._q_segments_blockid__block__VALUES______
mov dword [ebp - 0x80], str.SELECT_coalesce__SELECT_max_blockid__FROM__Q._q_segments___1__1_
mov dword [ebp - 0x7c], str.REPLACE_INTO__Q._q_segdir_VALUES_____________
mov dword [ebp - 0x78], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____ORDER_BY_idx_ASC
mov dword [ebp - 0x74], 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 [ebp - 0x70], str.SELECT_count___FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x6c], str.SELECT_max_level__FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [ebp - 0x68], str.DELETE_FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x64], str.DELETE_FROM__Q._q_segments_WHERE_blockid_BETWEEN___AND__
mov dword [ebp - 0x60], str.INSERT_INTO__Q._q_content_VALUES__s_
mov dword [ebp - 0x5c], str.DELETE_FROM__Q._q_docsize_WHERE_docid___
mov dword [ebp - 0x58], str.REPLACE_INTO__Q._q_docsize_VALUES_____
mov dword [ebp - 0x54], str.SELECT_size_FROM__Q._q_docsize_WHERE_docid_
mov dword [ebp - 0x50], str.SELECT_value_FROM__Q._q_stat_WHERE_id_
mov dword [ebp - 0x4c], str.REPLACE_INTO__Q._q_stat_VALUES_____
mov dword [ebp - 0x48], 0x5c37db0
mov dword [ebp - 0x44], 0x5c37db0
mov dword [ebp - 0x40], str.DELETE_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [ebp - 0x3c], str.SELECT___UNION_SELECT_level____1024_____FROM__Q._q_segdir
mov dword [ebp - 0x38], str.SELECT_level__count___AS_cnt_FROM__Q._q_segdir___GROUP_BY_level_HAVING_cnt____ORDER_BY__level____1024__ASC__2_DESC_LIMIT_1
mov dword [ebp - 0x34], str.SELECT_2__total_1__leaves_end_block___start_block____FROM__SELECT__FROM__Q._q_segdir_________WHERE_level____ORDER_BY_idx_ASC_LIMIT_____
mov dword [ebp - 0x30], str.DELETE_FROM__Q._q_segdir_WHERE_level____AND_idx___
mov dword [ebp - 0x2c], str.UPDATE__Q._q_segdir_SET_idx____WHERE_level__AND_idx_
mov dword [ebp - 0x28], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____AND_idx___
mov dword [ebp - 0x24], str.UPDATE__Q._q_segdir_SET_start_block_____root___WHERE_level____AND_idx___
mov dword [ebp - 0x20], str.SELECT_1_FROM__Q._q_segments_WHERE_blockid__AND_block_IS_NULL
mov dword [ebp - 0x1c], str.SELECT_idx_FROM__Q._q_segdir_WHERE_level__ORDER_BY_1_ASC
mov dword [ebp - 0x18], str.SELECT_max__level____1024___FROM__Q._q_segdir
mov dword [ebp - 0x14], str.SELECT_level__idx__end_block_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND___ORDER_BY_level_DESC__idx_ASC
mov dword [ebp - 0x10], str.UPDATE_OR_FAIL__Q._q_segdir_SET_level_1_idx__WHERE_level__AND_idx_
mov dword [ebp - 0xc], str.UPDATE_OR_FAIL__Q._q_segdir_SET_level__WHERE_level_1
mov dword [ebp - 0xbc], ecx
mov dword [ebp - 0xac], ebx
test ebx, ebx
jne 0x5b6c5ca
lea edi, [ebx + 5]
cmp eax, 0x12
jne 0x5b6c544
push dword [esi + 0xe4]
push dword [esi + 0x14]
push dword [esi + 0x10]
push str.INSERT_INTO__Q._q_content_VALUES__s_
call sym.SQLite.Interop.dll_SI5ea70b9767a9e9ce
add esp, 0x10
jmp 0x5b6c576
cmp eax, 7
jne 0x5b6c561
push dword [esi + 0xe0]
lea edi, [eax - 6]
push str.SELECT__s_WHERE_rowid_
call sym.SQLite.Interop.dll_SI5ea70b9767a9e9ce
add esp, 8
jmp 0x5b6c576
push dword [esi + 0x14]
push dword [esi + 0x10]
push dword [ebp + eax*4 - 0xa8]
call sym.SQLite.Interop.dll_SI5ea70b9767a9e9ce
add esp, 0xc
mov dword [ebp - 0xb4], eax
test eax, eax
jne 0x5b6c585
lea edi, [eax + 7]
jmp 0x5b6c5c4
push 0
lea ecx, [ebp - 0xac]
or edi, 0x80
push ecx
mov ecx, dword [esi + 0xc]
mov edx, eax
push 0
push edi
push 0xffffffffffffffff
call fcn.05bb1a30
add esp, 0x14
mov edi, eax
push dword [ebp - 0xb4]
call sym.SQLite.Interop.dll_SI9edfb98001bcad06
mov eax, dword [ebp - 0xbc]
add esp, 4
mov ebx, dword [ebp - 0xac]
mov dword [eax], ebx
mov edx, dword [ebp - 0xb0]
cmp dword [ebp - 0xb8], 0
je 0x5b6c633
test ebx, ebx
je 0x5b6c5dd
movsx ecx, word [ebx + 0x10]
jmp 0x5b6c5df
xor ecx, ecx
xor eax, eax
mov dword [ebp - 0xac], ecx
test edi, edi
jne 0x5b6c633
nop dword [eax + eax]
cmp eax, ecx
jge 0x5b6c618
mov ecx, dword [ebp - 0xb8]
lea esi, [eax + 1]
push dword [ecx + eax*4]
push esi
push ebx
call fcn.05bf17b0
mov ecx, dword [ebp - 0xac]
mov edi, eax
add esp, 0xc
mov eax, esi
test edi, edi
je 0x5b6c5f0
mov eax, dword [ebp - 0xb0]
mov dword [eax], ebx
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.05b011bc
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
mov dword [edx], ebx
xor ecx, ebp
pop ebx
call fcn.05b011bc
mov esp, ebp
pop ebp
ret