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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xf8
push esi
mov dword [ebp - 0x28], 0xa8
mov dword [ebp - 0x18], 0x98
mov dword [ebp - 4], 0x51
mov dword [ebp - 0x10], 0x90
push fcn.0040b613
mov eax, dword [0x41c118]
push eax
call fcn.0040ab83
add esp, 8
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov esi, eax
push fcn.0040d0d3
mov edx, dword [0x41c0d4]
push edx
mov eax, dword [ebp - 0xc]
push eax
call fcn.00413893
add esp, 0xc
cmp esi, eax
jae 0x41046d
mov dword [ebp - 0x2c], 1
jmp 0x410474
mov dword [ebp - 0x2c], 0
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.GDI32.dll_PolylineTo]
mov ecx, dword [0x41c11c]
or ecx, dword [0x41c0bc]
cmp eax, ecx
jae 0x41049f
mov dword [ebp - 0x30], 1
jmp 0x4104a6
mov dword [ebp - 0x30], 0
mov edx, dword [ebp - 0x2c]
cmp edx, dword [ebp - 0x30]
je 0x4104b7
mov dword [ebp - 0x34], 1
jmp 0x4104be
mov dword [ebp - 0x34], 0
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov esi, eax
mov ecx, dword [0x41c118]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp esi, eax
jne 0x4104e4
mov dword [ebp - 0x38], 1
jmp 0x4104eb
mov dword [ebp - 0x38], 0
mov edx, dword [ebp - 0x34]
cmp edx, dword [ebp - 0x38]
je 0x410662
mov dword [ebp - 0x48], 0xd0
mov eax, dword [ebp - 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x41c0c0], eax
push fcn.0040ab83
mov ecx, dword [ebp - 4]
push ecx
call fcn.0040ab83
add esp, 8
mov ecx, eax
mov eax, dword [0x41c134]
xor edx, edx
div dword [0x41c0cc]
cmp ecx, eax
je 0x41053a
mov dword [ebp - 0x3c], 1
jmp 0x410541
mov dword [ebp - 0x3c], 0
cmp dword [ebp - 0x3c], 0
jne 0x410591
mov edx, dword [0x41c11c]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov esi, eax
push fcn.0040b613
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [0x41c130]
push ecx
call fcn.00409c73
add esp, 0xc
cmp esi, eax
jbe 0x41057b
mov dword [ebp - 0x40], 1
jmp 0x410582
mov dword [ebp - 0x40], 0
cmp dword [ebp - 0x40], 0
jne 0x410591
mov dword [ebp - 0x44], 0
jmp 0x410598
mov dword [ebp - 0x44], 1
cmp dword [ebp - 0x44], 0
jne 0x4105e8
push fcn.0040cca3
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [0x41c12c]
push eax
call fcn.00413893
add esp, 0xc
mov esi, eax
mov ecx, dword [ebp - 0x48]
push ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp esi, eax
jae 0x4105d2
mov dword [ebp - 0x4c], 1
jmp 0x4105d9
mov dword [ebp - 0x4c], 0
cmp dword [ebp - 0x4c], 0
jne 0x4105e8
mov dword [ebp - 0x50], 0
jmp 0x4105ef
mov dword [ebp - 0x50], 1
cmp dword [ebp - 0x50], 0
je 0x410640
mov eax, dword [0x41c118]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov ecx, dword [0x41c134]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp esi, eax
jae 0x41061d
mov dword [ebp - 0x54], 1
jmp 0x410624
mov dword [ebp - 0x54], 0
cmp dword [ebp - 0x54], 0
je 0x410640
push fcn.0040ab83
mov edx, dword [0x41c120]
push edx
call fcn.0040b613
add esp, 8
jmp 0x41065d
mov dword [ebp - 0xa0], 0x4e
push fcn.0040ab83
mov eax, dword [0x41c124]
push eax
call fcn.0040ab83
add esp, 8
jmp 0x41093f
mov ecx, dword [0x41c130]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [0x41c12c]
add edx, dword [0x41c0c4]
cmp eax, edx
jbe 0x410688
mov dword [ebp - 0x58], 1
jmp 0x41068f
mov dword [ebp - 0x58], 0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
test eax, eax
je 0x4106b2
mov eax, dword [0x41c130]
imul eax, dword [0x41c0d0]
test eax, eax
je 0x4106b2
mov dword [ebp - 0x5c], 1
jmp 0x4106b9
mov dword [ebp - 0x5c], 0
mov ecx, dword [ebp - 0x58]
cmp ecx, dword [ebp - 0x5c]
jne 0x4106ca
mov dword [ebp - 0x60], 1
jmp 0x4106d1
mov dword [ebp - 0x60], 0
mov edx, dword [ebp - 0x18]
imul edx, dword [0x41c0bc]
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 0
je 0x4106fa
mov eax, dword [0x41c0c8]
sub eax, dword [0x41c124]
je 0x4106fa
mov dword [ebp - 0x64], 1
jmp 0x410701
mov dword [ebp - 0x64], 0
mov ecx, dword [ebp - 0x60]
cmp ecx, dword [ebp - 0x64]
jne 0x41073a
mov dword [ebp - 0x9c], 0xa8
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0x9c], eax
mov eax, dword [0x41c128]
push eax
mov ecx, dword [0x41c11c]
push ecx
call fcn.00412f53
add esp, 8
jmp 0x410750
mov dword [ebp - 0xa4], 0xb5
mov edx, dword [ebp - 8]
push edx
call fcn.0040cca3
add esp, 4
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [0x41c118]
push ecx
mov edx, dword [0x41c0d8]
push edx
call dword [sym.imp.GDI32.dll_PolylineTo]
mov esi, eax
mov eax, dword [ebp + 8]
push eax
call fcn.0040cca3
add esp, 4
cmp esi, eax
jbe 0x410783
mov dword [ebp - 0x68], 1
jmp 0x41078a
mov dword [ebp - 0x68], 0
cmp dword [ebp - 0x68], 0
jne 0x4107d0
mov ecx, dword [0x41c120]
push ecx
mov edx, dword [0x41c0c8]
push edx
call fcn.00412f53
add esp, 8
test eax, eax
jne 0x4107c3
mov eax, dword [ebp + 0xc]
or eax, dword [0x41c11c]
mov dword [0x41c0bc], eax
jne 0x4107c3
mov dword [ebp - 0x6c], 0
jmp 0x4107ca
mov dword [ebp - 0x6c], 1
cmp dword [ebp - 0x6c], 0
je 0x4107e3
push fcn.0040ab83
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.0040ab83
add esp, 8
jmp 0x410824
mov dword [ebp - 0xa8], 0xcc
mov edx, dword [0x41c120]
push edx
mov eax, dword [ebp - 0xc]
push eax
call fcn.00412f53
add esp, 8
mov ecx, dword [0x41c128]
and ecx, dword [0x41c0d4]
mov dword [0x41c110], ecx
mov edx, dword [ebp - 0x20]
push edx
mov eax, dword [0x41c0cc]
push eax
call fcn.0040d5a3
add esp, 8
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [0x41c0bc]
push edx
call fcn.00412f53
add esp, 8
mov eax, dword [str.p4vH_]
push eax
mov ecx, dword [ebp - 4]
push ecx
call fcn.00412f53
add esp, 8
mov esi, eax
push fcn.00412f53
mov edx, dword [0x41c12c]
push edx
call fcn.0040ab83
add esp, 8
cmp esi, eax
je 0x4108a1
mov dword [ebp - 0xac], 0x56
mov eax, dword [0x41c118]
push eax
mov ecx, dword [0x41c110]
push ecx
call fcn.0040d5a3
add esp, 8
mov edx, dword [0x41c0c4]
and edx, dword [ebp - 0xc]
mov dword [0x41c0d4], edx
mov eax, dword [ebp + 0xc]
sub eax, dword [0x41c0cc]
mov dword [0x41c120], eax
jmp 0x4108bf
mov ecx, dword [ebp - 0xc]
xor ecx, dword [0x41c0d0]
mov dword [0x41c0d4], ecx
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x41c130], eax
mov eax, dword [0x41c12c]
push eax
call fcn.0040cca3
add esp, 4
test eax, eax
je 0x41091c
push fcn.0040ab83
mov ecx, dword [ebp - 0x20]
push ecx
call fcn.0040b613
add esp, 8
test eax, eax
je 0x41091c
mov dword [ebp - 0xb0], 0x9f
mov dword [ebp - 0xb4], 0x4c
mov edx, dword [0x41c110]
or edx, dword [0x41c0c0]
mov dword [ebp - 0x10], edx
mov eax, dword [0x41c0cc]
imul eax, dword [0x41c118]
mov dword [0x41c110], eax
jmp 0x41093f
mov dword [ebp - 0xb8], 0x4e
mov dword [ebp - 0xbc], 0x11
mov ecx, dword [ebp + 8]
mov dword [ebp + 8], ecx
mov edx, dword [ebp + 8]
mov dword [0x41c11c], edx
mov eax, dword [0x41c0c0]
mov dword [ebp - 0x14], eax
jmp 0x410952
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
cmp edx, dword [0x41c124]
jae 0x410c1e
mov dword [ebp - 0xc0], 0xe2
mov dword [ebp - 0x90], 0xc
mov eax, dword [0x41c120]
push eax
mov ecx, dword [0x41c130]
push ecx
call dword [sym.imp.GDI32.dll_SetArcDirection]
mov esi, eax
push fcn.0040b613
mov edx, dword [0x41c0d4]
push edx
call fcn.0040b613
add esp, 8
cmp esi, eax
jne 0x4109ab
mov dword [ebp - 0x70], 1
jmp 0x4109b2
mov dword [ebp - 0x70], 0
mov eax, dword [ebp + 8]
add eax, dword [0x41c124]
mov ecx, dword [0x41c0c8]
xor ecx, dword [0x41c0c8]
cmp eax, ecx
jbe 0x4109d4
mov dword [ebp - 0x74], 1
jmp 0x4109db
mov dword [ebp - 0x74], 0
mov edx, dword [ebp - 0x70]
cmp edx, dword [ebp - 0x74]
jne 0x4109ec
mov dword [ebp - 0x78], 1
jmp 0x4109f3
mov dword [ebp - 0x78], 0
push fcn.00412f53
mov eax, dword [str.p4vH_]
push eax
mov ecx, dword [0x41c128]
push ecx
call fcn.00409c73
add esp, 0xc
mov esi, eax
mov edx, dword [0x41c0d0]
push edx
call dword [sym.imp.GDI32.dll_CreateBrushIndirect]
cmp esi, eax
je 0x410a29
mov dword [ebp - 0x7c], 1
jmp 0x410a30
mov dword [ebp - 0x7c], 0
mov eax, dword [ebp - 0x78]
cmp eax, dword [ebp - 0x7c]
jbe 0x410a5c
mov ecx, dword [0x41c118]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
mov dword [0x41c134], edx
mov eax, dword [0x41c0c0]
push eax
call fcn.0040cca3
add esp, 4
jmp 0x410a93
mov dword [ebp - 0xc4], 0x37
mov dword [ebp - 0xc8], 0xa4
mov ecx, dword [0x41c0cc]
imul ecx, dword [ebp - 0x10]
mov dword [ebp - 0xcc], ecx
mov edx, dword [ebp - 0x90]
push edx
mov eax, dword [ebp - 4]
push eax
call fcn.0040d5a3
add esp, 8
mov ecx, dword [0x41c0d0]
and ecx, dword [ebp - 0xc]
je 0x410ab5
mov edx, dword [0x41c0d8]
imul edx, dword [ebp - 0x14]
test edx, edx
je 0x410ab5
mov dword [ebp - 0x80], 1
jmp 0x410abc
mov dword [ebp - 0x80], 0
cmp dword [ebp - 0x80], 0
jne 0x410b25
push fcn.0040d5a3
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [0x41c0c4]
push ecx
call fcn.00409c73
add esp, 0xc
mov esi, eax
push fcn.0040d5a3
mov edx, dword [0x41c0c8]
push edx
mov eax, dword [0x41c134]
push eax
call fcn.00409c73
add esp, 0xc
cmp esi, eax
je 0x410b06
mov dword [ebp - 0x84], 1
jmp 0x410b10
mov dword [ebp - 0x84], 0
cmp dword [ebp - 0x84], 0
jne 0x410b25
mov dword [ebp - 0x88], 0
jmp 0x410b2f
mov dword [ebp - 0x88], 1
cmp dword [ebp - 0x88], 0
jne 0x410b85
mov ecx, dword [0x41c0c4]
or ecx, dword [0x41c12c]
mov dword [0x41c118], ecx
push fcn.0040b613
mov edx, dword [0x41c0c4]
push edx
call fcn.0040ab83
add esp, 8
cmp eax, dword [0x41c118]
jne 0x410b72
mov dword [ebp - 0x8c], 1
jmp 0x410b7c
mov dword [ebp - 0x8c], 0
cmp dword [ebp - 0x8c], 0
je 0x410bb6
mov dword [ebp - 0xd0], 0x38
push fcn.0040d5a3
mov eax, dword [ebp - 0x20]
push eax
call fcn.0040ab83
add esp, 8
push fcn.0040ab83
mov ecx, dword [ebp - 0x90]
push ecx
call fcn.0040ab83
add esp, 8
jmp 0x410be4
push fcn.0040cca3
mov edx, dword [str.p4vH_]
push edx
mov eax, dword [0x41c11c]
push eax
call fcn.00413893
add esp, 0xc
push fcn.0040ab83
mov ecx, dword [0x41c0bc]
push ecx
call fcn.0040b613
add esp, 8
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [0x41c0d0]
push eax
call fcn.00412f53
add esp, 8
mov ecx, dword [0x41c0d4]
or ecx, dword [ebp + 0xc]
mov dword [0x41c0c4], ecx
push fcn.0040ab83
mov edx, dword [0x41c0cc]
push edx
call fcn.0040b613
add esp, 8
jmp 0x410949
mov eax, dword [ebp - 0x20]
sub eax, dword [0x41c11c]
mov dword [0x41c0c4], eax
mov ecx, dword [0x41c0c8]
mov dword [ebp - 0x24], ecx
jmp 0x410c40
mov edx, dword [ebp - 0x24]
add edx, 1
mov dword [ebp - 0x24], edx
mov eax, dword [ebp - 0x24]
cmp eax, dword [0x41c0c4]
jae 0x410e1d
mov dword [ebp - 0xd4], 0x75
mov ecx, dword [ebp - 0x28]
push ecx
mov edx, dword [str.p4vH_]
push edx
call fcn.00412f53
add esp, 8
mov eax, dword [0x41c124]
imul eax, dword [ebp - 0x18]
test eax, eax
jne 0x410c93
mov ecx, dword [ebp - 4]
xor ecx, dword [0x41c120]
mov dword [ebp - 8], ecx
jne 0x410c93
mov dword [ebp - 0x94], 0
jmp 0x410c9d
mov dword [ebp - 0x94], 1
mov edx, dword [0x41c0c4]
and edx, dword [0x41c124]
mov dword [0x41c110], edx
mov eax, dword [0x41c128]
push eax
call fcn.0040cca3
add esp, 4
cmp eax, dword [0x41c110]
jae 0x410cd1
mov dword [ebp - 0x98], 1
jmp 0x410cdb
mov dword [ebp - 0x98], 0
mov ecx, dword [ebp - 0x94]
cmp ecx, dword [ebp - 0x98]
jae 0x410d09
mov dword [ebp - 0xd8], 0x5c
push fcn.0040d5a3
mov edx, dword [0x41c0cc]
push edx
call fcn.0040ab83
add esp, 8
jmp 0x410d34
mov dword [ebp - 0xdc], 0xa2
mov dword [ebp - 0xe0], 0xdb
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [ebp - 4], eax
mov eax, dword [0x41c0bc]
push eax
call fcn.0040cca3
add esp, 4
push fcn.00412f53
mov ecx, dword [ebp - 0x28]
push ecx
call fcn.0040b613
add esp, 8
mov edx, dword [ebp - 0xe4]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebp + 8], eax
mov eax, dword [0x41c0d0]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
sub ecx, 0x37
mov dword [ebp - 0x1c], ecx
cmp dword [ebp - 0x1c], 0x98
ja case.0x410d7d.1
mov edx, dword [ebp - 0x1c]
movzx eax, byte [edx + 0x410e4b]
jmp dword [eax*4 + 0x410e37]
mov dword [ebp - 0xe8], 0x1a
push fcn.0040cca3
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [0x41c0bc]
push edx
call fcn.00413893
add esp, 0xc
jmp 0x410e18
push fcn.00412f53
mov eax, dword [ebp - 0x28]
push eax
call fcn.0040b613
add esp, 8
jmp 0x410e18
mov dword [ebp - 0xec], 0x3f
mov dword [ebp - 0xf0], 0x37
mov ecx, dword [ebp + 0xc]
and ecx, dword [str.p4vH_]
mov dword [0x41c0bc], ecx
jmp 0x410e18
push fcn.0040ab83
mov edx, dword [ebp - 4]
push edx
call fcn.0040b613
add esp, 8
jmp 0x410e18
mov dword [ebp - 0xf4], 0xea
mov dword [ebp - 0xf8], 0xea
mov eax, dword [0x41c12c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x41c11c], eax
jmp 0x410c37
mov ecx, dword [0x41c12c]
push ecx
mov edx, dword [0x41c0c0]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
pop esi
mov esp, ebp
pop ebp
ret