Function at 0x140081380
Capabilities:
Encrypt data using chaskey

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
sub rsp, 0x20
mov rdi, rdx
mov rbx, rcx
test rcx, rcx
je 0x140081af6
test rdx, rdx
je 0x140081af6
mov rsi, qword [rcx]
test rsi, rsi
je 0x1400813db
mov eax, 0xffffffff
lock xadd dword [rsi + 8], eax
cmp eax, 1
jne 0x1400813db
mov rcx, rsi
call fcn.14007f580
mov rax, qword [0x1401a22e0]
mov rcx, rsi
test rax, rax
je 0x1400813d6
call rax
jmp 0x1400813db
call fcn.14012e000
lock inc dword [rdi + 8]
movzx eax, word [rbx + 0x304]
mov ebp, 1
mov qword [rbx], rdi
test al, 6
jne 0x140081403
test al, 8
jne 0x140081403
mov rax, qword [rdi]
movzx ecx, word [rax]
mov word [rbx + 0x308], cx
movzx eax, word [rbx + 0x4d4]
mov r11d, 0xffef
mov edx, dword [rdi + 0xb0]
movzx ecx, ax
mov dword [rbx + 0x4d0], edx
xor cx, word [rdi + 0xa6]
and cx, bp
xor cx, ax
mov word [rbx + 0x4d4], cx
movzx eax, cx
xor ax, word [rdi + 0xa6]
and ax, 2
xor ax, cx
mov word [rbx + 0x4d4], ax
movzx eax, byte [rbx + 0x309]
cmp al, 4
jne 0x140081472
bt edx, 0x1d
jae 0x140081472
mov rax, qword [rdi]
cmp byte [rax + 3], 0
je 0x1400814fb
mov byte [rbx + 0x309], 3
jmp 0x140081476
cmp al, 3
jne 0x140081494
mov al, 3
bt edx, 0x1b
jae 0x140081494
mov rax, qword [rdi]
cmp byte [rax + 3], 0
je 0x1400814fb
mov byte [rbx + 0x309], 2
mov al, 2
mov ecx, edx
jmp 0x14008149a
mov ecx, edx
cmp al, 2
jne 0x1400814ba
bt edx, 0x1a
jae 0x1400814ba
mov rax, qword [rdi]
cmp byte [rax + 3], 0
je 0x1400814fb
and word [rbx + 0x4d6], r11w
mov byte [rbx + 0x309], bpl
jmp 0x1400814bf
cmp al, bpl
jne 0x1400814e9
movzx eax, bpl
bt ecx, 0xd
jae 0x1400814f3
mov rax, qword [rdi]
cmp byte [rax + 3], 0
je 0x1400814fb
mov eax, 0xffe7
mov byte [rbx + 0x309], 0
and word [rbx + 0x4d6], ax
xor al, al
jmp 0x1400814ed
test al, al
jne 0x1400814f3
bt ecx, 0xc
jb 0x1400814fb
cmp al, byte [rbx + 0x4e7]
jae 0x14008150d
mov eax, 0xfffffeba
mov rbx, qword [rsp + 0x48]
add rsp, 0x20
pop rdi
pop rsi
pop rbp
ret
movzx eax, word [rdi + 0x140]
mov word [rbx + 0x5d0], ax
mov eax, dword [rdi + 0x13c]
mov dword [rbx + 0x5a8], eax
mov eax, dword [rdi + 0x144]
mov dword [rbx + 0x5d4], eax
mov rax, qword [rdi + 0xf0]
mov qword [rbx + 0x520], rax
mov eax, dword [rdi + 0x138]
mov dword [rbx + 0x2f4], eax
mov rax, qword [rdi + 0x118]
mov qword [rbx + 0xa0], rax
mov rax, qword [rdi]
mov qword [rsp + 0x40], r14
test rsi, rsi
je 0x14008156e
cmp byte [rax + 2], 3
je 0x140081594
movzx eax, byte [rax + 2]
mov edx, 0xfcff
and al, 3
movzx ecx, al
movzx eax, word [rbx + 0x4d4]
and ax, dx
shl cx, 8
or cx, ax
mov word [rbx + 0x4d4], cx
mov rax, qword [rdi]
mov edx, 0x7fff
mov r14d, 0xbfff
movzx ecx, byte [rax + 3]
movzx eax, word [rbx + 0x4d4]
and cl, bpl
and ax, r14w
movzx r9d, cl
shl r9w, 0xe
or r9w, ax
mov word [rbx + 0x4d4], r9w
movzx eax, byte [rdi + 0xa4]
mov byte [rbx + 0x4e7], al
movzx eax, byte [rdi + 0xa2]
shr al, 2
movzx ecx, al
movzx eax, word [rbx + 0x4d6]
and ax, dx
shl cx, 0xf
or cx, ax
mov word [rbx + 0x4d6], cx
mov ecx, 0xfffd
movzx eax, byte [rdi + 0xa2]
shr al, 4
and al, bpl
movzx edx, al
movzx eax, word [rbx + 0x4d8]
add dx, dx
and ax, cx
or dx, ax
mov word [rbx + 0x4d8], dx
movzx eax, byte [rdi + 0xa2]
shr al, 5
and al, bpl
movzx ecx, al
mov eax, 0xfffb
and dx, ax
shl cx, 2
or cx, dx
mov word [rbx + 0x4d8], cx
movzx eax, byte [rdi + 0xa2]
shr al, 3
and al, bpl
movzx edx, al
mov eax, 0xfffe
and cx, ax
or dx, cx
mov word [rbx + 0x4d8], dx
movzx eax, byte [rdi + 0xa3]
and al, bpl
movzx r8d, al
mov eax, 0xfff7
and dx, ax
shl r8w, 3
or r8w, dx
mov word [rbx + 0x4d8], r8w
and r8w, r11w
movzx eax, byte [rdi + 0xa2]
shr al, 6
and al, bpl
movzx ecx, al
shl cx, 4
or cx, r8w
mov r8d, 0xffdf
mov word [rbx + 0x4d8], cx
and cx, r8w
movzx eax, byte [rdi + 0xa2]
shr al, 7
movzx r10d, al
shl r10w, 5
or r10w, cx
mov word [rbx + 0x4d8], r10w
movzx eax, word [rdi + 0xa8]
mov word [rbx + 0x4ee], ax
movzx eax, word [rdi + 0xaa]
mov word [rbx + 0x4f0], ax
movzx eax, word [rdi + 0xac]
mov word [rbx + 0x4f4], ax
movzx eax, word [rdi + 0xae]
mov word [rbx + 0x4f6], ax
movzx eax, byte [rdi + 0xa0]
mov byte [rbx + 0x4f8], al
and r9w, r11w
movzx eax, byte [rdi + 0xa1]
mov esi, 0xfbff
shr al, 4
mov r11d, 0xf7ff
and al, bpl
movzx ecx, al
shl cx, 4
or cx, r9w
mov r9d, 0xdfff
mov word [rbx + 0x4d4], cx
and cx, r8w
movzx eax, byte [rdi + 0xa1]
shr al, 5
and al, bpl
movzx edx, al
shl dx, 5
or dx, cx
mov word [rbx + 0x4d4], dx
movzx eax, byte [rdi + 0xa1]
shr al, 6
and al, bpl
movzx ecx, al
mov eax, 0xffbf
and dx, ax
shl cx, 6
or cx, dx
mov word [rbx + 0x4d4], cx
movzx eax, byte [rdi + 0xa1]
shr al, 7
movzx edx, al
mov eax, 0xff7f
and cx, ax
shl dx, 7
or dx, cx
mov word [rbx + 0x4d4], dx
and dx, si
movzx eax, byte [rdi + 0xa1]
and al, bpl
movzx r8d, al
shl r8w, 0xa
or r8w, dx
mov word [rbx + 0x4d4], r8w
and r8w, r11w
movzx eax, byte [rdi + 0xa1]
shr al, 1
and al, bpl
movzx ecx, al
shl cx, 0xb
or cx, r8w
mov word [rbx + 0x4d4], cx
movzx eax, byte [rdi + 0xa1]
shr al, 2
and al, bpl
movzx r8d, al
mov eax, 0xefff
and cx, ax
shl r8w, 0xc
or r8w, cx
mov word [rbx + 0x4d4], r8w
and r8w, r9w
movzx eax, byte [rdi + 0xa1]
shr al, 3
and al, bpl
movzx edx, al
shl dx, 0xd
or dx, r8w
mov word [rbx + 0x4d4], dx
movzx eax, byte [rdi + 0xa2]
and al, 3
movzx ecx, al
mov eax, 0xfff3
and dx, ax
shl cx, 2
or cx, dx
mov word [rbx + 0x4d4], cx
movzx eax, byte [rdi + 0xa3]
shr al, 1
and al, bpl
movzx ecx, al
shl cx, 0xa
and r10w, si
or cx, r10w
mov word [rbx + 0x4d8], cx
and cx, r11w
movzx eax, byte [rdi + 0xa3]
shr al, 3
and al, bpl
movzx edx, al
shl dx, 0xb
or dx, cx
mov word [rbx + 0x4d8], dx
and dx, r9w
movzx eax, byte [rdi + 0xa3]
mov r9, qword [rbx + 8]
shr al, 4
and al, bpl
movzx ecx, al
shl cx, 0xd
or cx, dx
mov word [rbx + 0x4d8], cx
movzx eax, byte [rdi + 0xa5]
shr al, 4
and al, bpl
movzx ecx, al
movzx eax, word [rbx + 0x4da]
and ax, r14w
shl cx, 0xe
mov r14, qword [rsp + 0x40]
or cx, ax
mov word [rbx + 0x4da], cx
movups xmm0, xmmword [rdi + 0x10]
movups xmmword [rbx + 0x1f8], xmm0
movups xmm0, xmmword [rdi + 0x20]
movups xmmword [rbx + 0x208], xmm0
mov rax, qword [rdi + 0x30]
mov qword [rbx + 0x240], rax
mov rax, qword [rdi + 0x38]
mov qword [rbx + 0x260], rax
mov eax, dword [rdi + 0x68]
mov dword [rbx + 0x268], eax
mov rax, qword [rdi + 0x70]
mov qword [rbx + 0x248], rax
movzx eax, byte [rbx + 0x250]
movzx ecx, al
xor cl, byte [rdi + 0x78]
and cl, 0x3f
xor cl, al
mov byte [rbx + 0x250], cl
movzx edx, cl
xor dl, byte [rdi + 0x78]
and dl, 0x40
xor dl, cl
mov byte [rbx + 0x250], dl
xor dl, byte [rdi + 0x78]
and dl, 0x7f
xor dl, byte [rdi + 0x78]
mov byte [rbx + 0x250], dl
mov eax, dword [rdi + 0x7c]
mov dword [rbx + 0x254], eax
mov eax, dword [rdi + 0x80]
mov dword [rbx + 0x258], eax
test r9, r9
je 0x140081a5d
mov rax, qword [rdi + 0x90]
test rax, rax
jne 0x1400819c8
xor edx, edx
mov r8d, 0x158
mov rcx, r9
call fcn.14014c1f0
jmp 0x140081a5d
mov ecx, 2
nop dword [rax]
lea r9, [r9 + 0x80]
movups xmm0, xmmword [rax]
lea rax, [rax + 0x80]
movups xmmword [r9 - 0x80], xmm0
movups xmm1, xmmword [rax - 0x70]
movups xmmword [r9 - 0x70], xmm1
movups xmm0, xmmword [rax - 0x60]
movups xmmword [r9 - 0x60], xmm0
movups xmm1, xmmword [rax - 0x50]
movups xmmword [r9 - 0x50], xmm1
movups xmm0, xmmword [rax - 0x40]
movups xmmword [r9 - 0x40], xmm0
movups xmm1, xmmword [rax - 0x30]
movups xmmword [r9 - 0x30], xmm1
movups xmm0, xmmword [rax - 0x20]
movups xmmword [r9 - 0x20], xmm0
movups xmm1, xmmword [rax - 0x10]
movups xmmword [r9 - 0x10], xmm1
sub rcx, rbp
jne 0x1400819d0
movups xmm0, xmmword [rax]
movups xmmword [r9], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [r9 + 0x10], xmm1
movups xmm0, xmmword [rax + 0x20]
movups xmmword [r9 + 0x20], xmm0
movups xmm1, xmmword [rax + 0x30]
movups xmmword [r9 + 0x30], xmm1
movups xmm0, xmmword [rax + 0x40]
movups xmmword [r9 + 0x40], xmm0
mov rcx, qword [rax + 0x50]
mov qword [r9 + 0x50], rcx
movzx eax, word [rbx + 0x4d4]
mov ecx, 0x300
and ax, cx
cmp ax, cx
je 0x140081a7b
mov rcx, rbx
call fcn.140081230
mov ebp, eax
mov edx, dword [rdi + 0xb0]
test edx, edx
je 0x140081a91
mov rcx, rbx
call fcn.140074930
test eax, eax
je 0x140081af6
movzx eax, byte [rdi + 0x1c0]
mov byte [rbx + 0x550], al
lea rax, [0x1400d9750]
cmp qword [rbx + 0xb8], rax
je 0x140081abc
mov rax, qword [rdi + 0x100]
mov qword [rbx + 0xb8], rax
lea rax, [0x1400d98c0]
cmp qword [rbx + 0xc0], rax
je 0x140081ada
mov rax, qword [rdi + 0x108]
mov qword [rbx + 0xc0], rax
movzx eax, byte [rdi + 0xa0]
mov byte [rbx + 0x2fe], al
mov eax, ebp
mov rbx, qword [rsp + 0x48]
add rsp, 0x20
pop rdi
pop rsi
pop rbp
ret
mov rbx, qword [rsp + 0x48]
mov eax, 0xffffff53
add rsp, 0x20
pop rdi
pop rsi
pop rbp
ret