Function at 0x405810
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, 0x44
call fcn.0045d060
push 0x4188e0
push 0
call sub.kernel32.dll_AddVectoredExceptionHandler
test eax, eax
lea esi, [ebp - 0x34]
je 0x405bfd
mov dword [ebp - 0x34], 0x5000
push esi
call sub.kernel32.dll_SetThreadStackGuarantee
test eax, eax
jne 0x405854
call sub.kernel32.dll_GetLastError
cmp eax, 0x78
jne 0x405ca1
xor eax, eax
nop word cs:[eax + eax]
movzx ecx, byte [eax + 0x467980]
test cl, cl
js 0x4058b0
lea ecx, [eax + 0x467980]
neg ecx
test cl, 3
jne 0x4058dc
jmp 0x40588a
inc eax
cmp eax, 4
je 0x405977
cmp byte [eax + 0x467980], 0
jns 0x405880
nop word cs:[eax + eax]
nop dword [eax]
cmp eax, 4
jb 0x405860
jmp 0x405977
movzx edx, byte [ecx + 0x467518]
cmp edx, 3
je 0x4058eb
cmp edx, 2
jne 0x4059ed
cmp eax, 3
je 0x4059ed
cmp byte [eax + 0x467981], 0xbf
jg 0x4059ed
inc eax
inc eax
cmp eax, 4
jb 0x405860
jmp 0x405977
cmp eax, 3
je 0x4059ed
movzx edx, byte [eax + 0x467981]
cmp ecx, 0xe0
je 0x405915
cmp ecx, 0xed
jne 0x405922
cmp dl, 0x9f
jle 0x405954
jmp 0x4059ed
and dl, 0xe0
cmp dl, 0xa0
je 0x405954
jmp 0x4059ed
mov dh, cl
add dh, 0x1f
cmp dh, 0xc
jae 0x40593f
cmp dl, 0xbf
jg 0x4059ed
cmp eax, 1
jbe 0x40595d
jmp 0x4059ed
and cl, 0xfe
cmp cl, 0xee
jne 0x4059ed
cmp dl, 0xbf
jg 0x4059ed
cmp eax, 2
jae 0x4059ed
cmp byte [eax + 0x467982], 0xbf
jg 0x4059ed
add eax, 2
inc eax
cmp eax, 4
jb 0x405860
mov edx, 0x467980
lea ecx, [ebp - 0x34]
push 4
call fcn.0041b100
add esp, 4
mov edi, dword [ebp - 0x34]
cmp edi, 0x80000000
jne 0x4059c9
cmp byte [ebp - 0x30], 3
jne 0x4059ed
mov esi, dword [ebp - 0x2c]
mov ebx, dword [esi + 4]
mov edi, dword [esi]
mov eax, dword [ebx]
push edi
call eax
add esp, 4
cmp dword [ebx + 4], 0
je 0x4059df
cmp dword [ebx + 8], 9
jb 0x4059b9
mov edi, dword [edi - 4]
push edi
push 0
push dword [0x4760c0]
call sub.kernel32.dll_HeapFree
jmp 0x4059df
mov esi, dword [ebp - 0x30]
call sub.kernel32.dll_GetCurrentThread
mov ecx, dword [0x462020]
push esi
push eax
call ecx
test edi, edi
je 0x4059ed
push esi
push 0
push dword [0x4760c0]
call sub.kernel32.dll_HeapFree
movzx eax, byte [0x476104]
mov ecx, 5
call fcn.0043d720
test eax, eax
je 0x405c0e
mov dword [eax], 0x6e69616d
mov dword [ebp - 0x34], 5
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], 4
lea ecx, [ebp - 0x34]
call fcn.004069e0
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x34], 0x80000000
mov ebx, eax
mov esi, edx
movzx eax, byte [0x476104]
mov ecx, 0x20
call fcn.0043d720
test eax, eax
je 0x405c22
mov dword [eax], 1
mov dword [eax + 4], 1
mov dword [eax + 0x10], ebx
mov dword [eax + 0x14], esi
mov edi, eax
movq xmm0, qword [0x4760b8]
movd eax, xmm0
pshufd xmm0, xmm0, 0x55
movd edx, xmm0
nop dword [eax]
mov ebx, eax
mov ecx, edx
add ebx, 1
adc ecx, 0
jb 0x405bf3
lock cmpxchg8b qword [0x4760b8]
jne 0x405a80
mov dword [edi + 8], ebx
mov dword [edi + 0xc], ecx
mov byte [edi + 0x18], 0
mov dword [ebp - 0x44], edi
mov eax, dword [0x462058]
test eax, eax
je 0x405ab3
dec eax
jmp 0x405abd
mov ecx, 0x462058
call fcn.004193f0
push eax
call sub.kernel32.dll_TlsGetValue
cmp eax, 2
jb 0x405ad8
cmp dword [eax + 4], 0
mov esi, eax
je 0x405ad8
add esi, 8
jmp 0x405b9e
mov eax, dword [0x462058]
test eax, eax
je 0x405ae4
dec eax
jmp 0x405aee
mov ecx, 0x462058
call fcn.004193f0
push eax
call sub.kernel32.dll_TlsGetValue
test eax, eax
je 0x405b31
mov ebx, eax
cmp eax, 1
jne 0x405b76
lock dec dword [edi]
jne 0x405b0c
mov ecx, dword [ebp - 0x44]
call fcn.00441120
lea eax, [ebp - 0x10]
mov edx, 0x46
mov ecx, str.cannot_access_a_Thread_Local_Storage_value_during_or_after_destruction_rustc_25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04library_std_src_threadlocal.rs
push 0x4666dc
push 0x465acc
push eax
call fcn.00408b30
add esp, 0xc
jmp 0x4064a1
movzx eax, byte [0x476104]
mov ecx, 0xc
call fcn.0043d720
test eax, eax
je 0x405cd5
mov dword [eax], 0x462058
mov dword [eax + 4], 0
mov ebx, eax
mov eax, dword [0x462058]
test eax, eax
je 0x405b65
dec eax
jmp 0x405b6f
mov ecx, 0x462058
call fcn.004193f0
push ebx
push eax
call sub.kernel32.dll_TlsSetValue
mov ecx, dword [ebx + 8]
cmp dword [ebx + 4], 0
lea esi, [ebx + 8]
mov dword [ebx + 4], 1
mov dword [ebx + 8], 0
je 0x405b9e
test ecx, ecx
je 0x405b9e
lock dec dword [ecx]
jne 0x405b9e
call fcn.00441120
mov dword [ebp - 0x50], edi
cmp dword [esi], 0
jne 0x405c36
mov dword [esi], edi
xor edi, edi
mov ecx, 0x403820
call fcn.00401640
mov eax, dword [0x47605c]
cmp eax, 3
je 0x405be9
lea eax, [ebp - 0x40]
mov byte [ebp - 0x40], 1
mov dword [ebp - 0x34], eax
xor edx, edx
mov ecx, 0x47605c
push 0x4660dc
push 0x466868
lea eax, [ebp - 0x34]
push eax
call fcn.00418cd0
add esp, 0xc
mov eax, edi
add esp, 0x44
pop esi
pop edi
pop ebx
pop ebp
ret
call fcn.0041b0a0
jmp 0x4064a1
mov dword [ebp - 0x34], str.failed_to_install_exception_handler
mov edx, 0x467b84
jmp 0x405cad
mov ecx, 1
mov edx, 5
call fcn.004068b0
jmp 0x4064a1
mov ecx, 8
mov edx, 0x20
call fcn.004068b0
jmp 0x4064a1
lea eax, [ebp - 0x10]
mov dword [ebp - 0x34], 0x466ad8
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x4c], 0
mov byte [ebp - 0x48], 0
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x38], eax
mov byte [ebp - 0x40], 4
mov edx, 0x465fc0
lea eax, [ebp - 0x34]
lea ecx, [ebp - 0x40]
push eax
call fcn.00407f40
add esp, 4
movzx ecx, byte [ebp - 0x40]
test al, al
je 0x405ce9
cmp cl, 4
jne 0x405d40
mov edx, 0x46812c
mov esi, 2
jmp 0x405d46
mov edx, 0x467b14
mov dword [ebp - 0x34], 0x467ad8
mov dword [esi + 4], 1
mov dword [esi + 0x10], 0
mov dword [esi + 8], str.Index_out_of_bounds
mov dword [esi + 0xc], 0
mov ecx, esi
call fcn.00407170
jmp 0x4064a1
mov ecx, 4
mov edx, 0xc
call fcn.004068b0
jmp 0x4064a1
cmp cl, 3
mov esi, 4
jne 0x405d3e
mov eax, dword [ebp - 0x3c]
mov ebx, dword [eax + 4]
mov ecx, dword [eax]
mov dword [ebp - 0x18], eax
mov eax, dword [ebx]
mov dword [ebp - 0x1c], ecx
push ecx
call eax
add esp, 4
cmp dword [ebx + 4], 0
je 0x405d2e
cmp dword [ebx + 8], 9
jb 0x405d1e
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax - 4]
mov dword [ebp - 0x1c], eax
push dword [ebp - 0x1c]
push 0
push dword [0x4760c0]
call sub.kernel32.dll_HeapFree
push dword [ebp - 0x18]
push 0
push dword [0x4760c0]
call sub.kernel32.dll_HeapFree
jmp 0x405d46
mov esi, dword [ebp - 0x40]
mov edx, dword [ebp - 0x3c]
mov ecx, esi
call fcn.00418b20
mov ecx, 7
int 0x29
ud2
ud2