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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x94
mov eax, dword [0x5c1068]
xor eax, esp
mov dword [esp + 0x90], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
mov eax, dword [esi]
test eax, eax
je 0x507222
cmp byte [esi + 0x10], 0
jne 0x507222
push eax
call fcn.00507100
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x5074dd
mov edx, dword [ebx + 8]
mov ecx, dword [edi]
push 0
call fcn.004c5810
add esp, 4
mov dword [esi + 8], eax
mov edx, dword [ebx + 0xc]
mov ecx, dword [edi]
push 0
call fcn.004c5810
mov dword [esi + 0xc], eax
add esp, 4
mov edx, dword [ebx + 0x18]
test edx, edx
je 0x5071e4
mov ecx, dword [edi]
push 0
push 0
call fcn.004c54c0
add esp, 8
jmp 0x5071e6
xor eax, eax
mov dword [esi + 0x18], eax
mov edx, dword [ebx + 0x1c]
test edx, edx
je 0x507200
mov ecx, dword [edi]
push 0
push 0
call fcn.004c54c0
add esp, 8
jmp 0x507202
xor eax, eax
mov dword [esi + 0x1c], eax
movzx eax, byte [ebx + 0x11]
mov byte [esi + 0x11], al
movzx eax, byte [ebx + 0x12]
mov byte [esi + 0x12], al
mov cl, byte [ebx + 0x10]
mov byte [esi + 0x10], cl
movzx eax, byte [ebx + 0x14]
mov byte [esi + 0x14], al
jmp 0x507230
push edx
mov edx, esi
call fcn.00508030
mov cl, byte [esi + 0x10]
add esp, 4
mov ebx, dword [ebp + 0xc]
cmp cl, 0x59
jne 0x507276
cmp dword [esi + 0x18], 0
jne 0x507244
cmp dword [esi + 0x1c], 0
je 0x507276
mov eax, dword [esi + 0xc]
test eax, eax
je 0x507250
cmp dword [eax], 1
je 0x507276
push str.RANGE_with_offset_PRECEDING_FOLLOWING_requires_one_ORDER_BY_expression
push edi
call fcn.00493be0
add esp, 8
mov dword [esi + 0x2c], ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x90]
xor ecx, esp
call fcn.005349ca
mov esp, ebp
pop ebp
ret
test dword [ebx + 4], 0x10000
je 0x5074da
cmp dword [esi + 0x28], 0
mov eax, dword [edi]
mov dword [esp + 0xc], eax
je 0x5072b5
push str.FILTER_clause_may_only_be_used_with_aggregate_window_functions
push edi
call fcn.00493be0
add esp, 8
mov dword [esi + 0x2c], ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x90]
xor ecx, esp
call fcn.005349ca
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebx + 0x20]
lea eax, [esp + 0x18]
mov dword [esp + 0x18], str.row_number
xor edi, edi
mov dword [esp + 0x1c], 0x4c
mov dword [esp + 0x20], 0x5a
mov dword [esp + 0x24], 0x55
mov dword [esp + 0x28], str.dense_rank
mov dword [esp + 0x2c], 0x59
mov dword [esp + 0x30], 0x5a
mov dword [esp + 0x34], 0x55
mov dword [esp + 0x38], str.rank
mov dword [esp + 0x3c], 0x59
mov dword [esp + 0x40], 0x5a
mov dword [esp + 0x44], 0x55
mov dword [esp + 0x48], str.percent_rank
mov dword [esp + 0x4c], 0x5c
mov dword [esp + 0x50], 0x55
mov dword [esp + 0x54], 0x5a
mov dword [esp + 0x58], str.cume_dist
mov dword [esp + 0x5c], 0x5c
mov dword [esp + 0x60], 0x56
mov dword [esp + 0x64], 0x5a
mov dword [esp + 0x68], str.ntile
mov dword [esp + 0x6c], 0x4c
mov dword [esp + 0x70], 0x55
mov dword [esp + 0x74], 0x5a
mov dword [esp + 0x78], str.lead
mov dword [esp + 0x7c], 0x4c
mov dword [esp + 0x80], 0x5a
mov dword [esp + 0x84], 0x5a
mov dword [esp + 0x88], 0x597ba0
mov dword [esp + 0x8c], 0x4c
mov dword [esp + 0x90], 0x5a
mov dword [esp + 0x94], 0x55
cmp ecx, dword [eax]
je 0x5073f5
inc edi
add eax, 0x10
cmp edi, 8
jl 0x5073d0
mov dword [esi + 0x2c], ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x90]
xor ecx, esp
call fcn.005349ca
mov esp, ebp
pop ebp
ret
mov edx, dword [esi + 0x18]
test edx, edx
je 0x507405
mov ecx, dword [esp + 0xc]
call fcn.004c52d0
mov edx, dword [esi + 0x1c]
test edx, edx
je 0x507415
mov ecx, dword [esp + 0xc]
call fcn.004c52d0
add edi, edi
mov dword [esi + 0x18], 0
mov dword [esi + 0x1c], 0
mov byte [esi + 0x14], 0
movzx eax, byte [esp + edi*8 + 0x1c]
mov cl, byte [esp + edi*8 + 0x20]
mov byte [esi + 0x10], al
movzx eax, byte [esp + edi*8 + 0x24]
mov byte [esi + 0x11], cl
mov byte [esi + 0x12], al
cmp cl, 0x56
jne 0x5074da
xor edi, edi
lea edx, [esp + 0x10]
mov ecx, 0x593be4
mov dword [esp + 0x10], edi
call fcn.00494680
test eax, eax
mov ecx, 2
push 0
cmove edi, ecx
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x18], edi
lea eax, [edi + 0x34]
push eax
call fcn.00490ae0
mov edi, eax
add esp, 8
test edi, edi
je 0x5074d7
push 0x34
push 0
push edi
call fcn.0054d380
or eax, 0xffffffff
mov byte [edi], 0x98
add esp, 0xc
mov word [edi + 0x22], ax
cmp dword [esp + 0x14], 0
jne 0x5074bc
mov eax, dword [esp + 0x10]
mov ecx, 0x20800400
test eax, eax
mov dword [edi + 8], eax
mov edx, 0x10800400
cmovne ecx, edx
or dword [edi + 4], ecx
jmp 0x5074d0
lea ecx, [edi + 0x34]
mov dword [edi + 8], ecx
mov al, byte [0x593be4]
mov byte [ecx], al
mov eax, dword [edi + 8]
mov byte [eax + 1], 0
mov dword [edi + 0x18], 1
mov dword [esi + 0x18], edi
mov dword [esi + 0x2c], ebx
mov ecx, dword [esp + 0x9c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.005349ca
mov esp, ebp
pop ebp
ret