Function at 0x5ebf00
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa0
mov ecx, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, 0x75151c
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], eax
mov eax, dword [edi + ecx*4 + 0x38]
xor esi, esi
test eax, eax
mov dword [ebp - 0xa0], str.DELETE_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0x9c], str.SELECT_NOT_EXISTS_SELECT_docid_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0x98], str.DELETE_FROM__Q._q_content
mov dword [ebp - 0x94], str.DELETE_FROM__Q._q_segments
mov dword [ebp - 0x90], str.DELETE_FROM__Q._q_segdir
mov dword [ebp - 0x8c], str.DELETE_FROM__Q._q_docsize
mov dword [ebp - 0x88], str.DELETE_FROM__Q._q_stat
mov dword [ebp - 0x84], str.SELECT__s_WHERE_rowid_
mov dword [ebp - 0x80], str.SELECT__SELECT_max_idx__FROM__Q._q_segdir_WHERE_level______1
mov dword [ebp - 0x7c], str.REPLACE_INTO__Q._q_segments_blockid__block__VALUES______
mov dword [ebp - 0x78], str.SELECT_coalesce__SELECT_max_blockid__FROM__Q._q_segments___1__1_
mov dword [ebp - 0x74], str.REPLACE_INTO__Q._q_segdir_VALUES_____________
mov dword [ebp - 0x70], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____ORDER_BY_idx_ASC
mov dword [ebp - 0x6c], 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 - 0x68], str.SELECT_count___FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x64], str.SELECT_max_level__FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [ebp - 0x60], str.DELETE_FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x5c], str.DELETE_FROM__Q._q_segments_WHERE_blockid_BETWEEN___AND__
mov dword [ebp - 0x58], str.INSERT_INTO__Q._q_content_VALUES__s_
mov dword [ebp - 0x54], str.DELETE_FROM__Q._q_docsize_WHERE_docid___
mov dword [ebp - 0x50], str.REPLACE_INTO__Q._q_docsize_VALUES_____
mov dword [ebp - 0x4c], str.SELECT_size_FROM__Q._q_docsize_WHERE_docid_
mov dword [ebp - 0x48], str.SELECT_value_FROM__Q._q_stat_WHERE_id_
mov dword [ebp - 0x44], str.REPLACE_INTO__Q._q_stat_VALUES_____
mov dword [ebp - 0x38], str.DELETE_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [ebp - 0x34], str.SELECT___UNION_SELECT_level____1024_____FROM__Q._q_segdir
mov dword [ebp - 0x30], str.SELECT_level__count___AS_cnt_FROM__Q._q_segdir___GROUP_BY_level_HAVING_cnt____ORDER_BY__level____1024__ASC_LIMIT_1
mov dword [ebp - 0x2c], str.SELECT_2__total_1__leaves_end_block___start_block____FROM__Q._q_segdir_WHERE_level____AND_idx____
mov dword [ebp - 0x28], str.DELETE_FROM__Q._q_segdir_WHERE_level____AND_idx___
mov dword [ebp - 0x24], str.UPDATE__Q._q_segdir_SET_idx____WHERE_level__AND_idx_
mov dword [ebp - 0x20], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____AND_idx___
mov dword [ebp - 0x1c], str.UPDATE__Q._q_segdir_SET_start_block_____root___WHERE_level____AND_idx___
mov dword [ebp - 0x18], str.SELECT_1_FROM__Q._q_segments_WHERE_blockid__AND_block_IS_NULL
mov dword [ebp - 0x14], str.SELECT_idx_FROM__Q._q_segdir_WHERE_level__ORDER_BY_1_ASC
mov dword [ebp - 0x10], str.SELECT_max__level____1024___FROM__Q._q_segdir
mov dword [ebp - 0xc], str.SELECT_level__idx__end_block_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND___ORDER_BY_level_DESC__idx_ASC
mov dword [ebp - 8], str.UPDATE_OR_FAIL__Q._q_segdir_SET_level_1_idx__WHERE_level__AND_idx_
mov dword [ebp - 4], str.UPDATE_OR_FAIL__Q._q_segdir_SET_level__WHERE_level_1
mov dword [ebp + 8], eax
jne 0x5ec0e8
cmp ecx, 0x12
mov esi, 5
jne 0x5ec078
mov eax, dword [edi + 0xe0]
mov ecx, dword [edi + 0x14]
mov edx, dword [edi + 0x10]
push eax
push ecx
push edx
push str.INSERT_INTO__Q._q_content_VALUES__s_
call fcn.0057ad30
add esp, 0x10
jmp 0x5ec0b0
cmp ecx, 7
jne 0x5ec098
mov eax, dword [edi + 0xdc]
mov esi, 1
push eax
push str.SELECT__s_WHERE_rowid_
call fcn.0057ad30
add esp, 8
jmp 0x5ec0b0
mov edx, dword [edi + 0x14]
mov eax, dword [edi + 0x10]
mov ecx, dword [ebp + ecx*4 - 0xa0]
push edx
push eax
push ecx
call fcn.0057ad30
add esp, 0xc
mov ebx, eax
test ebx, ebx
jne 0x5ec0c0
mov eax, dword [ebp + 8]
mov esi, 7
jmp 0x5ec0e8
mov eax, dword [edi + 0xc]
lea edx, [ebp + 8]
push 0
push edx
push esi
push 0xffffffffffffffff
push ebx
push eax
call fcn.005aee30
push ebx
mov esi, eax
call fcn.00579000
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
add esp, 0x1c
mov dword [edi + ecx*4 + 0x38], eax
mov ebx, dword [ebp + 0x14]
test ebx, ebx
je 0x5ec151
push eax
call fcn.0058f910
add esp, 4
xor edi, edi
test esi, esi
mov dword [ebp + 0xc], eax
jne 0x5ec12f
cmp edi, dword [ebp + 0xc]
jge 0x5ec140
mov edx, dword [ebx]
mov eax, dword [ebp + 8]
inc edi
push edx
push edi
push eax
call fcn.0058f780
mov esi, eax
add esp, 0xc
add ebx, 4
test esi, esi
je 0x5ec101
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
pop edi
pop esi
mov dword [ecx], edx
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
pop edi
mov dword [eax], ecx
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
pop edi
mov dword [edx], eax
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x10]
pop edi
mov dword [ecx], eax
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret