Function at 0x1011e1a0
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 0x14]
and eax, 8
push edi
push 0x64
mov dword [esp + 0x24], eax
mov ebx, ecx
lea eax, [esi + 4]
mov dword [esp + 0x20], edx
push 0
push eax
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], 0
call fcn.10138870
mov ecx, dword [ebp + 0x10]
lea eax, [ebx + 0x44]
add esp, 0xc
mov dword [esi], ecx
cmp dword [eax], 0
jne 0x1011e29e
mov eax, dword [ebx]
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.100294e0
add esp, 0xc
mov edi, eax
cmp dword [ebx + 0x2c], 0
jne 0x1011e23c
test edi, edi
je 0x1011e233
mov eax, dword [ebx]
lea ecx, [ebx + 0x44]
push 0
push ecx
push 0
mov ecx, dword [eax]
mov edx, edi
push 0x85
push 0xffffffffffffffff
call fcn.1009d7f0
add esp, 0x14
mov dword [ebx + 0x2c], eax
jmp 0x1011e240
mov dword [ebx + 0x2c], 7
jmp 0x1011e298
test edi, edi
je 0x1011e298
cmp dword [0x10177b48], 0
je 0x1011e28e
mov eax, dword [0x1017ad00]
test eax, eax
je 0x1011e25c
push eax
call dword [0x10177b98]
add esp, 4
push edi
call dword [0x10177b74]
sub dword [0x1017ab88], eax
add esp, 4
dec dword [0x1017abac]
push edi
call dword [0x10177b6c]
mov eax, dword [0x1017ad00]
add esp, 4
test eax, eax
je 0x1011e298
push eax
call dword [0x10177ba0]
jmp 0x1011e295
push edi
call dword [0x10177b6c]
add esp, 4
mov ecx, dword [ebp + 0x10]
lea eax, [ebx + 0x44]
cmp dword [ebx + 0x2c], 0
mov edi, dword [eax]
jne 0x1011e50b
mov eax, dword [ecx]
cdq
push edx
push eax
push 1
push edi
call fcn.10056380
add esp, 0x10
mov edx, 1
mov ecx, edi
call fcn.10055ef0
test eax, eax
jne 0x1011e31c
cmp dword [esp + 0x1c], eax
je 0x1011e309
mov ecx, dword [edi + 0x64]
push eax
push eax
mov eax, dword [ebp + 8]
add ecx, 0x28
cdq
push edx
mov edx, dword [esp + 0x28]
push eax
call fcn.1004db70
add esp, 0x10
mov dword [esp + 0x24], eax
test eax, eax
je 0x1011e309
mov ecx, dword [edi]
mov edx, eax
mov dword [ecx + 0x40], eax
call fcn.1002a360
mov ecx, dword [edi]
mov edx, dword [esp + 0x24]
call fcn.100272e0
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x1011e31c
push eax
call dword [0x10177ba0]
add esp, 4
push edi
call fcn.10054c20
add esp, 4
cmp eax, 0x64
jne 0x1011e3e1
test edi, edi
jne 0x1011e345
mov ecx, 0x10161a88
call fcn.1004d340
mov ecx, eax
mov edx, ecx
jmp 0x1011e3d4
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x1011e358
push eax
call dword [0x10177b98]
add esp, 4
mov ecx, dword [edi + 0x78]
test ecx, ecx
je 0x1011e36a
xor eax, eax
cmp ax, word [edi + 0x90]
jb 0x1011e382
mov ecx, dword [edi]
mov edx, 0x19
mov dword [ecx + 0x40], 0x19
call fcn.1002a360
mov ecx, 0x10161a88
call fcn.1004d340
mov esi, dword [edi]
mov ecx, eax
mov eax, dword [edi + 0x24]
mov edx, ecx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], edx
cmp byte [esi + 0x57], 0
mov esi, dword [ebp + 0x14]
jne 0x1011e3a5
test eax, eax
je 0x1011e3b6
mov ecx, dword [edi]
mov edx, eax
call fcn.100272e0
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [edi + 0x24], eax
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x1011e3d4
push eax
call dword [0x10177ba0]
mov edx, dword [esp + 0x1c]
add esp, 4
mov ecx, dword [esp + 0x14]
sar ecx, 1
and edx, 1
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], edx
push edi
call fcn.10053c90
add esp, 4
mov dword [ebx + 0x2c], eax
mov edx, 1
mov ecx, edi
call fcn.10055ef0
test eax, eax
jne 0x1011e410
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x1011e410
push eax
call dword [0x10177ba0]
add esp, 4
mov eax, dword [ebp + 0x10]
xor edx, edx
mov ecx, ebx
mov eax, dword [eax + 4]
cmp dword [esp + 0x14], eax
cmovge edx, dword [esp + 0x18]
cmovge eax, dword [esp + 0x14]
mov dword [esp + 0x24], edx
dec eax
mov edx, esi
mov dword [esi + 8], eax
call fcn.1011c9b0
cmp dword [esi + 0xc], 0
mov edi, dword [esp + 0x20]
je 0x1011e455
push dword [ebp + 8]
mov edx, edi
mov ecx, ebx
push dword [esp + 0x20]
push esi
call fcn.1011dc80
add esp, 0xc
cmp dword [ebx + 0x2c], 0
lea edx, [ebx + 0x2c]
jne 0x1011e4c2
test edi, edi
jne 0x1011e4c2
mov edx, dword [esi + 4]
mov edi, dword [esi + 0xc]
or edx, 1
mov dword [esi + 4], edx
test edi, edi
je 0x1011e4bf
mov eax, dword [ebp + 0xc]
and eax, 2
mov dword [ebp + 0xc], eax
je 0x1011e483
or edx, 2
mov dword [esi + 4], edx
cmp dword [esp + 0x24], 0
je 0x1011e4b2
mov ecx, dword [esi + 0x2c]
and edx, 2
cmp ecx, dword [esi + 8]
jne 0x1011e49d
mov eax, dword [esi + 0x38]
cmp eax, dword [edi + 8]
jl 0x1011e4af
mov eax, dword [esi]
push ecx
mov ecx, ebx
push dword [eax]
call fcn.1011c410
add esp, 8
mov dword [esi + 0x48], eax
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x1011e4bf
mov edx, esi
mov ecx, ebx
call fcn.1011d940
lea edx, [ebx + 0x2c]
test byte [esi + 4], 2
je 0x1011e4cf
mov ecx, 0x1011d190
jmp 0x1011e4e2
mov eax, dword [ebx]
mov ecx, 0x1011d4a0
mov edi, 0x1011d210
cmp dword [eax + 0x34], 1
cmove ecx, edi
mov dword [esi + 0x28], ecx
mov eax, dword [esi]
mov edi, dword [eax + 0x20]
test edi, edi
jle 0x1011e50b
lea eax, [edi + edi*2]
mov ecx, edx
shl eax, 2
push 0
push eax
call fcn.10112db0
add esp, 8
test eax, eax
je 0x1011e50b
mov dword [esi + 0x20], eax
mov dword [esi + 0x24], edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret