Function at 0x611f50
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
mov eax, dword [0x6f0f64]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x78], ecx
lea ecx, [eax + 9]
mov ebx, dword [esi + ecx*4]
lea ecx, [esi + ecx*4]
push edi
xor edi, edi
mov dword [ebp - 0x70], edx
mov dword [ebp - 0x68], str.DELETE_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0x64], str.SELECT_NOT_EXISTS_SELECT_docid_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0x60], str.DELETE_FROM__Q._q_content
mov dword [ebp - 0x5c], str.DELETE_FROM__Q._q_segments
mov dword [ebp - 0x58], str.DELETE_FROM__Q._q_segdir
mov dword [ebp - 0x54], str.DELETE_FROM__Q._q_docsize
mov dword [ebp - 0x50], str.DELETE_FROM__Q._q_stat
mov dword [ebp - 0x4c], str.SELECT__FROM__Q._q_content_WHERE_rowid_
mov dword [ebp - 0x48], str.SELECT__SELECT_max_idx__FROM__Q._q_segdir_WHERE_level______1
mov dword [ebp - 0x44], str.INSERT_INTO__Q._q_segments_blockid__block__VALUES______
mov dword [ebp - 0x40], str.SELECT_coalesce__SELECT_max_blockid__FROM__Q._q_segments___1__1_
mov dword [ebp - 0x3c], str.INSERT_INTO__Q._q_segdir_VALUES_____________
mov dword [ebp - 0x38], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____ORDER_BY_idx_ASC
mov dword [ebp - 0x34], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_ORDER_BY_level_DESC__idx_ASC
mov dword [ebp - 0x30], str.SELECT_count___FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x2c], str.SELECT_count____max_level__FROM__Q._q_segdir
mov dword [ebp - 0x28], str.DELETE_FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x24], str.DELETE_FROM__Q._q_segments_WHERE_blockid_BETWEEN___AND__
mov dword [ebp - 0x20], str.INSERT_INTO__Q._q_content_VALUES__z_
mov dword [ebp - 0x1c], str.SELECT_block_FROM__Q._q_segments_WHERE_blockid___
mov dword [ebp - 0x18], str.DELETE_FROM__Q._q_docsize_WHERE_docid___
mov dword [ebp - 0x14], str.REPLACE_INTO__Q._q_docsize_VALUES_____
mov dword [ebp - 0x10], str.SELECT_size_FROM__Q._q_docsize_WHERE_docid_
mov dword [ebp - 0xc], str.SELECT_value_FROM__Q._q_stat_WHERE_id0
mov dword [ebp - 8], str.REPLACE_INTO__Q._q_stat_VALUES_0___
mov dword [ebp - 0x7c], ecx
mov dword [ebp - 0x6c], ebx
test ebx, ebx
jne 0x61210d
cmp eax, 0x12
jne 0x6120c2
mov eax, dword [esi + 0x18]
lea edi, [eax*2 + 2]
call fcn.00658040
test eax, eax
jne 0x6120a3
push edi
call fcn.0063b730
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x6120a3
mov byte [ecx], 0x3f
mov eax, dword [esi + 0x18]
mov byte [ecx + eax*2 + 1], bl
mov eax, 1
cmp dword [esi + 0x18], eax
jl 0x61208d
nop dword [eax]
mov word [ecx + eax*2 - 1], 0x3f2c
inc eax
cmp eax, dword [esi + 0x18]
jle 0x612080
push ecx
push dword [esi + 0x14]
push dword [esi + 0x10]
push str.INSERT_INTO__Q._q_content_VALUES__z_
call fcn.005f7a20
add esp, 0x10
jmp 0x6120d4
mov eax, dword [ebp - 0x78]
pop edi
pop esi
pop ebx
mov dword [eax], 0
mov eax, 7
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0058d09a
mov esp, ebp
pop ebp
ret
push dword [esi + 0x14]
push dword [esi + 0x10]
push dword [ebp + eax*4 - 0x68]
call fcn.005f7a20
add esp, 0xc
mov dword [ebp - 0x74], eax
test eax, eax
jne 0x6120e0
lea edi, [eax + 7]
jmp 0x61210a
push 0
lea ecx, [ebp - 0x6c]
push ecx
push 0
push 1
push 0xffffffffffffffff
push eax
push dword [esi + 0xc]
call fcn.0063b1b0
push dword [ebp - 0x74]
mov edi, eax
call fcn.005f7d20
mov eax, dword [ebp - 0x7c]
add esp, 0x20
mov ebx, dword [ebp - 0x6c]
mov dword [eax], ebx
mov edx, dword [ebp - 0x70]
test edx, edx
je 0x612148
test ebx, ebx
je 0x61211b
movsx ecx, word [ebx + 0x3a]
jmp 0x61211d
xor ecx, ecx
xor eax, eax
mov dword [ebp - 0x6c], ecx
test edi, edi
jne 0x612148
cmp eax, ecx
jge 0x612148
push dword [edx + eax*4]
lea esi, [eax + 1]
push esi
push ebx
call fcn.005f8d50
mov ecx, dword [ebp - 0x6c]
mov edi, eax
mov edx, dword [ebp - 0x70]
add esp, 0xc
mov eax, esi
test edi, edi
je 0x612126
mov eax, dword [ebp - 0x78]
mov ecx, dword [ebp - 4]
xor ecx, ebp
mov dword [eax], ebx
mov eax, edi
pop edi
pop esi
pop ebx
call fcn.0058d09a
mov esp, ebp
pop ebp
ret