Function at 0x140050180
Capabilities:
Encode data using xor
Get thread local storage value

Disassembly:
sub rsp, 0x98
mov qword [rsp + 0x68], rdx
mov qword [rsp + 0x60], rcx
mov ecx, dword [0x1402980b0]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rcx, qword [rsp + 0x60]
mov rdx, qword [rsp + 0x68]
add rax, 0x60
mov qword [rsp + 0x70], rax
mov rax, qword [rcx]
mov qword [rsp + 0x78], rax
cmp rax, rdx
jle 0x1400501d5
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x60]
call fcn.14004fca0
jmp 0x1400503f5
mov rax, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x68]
cmp rax, rcx
jge 0x1400503f5
mov rax, qword [rsp + 0x60]
mov rcx, rax
add rcx, 8
mov qword [rsp + 0x50], rcx
mov rax, qword [rax + 8]
mov qword [rsp + 0x58], rax
cmp rax, 0
je 0x140050269
mov rcx, qword [rsp + 0x68]
mov rax, qword [rsp + 0x58]
mov rax, qword [rax]
or rax, rax
xor rax, 0xffffffffffffffff
movabs rdx, 0x2bcaf23551424
movabs r8, 0xbffd4350dcaaebdb
xor rdx, r8
movabs r8, 0x15654ceef99c3cb7
movabs r9, 0xaa9ab3110663c348
xor r8, r9
or rdx, r8
xor rdx, 0xffffffffffffffff
xor rax, 0xffffffffffffffff
xor rdx, 0xffffffffffffffff
and rax, rdx
cmp rax, rcx
jge 0x14005032b
mov rdx, qword [rsp + 0x78]
mov r9, qword [rsp + 0x68]
mov rcx, r9
sub rcx, rdx
mov qword [rsp + 0x48], rcx
mov rax, rcx
or rax, rax
xor rax, 0xffffffffffffffff
mov r8, r9
xor r8, 0xffffffffffffffff
mov r10, r9
xor r10, 0xffffffffffffffff
and r8, r10
xor rax, 0xffffffffffffffff
xor r8, 0xffffffffffffffff
and rax, r8
mov r8, rcx
xor r8, 0xffffffffffffffff
xor r9, 0xffffffffffffffff
and r8, r9
xor rax, 0xffffffffffffffff
xor r8, 0xffffffffffffffff
and rax, r8
cmp rax, 0
setl al
xor rcx, rdx
movabs rdx, 0x9f6ba1a9b042019
movabs r8, 0xf60945e564fbdfe6
xor rdx, r8
cmp rcx, rdx
setg cl
and al, cl
test al, 1
jne 0x140050321
mov r8, qword [rsp + 0x48]
mov rdx, qword [rsp + 0x58]
mov rcx, qword [rsp + 0x78]
mov r9d, 0x10
mov qword [rsp + 0x20], 8
call fcn.1400265f0
mov rcx, rax
mov rax, qword [rsp + 0x50]
mov qword [rax], rcx
jmp 0x14005032b
call fcn.14000f24b
jmp 0x1400503f5
mov rax, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x60]
mov rdx, qword [rsp + 0x68]
mov qword [rcx], rdx
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x38], rax
mov ecx, dword [0x1402980b0]
mov rax, qword [sym.imp.KERNEL32.dll_TlsGetValue]
call rax
mov rcx, qword [rsp + 0x38]
mov rax, qword [rsp + 0x50]
mov rax, qword [rax]
shl rcx, 4
lea rcx, [rax + rcx + 8]
xorps xmm0, xmm0
movaps xmmword [rsp + 0x80], xmm0
lea rdx, [rsp + 0x80]
call fcn.140250fc3
mov rax, qword [rsp + 0x70]
cmp byte [rax], 0
jne 0x1400503f5
mov rcx, qword [rsp + 0x38]
movabs rdx, 0xa9b20f51adc0923f
mov rax, rcx
sub rax, rdx
add rax, 1
movabs rdx, 0xa9b20f51adc0923f
add rax, rdx
mov qword [rsp + 0x30], rax
xor rcx, 0xffffffffffffffff
and rax, rcx
cmp rax, 0
jge 0x1400503dd
call fcn.14000f24b
jmp 0x1400503f5
mov rax, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x68]
cmp rax, rcx
mov qword [rsp + 0x40], rax
jne 0x140050342
mov ecx, dword [0x140274848]
mov edx, dword [0x14027484c]
mov eax, ecx
and eax, edx
xor ecx, edx
or eax, ecx
xor eax, 0x1a4ca1e5
sub eax, 0x7aee0526
imul eax, eax, 0xb514b760
cmp eax, 0xe4d7f850
jae 0x14005048c
mov ecx, dword [0x140274850]
mov eax, dword [0x140274854]
xor eax, 0x6565ae32
xor ecx, eax
mov eax, ecx
and eax, 0xbbb3447d
or ecx, 0xbbb3447d
add eax, ecx
mov ecx, eax
xor ecx, 0xb0d7e5e0
mov edx, 0xcf5679a1
xor edx, 0x30a9865e
xor ecx, edx
and ecx, 0xb0d7e5e0
shl ecx, 1
sub ecx, 0xb0d7e5e0
sub eax, ecx
and eax, 0xc6219d96
mov ecx, 0xd27d9956
xor ecx, 0xe0289ff4
cmp eax, ecx
ja 0x140050424
add rsp, 0x98
ret
outsd dx, dword [rsi]
adc byte [rax], 0x98
jmp 0x140050424