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

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x20
cmp dword [ebp + 0xc], 3
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0xfeedbab1
mov dword [ebp - 0x14], 0
mov dword [ebp - 0xc], 1
je 0x417558
lea esp, [ebp - 8]
mov eax, 1
pop ebx
pop esi
pop ebp
ret 0xc
mov eax, dword [0x488dc0]
test eax, eax
je 0x4176e5
cmp dword [eax], 0xffffffff
je 0x41754a
mov eax, dword [0x488dc0]
test eax, eax
je 0x417736
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
test eax, eax
mov ebx, eax
je 0x41754a
test byte [eax + 0x20], 0x30
je 0x417637
mov eax, dword [eax + 0xbc]
test eax, eax
jne 0x4176d7
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x4175d5
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp], eax
call esi
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x4175c7
mov dword [esp], eax
call esi
sub esp, 4
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x14], 0
lea eax, [ebx + 0x1c]
mov dword [esp], eax
call sym._pthread_mutex_destroy
mov eax, dword [ebp - 0x18]
mov esi, dword [ebx + 0xb8]
mov dword [ebx + 0x34], eax
mov eax, dword [ebp - 0x14]
test esi, esi
mov dword [ebx + 0x38], eax
mov eax, dword [ebp - 0x10]
mov dword [ebx + 0x3c], eax
mov eax, dword [ebp - 0xc]
mov dword [ebx + 0x40], eax
je 0x41775c
mov eax, dword [0x488dc0]
test eax, eax
je 0x417710
mov dword [esp + 4], 0
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, 1
sub esp, 8
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret 0xc
mov ecx, dword [eax + 0x70]
mov eax, dword [eax + 0x18]
test ecx, ecx
jne 0x417691
test eax, eax
je 0x417651
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [ebx + 0xbc]
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x70], 1
test eax, eax
jne 0x4176d0
test byte [ebx + 0x24], 4
je 0x4176a8
mov eax, dword [ebx + 0x14]
mov dword [ebx], 0xdeadbeef
test eax, eax
je 0x4175ce
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x4175ce
test eax, eax
je 0x4176a1
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov dword [ebx + 0x18], 0
lea eax, [ebx + 0x1c]
mov dword [esp], eax
call sym._pthread_mutex_destroy
mov eax, dword [ebp - 0x18]
mov dword [ebx + 0x34], eax
mov eax, dword [ebp - 0x14]
mov dword [ebx + 0x38], eax
mov eax, dword [ebp - 0x10]
mov dword [ebx + 0x3c], eax
mov eax, dword [ebp - 0xc]
mov dword [ebx + 0x40], eax
jmp 0x41754a
call sym.__pthread_cleanup_dest.part.2
jmp 0x417669
call sym.__pthread_cleanup_dest.part.2
lea esi, [esi]
jmp 0x4175a3
mov dword [esp + 8], sym.___shmem_winpthreads_init__pthread_tls_shmem
mov dword [esp + 4], 4
mov dword [esp], str._pthread_tls_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x488dc0], eax
jmp 0x417565
mov dword [esp + 8], sym.___shmem_winpthreads_init__pthread_tls_shmem
mov dword [esp + 4], 4
mov dword [esp], str._pthread_tls_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x488dc0], eax
jmp 0x417613
mov dword [esp + 8], sym.___shmem_winpthreads_init__pthread_tls_shmem
mov dword [esp + 4], 4
mov dword [esp], str._pthread_tls_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x488dc0], eax
jmp 0x417577
mov eax, ebx
call sym._push_pthread_mem.part.0
jmp 0x417606