Function at 0x466100
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x30
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x10], ecx
mov eax, dword [ecx]
jmp 0x46613e
cmp byte [ebp - 0x38], 0
je 0x4663a5
mov ecx, dword [ebp - 0x10]
mov eax, edi
mov edx, 2
lock cmpxchg dword [ecx], edx
je 0x46631a
mov edi, eax
test eax, eax
je 0x46612a
cmp edi, 1
je 0x466120
cmp edi, 3
je 0x466345
mov eax, edi
and eax, 3
cmp eax, 2
je 0x46617e
jmp 0x4663d3
mov eax, edi
and eax, 3
cmp eax, 2
jne 0x466310
mov eax, dword [0x4ab078]
test eax, eax
je 0x4662b3
dec eax
push eax
call sub.kernel32.dll_TlsGetValue
cmp eax, 2
jb 0x4661b0
cmp dword [eax + 4], 0
mov ebx, eax
je 0x4661b0
add ebx, 8
jmp 0x466250
mov eax, dword [0x4ab078]
test eax, eax
je 0x4662c2
dec eax
push eax
call sub.kernel32.dll_TlsGetValue
test eax, eax
je 0x4661e0
mov esi, eax
cmp eax, 1
jne 0x466222
jmp 0x466382
movzx eax, byte [0x52314c]
mov ecx, 0xc
mov edx, 4
call fcn.00404a60
test eax, eax
je 0x466396
mov dword [eax], 0x4ab078
mov dword [eax + 4], 0
mov esi, eax
mov eax, dword [0x4ab078]
test eax, eax
je 0x4662d1
dec eax
push esi
push eax
call sub.kernel32.dll_TlsSetValue
mov ecx, dword [esi + 8]
cmp dword [esi + 4], 0
lea ebx, [esi + 8]
mov dword [esi + 4], 1
mov dword [esi + 8], 0
je 0x466250
test ecx, ecx
je 0x466250
lock dec dword [ecx]
jne 0x466250
call fcn.00466590
nop word [eax + eax]
mov esi, dword [ebx]
test esi, esi
jne 0x46626a
xor ecx, ecx
call fcn.00465d90
cmp dword [ebx], 0
mov esi, eax
jne 0x46634d
mov dword [ebx], esi
lock inc dword [esi]
jle 0x466380
mov ecx, dword [ebp - 0x10]
mov eax, edi
mov dword [ebp - 0x1c], esi
mov byte [ebp - 0x14], 0
lea edx, [ebp - 0x1a]
add eax, 0xfffffffe
mov dword [ebp - 0x18], eax
mov eax, edi
lock cmpxchg dword [ecx], edx
je 0x4662e5
mov edi, eax
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x466170
lock dec dword [eax]
jne 0x466170
mov ecx, dword [ebp - 0x1c]
call fcn.00466590
jmp 0x466170
mov ecx, 0x4ab078
call fcn.004665d0
jmp 0x46618c
mov ecx, 0x4ab078
call fcn.004665d0
jmp 0x4661be
mov ecx, 0x4ab078
call fcn.004665d0
jmp 0x46621b
call fcn.004666f0
movzx eax, byte [ebp - 0x14]
test al, al
je 0x4662e0
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x466310
lock dec dword [eax]
jne 0x466310
mov ecx, dword [ebp - 0x1c]
call fcn.00466590
nop word cs:[eax + eax]
nop dword [eax + eax]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
jmp 0x46613e
mov eax, dword [ebp + 0xc]
cmp edi, 1
mov dword [ebp - 0x34], 3
sete byte [ebp - 0x30]
mov eax, dword [eax + 0x10]
lea ecx, [ebp - 0x34]
push ecx
push dword [ebp + 8]
call eax
add esp, 8
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x10]
call 0x466430
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x34], str.reentrant_init
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x2c], str.combase.dll
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x34]
mov edx, 0x502654
call fcn.0040cbc0
ud2
mov ecx, 0x503084
mov edx, 0x5e
push 0x5030e4
call fcn.00410f30
mov ecx, 4
mov edx, 0xc
call fcn.00404f40
mov dword [ebp - 0x34], 0x504ab4
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x2c], str.combase.dll
mov dword [ebp - 0x28], 0
mov edx, dword [ebp + 0x10]
lea ecx, [ebp - 0x34]
call fcn.0040cbc0
mov ecx, str.assertion_failed:_state_and_queue.addr____STATE_MASK__RUNNINGlibrary_std_src_sys_commononcequeue.rs
mov edx, 0x40
push dword [ebp + 0x10]
call fcn.0040db80
mov edi, eax
mov ecx, dword [ebp - 0x10]
mov edx, 1
call 0x466430
jmp 0x46641f
push edi
call fcn.004a1fc0
nop word cs:[eax + eax]
nop
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x2c
xchg dword [ecx], edx
mov eax, edx
and eax, 3
cmp eax, 2
mov dword [ebp - 0x18], eax
jne 0x466558
add edx, 0xfffffffe
jne 0x466466
add esp, 0x2c
pop esi
pop edi
pop ebx
pop ebp
ret
test ebx, ebx
mov edx, ebx
je 0x466451
mov esi, dword [edx]
mov ebx, dword [edx + 4]
mov dword [edx], 0
test esi, esi
je 0x466503
mov byte [edx + 8], 1
mov al, 1
xchg byte [esi + 0x18], al
cmp al, 0xff
jne 0x466495
mov eax, dword [0x523114]
lea edi, [esi + 0x18]
test eax, eax
je 0x4664a3
push edi
call eax
lock dec dword [esi]
jne 0x466460
mov ecx, esi
call fcn.00466590
jmp 0x466460
mov ecx, dword [0x4ab038]
cmp ecx, 0xffffffff
jne 0x4664eb
mov dword [ebp - 0x10], 0xffffffff
mov eax, dword [0x4ab044]
push 0
push 0
push 0xc0000000
lea ecx, [ebp - 0x10]
push ecx
call eax
test eax, eax
jne 0x466517
mov ecx, dword [ebp - 0x10]
mov eax, 0xffffffff
lock cmpxchg dword [0x4ab038], ecx
je 0x4664eb
push ecx
mov dword [ebp - 0x1c], eax
call sub.kernel32.dll_CloseHandle
mov ecx, dword [ebp - 0x1c]
mov eax, dword [0x4ab048]
push 0
push 0
push edi
push ecx
call eax
lock dec dword [esi]
jne 0x466460
jmp 0x46649a
mov ecx, 0x5063db
mov edx, 0x2b
push 0x504b24
call fcn.0040db80
lea ebx, [ebp - 0x20]
lea edi, [ebp - 0x18]
mov dword [ebp - 0x38], 0x504794
mov dword [ebp - 0x34], 1
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x14], fcn.004175f0
mov dword [ebp - 0x2c], 1
lea ecx, [ebp - 0x38]
mov edx, 0x5047cc
call fcn.0040cbc0
ud2
mov dword [ebp - 0x38], 0
lea eax, [ebp - 0x38]
lea ecx, [ebp - 0x18]
mov edx, 0x504b34
push 0x504b38
push eax
call fcn.00466cf0
lock dec dword [esi]
mov edi, eax
jne 0x466583
mov ecx, esi
call fcn.00466590
push edi
call fcn.004a1fc0
nop dword [eax]