Function at 0x40fad4
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x114
push esi
mov dword [ebp - 0xc], 0xc0
mov dword [ebp - 4], 0x7a
mov dword [ebp - 0x10], 0xb9
mov dword [ebp - 8], 0xae
mov eax, dword [ebp + 8]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
sub ecx, 0x1c
mov dword [ebp - 0x14], ecx
cmp dword [ebp - 0x14], 0x7b
ja case.0x40fb1d.1
mov edx, dword [ebp - 0x14]
movzx eax, byte [edx + 0x41051c]
jmp dword [eax*4 + 0x410508]
mov dword [ebp - 0x88], 0x6c
mov eax, dword [ebp - 4]
xor edx, edx
div dword [0x421808]
mov dword [0x421824], eax
mov ecx, dword [0x4217e8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x4217e4], eax
jmp 0x40fc0d
mov dword [ebp - 0x8c], 0x5d
mov dword [ebp - 0x90], 0xd9
mov edx, dword [str.AJ]
or edx, dword [0x42180c]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x2c]
mov dword [0x4217e8], eax
mov ecx, dword [0x4217e8]
mov dword [0x421818], ecx
jmp 0x40fc0d
mov dword [ebp - 0x94], 0x24
mov edx, dword [0x42181c]
imul edx, dword [0x4217e0]
mov dword [ebp - 0x30], edx
mov eax, dword [0x4217f4]
push eax
mov ecx, dword [ebp - 0x98]
push ecx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [ebp - 0xc], eax
jmp 0x40fc0d
mov dword [ebp - 0x9c], 0x4f
mov edx, dword [ebp - 4]
push edx
mov eax, dword [0x4217f0]
push eax
call dword [sym.imp.GDI32.dll_SetArcDirection]
mov dword [0x4217e8], eax
jmp 0x40fc0d
mov dword [ebp - 0xa0], 0x8e
mov ecx, dword [0x42181c]
xor ecx, dword [0x421818]
mov dword [ebp - 0xc], ecx
mov edx, dword [0x42181c]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0xa4], eax
push fcn.00418024
mov eax, dword [0x42180c]
push eax
call fcn.00415df4
add esp, 8
mov esi, eax
mov ecx, dword [0x4217fc]
push ecx
mov edx, dword [0x421800]
push edx
mov eax, dword [0x421818]
push eax
call dword [sym.imp.GDI32.dll_PolylineTo]
cmp esi, eax
jae 0x40fc49
mov dword [ebp - 0x34], 1
jmp 0x40fc50
mov dword [ebp - 0x34], 0
cmp dword [ebp - 0x34], 0
jne 0x40fc9a
mov eax, dword [0x4217f8]
xor edx, edx
div dword [0x4217f4]
mov dword [0x421824], eax
mov ecx, dword [0x421800]
push ecx
mov edx, dword [0x421808]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp eax, dword [0x421824]
jae 0x40fc8d
mov dword [ebp - 0x38], 1
jmp 0x40fc94
mov dword [ebp - 0x38], 0
cmp dword [ebp - 0x38], 0
je 0x40fcb4
mov dword [ebp - 0xa8], 0xb7
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4217f4], eax
jmp 0x40fc0d
mov eax, dword [0x4217fc]
mov dword [ebp - 0x18], eax
jmp 0x40fcc7
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 8]
jae 0x40fe82
mov dword [ebp - 0xac], 0x32
mov eax, dword [0x4217ec]
imul eax, dword [0x421814]
mov dword [0x42181c], eax
mov ecx, dword [ebp - 0x24]
push ecx
mov edx, dword [0x4217e4]
push edx
mov eax, dword [0x421800]
push eax
call dword [sym.imp.GDI32.dll_PolylineTo]
mov dword [ebp - 0x3c], eax
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 8]
mov dword [0x421800], edx
cmp dword [0x421800], 0
je 0x40fd37
mov eax, dword [ebp - 0x3c]
add eax, dword [0x4217f0]
mov dword [ebp - 0x74], eax
je 0x40fd37
mov dword [ebp - 0x40], 1
jmp 0x40fd3e
mov dword [ebp - 0x40], 0
mov ecx, dword [0x4217f4]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov esi, eax
push fcn.0040e4a4
mov edx, dword [ebp - 0x3c]
push edx
call fcn.0040e4a4
add esp, 8
cmp esi, eax
jae 0x40fd6b
mov dword [ebp - 0x44], 1
jmp 0x40fd72
mov dword [ebp - 0x44], 0
mov eax, dword [ebp - 0x40]
cmp eax, dword [ebp - 0x44]
je 0x40fd83
mov dword [ebp - 0x48], 1
jmp 0x40fd8a
mov dword [ebp - 0x48], 0
cmp dword [ebp - 0x48], 0
je 0x40fde5
push fcn.00418024
mov ecx, dword [str.AJ]
push ecx
mov edx, dword [0x4217ec]
push edx
call fcn.00412234
add esp, 0xc
test eax, eax
je 0x40fdcf
push fcn.00418e94
mov eax, dword [0x4217e4]
push eax
call fcn.004154e4
add esp, 8
test eax, eax
je 0x40fdcf
mov dword [ebp - 0x4c], 1
jmp 0x40fdd6
mov dword [ebp - 0x4c], 0
cmp dword [ebp - 0x4c], 0
je 0x40fde5
mov dword [ebp - 0x50], 1
jmp 0x40fdec
mov dword [ebp - 0x50], 0
cmp dword [ebp - 0x50], 0
jne 0x40fe2e
push fcn.0040e4a4
mov ecx, dword [0x4217f8]
push ecx
call fcn.0040e4a4
add esp, 8
test eax, eax
je 0x40fe21
mov edx, dword [ebp + 8]
sub edx, dword [ebp - 0x24]
mov dword [0x42181c], edx
je 0x40fe21
mov dword [ebp - 0x54], 1
jmp 0x40fe28
mov dword [ebp - 0x54], 0
cmp dword [ebp - 0x54], 0
je 0x40fe62
mov dword [ebp - 0xb0], 0x81
push fcn.00418024
mov eax, dword [0x4217f8]
push eax
call fcn.004154e4
add esp, 8
push fcn.0040bf14
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x18]
push edx
call fcn.00412234
add esp, 0xc
jmp 0x40fe7d
mov dword [ebp - 0xb4], 0x6b
mov eax, dword [0x42180c]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [0x421804], eax
jmp 0x40fcbe
mov ecx, dword [0x4217e4]
mov dword [ebp - 0x58], ecx
cmp dword [ebp - 0x58], 0x10
je 0x40fecb
cmp dword [ebp - 0x58], 0x34
je 0x40fe99
jmp 0x40fef2
mov dword [ebp - 0xb8], 0xa7
mov dword [ebp - 0xbc], 0x2b
mov dword [ebp - 0xc0], 0x41
mov edx, dword [0x421804]
xor edx, dword [0x421820]
mov dword [0x421820], edx
jmp 0x40ff07
mov eax, dword [0x4217e4]
push eax
call fcn.0040bf14
add esp, 4
mov ecx, dword [0x42180c]
push ecx
mov edx, dword [0x421814]
push edx
call dword [sym.imp.GDI32.dll_SetArcDirection]
mov dword [ebp - 0xc], eax
jmp 0x40ff07
mov dword [ebp - 0xc4], 0x70
mov eax, dword [0x421808]
add eax, dword [ebp + 8]
mov dword [ebp - 4], eax
mov ecx, dword [0x4217e4]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x1c]
sub edx, 0x7a
mov dword [ebp - 0x1c], edx
cmp dword [ebp - 0x1c], 0x7c
ja case.0x40ff2d.1
mov eax, dword [ebp - 0x1c]
movzx ecx, byte [eax + 0x4105b8]
jmp dword [ecx*4 + 0x410598]
mov dword [ebp - 0xc8], 0x6f
mov edx, dword [0x4217ec]
push edx
mov eax, dword [0x421824]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x421814], eax
mov ecx, dword [0x421800]
and ecx, dword [0x4217e4]
mov dword [0x4217f0], ecx
jmp 0x410095
mov edx, dword [ebp - 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x421800], eax
mov eax, dword [0x4217fc]
push eax
call fcn.00418e94
add esp, 4
jmp 0x410095
mov dword [ebp - 0xcc], 0x17
mov ecx, dword [0x421818]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x421820], eax
jmp 0x410095
push fcn.0040bf14
mov edx, dword [0x42180c]
push edx
call fcn.004154e4
add esp, 8
mov eax, dword [0x42180c]
push eax
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov dword [0x421814], eax
mov eax, dword [0x4217e0]
xor edx, edx
div dword [0x4217e0]
mov dword [0x421808], eax
jmp 0x410095
push fcn.0040b7d4
mov edx, dword [0x4217e4]
push edx
call fcn.004154e4
add esp, 8
push fcn.00417804
mov eax, dword [0x421800]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00417804
add esp, 0xc
push fcn.00418024
mov edx, dword [ebp - 4]
push edx
mov eax, dword [0x4217fc]
push eax
call fcn.00412234
add esp, 0xc
jmp 0x410095
mov dword [ebp - 0xd0], 0x4c
mov dword [ebp - 0xd4], 0xc4
mov dword [ebp - 0xd8], 0xd6
mov ecx, dword [0x4217e0]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [str.AJ], eax
jmp 0x410095
mov edx, dword [0x4217f8]
add edx, dword [0x4217fc]
mov dword [0x421818], edx
jmp 0x410095
mov dword [ebp - 0xdc], 0xb2
push fcn.0040b7d4
mov eax, dword [ebp - 0x10]
push eax
call fcn.004107c4
add esp, 8
mov ecx, dword [str.AJ]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
sub edx, 0xd
mov dword [ebp - 0x20], edx
cmp dword [ebp - 0x20], 0xe9
ja case.0x4100be.1
mov eax, dword [ebp - 0x20]
movzx ecx, byte [eax + 0x41065c]
jmp dword [ecx*4 + 0x410638]
mov dword [ebp - 0xe0], 0x72
mov edx, dword [0x421800]
push edx
mov eax, dword [0x421820]
push eax
mov ecx, dword [0x421814]
push ecx
mov edx, dword [0x4217f8]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [0x4217f8], eax
jmp fcn.0041026e
mov dword [ebp - 0xe4], 0x20
mov eax, dword [0x4217ec]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x42180c], eax
mov eax, dword [0x421808]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x10], eax
jmp fcn.0041026e
push fcn.00415df4
mov ecx, dword [0x4217fc]
push ecx
call fcn.0040e4a4
add esp, 8
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4217f0], eax
jmp fcn.0041026e
mov dword [ebp - 0xe8], 0x83
mov edx, dword [0x421820]
xor edx, dword [0x42180c]
mov dword [0x421820], edx
mov eax, dword [ebp - 0x24]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
mov dword [0x42181c], ecx
jmp fcn.0041026e
mov dword [ebp - 0xec], 0xf9
mov dword [ebp - 0xf0], 0x53
mov dword [ebp - 0xf4], 0x15
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4217ec], eax
mov edx, dword [0x421824]
push edx
call fcn.00418e94
add esp, 4
jmp fcn.0041026e
mov dword [ebp - 0xf8], 0xd7
mov eax, dword [0x4217f4]
sub eax, dword [0x4217ec]
mov dword [0x421804], eax
jmp fcn.0041026e
mov dword [ebp - 0xfc], 0x35
mov ecx, dword [0x4217e4]
push ecx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x421808], eax
mov edx, dword [0x4217f4]
add edx, dword [ebp - 0x100]
mov dword [0x421808], edx
jmp fcn.0041026e
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4217e4], eax
mov eax, dword [0x421824]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 8], eax
mov eax, dword [0x421824]
xor edx, edx
div dword [0x421804]
mov dword [0x421818], eax
jmp fcn.0041026e
mov dword [ebp - 0x78], 0xe2
mov dword [ebp - 0x104], 0x85
mov ecx, dword [ebp - 0x78]
push ecx
mov edx, dword [ebp - 0x2c]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4217f0], eax