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

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 0x5c
mov dword [esp + 0x20], eax
mov ebx, ecx
lea eax, [esi + 4]
mov dword [esp + 0x1c], edx
push 0
push eax
mov dword [esp + 0x20], 1
mov dword [esp + 0x1c], 0
call fcn.00570cd0
mov eax, dword [ebp + 0x10]
add esp, 0xc
mov dword [esi], eax
cmp dword [ebx + 0x3c], 0
jne 0x52d150
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.0043e130
add esp, 0xc
lea edx, [ebx + 0x3c]
mov ecx, ebx
push eax
call fcn.00529d30
mov eax, dword [ebp + 0x10]
add esp, 4
cmp dword [ebx + 0x24], 0
mov edi, dword [ebx + 0x3c]
jne 0x52d3b5
mov eax, dword [eax]
cdq
push edx
push eax
push 1
push edi
call fcn.00467fa0
add esp, 0x10
mov edx, 1
mov ecx, edi
call fcn.00467b40
test eax, eax
jne 0x52d1cf
cmp dword [esp + 0x18], eax
je 0x52d1bc
mov ecx, dword [edi + 0x64]
push eax
push eax
mov eax, dword [ebp + 8]
add ecx, 0x28
cdq
push edx
mov edx, dword [esp + 0x24]
push eax
call fcn.0045fb80
add esp, 0x10
mov dword [esp + 0x20], eax
test eax, eax
je 0x52d1bc
mov ecx, dword [edi]
mov edx, eax
mov dword [ecx + 0x40], eax
call fcn.0043ee60
mov ecx, dword [edi]
mov edx, dword [esp + 0x20]
call fcn.0043bb70
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x52d1cf
push eax
call dword [0x5dac88]
add esp, 4
push edi
call fcn.004669b0
add esp, 4
cmp eax, 0x64
jne 0x52d2b0
test edi, edi
je 0x52d21d
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x52d1f8
push eax
call dword [0x5dac80]
add esp, 4
mov ecx, dword [edi + 0x78]
test ecx, ecx
je 0x52d20a
xor eax, eax
cmp ax, word [edi + 0x90]
jb 0x52d222
mov ecx, dword [edi]
mov edx, 0x19
mov dword [ecx + 0x40], 0x19
call fcn.0043ee60
mov ecx, 0x5b3788
movzx eax, word [ecx + 0x10]
test al, 0x24
je 0x52d232
mov eax, dword [ecx]
mov dword [esp + 0x10], eax
jmp 0x52d263
test al, 8
je 0x52d241
movsd xmm0, qword [ecx]
call fcn.0045f320
jmp 0x52d25f
test al, 0x12
je 0x52d252
cmp dword [ecx + 8], 0
je 0x52d252
call fcn.0045f350
jmp 0x52d25f
xorps xmm0, xmm0
movlpd qword [esp + 0x20], xmm0
mov eax, dword [esp + 0x20]
mov dword [esp + 0x10], eax
mov ecx, eax
mov dword [esp + 0x14], ecx
test edi, edi
je 0x52d2a3
mov ecx, dword [edi]
mov edx, dword [edi + 0x24]
cmp byte [ecx + 0x57], 0
jne 0x52d280
test edx, edx
jne 0x52d280
xor eax, eax
jmp 0x52d285
call fcn.0043bb70
mov dword [edi + 0x24], eax
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x52d29b
push eax
call dword [0x5dac88]
add esp, 4
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
sar ecx, 1
and eax, 1
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
push edi
call fcn.00465900
add esp, 4
mov dword [ebx + 0x24], eax
mov edx, 1
mov ecx, edi
call fcn.00467b40
test eax, eax
jne 0x52d2df
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x52d2df
push eax
call dword [0x5dac88]
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 + 0x10]
cmovge eax, dword [esp + 0x14]
mov dword [esp + 0x20], edx
dec eax
mov edx, esi
mov dword [esi + 8], eax
call fcn.0052b9e0
cmp dword [esi + 0xc], 0
mov edi, dword [esp + 0x1c]
je 0x52d324
push dword [ebp + 8]
mov edx, edi
mov ecx, ebx
push dword [esp + 0x1c]
push esi
call fcn.0052cc30
add esp, 0xc
cmp dword [ebx + 0x24], 0
jne 0x52d38b
test edi, edi
jne 0x52d38b
mov edx, dword [esi + 4]
mov edi, dword [esi + 0xc]
or edx, 1
mov dword [esi + 4], edx
test edi, edi
je 0x52d38b
mov eax, dword [ebp + 0xc]
and eax, 2
mov dword [ebp + 0xc], eax
je 0x52d34f
or edx, 2
mov dword [esi + 4], edx
cmp dword [esp + 0x20], 0
je 0x52d37e
mov ecx, dword [esi + 0x24]
and edx, 2
cmp ecx, dword [esi + 8]
jne 0x52d369
mov eax, dword [esi + 0x30]
cmp eax, dword [edi + 8]
jl 0x52d37b
mov eax, dword [esi]
push ecx
mov ecx, ebx
push dword [eax]
call fcn.0052b440
add esp, 8
mov dword [esi + 0x40], eax
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x52d38b
mov edx, esi
mov ecx, ebx
call fcn.0052c930
test byte [esi + 4], 2
je 0x52d39f
mov dword [esi + 0x20], 0x52c1a0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx]
mov ecx, 0x52c490
mov edx, 0x52c220
cmp dword [eax + 0x30], 1
cmove ecx, edx
mov dword [esi + 0x20], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret