Function at 0x3999785d0
Capabilities:
Authenticate hmac
Encode data using xor
Encrypt data using chaskey

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov rsi, rcx
mov ebx, edx
push r13
psllq mm0, 0x32
push rbx
nop
neg r13b
push r12
emms
psrld mm3, 0x35
emms
push r8
psllq mm3, 0x6a
pcmpgtb mm4, mm3
neg r8
nop
pop r8
sar r12w, 2
rcr r12, 4
not r13
pop r12
not r13w
packuswb mm2, mm6
pop rbx
mov r13, 4
pop r13
push rcx
mov rcx, 2
push r8
emms
push r11
orps xmm4, xmm8
por mm4, mm2
push r10
pcmpgtb mm3, mm0
nop
psubusw mm7, mm0
pop r10
mov r11w, 0xa
emms
pop r11
inc r8
pop r8
dec rcx
jne 0x39997862c
pop rcx
call fcn.3999785b5
lea rbp, [0x39997f010]
test ebx, ebx
je 0x399978dd1
push r14
rol r14, 0xc
rcr r14w, 2
push r15
nop
rcr r15w, 0xd
push r12
nop
test r14d, r15d
push rdx
pslld mm6, 0x24
not r12
push r8
packsswb mm1, mm2
emms
pop r8
subss xmm10, xmm1
psrld mm6, 0x19
pop rdx
emms
sub r15d, 8
pop r12
emms
ror r15d, 0x16
pop r15
neg r14d
inc r14
pop r14
call fcn.399978356
xor edi, edi
lea r12, [rsp + 0x20]
push r11
rcpss xmm8, xmm2
shl r11, 0xd
emms
nop
paddb mm7, mm1
push r14
and r11b, r14b
emms
nop
pmaxsw mm0, mm1
add r14d, r11d
pop r14
emms
paddb mm4, mm0
subss xmm9, xmm5
inc r11
nop
shl r11d, 0x13
pop r11
call fcn.3999783de
mov al, byte [rbp + rdi]
mov byte [rdi + r12], al
push rcx
shr rcx, 4
nop
emms
push r15
nop
psraw mm5, 0x1c
pslld mm2, 0x5f
push rdx
add r15b, cl
nop
movlhps xmm12, xmm2
pop rdx
nop
nop
sbb cl, 0xd
pop r15
nop
emms
nop
pop rcx
inc rdi
cmp rdi, 0x10
jne 0x3999786c4
push rdx
pcmpgtw mm5, mm3
dec edx
pandn mm3, mm7
emms
inc rdx
inc edx
shl dx, 0x10
inc rdx
sbb dl, 1
nop
emms
emms
pop rdx
mov ecx, 2
mov edx, 8
call sub.msvcrt.dll_calloc
mov rcx, rax
xor eax, eax
push r14
dec r14
inc r14d
nop
psadbw mm3, mm5
push r9
shr r9d, 0xd
movaps xmm8, xmm1
por mm1, mm6
emms
pop r9
nop
paddsb mm6, mm4
neg r14d
mov r14, 5
pop r14
xor qword [rcx + rax*8], 0x36
push r15
mov r15, 1
push r8
push r11
pop r11
pop r8
dec r15
jne 0x3999787a7
pop r15
test rax, rax
jne 0x3999787c2
mov eax, 1
jmp 0x39997876c
call sub.msvcrt.dll_free
push rcx
emms
push r13
rcpss xmm4, xmm2
pop r13
punpcklbw mm6, mm2
pop rcx
push r12
pslld mm4, 0x5d
push r9
shl r9, 0xe
pop r9
paddd mm6, mm0
pop r12
xor r13d, r13d
lea rdi, section..data
push r13
shl r13d, 7
pop r13
call sym.FillExecutable.dll_OutFullRun
mov eax, dword [r12 + r13]
xor eax, dword [rdi + r13]
mov dword [r12 + r13], eax
add r13, 4
cmp r13, 0x10
jne 0x3999787f3
push r8
not r8
push r13
cmp r13w, r8w
push r9
nop
pop r9
cmp r13w, r8w
pop r13
andps xmm15, xmm9
pop r8
mov edx, 4
mov ecx, 3
call sub.msvcrt.dll_calloc
mov rcx, rax
cmp bl, r14b
jne 0x39997885e
push r8
neg r8
push r13
emms
dec r8d
pop r13
movaps xmm2, xmm4
pop r8
jmp 0x399978872
push r15
emms
push r14
and r14b, r15b
xchg r14w, r15w
pop r14
movaps xmm2, xmm6
pop r15
push rbx
emms
push rax
psubw mm3, mm4
inc rax
pop rax
rol bx, 1
pop rbx
mov edx, 0x60
call sub.msvcrt.dll_realloc
mov rcx, rax
push r12
paddb mm7, mm6
push r11
or r12w, r11w
push rdx
paddsb mm6, mm5
pop rdx
movaps xmm3, xmm2
pop r11
maxps xmm12, xmm7
pop r12
call sub.msvcrt.dll_free
cmp rbx, r11
jne 0x3999788d8
push r8
neg r8d
push r9
emms
psrlw mm2, 0xe
pop r9
emms
pop r8
jmp 0x3999788ed
push r13
psraw mm7, 0x17
push r10
inc r10
emms
pop r10
comiss xmm14, xmm6
pop r13
push rdx
psrlq mm7, 0x5c
push rbx
psrlq mm1, 0x64
movlhps xmm15, xmm12
pop rbx
emms
pop rdx
mov r9d, 0x10
push rax
nop
push rbx
nop
push r14
nop
pop r14
addps xmm11, xmm15
pop rbx
psrlq mm5, 0x50
pop rax
mov eax, 4
push r8
psrad mm7, 0x3d
psrld mm0, 9
shl r8b, 7
psrlq mm5, 0x55
push rdx
psllq mm3, 0x3e
inc edx
psrld mm5, 0x26
push rbx
nop
mov r8d, edx
push r9
nop
pop r9
inc ebx
psrlq mm1, 0xf
pop rbx
rcr r8, 0xd
nop
ror rdx, 0x12
pop rdx
mulps xmm10, xmm13
nop
inc r8
punpckhbw mm1, mm2
pop r8
push rbx
pcmpgtw mm4, mm3
push r14
emms
psrad mm3, 0x5e
pop r14
neg bx
pop rbx
dec eax
jne 0x39997891d
push r10
rcl r10w, 0xd
neg r10
inc r10d
andnps xmm14, xmm7
maxss xmm2, xmm0
movups xmm2, xmm7
neg r10w
pop r10
mov eax, dword [rsp + 0x24]
mov edx, dword [rsp + 0x2c]
mov r8d, dword [rsp + 0x20]
mov ecx, dword [rsp + 0x28]
add r8d, eax
add ecx, edx
rol eax, 5
rol edx, 8
xor eax, r8d
rol r8d, 0x10
xor edx, ecx
add ecx, eax
rol eax, 7
add r8d, edx
rol edx, 0xd
xor eax, ecx
xor edx, r8d
rol ecx, 0x10
mov dword [rsp + 0x20], r8d
mov dword [rsp + 0x2c], edx
mov dword [rsp + 0x24], eax
mov dword [rsp + 0x28], ecx
dec r9d
jne 0x399978905
push r11
orps xmm1, xmm2
push r12
psrlq mm2, 0x4f
pop r12
neg r11d
pop r11
xor eax, eax
push r9
rol r9b, 0x17
psraw mm0, 0x69
sar r9w, 0xf
emms
emms
push r12
orps xmm7, xmm8
movups xmm2, xmm3
nop
rcl r9w, 8
push rdx
subps xmm15, xmm6
punpcklbw mm4, mm3
shl r9d, 2
push rcx
xorps xmm11, xmm15
addss xmm13, xmm12
push r13
nop
pop r13
nop
psrld mm6, 0x2e
pop rcx
emms
not r9w
emms
pop rdx
nop
pmaxsw mm6, mm5
psrad mm1, 0x22
rcpps xmm15, xmm6
pop r12
psrlw mm7, 0x58
nop
psllq mm7, 0x6a
psrlq mm7, 0x2d
nop
pop r9
mov edx, dword [r12 + rax]
xor edx, dword [rdi + rax]
mov dword [r12 + rax], edx
add rax, 4
cmp rax, 0x10
jne 0x3999789fc
push r12
pslld mm4, 0x5d
push r9
shl r9, 0xe
pop r9
paddd mm6, mm0
pop r12
mov edi, 0x10
cmp ebx, edi
cmovbe rdi, rbx
push rcx
paddsw mm2, mm5
push rax
maxps xmm9, xmm14
push r14
psrad mm5, 0x5c
push r11
psrad mm6, 0x4a
push r15
nop
pop r15
movss xmm12, xmm8
pop r11
emms
pop r14
mulps xmm7, xmm15
pop rax
emms
pop rcx
xor eax, eax
cmp bl, dl
jne 0x399978ae5
push r12
movaps xmm4, xmm5
push r15
movhlps xmm15, xmm10
psraw mm5, 0x59
pop r15
sub r12, 0x13
pop r12
jmp 0x399978af9
push r8
shr r8d, 0xd
push r13
inc r8d
emms
pop r13
inc r8
pop r8
push r14
addss xmm11, xmm7
push rcx
emms
dec r14
pop rcx
paddb mm6, mm5
pop r14
mov dl, byte [r12 + rax]
xor byte [rsi + rax], dl
push r13
shr r13w, 0xc
push r15
psrld mm3, 0xd
push rcx
psubusw mm3, mm2
push r8
emms
push r12
nop
pop r12
comiss xmm5, xmm4
pop r8
test r13, rcx
pop rcx
test r13d, r15d
pop r15
packuswb mm6, mm3
pop r13
inc rax
cmp eax, edi
jb 0x399978ac8
push r13
shl r13d, 7
pop r13
call sym.FillExecutable.dll_OutFullRun
sub ebx, edi
push r8
not r8
push r13
cmp r13w, r8w
push r9
nop
pop r9
cmp r13w, r8w
pop r13
andps xmm15, xmm9
pop r8
mov edx, 4
mov ecx, 3
call sub.msvcrt.dll_calloc
mov rcx, rax
cmp bl, r14b
jne 0x399978b9e
push r8
neg r8
push r13
emms
dec r8d
pop r13
movaps xmm2, xmm4
pop r8
jmp 0x399978bb2
push r15
emms
push r14
and r14b, r15b
xchg r14w, r15w
pop r14
movaps xmm2, xmm6
pop r15
push rbx
emms
push rax
psubw mm3, mm4
inc rax
pop rax
rol bx, 1
pop rbx
mov edx, 0x60
call sub.msvcrt.dll_realloc
mov rcx, rax
push r12
paddb mm7, mm6
push r11
or r12w, r11w
push rdx
paddsb mm6, mm5
pop rdx
movaps xmm3, xmm2
pop r11
maxps xmm12, xmm7
pop r12
call sub.msvcrt.dll_free
cmp rbx, r11
jne 0x399978c18
push r8
neg r8d
push r9
emms
psrlw mm2, 0xe
pop r9
emms
pop r8
jmp 0x399978c2d
push r13
psraw mm7, 0x17
push r10
inc r10
emms
pop r10
comiss xmm14, xmm6
pop r13
push rdx
psrlq mm7, 0x5c
push rbx
psrlq mm1, 0x64
movlhps xmm15, xmm12
pop rbx
emms
pop rdx
add rsi, rdi
push r9
rol r9b, 0x17
psraw mm0, 0x69
sar r9w, 0xf
emms
emms
push r12
orps xmm7, xmm8
movups xmm2, xmm3
nop
rcl r9w, 8
push rdx
subps xmm15, xmm6
punpcklbw mm4, mm3
shl r9d, 2
push rcx
xorps xmm11, xmm15
addss xmm13, xmm12
push r13
nop
pop r13
nop
psrld mm6, 0x2e
pop rcx
emms
not r9w
emms
pop rdx
nop
pmaxsw mm6, mm5
psrad mm1, 0x22
rcpps xmm15, xmm6
pop r12
psrlw mm7, 0x58
nop
psllq mm7, 0x6a
psrlq mm7, 0x2d
nop
pop r9
lea rax, section..data
lea rcx, [rax - 0x10]
push rax
psrad mm6, 0x22
psllq mm2, 0x3c
shl al, 0xa
push r8
psrad mm0, 0x29
xadd ax, r8w
push r15
dec r8
pop r15
xchg al, r8b
nop
pop r8
sar eax, 0x10
emms
rol eax, 0x12
pop rax
inc byte [rax + 0x1f]
jne 0x399978da6
cmp rbx, 0x68
jne 0x399978d31
push rbx
psllq mm7, 0x53
push rcx
inc ecx
push r8
emms
push r15
not r15
push rax
nop
push r11
nop
push r12
emms
pop r12
psraw mm0, 0x2a
pop r11
inc ebx
pop rax
nop
pop r15
emms
pop r8
movlhps xmm1, xmm13
pop rcx
sar bx, 8
pop rbx
jmp 0x399978d72
push r8
nop
push r9
rcpss xmm9, xmm10
sar r9w, 0x17
push rax
mulss xmm11, xmm15
emms
psrlw mm2, 0x34
push r14
shl r8w, 0x15
not r8w
nop
pcmpeqb mm7, mm2
pop r14
emms
pslld mm3, 0x63
nop
pop rax
movss xmm2, xmm3
xorps xmm15, xmm2
pop r9
nop
pop r8
push rax
inc rax
psrad mm4, 0x3b
pcmpeqd mm1, mm6
not rax
xorps xmm0, xmm15
movlhps xmm10, xmm4
andnps xmm4, xmm15
shr ax, 0x12
psubsb mm6, mm5
movss xmm2, xmm3
nop
nop
pop rax
dec rax
cmp rcx, rax
jne 0x399978cb7
push rdx
packuswb mm1, mm2
nop
psraw mm2, 0x51
pcmpgtw mm1, mm3
psrlq mm7, 2
shl dl, 4
por mm3, mm6
paddsb mm6, mm1
mov dx, 0xb
pslld mm5, 0x40
emms
emms
pop rdx
jmp 0x399978664
push rcx
mov rcx, 2
push r8
emms
push r11
orps xmm4, xmm8
por mm4, mm2
push r10
pcmpgtb mm3, mm0
nop
psubusw mm7, mm0
pop r10
mov r11w, 0xa
emms
pop r11
inc r8
pop r8
dec rcx
jne 0x399978dd9
pop rcx
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp fcn.3999785b5