Function at 0x40d751
Capabilities:
Allocate thread local storage
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8c
push esi
mov dword [ebp - 4], 0xc4
mov dword [ebp - 0x50], 0x49
mov dword [ebp - 0x54], 0x23
mov eax, dword [0x4190cc]
sub eax, dword [0x4190e4]
mov dword [0x4190e0], eax
mov ecx, dword [0x41911c]
push ecx
call dword [ebp + 0xc]
add esp, 4
cmp dword [0x4190e0], eax
jbe 0x40d79e
mov dword [ebp - 0x10], 1
jmp 0x40d7a5
mov dword [ebp - 0x10], 0
cmp dword [ebp - 0x10], 0
jne 0x40d7ed
mov edx, dword [ebp - 0x58]
push edx
mov eax, dword [0x4190e4]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
mov ecx, dword [0x419124]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp esi, eax
jne 0x40d7d7
mov dword [ebp - 0x14], 1
jmp 0x40d7de
mov dword [ebp - 0x14], 0
cmp dword [ebp - 0x14], 0
jne 0x40d7ed
mov dword [ebp - 0x18], 0
jmp 0x40d7f4
mov dword [ebp - 0x18], 1
mov edx, dword [0x4190e0]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x40d82e
mov ecx, dword [0x4190cc]
imul ecx, dword [0x4190bc]
mov dword [0x4190d0], ecx
cmp dword [0x4190d0], 0
jne 0x40d82e
mov dword [ebp - 0x1c], 0
jmp 0x40d835
mov dword [ebp - 0x1c], 1
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0x1c]
jne 0x40d94f
mov eax, dword [0x4190c0]
add eax, dword [ebp - 8]
mov dword [0x419128], eax
je 0x40d86a
mov ecx, dword [ebp - 0x5c]
and ecx, dword [0x4190c8]
mov dword [0x4190d4], ecx
je 0x40d86a
mov dword [ebp - 0x20], 1
jmp 0x40d871
mov dword [ebp - 0x20], 0
mov edx, dword [0x4190e4]
imul edx, dword [ebp - 0x50]
mov dword [ebp - 0xc], edx
mov eax, dword [0x4190c8]
push eax
call fcn.0040a511
add esp, 4
cmp eax, dword [ebp - 0xc]
jne 0x40d89a
mov dword [ebp - 0x24], 1
jmp 0x40d8a1
mov dword [ebp - 0x24], 0
mov ecx, dword [ebp - 0x20]
cmp ecx, dword [ebp - 0x24]
jne 0x40d8b2
mov dword [ebp - 0x28], 1
jmp 0x40d8b9
mov dword [ebp - 0x28], 0
cmp dword [ebp - 0x28], 0
je 0x40d917
mov eax, dword [0x4190d8]
xor edx, edx
div dword [ebp + 8]
mov dword [0x41911c], eax
cmp dword [0x41911c], 0
je 0x40d8e8
mov edx, dword [ebp - 0x54]
sub edx, dword [ebp - 4]
je 0x40d8e8
mov dword [ebp - 0x2c], 1
jmp 0x40d8ef
mov dword [ebp - 0x2c], 0
cmp dword [ebp - 0x2c], 0
je 0x40d917
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov dword [0x419120], eax
jmp 0x40d93a
mov eax, dword [0x4190e4]
push eax
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x4190cc], eax
mov ecx, dword [0x419130]
add ecx, dword [0x4190dc]
mov dword [0x419124], ecx
mov edx, dword [0x4190cc]
imul edx, dword [ebp - 0x60]
mov dword [0x4190bc], edx
jmp 0x40db01
mov dword [ebp - 0x64], 0x11
mov dword [ebp - 0x68], 0xdd
mov eax, dword [0x4190c0]
xor edx, edx
div dword [0x41912c]
mov dword [0x4190d4], eax
cmp dword [0x4190d4], 0
je 0x40d99a
mov eax, dword [0x4190cc]
push eax
mov ecx, dword [0x41912c]
push ecx
call fcn.0040a771
add esp, 8
test eax, eax
je 0x40d99a
mov dword [ebp - 0x30], 1
jmp 0x40d9a1
mov dword [ebp - 0x30], 0
cmp dword [ebp - 0x30], 0
je 0x40d9ee
mov edx, dword [0x4190d4]
push edx
mov eax, dword [0x4190e0]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
mov ecx, dword [0x4190bc]
push ecx
call fcn.0040a511
add esp, 4
cmp esi, eax
jbe 0x40d9d8
mov dword [ebp - 0x34], 1
jmp 0x40d9df
mov dword [ebp - 0x34], 0
cmp dword [ebp - 0x34], 0
je 0x40d9ee
mov dword [ebp - 0x38], 1
jmp 0x40d9f5
mov dword [ebp - 0x38], 0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov edx, dword [0x4190d0]
or edx, dword [0x419120]
cmp eax, edx
jae 0x40da14
mov dword [ebp - 0x3c], 1
jmp 0x40da1b
mov dword [ebp - 0x3c], 0
mov eax, dword [ebp - 0x38]
cmp eax, dword [ebp - 0x3c]
jne 0x40da2c
mov dword [ebp - 0x40], 1
jmp 0x40da33
mov dword [ebp - 0x40], 0
mov ecx, dword [0x4190c8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
test eax, eax
jne 0x40da62
mov edx, dword [0x4190d8]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.ole32.dll_CoTreatAsClass]
test eax, eax
jne 0x40da62
mov dword [ebp - 0x44], 0
jmp 0x40da69
mov dword [ebp - 0x44], 1
mov ecx, dword [ebp - 0x40]
cmp ecx, dword [ebp - 0x44]
jbe 0x40da9d
mov edx, dword [0x4190d4]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebp - 0x6c], eax
push fcn.0040a771
mov eax, dword [0x41911c]
push eax
mov ecx, dword [0x419114]
push ecx
call fcn.0040f8d1
add esp, 0xc
jmp 0x40dabe
mov dword [ebp - 0x70], 0xb0
mov dword [ebp - 0x74], 0xb8
mov edx, dword [0x4190d4]
imul edx, dword [0x41911c]
mov dword [0x4190dc], edx
mov eax, dword [0x4190cc]
or eax, dword [0x419128]
mov dword [0x419118], eax
mov ecx, dword [0x4190c0]
push ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [0x4190c8]
push ecx
mov edx, dword [0x4190c4]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [0x4190d4]
push ecx
call dword [sym.imp.GDI32.dll_SetDIBits]
mov dword [0x41911c], eax
mov edx, dword [0x4190bc]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x419110], eax
mov eax, dword [0x419110]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0xec
ja case.0x40db32.1
mov ecx, dword [ebp - 0x48]
movzx edx, byte [ecx + 0x40dc6d]
jmp dword [edx*4 + 0x40dc51]
mov eax, dword [0x4190e4]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x419124], eax
push fcn.0040a771
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x78]
push edx
call fcn.0040f8d1
add esp, 0xc
jmp 0x40dc24
mov dword [ebp - 0x7c], 6
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [0x419124]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOverridePredefKey]
mov dword [0x41911c], eax
jmp 0x40dc24
mov dword [ebp - 0x80], 0x99
mov dword [ebp - 0x4c], 0x82
mov dword [ebp - 0x84], 0xf0
mov edx, dword [0x41911c]
xor edx, dword [ebp - 0x4c]
mov dword [ebp - 0x4c], edx
jmp 0x40dc24
mov eax, dword [0x4190bc]
push eax
mov ecx, dword [0x419110]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4190e0], eax
jmp 0x40dc24
mov dword [ebp - 0x88], 0x10
mov edx, dword [0x4190e0]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x4190d4], eax
mov eax, dword [0x4190c4]
add eax, dword [ebp - 8]
mov dword [0x419120], eax
jmp 0x40dc24
mov dword [ebp - 0x8c], 0x92
mov ecx, dword [0x4190cc]
push ecx
call fcn.0040a511
add esp, 4
jmp 0x40dc24
mov edx, dword [0x419120]
push edx
mov eax, dword [0x419130]
push eax
call dword [sym.imp.ADVAPI32.dll_RegOverridePredefKey]
mov dword [0x4190d8], eax
mov ecx, dword [0x419128]
or ecx, dword [ebp - 4]
mov dword [0x4190d0], ecx
mov edx, dword [0x419124]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [0x419114]
push ecx
call dword [sym.imp.GDI32.dll_PolylineTo]
pop esi
mov esp, ebp
pop ebp
ret