Function at 0x509490
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, 0x288
mov rsi, rdx
mov rdi, rcx
lea rcx, [rsp + 0x88]
mov r8d, 0x200
xor edx, edx
call sub.msvcrt.dll_memset
mov rcx, qword [rdi + 0x18]
mov rax, rcx
mov qword [rsp + 0x68], rcx
test rcx, rcx
je 0x5095e6
mov qword [rsp + 0x60], rsi
mov rax, qword [rdi + 0x10]
mov qword [rsp + 0x58], rax
movzx r12d, byte [rax]
mov rax, qword [rdi + 8]
test rax, rax
mov qword [rsp + 0x80], rdi
je 0x509608
mov rcx, qword [rdi]
add rax, rcx
xor r14d, r14d
nop word cs:[rax + rax]
movzx edx, byte [rcx]
test dl, dl
js 0x509530
inc rcx
cmp r14, 0x80
jne 0x5095d0
jmp 0x5099e9
mov r8d, edx
and r8d, 0x1f
movzx r10d, byte [rcx + 1]
and r10d, 0x3f
cmp dl, 0xdf
jbe 0x509591
movzx r9d, byte [rcx + 2]
shl r10d, 6
and r9d, 0x3f
or r9d, r10d
cmp dl, 0xf0
jb 0x5095ad
movzx edx, byte [rcx + 3]
and r8d, 7
shl r8d, 0x12
shl r9d, 6
and edx, 0x3f
or edx, r9d
or edx, r8d
cmp edx, 0x110000
je 0x50960b
add rcx, 4
cmp r14, 0x80
jne 0x5095d0
jmp 0x5099e9
add rcx, 2
shl r8d, 6
or r8d, r10d
mov edx, r8d
cmp r14, 0x80
jne 0x5095d0
jmp 0x5099e9
add rcx, 3
shl r8d, 0xc
or r9d, r8d
mov edx, r9d
cmp r14, 0x80
je 0x5099e9
nop dword [rax + rax]
mov dword [rsp + r14*4 + 0x88], edx
inc r14
cmp rcx, rax
jne 0x509510
jmp 0x50960b
mov rdx, qword [rdi]
mov r8, qword [rdi + 8]
mov rcx, rsi
add rsp, 0x288
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp fcn.00518a00
xor r14d, r14d
mov rax, qword [rsp + 0x68]
mov r13, qword [rsp + 0x58]
add rax, r13
mov qword [rsp + 0x70], rax
lea rax, [r14 - 1]
mov qword [rsp + 0x78], rax
lea rax, [r14*4 + 4]
mov qword [rsp + 0x30], rax
lea rbx, [rsp + r14*4]
add rbx, 0x88
mov rax, r14
neg rax
mov qword [rsp + 0x40], rax
mov ecx, r14d
xor cl, 3
lea rax, [r14 + 1]
mov qword [rsp + 0x50], rax
mov eax, 0x2bc
mov qword [rsp + 0x28], rax
mov r15d, 0x48
mov eax, pe_nt_image_headers64
mov qword [rsp + 0x20], rax
mov r10d, 1
mov r11d, 0x1a
xor eax, eax
mov qword [rsp + 0x48], rax
xor r9d, r9d
mov edx, 0x24
sub rdx, r15
mov eax, 0
cmovae rax, rdx
cmp rax, 2
cmovb rax, r10
cmp rax, 0x1a
cmovae rax, r11
lea edx, [r12 - 0x61]
cmp dl, 0x1a
jb 0x5096c8
lea edx, [r12 - 0x30]
cmp dl, 9
ja 0x5099e9
add r12b, 0xea
mov edx, r12d
mov edi, 0x1a
inc r13
movzx r10d, dl
cmp rax, r10
jbe 0x509710
add r9, r10
cmovae r8, r9
jb 0x5099e9
lea rbp, [r14 + 1]
mov rax, r8
or rax, rbp
shr rax, 0x20
je 0x5097b2
mov rax, r8
xor edx, edx
div rbp
mov r9, rdx
jmp 0x5097bc
mov r11d, 0x24
sub r11, rax
mov ebp, 0x48
nop
mov rax, rbp
sub rax, r15
mov esi, 0
cmovae rsi, rax
cmp rsi, 2
mov eax, 1
cmovb rsi, rax
cmp rsi, 0x1a
cmovae rsi, rdi
cmp r13, qword [rsp + 0x70]
je 0x5099e9
movzx eax, byte [r13]
lea edx, [rax - 0x61]
cmp dl, 0x1a
jb 0x50976c
lea edx, [rax - 0x30]
cmp dl, 0xa
jae 0x5099e9
add al, 0xea
mov edx, eax
movzx r12d, dl
mov rax, r12
mul r11
jo 0x5099e9
add r10, rax
jb 0x5099e9
inc r13
cmp rsi, r12
ja 0x5096d9
mov r12d, 0x24
sub r12, rsi
add rbp, 0x24
mov rax, r11
mul r12
mov r11, rax
jno 0x509720
jmp 0x5099e9
mov eax, r8d
xor edx, edx
div ebp
mov r9d, edx
mov r11, qword [rsp + 0x20]
mov rdx, r11
add rdx, rax
cmovae r11, rdx
mov qword [rsp + 0x20], r11
jb 0x5099e9
mov rax, qword [rsp + 0x20]
shr rax, 0x20
jne 0x5099e9
mov rax, qword [rsp + 0x20]
xor eax, 0xd800
add eax, 0xfffff800
cmp eax, 0x10f7ff
ja 0x5099e9
cmp dword [rsp + 0x20], 0x110000
je 0x5099e9
cmp r14, 0x7f
ja 0x5099e9
cmp r14, r9
jbe 0x5098c8
mov rax, qword [rsp + 0x78]
mov rdx, qword [rsp + 0x48]
lea r11, [rax + rdx]
mov eax, r14d
sub eax, r9d
sub r11, r9
test al, 3
mov rsi, qword [rsp + 0x50]
je 0x50989b
mov rax, r8
or rax, rsi
shr rax, 0x20
je 0x509859
mov rax, r8
xor edx, edx
div rsi
mov rdx, rax
jmp 0x509862
mov eax, r8d
xor edx, edx
div esi
mov edx, eax
xor esi, esi
nop word cs:[rax + rax]
mov eax, dword [rbx + rsi*4 - 4]
mov dword [rbx + rsi*4], eax
dec rsi
mov eax, ecx
mul dl
add al, r8b
mov r15d, r14d
sub r15b, al
movzx eax, r15b
and eax, 3
add rax, rsi
jne 0x509870
sub rsi, qword [rsp + 0x40]
mov r14, rsi
cmp r11, 3
jb 0x5098c8
nop word cs:[rax + rax]
movups xmm0, xmmword [rsp + r14*4 + 0x78]
movups xmmword [rsp + r14*4 + 0x7c], xmm0
lea rax, [r14 - 4]
mov r14, rax
cmp rax, r9
ja 0x5098b0
cmp r9, 0x80
jae 0x509ac3
mov rax, qword [rsp + 0x20]
mov dword [rsp + r9*4 + 0x88], eax
cmp r13, qword [rsp + 0x70]
je 0x509a81
movzx r12d, byte [r13]
mov rax, r10
shr rax, 0x20
mov r14, qword [rsp + 0x30]
je 0x50990f
mov rax, r10
xor edx, edx
div qword [rsp + 0x28]
mov r11, rax
jmp 0x50991b
mov eax, r10d
xor edx, edx
div dword [rsp + 0x28]
mov r11d, eax
movabs rdi, 0xea0ea0ea0ea0ea0f
mov rax, r11
or rax, rbp
shr rax, 0x20
je 0x50994c
mov rax, r11
xor edx, edx
div rbp
mov r10, rax
add r10, r11
xor esi, esi
cmp r10, 0x1c8
jae 0x509964
jmp 0x50998d
mov eax, r11d
xor edx, edx
div ebp
mov r10d, eax
add r10, r11
xor esi, esi
cmp r10, 0x1c8
jb 0x50998d
mov r11, r10
nop word [rax + rax]
mov rax, r11
mul rdi
mov r10, rdx
shr r10, 5
add rsi, 0x24
cmp r11, 0x3e57
mov r11, r10
ja 0x509970
inc r9
lea eax, [r10*4]
lea eax, [rax + rax*8]
add r10d, 0x26
xor edx, edx
div r10w
movzx r15d, ax
add r15, rsi
inc qword [rsp + 0x48]
add r14, 4
mov qword [rsp + 0x30], r14
add rbx, 4
dec qword [rsp + 0x40]
add cl, 3
inc qword [rsp + 0x50]
mov eax, 2
mov qword [rsp + 0x28], rax
mov r14, rbp
mov r10d, 1
mov r11d, 0x1a
jmp 0x509688
lea rdx, str.punycode_0called__Option::unwrap____on_a__None__value
mov r8d, 9
mov rsi, qword [rsp + 0x60]
mov rcx, rsi
call fcn.00518a00
mov bpl, 1
test al, al
jne 0x509a59
mov rax, qword [rsp + 0x80]
mov r8, qword [rax + 8]
test r8, r8
je 0x509a43
mov rdx, qword [rax]
mov rcx, rsi
call fcn.00518a00
test al, al
jne 0x509a59
lea rdx, [0x00653fa1]
mov r8d, 1
mov rcx, rsi
call fcn.00518a00
test al, al
jne 0x509a59
mov rcx, rsi
mov rdx, qword [rsp + 0x58]
mov r8, qword [rsp + 0x68]
call fcn.00518a00
test al, al
je 0x509a6f
mov eax, ebp
add rsp, 0x288
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
lea rdx, [0x00653fa2]
mov r8d, 1
jmp 0x5095ed
lea rdi, [rsp + 0x3c]
mov rsi, qword [rsp + 0x60]
lea rbx, [rsp + 0x88]
mov r14, qword [rsp + 0x30]
nop dword [rax + rax]
mov eax, dword [rbx]
mov dword [rsp + 0x3c], eax
mov rcx, rdi
mov rdx, rsi
call fcn.0051a340
mov ebp, eax
test al, al
jne 0x509a59
add rbx, 4
add r14, 0xfffffffffffffffc
jne 0x509aa0
jmp 0x509a59
lea r8, [0x00653f80]
mov edx, pe_nt_image_headers64
mov rcx, r9
call fcn.005325b0
ud2