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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x58
mov dword [rsp + 0x4c], r9d
mov ebx, r8d
mov r13d, edx
mov rdi, rcx
mov r15, qword [rcx]
mov r14, qword [rcx + 8]
mov rsi, qword [rcx + 0x10]
mov cl, byte [r14 + 0x20]
cmp cl, 0x4c
setne byte [rsp + 0x37]
mov ebp, dword [r15 + 0x44]
lea eax, [rbp - 1]
mov dword [rsp + 0x30], eax
mov dword [r15 + 0x44], eax
cmp edx, 2
jne 0x508af7
xor r12d, r12d
cmp byte [r14 + 0x21], 0x5a
je 0x509461
test ebx, ebx
mov byte [rsp + 0x36], cl
jle 0x508b8d
mov eax, dword [rsi + 0x90]
cmp cl, 0x59
jne 0x508b47
mov dword [rsp + 0x38], eax
cmp r13d, 2
jne 0x508bbe
cmp byte [r14 + 0x21], 0x56
jne 0x508c16
mov eax, dword [rdi + 0x2c]
mov r8d, dword [rdi + 0x34]
mov ecx, dword [rsp + 0x30]
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], eax
mov rcx, rdi
mov edx, 0x37
jmp 0x508c31
cmp dword [rsi + 0x94], eax
jle 0x508be9
cdqe
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x31
mov dword [rcx + rax*8 + 4], ebx
mov edx, dword [rsp + 0x30]
mov dword [rcx + rax*8 + 8], edx
mov dword [rcx + rax*8 + 0xc], 1
mov qword [rcx + rax*8 + 0x10], 0
mov dword [rsp + 0x38], 0
cmp r13d, 1
jne 0x508c39
cmp dword [r14 + 0x84], 0
jne 0x508c39
mov rcx, qword [rdi]
mov rdx, qword [rdi + 8]
xor r8d, r8d
call fcn.00506e30
jmp 0x508c39
mov eax, dword [rdi + 0x34]
mov r8d, dword [rdi + 0x3c]
mov ecx, dword [rsp + 0x30]
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], eax
mov rcx, rdi
mov edx, 0x36
mov r9d, ebx
call fcn.00509480
cmp r13d, 1
je 0x508b9f
jmp 0x508c39
mov dword [rsp + 0x20], 1
mov rcx, rsi
mov edx, 0x31
mov r8d, ebx
mov r9d, dword [rsp + 0x30]
call fcn.0047df60
mov dword [rsp + 0x38], 0
cmp r13d, 1
jne 0x508c39
jmp 0x508b9f
mov r8d, dword [rdi + 0x2c]
mov eax, dword [rdi + 0x34]
mov ecx, dword [rsp + 0x30]
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], eax
mov rcx, rdi
mov edx, 0x39
mov r9d, ebx
call fcn.00509480
movsxd rdx, dword [rsi + 0x90]
mov al, byte [r14 + 0x21]
cmp al, byte [r14 + 0x22]
setne al
test ebx, ebx
setne cl
cmp cl, al
mov qword [rsp + 0x50], rdx
je 0x508f42
test ebx, ebx
je 0x508f42
cmp byte [r14 + 0x20], 0x59
jne 0x508f42
mov al, byte [r15 + 0x1f]
test al, al
je 0x508d2a
lea ecx, [rax - 1]
mov byte [r15 + 0x1f], cl
movzx ecx, cl
mov r12d, dword [r15 + rcx*4 + 0xd8]
test cl, cl
je 0x508d4b
add al, 0xfe
mov byte [r15 + 0x1f], al
movzx eax, al
mov ebx, dword [r15 + rax*4 + 0xd8]
cmp r13d, 2
je 0x508d60
cmp dword [rdi + 0x28], 0
je 0x508dfe
mov r8d, dword [rdi + 0x3c]
cmp dword [rsi + 0x94], edx
jle 0x508ea0
lea eax, [rdx + 1]
mov dword [rsi + 0x90], eax
mov rax, qword [rsi + 0x88]
lea rcx, [rdx + rdx*2]
mov dword [rax + rcx*8], 0x87
mov dword [rax + rcx*8 + 4], r8d
mov dword [rax + rcx*8 + 8], r12d
mov dword [rax + rcx*8 + 0xc], 0
mov qword [rax + rcx*8 + 0x10], 0
mov r8d, dword [rdi + 0x28]
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jg 0x508ecf
mov dword [rsp + 0x20], r12d
mov rcx, rsi
mov edx, 0x39
jmp 0x508df4
mov ebx, dword [r15 + 0x38]
add ebx, 1
mov dword [r15 + 0x38], ebx
mov r12d, ebx
add ebx, 1
mov dword [r15 + 0x38], ebx
cmp r13d, 2
jne 0x508cb1
jmp 0x508d60
mov ebx, dword [r15 + 0x38]
add ebx, 1
mov dword [r15 + 0x38], ebx
cmp r13d, 2
jne 0x508cb1
mov r8d, dword [rdi + 0x2c]
cmp dword [rsi + 0x94], edx
jle 0x508e0c
lea eax, [rdx + 1]
mov dword [rsi + 0x90], eax
mov rax, qword [rsi + 0x88]
lea rcx, [rdx + rdx*2]
mov dword [rax + rcx*8], 0x87
mov dword [rax + rcx*8 + 4], r8d
mov dword [rax + rcx*8 + 8], r12d
mov dword [rax + rcx*8 + 0xc], 0
mov qword [rax + rcx*8 + 0x10], 0
mov r8d, dword [rdi + 0x3c]
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jg 0x508e37
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x87
mov r9d, ebx
call fcn.0047df60
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jg 0x508e7f
mov dword [rsp + 0x20], r12d
mov rcx, rsi
mov edx, 0x39
mov r8d, ebx
mov r9d, dword [rsp + 0x30]
call fcn.0047df60
test r12d, r12d
jne 0x508f0a
jmp 0x508f24
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x87
mov r9d, r12d
call fcn.0047df60
mov r8d, dword [rdi + 0x3c]
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x508db9
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x87
mov dword [rcx + rax*8 + 4], r8d
mov dword [rcx + rax*8 + 8], ebx
mov dword [rcx + rax*8 + 0xc], 0
mov qword [rcx + rax*8 + 0x10], 0
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x508de4
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x39
mov dword [rcx + rax*8 + 4], ebx
jmp 0x508eef
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x87
mov r9d, r12d
call fcn.0047df60
mov r8d, dword [rdi + 0x28]
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x508d18
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x39
mov dword [rcx + rax*8 + 4], r8d
mov edx, dword [rsp + 0x30]
mov dword [rcx + rax*8 + 8], edx
mov dword [rcx + rax*8 + 0xc], r12d
mov qword [rcx + rax*8 + 0x10], 0
test r12d, r12d
je 0x508f24
movzx eax, byte [r15 + 0x1f]
cmp rax, 7
ja 0x508f24
lea ecx, [rax + 1]
mov byte [r15 + 0x1f], cl
mov dword [r15 + rax*4 + 0xd8], r12d
test ebx, ebx
je 0x508f42
movzx eax, byte [r15 + 0x1f]
cmp rax, 7
ja 0x508f42
lea ecx, [rax + 1]
mov byte [r15 + 0x1f], cl
mov dword [r15 + rax*4 + 0xd8], ebx
cmp r13d, 2
jge 0x508f6f
mov ebx, dword [rdi + 0x34]
mov eax, dword [rdi + 0x38]
mov dword [rsp + 0x3c], eax
mov rcx, rdi
call fcn.005072a0
mov eax, dword [rsi + 0x90]
cmp dword [rdi + 0x24], r13d
je 0x509088
jmp 0x5090ff
jne 0x508fe1
mov ebx, dword [rdi + 0x2c]
mov eax, dword [rdi + 0x30]
mov dword [rsp + 0x3c], eax
mov r8d, dword [r14 + 0x84]
test r8d, r8d
je 0x509037
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x50900b
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x56
mov dword [rcx + rax*8 + 4], r8d
mov qword [rcx + rax*8 + 8], 1
mov qword [rcx + rax*8 + 0x10], 0
mov eax, dword [rsi + 0x90]
cmp dword [rdi + 0x24], r13d
je 0x509088
jmp 0x5090ff
mov ebx, dword [rdi + 0x3c]
mov eax, dword [rdi + 0x40]
mov dword [rsp + 0x3c], eax
cmp dword [r14 + 0x84], 0
je 0x509064
mov r8d, dword [r14 + 0x88]
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jg 0x508f9a
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x56
mov r9d, 1
call fcn.0047df60
mov eax, dword [rsi + 0x90]
cmp dword [rdi + 0x24], r13d
je 0x509088
jmp 0x5090ff
mov eax, dword [rdi + 0x20]
mov rcx, qword [rdi]
mov dword [rsp + 0x20], eax
mov rdx, r14
mov r8d, ebx
mov r9d, 1
call fcn.00509d20
mov eax, dword [rsi + 0x90]
cmp dword [rdi + 0x24], r13d
jne 0x5090ff
jmp 0x509088
mov eax, dword [rdi + 0x20]
mov rcx, qword [rdi]
mov dword [rsp + 0x20], eax
mov rdx, r14
mov r8d, ebx
xor r9d, r9d
call fcn.00509d20
mov eax, dword [rsi + 0x90]
cmp dword [rdi + 0x24], r13d
jne 0x5090ff
cmp dword [rsi + 0x94], eax
jle 0x5090c5
cdqe
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x82
mov dword [rcx + rax*8 + 4], ebx
xorps xmm0, xmm0
movups xmmword [rcx + rax*8 + 8], xmm0
mov eax, dword [rsi + 0x90]
test eax, eax
jg 0x5090ea
jmp 0x5090ff
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x82
mov r8d, ebx
xor r9d, r9d
call fcn.0047df60
mov eax, dword [rsi + 0x90]
test eax, eax
jle 0x5090ff
mov rcx, qword [rsi + 0x88]
lea edx, [rax - 1]
lea rdx, [rdx + rdx*2]
mov word [rcx + rdx*8 + 2], 2
cmp dword [rsp + 0x4c], 0
mov dword [rsp + 0x48], ebx
je 0x509197
lea r9d, [rax + 2]
cmp dword [rsi + 0x94], eax
jle 0x5091fd
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
cdqe
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x26
mov dword [rcx + rax*8 + 4], ebx
mov dword [rcx + rax*8 + 8], r9d
mov dword [rcx + rax*8 + 0xc], 0
mov qword [rcx + rax*8 + 0x10], 0
mov r12d, dword [rsi + 0x90]
cmp dword [rsi + 0x94], r12d
jg 0x509229
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 8
xor r8d, r8d
xor r9d, r9d
call fcn.0047df60
mov r12d, eax
cmp byte [rsp + 0x36], 0x4c
jne 0x5092f4
jmp 0x5093d1
xor ecx, ecx
mov dl, byte [rsp + 0x37]
mov cl, dl
lea r9d, [rax + rcx]
add r9d, 1
cmp dword [rsi + 0x94], eax
jle 0x509265
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
cdqe
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x26
mov dword [rcx + rax*8 + 4], ebx
mov dword [rcx + rax*8 + 8], r9d
mov dword [rcx + rax*8 + 0xc], 0
mov qword [rcx + rax*8 + 0x10], 0
xor r12d, r12d
cmp byte [rsp + 0x36], 0x4c
jne 0x50928b
jmp 0x5093d1
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x26
mov r8d, ebx
call fcn.0047df60
mov r12d, dword [rsi + 0x90]
cmp dword [rsi + 0x94], r12d
jle 0x509169
movsxd rax, r12d
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov byte [rcx + rax*8], 8
xorps xmm0, xmm0
movups xmmword [rcx + rax*8 + 1], xmm0
mov qword [rcx + rax*8 + 0x10], 0
cmp byte [rsp + 0x36], 0x4c
jne 0x5092f4
jmp 0x5093d1
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x26
mov r8d, ebx
call fcn.0047df60
xor r12d, r12d
cmp byte [rsp + 0x36], 0x4c
je 0x5093d1
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x5092d4
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov qword [rcx + rax*8], 8
mov edx, dword [rsp + 0x30]
mov dword [rcx + rax*8 + 8], edx
mov dword [rcx + rax*8 + 0xc], 0
mov qword [rcx + rax*8 + 0x10], 0
xor r12d, r12d
jmp 0x5092f4
mov dword [rsp + 0x20], 0
xor r12d, r12d
mov rcx, rsi
mov edx, 8
xor r8d, r8d
mov r9d, dword [rsp + 0x30]
call fcn.0047df60
mov r13d, dword [rsp + 0x3c]
mov rax, qword [r14 + 0x18]
test rax, rax
mov qword [rsp + 0x40], rbp
je 0x50932d
mov ebx, dword [rax]
test ebx, ebx
je 0x509333
cmp ebx, 1
jne 0x509337
mov al, byte [r15 + 0x1f]
test al, al
je 0x50935f
add al, 0xff
mov byte [r15 + 0x1f], al
movzx eax, al
mov ebp, dword [r15 + rax*4 + 0xd8]
jmp 0x50936a
xor ebx, ebx
xor ebp, ebp
jmp 0x50936f
mov ebp, ebx
jmp 0x50936f
mov eax, dword [r15 + 0x28]
sub eax, ebx
jge 0x50934e
mov eax, dword [r15 + 0x38]
lea ebp, [rax + 1]
add eax, ebx
mov dword [r15 + 0x38], eax
jmp 0x50936f
mov ebp, dword [r15 + 0x2c]
lea ecx, [rbx + rbp]
mov dword [r15 + 0x2c], ecx
mov dword [r15 + 0x28], eax
jmp 0x50936f
mov ebp, dword [r15 + 0x38]
add ebp, 1
mov dword [r15 + 0x38], ebp
mov ebx, 1
mov rcx, rdi
mov edx, dword [rsp + 0x48]
mov r8d, ebp
call fcn.00509c50
mov rdx, qword [r14 + 0x18]
mov rax, qword [rsp + 0x50]
mov dword [rsp + 0x20], eax
mov rcx, r15
mov r8d, ebp
mov r9d, r13d
call fcn.00508700
cmp ebx, 1
jne 0x5093be
test ebp, ebp
je 0x5093cc
movzx eax, byte [r15 + 0x1f]
cmp rax, 7
ja 0x5093cc
lea ecx, [rax + 1]
mov byte [r15 + 0x1f], cl
mov dword [r15 + rax*4 + 0xd8], ebp
jmp 0x5093cc
cmp dword [r15 + 0x28], ebx
jge 0x5093cc
mov dword [r15 + 0x28], ebx
mov dword [r15 + 0x2c], ebp
mov rbp, qword [rsp + 0x40]
mov r9d, dword [rsp + 0x38]
test r9d, r9d
je 0x509436
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x50941e
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov qword [rcx + rax*8], 8
mov dword [rcx + rax*8 + 8], r9d
mov dword [rcx + rax*8 + 0xc], 0
mov qword [rcx + rax*8 + 0x10], 0
jmp 0x509436
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 8
xor r8d, r8d
call fcn.0047df60
mov rcx, qword [rsi + 0x18]
neg ebp
mov eax, dword [rcx + 0x44]
add eax, dword [rcx + 0x48]
js 0x509456
mov eax, dword [rsi + 0x90]
mov rcx, qword [rcx + 0x50]
movsxd rdx, ebp
mov dword [rcx + rdx*4], eax
jmp 0x509461
mov rdx, rsi
mov r8d, ebp
call fcn.004d3e00
mov eax, r12d
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret