Function at 0x1800040c0
Capabilities:
Set thread local storage value

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x20
mov r13d, dword [r8]
mov r14, r9
mov r15, r8
inc r13d
mov rsi, rcx
movsxd rax, r13d
mov edi, r13d
lea rbx, [rcx + rax*8 + 0x828]
cmp qword [rbx], 0
je 0x18000414a
mov rbp, rbx
nop
mov rbx, qword [rbx]
mov eax, dword [rbx + 0x36c]
test eax, eax
je 0x180004128
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [rbx + 0x374]
cmp ecx, eax
jne 0x180004137
inc dword [rbx + 0x370]
jmp 0x180004339
mov eax, 1
xchg dword [rbx + 0x36c], eax
test eax, eax
je 0x180004185
add rbp, 8
inc edi
cmp qword [rbp], 0
mov r13d, edi
mov rbx, rbp
jne 0x180004100
xor r12d, r12d
mov edi, r12d
cmp dword [r15], r12d
jle 0x1800041ba
lea rbp, [rsi + 0x828]
nop dword [rax]
mov rbx, qword [rbp]
test rbx, rbx
je 0x1800041ba
mov eax, dword [rbx + 0x36c]
test eax, eax
je 0x1800041a0
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [rbx + 0x374]
cmp ecx, eax
je 0x18000411d
jmp 0x1800041af
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rbx + 0x374], eax
mov dword [rbx + 0x370], 1
jmp 0x180004339
mov eax, 1
xchg dword [rbx + 0x36c], eax
test eax, eax
je 0x180004185
inc edi
add rbp, 8
cmp edi, dword [r15]
jl 0x180004160
cmp r13d, dword [rsi + 0x18]
jge 0x180004273
mov rcx, r14
call fcn.180002dc0
mov rbx, rax
test rax, rax
je 0x180004273
mov edi, r12d
nop dword [rax + rax]
mov ecx, dword [rsi]
test ecx, ecx
je 0x1800041f8
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [rsi + 8]
cmp ecx, eax
jne 0x180004203
inc dword [rsi + 4]
jmp 0x180004230
mov eax, 1
xchg dword [rsi], eax
test eax, eax
je 0x180004217
inc edi
test dil, 0x3f
jne 0x1800041e0
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SleepEx]
jmp 0x1800041e0
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rsi + 4], eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rsi + 8], eax
mov dword [rsi + 4], 1
movsxd rax, r13d
lea rcx, [rsi + rax*8 + 0x828]
cmp qword [rcx], r12
je 0x180004254
mov eax, dword [rsi + 0x18]
cmp r13d, eax
jge 0x180004254
add rcx, 8
inc r13d
cmp qword [rcx], r12
jne 0x180004243
cmp r13d, dword [rsi + 0x18]
jl 0x1800042ad
dec dword [rsi + 4]
mov eax, dword [rsi + 4]
jne 0x18000426b
mov eax, r12d
mov dword [rsi + 8], r12d
xchg dword [rsi], eax
mov rcx, rbx
call fcn.180002e70
movsxd rax, dword [r15]
mov rbx, qword [rsi + rax*8 + 0x828]
nop
mov eax, dword [rbx + 0x36c]
test eax, eax
je 0x18000436f
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [rbx + 0x374]
cmp ecx, eax
jne 0x18000437e
inc dword [rbx + 0x370]
jmp 0x1800043bc
movsxd rax, r13d
mov edi, r12d
mov qword [rsi + rax*8 + 0x828], rbx
nop dword [rax + rax]
mov eax, dword [rbx + 0x36c]
test eax, eax
je 0x1800042e2
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [rbx + 0x374]
cmp ecx, eax
jne 0x1800042f1
inc dword [rbx + 0x370]
jmp 0x180004327
mov eax, 1
xchg dword [rbx + 0x36c], eax
test eax, eax
je 0x180004305
inc edi
test dil, 0x3f
jne 0x1800042c0
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SleepEx]
jmp 0x1800042c0
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rbx + 0x370], eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rbx + 0x374], eax
mov dword [rbx + 0x370], 1
dec dword [rsi + 4]
mov eax, dword [rsi + 4]
jne 0x180004336
mov dword [rsi + 8], r12d
xchg dword [rsi], r12d
mov edi, r13d
mov rax, qword [rsp + 0x68]
mov dword [r15], edi
test rax, rax
je 0x18000434d
mov dword [rax], edi
movsxd rax, edi
jmp 0x1800043bf
mov ecx, dword [rsi + 0x820]
or eax, 0xffffffff
sub eax, edi
movsxd rdx, eax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x18000436a
call fcn.180086f78
movsxd rax, edi
jmp 0x1800043bf
mov eax, 1
xchg dword [rbx + 0x36c], eax
test eax, eax
je 0x18000439a
inc r12d
test r12b, 0x3f
jne 0x180004280
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SleepEx]
jmp 0x180004280
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rbx + 0x370], eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rbx + 0x374], eax
mov dword [rbx + 0x370], 1
movsxd rax, dword [r15]
mov rax, qword [rsi + rax*8 + 0x828]
mov rbx, qword [rsp + 0x70]
add rsp, 0x20
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret