Function at 0x4fbe00
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84
mov eax, dword [0x661204]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 8]
lea ecx, [eax + 0xa]
lea ecx, [esi + ecx*4]
mov dword [ebp - 0x80], ebx
mov ebx, dword [ecx]
push edi
xor edi, edi
mov dword [ebp - 0x78], edx
mov dword [ebp - 0x70], str.DELETE_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0x6c], str.SELECT_NOT_EXISTS_SELECT_docid_FROM__Q._q_content_WHERE_rowid___
mov dword [ebp - 0x68], str.DELETE_FROM__Q._q_content
mov dword [ebp - 0x64], str.DELETE_FROM__Q._q_segments
mov dword [ebp - 0x60], str.DELETE_FROM__Q._q_segdir
mov dword [ebp - 0x5c], str.DELETE_FROM__Q._q_docsize
mov dword [ebp - 0x58], str.DELETE_FROM__Q._q_stat
mov dword [ebp - 0x54], str.SELECT__s_WHERE_rowid_
mov dword [ebp - 0x50], str.SELECT__SELECT_max_idx__FROM__Q._q_segdir_WHERE_level______1
mov dword [ebp - 0x4c], str.INSERT_INTO__Q._q_segments_blockid__block__VALUES______
mov dword [ebp - 0x48], str.SELECT_coalesce__SELECT_max_blockid__FROM__Q._q_segments___1__1_
mov dword [ebp - 0x44], str.INSERT_INTO__Q._q_segdir_VALUES_____________
mov dword [ebp - 0x40], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____ORDER_BY_idx_ASC
mov dword [ebp - 0x3c], 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 - 0x38], str.SELECT_count___FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x34], str.SELECT_max_level__FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [ebp - 0x30], str.DELETE_FROM__Q._q_segdir_WHERE_level___
mov dword [ebp - 0x2c], str.DELETE_FROM__Q._q_segments_WHERE_blockid_BETWEEN___AND__
mov dword [ebp - 0x28], str.INSERT_INTO__Q._q_content_VALUES__s_
mov dword [ebp - 0x24], str.DELETE_FROM__Q._q_docsize_WHERE_docid___
mov dword [ebp - 0x20], str.REPLACE_INTO__Q._q_docsize_VALUES_____
mov dword [ebp - 0x1c], str.SELECT_size_FROM__Q._q_docsize_WHERE_docid_
mov dword [ebp - 0x18], str.SELECT_value_FROM__Q._q_stat_WHERE_id0
mov dword [ebp - 0x14], str.REPLACE_INTO__Q._q_stat_VALUES_0___
mov dword [ebp - 0x10], 0x5ead72
mov dword [ebp - 0xc], 0x5ead72
mov dword [ebp - 8], str.DELETE_FROM__Q._q_segdir_WHERE_level_BETWEEN___AND__
mov dword [ebp - 0x84], ecx
mov dword [ebp - 0x74], ebx
test ebx, ebx
jne 0x4fbf88
cmp eax, 0x12
jne 0x4fbf20
push dword [esi + 0x98]
push dword [esi + 0x14]
push dword [esi + 0x10]
push str.INSERT_INTO__Q._q_content_VALUES__s_
call fcn.004d89d0
add esp, 0x10
jmp 0x4fbf4c
cmp eax, 7
jne 0x4fbf3a
push dword [esi + 0x94]
push str.SELECT__s_WHERE_rowid_
call fcn.004d89d0
add esp, 8
jmp 0x4fbf4c
push dword [esi + 0x14]
push dword [esi + 0x10]
push dword [ebp + eax*4 - 0x70]
call fcn.004d89d0
add esp, 0xc
mov dword [ebp - 0x7c], eax
test eax, eax
jne 0x4fbf58
lea edi, [eax + 7]
jmp 0x4fbf85
push 0
lea ecx, [ebp - 0x74]
push ecx
push 0
push 1
push 0xffffffffffffffff
push eax
push dword [esi + 0xc]
call fcn.00526570
push dword [ebp - 0x7c]
mov edi, eax
call fcn.004d8ef0
mov eax, dword [ebp - 0x84]
add esp, 0x20
mov ebx, dword [ebp - 0x74]
mov dword [eax], ebx
mov edx, dword [ebp - 0x78]
cmp dword [ebp - 0x80], 0
je 0x4fbfdd
test ebx, ebx
je 0x4fbf98
movsx ecx, word [ebx + 0x50]
jmp 0x4fbf9a
xor ecx, ecx
xor eax, eax
mov dword [ebp - 0x74], ecx
test edi, edi
jne 0x4fbfdd
cmp eax, ecx
jge 0x4fbfc5
mov ecx, dword [ebp - 0x80]
lea esi, [eax + 1]
push dword [ecx + eax*4]
push esi
push ebx
call fcn.004dc4c0
mov ecx, dword [ebp - 0x74]
mov edi, eax
add esp, 0xc
mov eax, esi
test edi, edi
je 0x4fbfa3
mov eax, dword [ebp - 0x78]
mov dword [eax], ebx
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054c3c9
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.0054c3c9
mov esp, ebp
pop ebp
ret