Function at 0x50b300
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
push edi
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp + 8], 0
mov eax, dword [edi + 4]
mov ecx, dword [ebx]
test eax, eax
lea edx, [eax - 1]
mov dword [ebp - 0x14], edx
mov edx, dword [edi + 8]
mov dword [ebp - 4], edx
je 0x50b649
mov eax, dword [edi]
mov edx, dword [ecx + 8]
push esi
push eax
mov eax, dword [ecx + 4]
push edx
push eax
push str.SELECT_segid__term___pgno__1____pgno1__FROM__Q._q_idx_WHERE_segid_d
call fcn.004711e0
lea ecx, [ebp + 8]
push eax
push ecx
push ebx
call fcn.004f9bb0
mov eax, dword [ebx + 0x24]
add esp, 0x1c
test eax, eax
jne 0x50b632
mov edx, dword [ebp + 8]
push edx
call fcn.00484290
add esp, 4
cmp eax, 0x64
jne 0x50b632
mov eax, dword [ebp + 8]
push 1
push eax
call fcn.00485400
mov ecx, dword [ebp + 8]
push 1
push ecx
mov dword [ebp - 8], eax
call fcn.004854f0
mov edx, dword [ebp + 8]
push 2
push edx
mov dword [ebp - 0x1c], eax
call fcn.00485490
mov esi, eax
mov eax, dword [ebp + 8]
push 3
push eax
mov dword [ebp - 0x10], esi
call fcn.00485490
mov dword [ebp - 0x24], eax
mov eax, dword [edi + 4]
add esp, 0x20
cmp esi, eax
jl 0x50b627
mov eax, dword [edi]
push 0x20
cdq
push 0
push edx
push eax
call fcn.00548e30
mov ecx, eax
mov eax, esi
mov edi, edx
cdq
add ecx, eax
adc edi, edx
push edi
push ecx
push ebx
call fcn.004fd210
mov esi, eax
add esp, 0xc
test esi, esi
mov dword [ebp - 0xc], esi
je 0x50b632
mov ecx, dword [esi + 4]
mov eax, dword [esi + 8]
cmp ecx, eax
jg 0x50b401
mov dword [ebx + 0x24], 0x10b
jmp 0x50b48a
push esi
call fcn.004fe1a0
mov edx, dword [esi]
mov edi, eax
push edx
call fcn.004fa5c0
and eax, 0xffff
add esp, 8
cmp eax, edi
jge 0x50b479
cmp edi, dword [esi + 8]
jge 0x50b479
mov ecx, dword [esi]
lea eax, [ebp - 0x18]
add ecx, edi
push eax
push ecx
call fcn.0050e820
mov edx, dword [ebp - 0x18]
add edi, eax
mov eax, dword [ebp - 8]
add esp, 8
cmp edx, eax
mov dword [ebp - 0x20], edi
mov ecx, edx
jl 0x50b446
mov ecx, eax
test ecx, ecx
je 0x50b471
cmp edx, eax
jge 0x50b450
mov eax, edx
mov esi, dword [esi]
mov edi, dword [ebp - 0x1c]
mov ecx, eax
mov eax, dword [ebp - 0x20]
add esi, eax
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x50b467
sbb eax, eax
sbb eax, 0xffffffff
mov esi, dword [ebp - 0xc]
test eax, eax
jne 0x50b475
mov eax, dword [ebp - 8]
sub edx, eax
mov eax, edx
test eax, eax
jge 0x50b480
mov dword [ebx + 0x24], 0x10b
push esi
push ebx
call fcn.0050b6e0
add esp, 8
push esi
call fcn.004e0130
mov eax, dword [ebx + 0x24]
add esp, 4
test eax, eax
jne 0x50b632
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x14]
mov esi, dword [ebp + 0xc]
lea edx, [edi - 1]
inc eax
push edx
inc ecx
push eax
push ecx
push esi
push ebx
call fcn.0050b650
mov eax, dword [ebx + 0x24]
add esp, 0x14
test eax, eax
jne 0x50b632
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x50b61b
mov esi, dword [esi]
push edi
push esi
push 0
push ebx
mov dword [ebp - 0xc], edi
mov dword [ebp - 4], 0
call fcn.004fe800
mov edi, eax
push edi
push ebx
call fcn.004ff860
add esp, 0x18
test eax, eax
jne 0x50b607
mov eax, esi
push 0x20
cdq
push 0
push edx
push eax
call fcn.00548e30
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], edx
mov edx, dword [ebp - 0xc]
push edi
lea esi, [edx + 1]
mov dword [ebp - 4], esi
call fcn.004fe7b0
add esp, 4
cmp esi, eax
jge 0x50b57d
jmp 0x50b52b
mov esi, dword [ebp - 4]
mov ecx, dword [ebp - 0x2c]
mov eax, esi
mov esi, dword [ebp - 0x28]
cdq
add eax, ecx
adc edx, esi
push edx
push eax
push ebx
call fcn.004fa480
mov esi, eax
add esp, 0xc
test esi, esi
je 0x50b569
mov eax, dword [esi]
push eax
call fcn.004fa5c0
add esp, 4
test ax, ax
je 0x50b560
mov dword [ebx + 0x24], 0x10b
push esi
call fcn.004e0130
add esp, 4
mov esi, dword [ebp - 4]
push edi
inc esi
mov dword [ebp - 4], esi
call fcn.004fe7b0
add esp, 4
cmp esi, eax
jl 0x50b528
push edi
call fcn.004fe7b0
mov ecx, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x28]
mov dword [ebp - 0xc], eax
cdq
add eax, ecx
adc edx, esi
push edx
push eax
push ebx
call fcn.004fa480
mov esi, eax
add esp, 0x10
test esi, esi
je 0x50b5ee
mov ecx, dword [esi]
push ecx
call fcn.004fa5c0
mov ecx, dword [esi + 8]
and eax, 0xffff
add esp, 4
cmp eax, ecx
jge 0x50b5de
mov ecx, dword [esi]
lea edx, [ebp - 0x34]
add ecx, eax
push edx
push ecx
call fcn.0050e8c0
push edi
call fcn.004ffa80
mov ecx, dword [ebp - 0x34]
add esp, 0xc
cmp ecx, eax
jne 0x50b5de
mov eax, dword [ebp - 0x30]
cmp eax, edx
je 0x50b5e5
mov dword [ebx + 0x24], 0x10b
push esi
call fcn.004e0130
add esp, 4
push edi
push ebx
call fcn.004ff780
push edi
push ebx
call fcn.004ff860
add esp, 0x10
test eax, eax
je 0x50b510
mov ecx, dword [ebp - 4]
push edi
mov dword [ebp - 4], ecx
call fcn.004fb160
mov edi, dword [ebp - 0x10]
add esp, 4
jmp 0x50b621
mov edx, dword [esi + 8]
mov dword [ebp - 4], edx
mov dword [ebp - 0x14], edi
mov edi, dword [ebp + 0xc]
mov eax, dword [ebx + 0x24]
test eax, eax
je 0x50b35d
mov eax, dword [ebp + 8]
push eax
call fcn.00480cf0
mov ecx, dword [ebx + 0x24]
add esp, 4
test ecx, ecx
pop esi
jne 0x50b649
mov dword [ebx + 0x24], eax
pop edi
pop ebx
mov esp, ebp
pop ebp
ret