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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x84
mov eax, dword [0x5c31c8]
xor eax, esp
mov dword [esp + 0x80], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, ecx
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
mov dword [esp + 0x18], eax
mov ecx, str.INSERT_INTO__Q._q_content_VALUES__s_
push edi
mov eax, dword [esi + edx*4 + 0x24]
mov edi, ebx
mov dword [esp + 0x18], edx
mov dword [esp + 0x28], str.DELETE_FROM__Q._q_content_WHERE_rowid___
mov dword [esp + 0x2c], str.SELECT_NOT_EXISTS_SELECT_docid_FROM__Q._q_content_WHERE_rowid___
mov dword [esp + 0x30], str.DELETE_FROM__Q._q_content
mov dword [esp + 0x34], str.DELETE_FROM__Q._q_segments
mov dword [esp + 0x38], str.DELETE_FROM__Q._q_segdir
mov dword [esp + 0x3c], str.DELETE_FROM__Q._q_docsize
mov dword [esp + 0x40], str.DELETE_FROM__Q._q_stat
mov dword [esp + 0x44], str.SELECT__s_FROM__Q._q_content_AS_x_WHERE_rowid_
mov dword [esp + 0x48], str.SELECT__SELECT_max_idx__FROM__Q._q_segdir_WHERE_level______1
mov dword [esp + 0x4c], str.INSERT_INTO__Q._q_segments_blockid__block__VALUES______
mov dword [esp + 0x50], str.SELECT_coalesce__SELECT_max_blockid__FROM__Q._q_segments___1__1_
mov dword [esp + 0x54], str.INSERT_INTO__Q._q_segdir_VALUES_____________
mov dword [esp + 0x58], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_WHERE_level____ORDER_BY_idx_ASC
mov dword [esp + 0x5c], str.SELECT_idx__start_block__leaves_end_block__end_block__root_FROM__Q._q_segdir_ORDER_BY_level_DESC__idx_ASC
mov dword [esp + 0x60], str.SELECT_count___FROM__Q._q_segdir_WHERE_level___
mov dword [esp + 0x64], str.SELECT_count____max_level__FROM__Q._q_segdir
mov dword [esp + 0x68], str.DELETE_FROM__Q._q_segdir_WHERE_level___
mov dword [esp + 0x6c], str.DELETE_FROM__Q._q_segments_WHERE_blockid_BETWEEN___AND__
mov dword [esp + 0x70], ecx
mov dword [esp + 0x74], str.DELETE_FROM__Q._q_docsize_WHERE_docid___
mov dword [esp + 0x78], str.REPLACE_INTO__Q._q_docsize_VALUES_____
mov dword [esp + 0x7c], str.SELECT_size_FROM__Q._q_docsize_WHERE_docid_
mov dword [esp + 0x80], str.SELECT_value_FROM__Q._q_stat_WHERE_id0
mov dword [esp + 0x84], str.REPLACE_INTO__Q._q_stat_VALUES_0___
mov dword [esp + 0x10], eax
mov dword [esp + 0x20], eax
test eax, eax
jne 0x4fa407
push 7
pop edi
cmp edx, 0x12
jne 0x4fa3a2
push dword [esi + 0x88]
push dword [esi + 0x14]
push dword [esi + 0x10]
push ecx
call fcn.004b67e1
add esp, 0x10
jmp 0x4fa3c5
push dword [esi + 0x14]
push dword [esi + 0x10]
cmp edx, edi
jne 0x4fa3b9
push dword [esi + 0x84]
push str.SELECT__s_FROM__Q._q_content_AS_x_WHERE_rowid_
jmp 0x4fa398
push dword [esp + edx*4 + 0x30]
call fcn.004b67e1
add esp, 0xc
mov dword [esp + 0x14], eax
test eax, eax
jne 0x4fa3d3
mov eax, dword [esp + 0x10]
jmp 0x4fa407
push ebx
lea ecx, [esp + 0x24]
mov edx, eax
push ecx
mov ecx, dword [esi + 0xc]
push ebx
push 1
push 0xffffffffffffffff
call fcn.004e4309
add esp, 0x14
mov edi, eax
push dword [esp + 0x14]
call fcn.004b5459
mov eax, dword [esp + 0x24]
pop ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x10], eax
mov dword [esi + ecx*4 + 0x24], eax
cmp dword [esp + 0x1c], ebx
je 0x4fa441
push eax
call fcn.004cb2d7
pop ecx
mov dword [esp + 0x18], eax
jmp 0x4fa43d
cmp ebx, eax
jge 0x4fa441
mov eax, dword [esp + 0x1c]
lea esi, [ebx + 1]
push dword [eax + ebx*4]
push esi
push dword [esp + 0x18]
call fcn.004cb1dc
mov edi, eax
add esp, 0xc
mov eax, dword [esp + 0x18]
mov ebx, esi
test edi, edi
je 0x4fa41a
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x10]
mov dword [ecx], eax
mov eax, edi
mov ecx, dword [esp + 0x8c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0055daac
mov esp, ebp
pop ebp
ret