Function at 0x4fb480
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 0x14]
and eax, 8
push edi
push 0x54
mov dword [esp + 0x1c], eax
mov edi, ecx
lea eax, [esi + 4]
mov dword [esp + 0x18], edx
push 0
push eax
mov dword [esp + 0x18], 1
mov dword [esp + 0x1c], 0
call sub.VCRUNTIME140.dll_memset
mov ecx, dword [ebp + 0x10]
add esp, 0xc
mov dword [esi], ecx
mov ebx, dword [edi + 0x3c]
test ebx, ebx
jne 0x4fb4f4
mov eax, dword [edi]
push dword [eax + 8]
push dword [eax + 4]
push str.SELECT_pgno_FROM__q._q_idx_WHERE_segid__AND_term___ORDER_BY_term_DESC_LIMIT_1
call fcn.0043d5d0
add esp, 0xc
lea edx, [edi + 0x3c]
mov ecx, edi
push eax
call fcn.004f8740
mov ebx, dword [edi + 0x3c]
add esp, 4
mov ecx, dword [ebp + 0x10]
cmp dword [edi + 0x24], 0
jne 0x4fb6ab
mov eax, dword [ecx]
cdq
push edx
push eax
push 1
push ebx
call fcn.004682a0
add esp, 0x10
mov edx, 2
mov ecx, ebx
call fcn.00467f60
test eax, eax
jne 0x4fb57b
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4fb568
mov ecx, dword [ebx + 0x64]
mov edx, eax
push 0
push 0
push dword [ebp + 8]
add ecx, 0x28
call fcn.0045f6d0
add esp, 0xc
mov dword [esp + 0x1c], eax
test eax, eax
je 0x4fb568
mov ecx, dword [ebx]
mov edx, eax
mov dword [ecx + 0x40], eax
call fcn.0043e3c0
mov ecx, dword [ebx]
cmp byte [ecx + 0x51], 0
jne 0x4fb563
cmp dword [esp + 0x1c], 0xc0a
jne 0x4fb568
call fcn.0043b490
mov eax, dword [ebx]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x4fb57b
push eax
call dword [0x5350c0]
add esp, 4
push ebx
call fcn.00466ed0
add esp, 4
cmp eax, 0x64
jne 0x4fb5a6
push 0
push ebx
call fcn.004678f0
cdq
add esp, 8
mov ecx, eax
shrd eax, edx, 1
and ecx, 1
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], ecx
push ebx
call fcn.00465d10
add esp, 4
mov dword [edi + 0x24], eax
mov edx, 2
mov ecx, ebx
call fcn.00467f60
test eax, eax
jne 0x4fb5d5
mov eax, dword [ebx]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x4fb5d5
push eax
call dword [0x5350c0]
add esp, 4
mov eax, dword [ebp + 0x10]
xor ecx, ecx
mov edx, esi
mov eax, dword [eax + 4]
cmp dword [esp + 0xc], eax
cmovge ecx, dword [esp + 0x10]
cmovge eax, dword [esp + 0xc]
mov dword [esp + 0x1c], ecx
dec eax
mov ecx, edi
mov dword [esi + 8], eax
call fcn.004fa310
cmp dword [esi + 0xc], 0
mov ebx, dword [esp + 0x18]
je 0x4fb61a
push dword [ebp + 8]
mov edx, ebx
mov ecx, edi
push dword [esp + 0x18]
push esi
call fcn.004fb070
add esp, 0xc
cmp dword [edi + 0x24], 0
jne 0x4fb681
test ebx, ebx
jne 0x4fb681
mov edx, dword [esi + 4]
mov ebx, dword [esi + 0xc]
or edx, 1
mov dword [esi + 4], edx
test ebx, ebx
je 0x4fb681
mov eax, dword [ebp + 0xc]
and eax, 2
mov dword [ebp + 0xc], eax
je 0x4fb645
or edx, 2
mov dword [esi + 4], edx
cmp dword [esp + 0x1c], 0
je 0x4fb674
mov ecx, dword [esi + 0x1c]
and edx, 2
cmp ecx, dword [esi + 8]
jne 0x4fb65f
mov eax, dword [esi + 0x28]
cmp eax, dword [ebx + 8]
jl 0x4fb671
mov eax, dword [esi]
push ecx
mov ecx, edi
push dword [eax]
call fcn.004fa090
add esp, 8
mov dword [esi + 0x38], eax
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x4fb681
mov edx, esi
mov ecx, edi
call fcn.004fae70
test byte [esi + 4], 2
je 0x4fb695
mov dword [esi + 0x18], 0x4fa980
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi]
mov ecx, 0x4fabb0
mov edx, 0x4faa00
cmp dword [eax + 0x30], 1
cmove ecx, edx
mov dword [esi + 0x18], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret