Function at 0x51eba0
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 0x51ebde
cmp byte [ebp - 0x38], 0
je 0x51ee45
mov ecx, dword [ebp - 0x10]
mov eax, edi
mov edx, 2
lock cmpxchg dword [ecx], edx
je 0x51edba
mov edi, eax
test eax, eax
je 0x51ebca
cmp edi, 1
je 0x51ebc0
cmp edi, 3
je 0x51ede5
mov eax, edi
and eax, 3
cmp eax, 2
je 0x51ec1e
jmp 0x51ee73
mov eax, edi
and eax, 3
cmp eax, 2
jne 0x51edb0
mov eax, dword [0x592098]
test eax, eax
je 0x51ed53
dec eax
push eax
call sub.KERNEL32.DLL_TlsGetValue
cmp eax, 2
jb 0x51ec50
cmp dword [eax + 4], 0
mov ebx, eax
je 0x51ec50
add ebx, 8
jmp 0x51ecf0
mov eax, dword [0x592098]
test eax, eax
je 0x51ed62
dec eax
push eax
call sub.KERNEL32.DLL_TlsGetValue
test eax, eax
je 0x51ec80
mov esi, eax
cmp eax, 1
jne 0x51ecc2
jmp 0x51ee22
movzx eax, byte [0x706188]
mov ecx, 0xc
mov edx, 4
call fcn.00425680
test eax, eax
je 0x51ee36
mov dword [eax], 0x592098
mov dword [eax + 4], 0
mov esi, eax
mov eax, dword [0x592098]
test eax, eax
je 0x51ed71
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 0x51ecf0
test ecx, ecx
je 0x51ecf0
lock dec dword [ecx]
jne 0x51ecf0
call fcn.0051f030
nop word [eax + eax]
mov esi, dword [ebx]
test esi, esi
jne 0x51ed0a
xor ecx, ecx
call fcn.0051e870
cmp dword [ebx], 0
mov esi, eax
jne 0x51eded
mov dword [ebx], esi
lock inc dword [esi]
jle 0x51ee20
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 0x51ed85
mov edi, eax
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x51ec10
lock dec dword [eax]
jne 0x51ec10
mov ecx, dword [ebp - 0x1c]
call fcn.0051f030
jmp 0x51ec10
mov ecx, 0x592098
call fcn.0051f070
jmp 0x51ec2c
mov ecx, 0x592098
call fcn.0051f070
jmp 0x51ec5e
mov ecx, 0x592098
call fcn.0051f070
jmp 0x51ecbb
call fcn.0051f1a0
movzx eax, byte [ebp - 0x14]
test al, al
je 0x51ed80
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x51edb0
lock dec dword [eax]
jne 0x51edb0
mov ecx, dword [ebp - 0x1c]
call fcn.0051f030
nop word cs:[eax + eax]
nop dword [eax + eax]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
jmp 0x51ebde
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 0x51eed0
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], 0x6c4590
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x34]
mov edx, 0x69b6a4
call fcn.00439fc0
ud2
mov ecx, str.use_of_std::thread::current___is_not_possible_after_the_threads_local_data_has_been_destroyed
mov edx, 0x5e
push 0x69c3b4
call fcn.004408d0
mov ecx, 4
mov edx, 0xc
call fcn.00434230
mov dword [ebp - 0x34], 0x69e310
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x2c], 0x6c4590
mov dword [ebp - 0x28], 0
mov edx, dword [ebp + 0x10]
lea ecx, [ebp - 0x34]
call fcn.00439fc0
mov ecx, str.assertion_failed:_state_and_queue.addr____STATE_MASK__RUNNING
mov edx, 0x40
push dword [ebp + 0x10]
call fcn.0043a9e0
mov edi, eax
mov ecx, dword [ebp - 0x10]
mov edx, 1
call 0x51eed0
jmp 0x51eebf
push edi
call fcn.0056dac0
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 0x51eff8
add edx, 0xfffffffe
jne 0x51ef06
add esp, 0x2c
pop esi
pop edi
pop ebx
pop ebp
ret
test ebx, ebx
mov edx, ebx
je 0x51eef1
mov esi, dword [edx]
mov ebx, dword [edx + 4]
mov dword [edx], 0
test esi, esi
je 0x51efa3
mov byte [edx + 8], 1
mov al, 1
xchg byte [esi + 0x18], al
cmp al, 0xff
jne 0x51ef35
mov eax, dword [0x706144]
lea edi, [esi + 0x18]
test eax, eax
je 0x51ef43
push edi
call eax
lock dec dword [esi]
jne 0x51ef00
mov ecx, esi
call fcn.0051f030
jmp 0x51ef00
mov ecx, dword [0x592058]
cmp ecx, 0xffffffff
jne 0x51ef8b
mov dword [ebp - 0x10], 0xffffffff
mov eax, dword [0x592064]
push 0
push 0
push 0xc0000000
lea ecx, [ebp - 0x10]
push ecx
call eax
test eax, eax
jne 0x51efb7
mov ecx, dword [ebp - 0x10]
mov eax, 0xffffffff
lock cmpxchg dword [0x592058], ecx
je 0x51ef8b
push ecx
mov dword [ebp - 0x1c], eax
call sub.KERNEL32.DLL_CloseHandle
mov ecx, dword [ebp - 0x1c]
mov eax, dword [0x592068]
push 0
push 0
push edi
push ecx
call eax
lock dec dword [esi]
jne 0x51ef00
jmp 0x51ef3a
mov ecx, str.called__Option::unwrap____on_a__None__valueC:Users_admin.cargo_registry_srcindex.crates.io_6f17d22bba15001fwinapi_util_0.1.6_srcwin.rs
mov edx, 0x2b
push 0x69e384
call fcn.0043a9e0
lea ebx, [ebp - 0x20]
lea edi, [ebp - 0x18]
mov dword [ebp - 0x38], 0x69dfc8
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.00445500
mov dword [ebp - 0x2c], 1
lea ecx, [ebp - 0x38]
mov edx, 0x69e000
call fcn.00439fc0
ud2
mov dword [ebp - 0x38], 0
lea eax, [ebp - 0x38]
lea ecx, [ebp - 0x18]
mov edx, 0x69e358
push 0x69e394
push eax
call fcn.0051f730
lock dec dword [esi]
mov edi, eax
jne 0x51f023
mov ecx, esi
call fcn.0051f030
push edi
call fcn.0056dac0
nop dword [eax]