Function at 0x40b141
Capabilities:
Allocate thread local storage

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x98
push esi
mov dword [ebp - 0x10], 0xea
mov dword [ebp - 4], 0x67
mov eax, dword [0x419128]
sub eax, dword [ebp - 8]
mov dword [ebp - 4], eax
mov ecx, dword [0x419130]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp dword [ebp - 4], eax
jae 0x40b17f
mov dword [ebp - 0x20], 1
jmp 0x40b186
mov dword [ebp - 0x20], 0
mov edx, dword [0x4190d8]
xor edx, dword [0x4190d8]
mov dword [0x4190d8], edx
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp dword [0x4190d8], eax
jae 0x40b1b3
mov dword [ebp - 0x24], 1
jmp 0x40b1ba
mov dword [ebp - 0x24], 0
mov ecx, dword [ebp - 0x20]
cmp ecx, dword [ebp - 0x24]
jbe 0x40b1cb
mov dword [ebp - 0x28], 1
jmp 0x40b1d2
mov dword [ebp - 0x28], 0
mov edx, dword [0x419128]
add edx, dword [0x4190c0]
mov dword [0x419110], edx
jne 0x40b208
mov eax, dword [ebp - 4]
xor edx, edx
div dword [0x419120]
mov dword [0x41911c], eax
cmp dword [0x41911c], 0
jne 0x40b208
mov dword [ebp - 0x2c], 0
jmp 0x40b20f
mov dword [ebp - 0x2c], 1
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x2c]
jbe 0x40b220
mov dword [ebp - 0x30], 1
jmp 0x40b227
mov dword [ebp - 0x30], 0
mov ecx, dword [0x4190bc]
or ecx, dword [ebp - 4]
mov dword [0x4190c8], ecx
jne 0x40b258
mov edx, dword [0x4190e4]
push edx
mov eax, dword [ebp - 0x18]
push eax
call fcn.0040a771
add esp, 8
test eax, eax
jne 0x40b258
mov dword [ebp - 0x34], 0
jmp 0x40b25f
mov dword [ebp - 0x34], 1
mov ecx, dword [ebp - 0x30]
cmp ecx, dword [ebp - 0x34]
jbe 0x40b393
mov dword [ebp - 0x60], 0x6a
mov dword [ebp - 0x64], 0x77
mov edx, dword [0x4190e4]
push edx
mov eax, dword [0x419114]
push eax
call fcn.00411ab1
add esp, 8
mov ecx, dword [0x4190cc]
push ecx
call fcn.00409e71
add esp, 4
mov esi, eax
mov edx, dword [ebp - 0x50]
push edx
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [0x4190d4]
push ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp esi, eax
jae 0x40b2c5
mov dword [ebp - 0x38], 1
jmp 0x40b2cc
mov dword [ebp - 0x38], 0
mov eax, dword [ebp - 0x10]
xor edx, edx
div dword [0x419114]
test eax, eax
jne 0x40b2f2
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
test eax, eax
jne 0x40b2f2
mov dword [ebp - 0x3c], 0
jmp 0x40b2f9
mov dword [ebp - 0x3c], 1
mov ecx, dword [ebp - 0x38]
cmp ecx, dword [ebp - 0x3c]
jne 0x40b30a
mov dword [ebp - 0x40], 1
jmp 0x40b311
mov dword [ebp - 0x40], 0
cmp dword [ebp - 0x40], 0
je 0x40b38e
mov edx, dword [0x4190c4]
push edx
call fcn.0040ec41
add esp, 4
test eax, eax
je 0x40b354
mov eax, dword [0x4190bc]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [0x4190c0]
push edx
mov eax, dword [0x4190c4]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
je 0x40b354
mov dword [ebp - 0x44], 1
jmp 0x40b35b
mov dword [ebp - 0x44], 0
cmp dword [ebp - 0x44], 0
je 0x40b38e
mov dword [ebp - 0x68], 0x76
mov ecx, dword [0x4190c4]
sub ecx, dword [ebp - 0x4c]
mov dword [0x4190d4], ecx
mov edx, dword [0x419124]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x4190c4], eax
jmp 0x40b28e
jmp 0x40b159
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [0x41912c]
push ecx
mov edx, dword [0x4190bc]
push edx
mov eax, dword [0x41911c]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [0x4190d8], eax
mov ecx, dword [0x419110]
push ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [0x419130], eax
mov eax, dword [0x419118]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0x2d
je 0x40b3f7
cmp dword [ebp - 0x48], 0x92
je 0x40b3e5
jmp 0x40b41f
mov ecx, dword [0x4190dc]
imul ecx, dword [ebp - 4]
mov dword [0x419114], ecx
jmp 0x40b449
mov dword [ebp - 0x6c], 0xec
mov dword [ebp - 0x70], 0xfe
mov edx, dword [ebp - 0x74]
or edx, dword [0x419130]
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x14]
push eax
call fcn.00409e71
add esp, 4
jmp 0x40b449
mov dword [ebp - 0x78], 0xbd
mov ecx, dword [ebp - 0x14]
add ecx, dword [ebp - 8]
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x4c]
add edx, dword [0x419124]
mov dword [ebp - 0x14], edx
mov eax, dword [0x41911c]
xor eax, dword [0x419130]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 4]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
sub edx, 0x26
mov dword [ebp - 0xc], edx
cmp dword [ebp - 0xc], 0x8d
ja case.0x40b46f.2
mov eax, dword [ebp - 0xc]
movzx ecx, byte [eax + 0x40b669]
jmp dword [ecx*4 + 0x40b645]
mov dword [ebp - 0x7c], 0x37
mov dword [ebp - 0x80], 0x9e
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [ebp - 4], eax
jmp 0x40b635
mov dword [ebp - 0x84], 0x38
mov edx, dword [0x41912c]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x4190c0], eax
mov eax, dword [0x4190cc]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x4190d0], eax
mov ecx, dword [0x4190e4]
mov dword [0x41911c], ecx
mov edx, dword [0x41911c]
mov dword [0x419128], edx
jmp 0x40b635
mov dword [ebp - 0x88], 0xcc
mov dword [ebp - 0x8c], 5
mov eax, dword [0x4190d0]
push eax
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 4], eax
mov ecx, dword [0x4190c0]
imul ecx, dword [0x419118]
mov dword [ebp - 0x18], ecx
mov edx, dword [0x4190e0]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
mov dword [ebp - 8], eax
jmp 0x40b635
mov dword [ebp - 0x90], 0xfe
push fcn.0040a771
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [0x419110]
push edx
call fcn.0040f8d1
add esp, 0xc
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x54], eax
mov ecx, dword [ebp - 0x54]
mov dword [0x41911c], ecx
mov edx, dword [0x4190bc]
mov eax, 1
lock xadd dword [edx], eax
inc eax
mov dword [ebp - 0x1c], eax
jmp 0x40b635
mov dword [ebp - 0x94], 8
mov ecx, dword [0x419118]
push ecx
mov edx, dword [0x4190c8]
push edx
mov eax, dword [0x419110]
push eax
call dword [sym.imp.GDI32.dll_PolylineTo]
mov dword [0x4190d8], eax
mov ecx, dword [0x4190e0]
xor ecx, dword [0x4190dc]
mov dword [0x4190bc], ecx
mov edx, dword [0x4190e4]
mov dword [0x4190d8], edx
mov eax, dword [0x4190d8]
mov dword [ebp - 0x50], eax
jmp 0x40b635
mov eax, dword [ebp - 0x18]
xor edx, edx
div dword [ebp - 0x50]
mov dword [0x4190c8], eax
jmp 0x40b635
mov dword [ebp - 0x58], 0x37
mov dword [ebp - 0x98], 0xaf
mov ecx, dword [ebp - 8]
or ecx, dword [0x4190dc]
mov dword [0x4190dc], ecx
mov edx, dword [ebp - 0x58]
or edx, dword [0x4190c0]
mov dword [0x4190c4], edx
jmp 0x40b635
mov eax, dword [0x4190d8]
and eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
jmp 0x40b635
mov dword [ebp - 0x5c], 0x2e
mov ecx, dword [0x419128]
push ecx
mov edx, dword [0x41911c]
push edx
call fcn.0040a771
add esp, 8
mov eax, dword [ebp - 0x5c]
imul eax, dword [ebp - 0x1c]
mov dword [0x4190c8], eax
mov eax, dword [0x4190c4]
or eax, dword [ebp + 8]
pop esi
mov esp, ebp
pop ebp
ret