Function at 0x408060
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x44c7ad
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push esi
mov eax, dword [0x46d45c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x34], 0
lea ecx, [ebp - 0x14]
call fcn.00402160
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x10]
call fcn.00402160
mov byte [ebp - 4], 2
mov eax, dword [ebp + 0xc]
push eax
lea ecx, [ebp - 0x14]
call fcn.004021e0
mov ecx, dword [0x46f464]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp eax, 0x100
jne 0x4081a2
lea edx, [ebp - 0x14]
push edx
lea ecx, [ebp - 0x18]
call fcn.00402280
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x18]
call fcn.00402270
push eax
call fcn.004397e3
add esp, 4
push 0x4547ec
lea ecx, [ebp - 0x18]
call fcn.00402270
push eax
call fcn.00416750
add esp, 8
test eax, eax
je 0x408196
push 0x45480c
lea ecx, [ebp - 0x18]
call fcn.00402270
push eax
call fcn.00416750
add esp, 8
mov esi, eax
lea ecx, [ebp - 0x18]
call fcn.00402270
sub esi, eax
sar esi, 1
mov dword [ebp - 0x1c], esi
push 0x1c
push 0x45482c
lea ecx, [ebp - 0x14]
call fcn.00402270
mov ecx, dword [ebp - 0x1c]
lea edx, [eax + ecx*2]
push edx
call fcn.00437b50
add esp, 0xc
lea ecx, [ebp - 0x14]
call fcn.00402270
mov ecx, dword [ebp - 0x1c]
lea esi, [eax + ecx*2]
push 0x45484c
call fcn.00438225
add esp, 4
lea edx, [esi + eax*2]
push edx
lea ecx, [ebp - 0x14]
call fcn.00402270
mov ecx, dword [ebp - 0x1c]
lea esi, [eax + ecx*2]
push 0x45486c
call fcn.00438225
add esp, 4
lea edx, [esi + eax*2]
push edx
call fcn.004387e0
add esp, 8
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x18]
call fcn.004021c0
lea ecx, [ebp - 0x14]
call fcn.00402270
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.0041d6a0
add esp, 8
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x3c], ecx
mov byte [ebp - 4], 4
mov edx, dword [ebp - 0x3c]
push edx
lea ecx, [ebp - 0x10]
call fcn.00402240
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x30]
call fcn.004021c0
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.00402240
lea ecx, [ebp - 0x10]
call fcn.00402270
movzx ecx, word [eax]
cmp ecx, 0x22
jne 0x408259
push 0x22
lea ecx, [ebp - 0x10]
call fcn.00402270
add eax, 2
push eax
call fcn.00416790
add esp, 8
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x408240
xor edx, edx
mov eax, dword [ebp - 0x20]
mov word [eax], dx
lea ecx, [ebp - 0x10]
call fcn.00402270
add eax, 2
push eax
lea ecx, [ebp - 0x14]
call fcn.004021e0
mov ecx, 0x22
mov edx, dword [ebp - 0x20]
mov word [edx], cx
jmp 0x408254
lea ecx, [ebp - 0x10]
call fcn.00402270
add eax, 2
push eax
lea ecx, [ebp - 0x14]
call fcn.004021e0
jmp 0x40831f
lea ecx, [ebp - 0x10]
call fcn.00402270
push eax
call fcn.0041d990
add esp, 4
cmp eax, 0xffffffff
jne 0x40831f
mov dword [ebp - 0x28], 0
push 0x20
lea ecx, [ebp - 0x10]
call fcn.00402270
push eax
call fcn.00416770
add esp, 8
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
je 0x40830e
cmp dword [ebp - 0x28], 0
je 0x4082a7
mov eax, 0x20
mov ecx, dword [ebp - 0x28]
mov word [ecx], ax
xor edx, edx
mov eax, dword [ebp - 0x24]
mov word [eax], dx
lea ecx, [ebp - 0x10]
call fcn.00402270
push eax
call fcn.0041d990
add esp, 4
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0xffffffff
je 0x408303
mov ecx, dword [ebp - 0x2c]
and ecx, 0x10
jne 0x408303
lea edx, [ebp - 0x10]
push edx
mov ecx, dword [ebp + 8]
call fcn.00402280
mov eax, dword [ebp - 0x34]
or eax, 1
mov dword [ebp - 0x34], eax
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x10]
call fcn.004021c0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x14]
call fcn.004021c0
mov eax, dword [ebp + 8]
jmp 0x40834f
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x28], ecx
jmp 0x40827a
cmp dword [ebp - 0x28], 0
je 0x40831f
mov edx, 0x20
mov eax, dword [ebp - 0x28]
mov word [eax], dx
lea ecx, [ebp - 0x14]
push ecx
mov ecx, dword [ebp + 8]
call fcn.00402280
mov edx, dword [ebp - 0x34]
or edx, 1
mov dword [ebp - 0x34], edx
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x10]
call fcn.004021c0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x14]
call fcn.004021c0
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
mov esp, ebp
pop ebp
ret