Function at 0x513e50
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x44
push ebx
mov ebx, dword [esp + 0x50]
xor edx, edx
push ebp
mov ebp, dword [esp + 0x50]
push esi
mov eax, dword [ebx + 0x1c]
push edi
mov edi, dword [ebx + 0x20]
mov esi, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 0x24], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x28], edx
cmp dword [ebx + 0x44], edx
je 0x513e97
push str.cannot_use_window_functions_in_recursive_queries
push ebp
call fcn.00539ba0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push 0
push 0
push 0
push 0x21
push ebp
call fcn.0052e3c0
add esp, 0x14
test eax, eax
jne 0x51449e
dec dword [ebp + 0x38]
mov ecx, 0x140
mov eax, dword [ebp + 0x38]
push eax
push ebx
push ebp
mov dword [esp + 0x28], eax
mov word [ebx + 2], cx
call fcn.004f8b30
mov eax, dword [ebx + 0x3c]
add esp, 0xc
mov ecx, dword [ebx + 0x30]
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x30], eax
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x2c], eax
xor eax, eax
mov dword [ebx + 0x3c], 0
mov dword [ebx + 0xc], 0
mov dword [ebx + 8], 0
mov edx, dword [edi]
mov dword [esp + 0x14], ecx
test edx, edx
jle 0x513f2e
lea ecx, [edi + 0x30]
lea ebx, [ebx]
test byte [ecx], 0x20
jne 0x513f1f
inc eax
add ecx, 0x48
cmp eax, edx
jl 0x513f10
jmp 0x513f2a
lea eax, [eax + eax*8]
mov eax, dword [edi + eax*8 + 0x34]
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x14]
mov edi, dword [ebp + 0x28]
mov dword [esp + 0x10], edi
lea eax, [edi + 1]
mov dword [ebp + 0x28], eax
cmp byte [ebx], 0x86
jne 0x513f56
xor ecx, ecx
mov dword [esp + 0x28], eax
cmp dword [esp + 0x14], ecx
setne cl
add ecx, 5
inc eax
mov dword [ebp + 0x28], eax
jmp 0x513f5d
neg ecx
sbb ecx, ecx
add ecx, 8
inc dword [ebp + 0x2c]
mov edx, dword [ebp + 0x2c]
mov byte [esp + 0x38], cl
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov ecx, dword [esi + 0x74]
mov dword [esp + 0x20], edx
cmp dword [esi + 0x78], ecx
jg 0x513fb1
push dword [esp + 0x24]
push edx
push dword [esp + 0x20]
push 0x78
push esi
call fcn.00515850
mov edx, dword [esp + 0x38]
add esp, 0x14
jmp 0x513fe4
mov ebx, dword [esp + 0x18]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4 + 8], edx
mov edx, dword [esp + 0x24]
mov dword [eax + ecx*4 + 4], ebx
mov ebx, dword [esp + 0x5c]
mov dword [eax + ecx*4], 0x78
mov dword [eax + ecx*4 + 0xc], edx
mov dword [eax + ecx*4 + 0x10], 0
cmp dword [esp + 0x14], 0
je 0x514019
push 1
push ebx
push ebp
call fcn.0051de30
push 0xfffffffffffffff7
push eax
mov eax, dword [esp + 0x28]
push 0
mov eax, dword [eax]
add eax, 2
push eax
push edi
push 0x74
push esi
call fcn.00560e10
mov eax, dword [esp + 0x3c]
add esp, 0x28
mov dword [esp + 0x50], eax
jmp 0x51405d
mov ecx, dword [esi + 0x74]
cmp dword [esi + 0x78], ecx
jg 0x514032
push 0
push edx
push edi
push 0x74
push esi
call fcn.00515850
add esp, 0x14
jmp 0x51405d
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4], 0x74
mov dword [eax + ecx*4 + 4], edi
mov dword [eax + ecx*4 + 8], edx
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
mov edi, dword [esp + 0x28]
test edi, edi
je 0x5140bb
mov edx, dword [esi + 0x74]
cmp dword [esi + 0x78], edx
jg 0x514081
push 0
push 0
push edi
push 0x74
push esi
call fcn.00515850
add esp, 0x14
mov edx, eax
jmp 0x5140b4
mov ebx, dword [esp + 0x5c]
lea eax, [edx + 1]
mov dword [esi + 0x74], eax
lea ecx, [edx + edx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4], 0x74
mov dword [eax + ecx*4 + 4], edi
mov dword [eax + ecx*4 + 8], 0
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
mov dword [ebx + 0x14], edx
or dword [ebx + 4], 0x20
mov dword [ebx + 0x30], 0
mov edi, ebx
test byte [edi + 4], 8
jne 0x51446f
mov eax, dword [edi + 0x34]
mov byte [edi], 0x87
test dword [eax + 4], 0x2000
je 0x5140e3
mov edi, eax
test edi, edi
jne 0x5140c4
mov eax, dword [edi + 0x34]
push str.SETUP
push 1
push ebp
mov dword [esp + 0x30], eax
mov dword [eax + 0x38], 0
call fcn.00568be0
lea eax, [esp + 0x44]
push eax
push dword [esp + 0x34]
push ebp
call fcn.00558140
mov ecx, dword [esp + 0x3c]
add esp, 0x18
mov dword [ecx + 0x38], ebx
test eax, eax
jne 0x51447d
mov ecx, dword [esi + 0x74]
mov dword [esp + 0x28], ecx
cmp dword [esi + 0x78], ecx
jg 0x514147
mov edx, dword [esp + 0x1c]
push eax
push edx
mov edx, dword [esp + 0x18]
push edx
push 0x26
push esi
call fcn.00515850
add esp, 0x14
mov dword [esp + 0x28], eax
jmp 0x51417a
mov edx, dword [esp + 0x10]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4 + 4], edx
mov edx, dword [esp + 0x1c]
mov dword [eax + ecx*4], 0x26
mov dword [eax + ecx*4 + 8], edx
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
mov ecx, dword [esi + 0x74]
cmp dword [esi + 0x78], ecx
jg 0x51419a
push 0
push 0
push dword [esp + 0x20]
push 0x87
push esi
call fcn.00515850
add esp, 0x14
jmp 0x5141cd
mov edx, dword [esp + 0x18]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4], 0x87
mov dword [eax + ecx*4 + 4], edx
mov dword [eax + ecx*4 + 8], 0
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x74]
test eax, eax
je 0x51422a
mov eax, dword [eax]
inc eax
mov dword [esp + 0x58], eax
cmp dword [esi + 0x78], ecx
jg 0x514201
push dword [esp + 0x20]
push eax
push dword [esp + 0x18]
push 0x5d
push esi
call fcn.00515850
mov edx, dword [esp + 0x24]
add esp, 0x14
jmp 0x514284
mov ebx, dword [esp + 0x58]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4 + 8], ebx
mov ebx, dword [esp + 0x20]
mov dword [eax + ecx*4 + 0xc], ebx
mov ebx, dword [esp + 0x5c]
mov dword [eax + ecx*4], 0x5d
jmp 0x514274
cmp dword [esi + 0x78], ecx
jg 0x51424d
push 0
push dword [esp + 0x24]
push dword [esp + 0x18]
push 0x85
push esi
call fcn.00515850
mov edx, dword [esp + 0x24]
add esp, 0x14
jmp 0x514284
mov ebp, dword [esp + 0x20]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4 + 8], ebp
mov ebp, dword [esp + 0x58]
mov dword [eax + ecx*4], 0x85
mov dword [eax + ecx*4 + 0xc], 0
mov edx, dword [esp + 0x10]
mov dword [eax + ecx*4 + 0x10], 0
mov dword [eax + ecx*4 + 4], edx
mov ecx, dword [esi + 0x74]
cmp dword [esi + 0x78], ecx
jg 0x5142a1
push 0
push 0
push edx
push 0x81
push esi
call fcn.00515850
add esp, 0x14
jmp 0x5142d4
mov ebx, dword [esp + 0x5c]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4], 0x81
mov dword [eax + ecx*4 + 4], edx
mov dword [eax + ecx*4 + 8], 0
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
dec dword [ebp + 0x38]
mov eax, dword [esp + 0x2c]
mov edx, dword [ebp + 0x38]
mov dword [esp + 0x58], edx
test eax, eax
jle 0x514336
mov ecx, dword [esi + 0x74]
cmp dword [esi + 0x78], ecx
jg 0x514303
push 1
push edx
push eax
push 0x31
push esi
call fcn.00515850
mov edx, dword [esp + 0x6c]
add esp, 0x14
jmp 0x514336
mov ebx, dword [esp + 0x2c]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4 + 4], ebx
mov ebx, dword [esp + 0x5c]
mov dword [eax + ecx*4], 0x31
mov dword [eax + ecx*4 + 8], edx
mov dword [eax + ecx*4 + 0xc], 1
mov dword [eax + ecx*4 + 0x10], 0
push dword [esp + 0x1c]
push edx
push dword [esp + 0x68]
push 0
push 0
push dword [esp + 0x2c]
push ebx
push ebp
call fcn.0052a6e0
mov edx, dword [esp + 0x50]
add esp, 0x20
test edx, edx
je 0x5143a8
mov ecx, dword [esi + 0x74]
cmp dword [esi + 0x78], ecx
jg 0x514375
push 0
push dword [esp + 0x20]
push edx
push 0x3c
push esi
call fcn.00515850
add esp, 0x14
jmp 0x5143a8
mov ebx, dword [esp + 0x5c]
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4 + 4], edx
mov edx, dword [esp + 0x1c]
mov dword [eax + ecx*4], 0x3c
mov dword [eax + ecx*4 + 8], edx
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
mov ecx, dword [esi + 0xc]
mov edx, dword [esp + 0x58]
not edx
mov eax, dword [ecx + 0x3c]
add eax, dword [ecx + 0x38]
jns 0x5143c6
push edx
push esi
push ecx
call fcn.005278f0
add esp, 0xc
jmp 0x5143cf
mov ecx, dword [ecx + 0x40]
mov eax, dword [esi + 0x74]
mov dword [ecx + edx*4], eax
push str.RECURSIVE_STEP
push 1
push ebp
mov dword [edi + 0x34], 0
call fcn.00568be0
lea eax, [esp + 0x44]
push eax
push ebx
push ebp
call fcn.00558140
mov eax, dword [esp + 0x3c]
add esp, 0x18
mov edx, dword [esp + 0x28]
mov dword [edi + 0x34], eax
mov ecx, dword [esi + 0x74]
cmp dword [esi + 0x78], ecx
jg 0x514417
push 0
push edx
push 0
push 0xb
push esi
call fcn.00515850
add esp, 0x14
jmp 0x514446
lea eax, [ecx + 1]
mov dword [esi + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [esi + 0x70]
mov dword [eax + ecx*4], 0xb
mov dword [eax + ecx*4 + 4], 0
mov dword [eax + ecx*4 + 8], edx
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
mov ecx, dword [esi + 0xc]
mov edx, dword [esp + 0x1c]
not edx
mov eax, dword [ecx + 0x3c]
add eax, dword [ecx + 0x38]
jns 0x514464
push edx
push esi
push ecx
call fcn.005278f0
add esp, 0xc
jmp 0x51447d
mov ecx, dword [ecx + 0x40]
mov eax, dword [esi + 0x74]
mov dword [ecx + edx*4], eax
jmp 0x51447d
push str.recursive_aggregate_queries_not_supported
push ebp
call fcn.00539ba0
add esp, 8
mov eax, dword [ebx + 0x30]
test eax, eax
je 0x514490
push eax
push dword [ebp]
call fcn.004fef40
add esp, 8
mov eax, dword [esp + 0x14]
mov dword [ebx + 0x30], eax
mov eax, dword [esp + 0x34]
mov dword [ebx + 0x3c], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret