Function at 0x14004fd20
Capabilities:
Get thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x38
mov r15, rdx
mov rdi, rcx
mov rax, qword [0x1400e5028]
xor rax, rsp
mov qword [rsp + 0x30], rax
cmp rcx, 0x10
ja 0x14004ff5a
lea rax, [rdi - 1]
test rdi, rax
sete al
test rdi, rdi
setne cl
test cl, al
je 0x1400501fc
mov r14, qword [0x1400ecb48]
test r14, r14
je 0x1400501ff
mov eax, 0x40
mov ecx, 0x40
test r15, r15
je 0x14004fd8e
bsr rcx, r15
xor rcx, 0x3f
sub rax, rcx
lea rcx, [0x1400d1e70]
mov cl, byte [rax + rcx]
mov rdx, r15
shr rdx, cl
and edx, 7
lea rcx, [0x1400d1ec0]
mov rcx, qword [rcx + rax*8]
and rcx, r15
lea rax, [rdx + rax*8]
cmp rcx, 1
sbb rax, 0xffffffffffffffff
lea rcx, [0x1400d1650]
movzx r13d, word [rcx + rax*2 + 0x400]
mov byte [rsp + 0x2f], 0
cmp byte [r14 + 2], 0
je 0x14005028b
mov edi, dword [0x1400f0298]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test ebx, ebx
jne 0x140050188
cmp rdi, 1
jbe 0x1400502e7
add qword [rdi + 0x298], 1
cmp r13w, 0x29
jb 0x14004fee7
add qword [rdi + 0x2b8], 1
add qword [rdi + 0x2a8], 1
lea rax, [r13*4]
add rax, r13
lea rdi, [r14 + rax*8]
add rdi, 0x10
lea rsi, [r14 + 8]
mov ebx, 1
xor ebp, ebp
mov r12, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov r13d, 0x40
mov rcx, rsi
call r12
test al, al
jne 0x14004fe87
jmp 0x1400500d9
pause
dec eax
jne 0x14004fe66
add ebp, ebx
add ebx, ebx
cmp ebx, 0x40
cmovge ebx, r13d
cmp ebp, 0x3e8
jl 0x14004fe57
mov rcx, rsi
call sub.KERNEL32.dll_AcquireSRWLockExclusive
mov rax, qword [rdi]
mov rbx, qword [rax]
test rbx, rbx
je 0x14004ff37
mov byte [rsp + 0x2f], 0
mov rcx, qword [rbx]
test rcx, rcx
je 0x14004feb3
mov rdx, rcx
not rdx
cmp qword [rbx + 8], rdx
jne 0x140050482
bswap rcx
mov qword [rax], rcx
inc word [rax + 0x18]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov rcx, qword [rsp + 0x30]
xor rcx, rsp
call fcn.14005e850
mov rax, rbx
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rsi, r13
shl rsi, 4
mov rbp, rdi
add rbp, rsi
cmp qword [rdi + rsi], 0
je 0x1400500ae
inc qword [rdi + 0x2a0]
mov rbx, qword [rbp]
mov rax, qword [rbx]
test rax, rax
je 0x14004ff22
mov rcx, rax
not rcx
cmp qword [rbx + 8], rcx
jne 0x140050482
bswap rax
dec byte [rdi + rsi + 8]
mov qword [rbp], rax
test rbx, rbx
jne 0x14004fec6
jmp 0x14004fe2c
lea rax, [rsp + 0x2f]
mov qword [rsp + 0x20], rax
mov rcx, rdi
mov rdx, r14
xor r8d, r8d
mov r9, r15
call fcn.14003bd50
mov rbx, rax
jmp 0x14004febd
mov r14, qword [0x1400ecb48]
test r14, r14
je 0x14005035f
lea r12, [rdi - 1]
test rdi, r12
sete al
test rdi, rdi
setne cl
test cl, al
je 0x1400503eb
cmp r15, rdi
jae 0x140050088
cmp rdi, r15
jb 0x1400503ee
bsr rax, rdi
xor rax, 0xffffffffffffffc0
lea rcx, [0x1400d1e70]
mov cl, byte [rax + rcx + 0x41]
mov rdx, rdi
shr rdx, cl
and edx, 7
lea rcx, [0x1400d1ec0]
mov rcx, qword [rcx + rax*8 + 0x208]
and rcx, rdi
lea rax, [rdx + rax*8]
add rax, 0x208
cmp rcx, 1
sbb rax, 0xffffffffffffffff
lea rcx, [0x1400d1650]
movzx r15d, word [rcx + rax*2 + 0x400]
mov byte [rsp + 0x2e], 0
cmp byte [r14 + 2], 0
je 0x1400503f6
mov esi, dword [0x1400f0298]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, rax
test ebx, ebx
jne 0x1400501b5
cmp rsi, 1
jbe 0x140050487
inc qword [rsi + 0x298]
cmp r15w, 0x29
jae 0x1400500e8
mov rbp, r15
shl rbp, 4
mov r13, rsi
add r13, rbp
cmp qword [rsi + rbp], 0
je 0x1400501c2
inc qword [rsi + 0x2a0]
mov rbx, qword [r13]
mov rax, qword [rbx]
test rax, rax
je 0x14005006c
mov rcx, rax
not rcx
cmp qword [rbx + 8], rcx
jne 0x140050482
bswap rax
dec byte [rsi + rbp + 8]
mov qword [r13], rax
test rbx, rbx
je 0x1400500f6
test r12, rbx
je 0x14004fec6
int3
mov rax, r15
dec rax
je 0x1400500a7
bsr rcx, rax
xor rcx, 0x3f
neg cl
mov edi, 1
shl rdi, cl
jmp 0x14004ff8b
mov ecx, 0x40
jmp 0x140050098
inc qword [rdi + 0x2b0]
inc qword [rdi + 0x2a8]
mov rcx, rdi
mov rdx, r13
call fcn.140054be0
mov rbx, qword [rbp]
test rbx, rbx
jne 0x14004ff0a
jmp 0x14004fe2c
mov eax, ebx
test ebx, ebx
jg 0x14004fe66
jmp 0x14004fe6e
inc qword [rsi + 0x2b8]
inc qword [rsi + 0x2a8]
lea rax, [r15 + r15*4]
lea rsi, [r14 + rax*8]
add rsi, 0x10
lea r15, [r14 + 8]
mov ebx, 1
xor ebp, ebp
mov r13, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov rcx, r15
call r13
test al, al
jne 0x140050148
jmp 0x1400501ed
pause
dec eax
jne 0x140050123
add ebp, ebx
add ebx, ebx
cmp ebx, 0x40
mov eax, 0x40
cmovge ebx, eax
cmp ebp, 0x3e8
jl 0x140050114
mov rcx, r15
call sub.KERNEL32.dll_AcquireSRWLockExclusive
mov rax, qword [rsi]
mov rbx, qword [rax]
test rbx, rbx
je 0x140050195
mov byte [rsp + 0x2e], 0
mov rcx, qword [rbx]
test rcx, rcx
je 0x140050170
mov rdx, rcx
not rdx
cmp qword [rbx + 8], rdx
jne 0x140050482
bswap rcx
mov qword [rax], rcx
inc word [rax + 0x18]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x14005007c
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x14004fdff
lea rax, [rsp + 0x2e]
mov qword [rsp + 0x20], rax
mov rcx, rsi
mov rdx, r14
xor r8d, r8d
mov r9, rdi
call fcn.14003bd50
mov rbx, rax
jmp 0x14005017a
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140050015
inc qword [rsi + 0x2b0]
inc qword [rsi + 0x2a8]
mov rcx, rsi
mov rdx, r15
call fcn.140054be0
mov rbx, qword [r13]
test rbx, rbx
jne 0x140050054
jmp 0x1400500f6
mov eax, ebx
test ebx, ebx
jg 0x140050123
jmp 0x14005012b
int3
mov cl, 1
xor eax, eax
lock cmpxchg byte [0x1400ecb50], cl
jne 0x140050201
mov r14, qword [0x1400ecb48]
test r14, r14
jne 0x14005027f
mov dword [0x1400ecb58], 0x1000000
lea r14, [0x1400ecb58]
mov byte [0x1400ecb5e], 1
mov byte [0x1400edf90], 0
mov qword [0x1400ee068], 0
lea rcx, [0x1400ecb60]
mov r8d, 0x1408
xor edx, edx
call fcn.1400611e0
lea rcx, [0x1400edf98]
mov r8d, 0xca
xor edx, edx
call fcn.1400611e0
mov rcx, r14
mov edx, 0x1010100
call fcn.14001abf0
mov qword [0x1400ecb48], r14
mov byte [0x1400ecb50], 0
jmp 0x14004fd77
lea rax, [r13*4]
add rax, r13
lea rdi, [r14 + rax*8]
add rdi, 0x10
lea rsi, [r14 + 8]
mov ebx, 1
xor ebp, ebp
mov r12, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov r13d, 0x40
mov rcx, rsi
call r12
test al, al
jne 0x14004fe87
jmp 0x1400504ae
pause
dec eax
jne 0x1400502c9
add ebp, ebx
add ebx, ebx
cmp ebx, 0x40
cmovge ebx, r13d
cmp ebp, 0x3e8
jl 0x1400502b6
jmp 0x14004fe7f
je 0x14004fe2c
mov byte [r14 + 2], 0
mov rcx, r14
call fcn.140054960
mov rdi, rax
mov byte [r14 + 2], 1
inc qword [rax + 0x298]
cmp r13w, 0x29
jae 0x1400504cc
mov rsi, r13
shl rsi, 4
mov r12, rdi
add r12, rsi
cmp qword [rdi + rsi], 0
je 0x1400504df
inc qword [rdi + 0x2a0]
mov rbx, qword [r12]
mov rax, qword [rbx]
test rax, rax
je 0x14005034f
mov rcx, rax
not rcx
cmp qword [rbx + 8], rcx
jne 0x140050482
bswap rax
dec byte [rdi + rsi + 8]
mov qword [r12], rax
jmp 0x14004ff2d
mov cl, 1
xor eax, eax
lock cmpxchg byte [0x1400ecb50], cl
jne 0x140050361
mov r14, qword [0x1400ecb48]
test r14, r14
jne 0x1400503df
mov dword [0x1400ecb58], 0x1000000
lea r14, [0x1400ecb58]
mov byte [0x1400ecb5e], 1
mov byte [0x1400edf90], 0
mov qword [0x1400ee068], 0
lea rcx, [0x1400ecb60]
mov r8d, 0x1408
xor edx, edx
call fcn.1400611e0
lea rcx, [0x1400edf98]
mov r8d, 0xca
xor edx, edx
call fcn.1400611e0
mov rcx, r14
mov edx, 0x1010100
call fcn.14001abf0
mov qword [0x1400ecb48], r14
mov byte [0x1400ecb50], 0
jmp 0x14004ff6a
int3
mov rcx, r15
call fcn.1400b8fd0
lea rax, [r15 + r15*4]
lea r15, [r14 + rax*8]
add r15, 0x10
lea rsi, [r14 + 8]
mov ebx, 1
xor ebp, ebp
mov r13, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov rcx, rsi
call r13
test al, al
jne 0x140050448
jmp 0x1400504bd
pause
dec eax
jne 0x140050423
add ebp, ebx
add ebx, ebx
cmp ebx, 0x40
mov eax, 0x40
cmovge ebx, eax
cmp ebp, 0x3e8
jl 0x140050414
mov rcx, rsi
call sub.KERNEL32.dll_AcquireSRWLockExclusive
mov rax, qword [r15]
mov rbx, qword [rax]
test rbx, rbx
je 0x14005050a
mov byte [rsp + 0x2e], 0
mov rcx, qword [rbx]
test rcx, rcx
je 0x140050470
mov rdx, rcx
not rdx
cmp qword [rbx + 8], rdx
jne 0x140050482
bswap rcx
mov qword [rax], rcx
inc word [rax + 0x18]
mov rcx, rsi
jmp 0x14005017d
call 0x140089960
je 0x1400500f6
mov byte [r14 + 2], 0
mov rcx, r14
call fcn.140054960
mov rsi, rax
mov byte [r14 + 2], 1
inc qword [rax + 0x298]
jmp 0x140050026
mov eax, ebx
test ebx, ebx
jg 0x1400502c9
jmp 0x1400502d1
mov eax, ebx
test ebx, ebx
jg 0x140050423
jmp 0x14005042b
inc qword [rdi + 0x2b8]
inc qword [rdi + 0x2a8]
jmp 0x14004fe2c
inc qword [rdi + 0x2b0]
inc qword [rdi + 0x2a8]
mov rcx, rdi
mov rdx, r13
call fcn.140054be0
mov rbx, qword [r12]
test rbx, rbx
jne 0x140050337
jmp 0x14004fe2c
lea rax, [rsp + 0x2e]
mov qword [rsp + 0x20], rax
mov rcx, r15
mov rdx, r14
xor r8d, r8d
mov r9, rdi
call fcn.14003bd50
mov rbx, rax
jmp 0x14005047a