Function at 0x409f90
Capabilities:
Allocate thread local storage
Set thread local storage value
Write file on windows

Disassembly:
mov edx, dword [0x419114]
push edx
mov eax, dword [0x4190d0]
push eax
call fcn.00411ab1
add esp, 8
mov esi, eax
mov ecx, dword [ebp - 0x24]
push ecx
mov edx, dword [ebp - 8]
push edx
call fcn.00411ab1
add esp, 8
cmp esi, eax
jne 0x409f33
mov dword [ebp - 0x28], 1
jmp 0x409f3a
mov dword [ebp - 0x28], 0
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x24]
mov dword [0x419130], ecx
mov edx, dword [0x419130]
push edx
call fcn.0040ba01
add esp, 4
cmp eax, dword [0x419130]
jae 0x409f69
mov dword [ebp - 0x2c], 1
jmp 0x409f70
mov dword [ebp - 0x2c], 0
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x2c]
jbe 0x409f81
mov dword [ebp - 0x30], 1
jmp 0x409f88
mov dword [ebp - 0x30], 0
mov ecx, dword [0x419124]
xor ecx, dword [0x4190cc]
inc ecx
add byte [ebp + 0x1c], dh
inc ecx
add byte [ebp + 0x1c], dh
mov edx, dword [ebp - 0xc]
imul edx, dword [0x419114]
mov dword [ebp + 8], edx
cmp dword [ebp + 8], 0
jne 0x409fb2
mov dword [ebp - 0x34], 0
jmp 0x409fb9
mov dword [ebp - 0x34], 1
mov eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x34]
jne 0x409fca
mov dword [ebp - 0x38], 1
jmp 0x409fd1
mov dword [ebp - 0x38], 0
mov ecx, dword [0x4190cc]
push ecx
mov edx, dword [0x4190e0]
push edx
call fcn.00411ab1
add esp, 8
mov esi, eax
mov eax, dword [ebp - 4]
push eax
call fcn.0040ba01
add esp, 4
cmp esi, eax
jbe 0x40a002
mov dword [ebp - 0x3c], 1
jmp 0x40a009
mov dword [ebp - 0x3c], 0
mov ecx, dword [ebp - 0x38]
cmp ecx, dword [ebp - 0x3c]
je 0x40a055
mov dword [ebp - 0x88], 0x17
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x419124], eax
mov edx, dword [ebp - 0x7c]
push edx
mov eax, dword [0x4190bc]
push eax
call fcn.00411ab1
add esp, 8
mov ecx, dword [0x419124]
mov dword [0x41911c], ecx
mov edx, dword [0x41911c]
mov dword [0x4190c0], edx
jmp 0x409eff
mov eax, dword [ebp + 8]
mov dword [ebp - 0x14], eax
jmp 0x40a066
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
cmp edx, dword [0x4190d4]
jae 0x40a15d
mov dword [ebp - 0x8c], 0x7a
mov dword [ebp - 0x90], 0xed
mov eax, dword [0x4190d8]
mov esi, 1
lock xadd dword [eax], esi
inc esi
mov ecx, dword [ebp - 8]
push ecx
call fcn.0040a511
add esp, 4
cmp esi, eax
je 0x40a0b1
mov dword [ebp - 0x40], 1
jmp 0x40a0b8
mov dword [ebp - 0x40], 0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
test eax, eax
jne 0x40a0dc
mov edx, dword [0x419120]
imul edx, dword [0x4190e4]
test edx, edx
jne 0x40a0dc
mov dword [ebp - 0x44], 0
jmp 0x40a0e3
mov dword [ebp - 0x44], 1
mov eax, dword [ebp - 0x40]
cmp eax, dword [ebp - 0x44]
je 0x40a101
push fcn.0040a511
mov ecx, dword [0x419110]
push ecx
call fcn.0040d751
add esp, 8
jmp 0x40a13f
mov dword [ebp - 0x94], 0x18
push fcn.0040d751
mov edx, dword [ebp - 8]
push edx
mov eax, dword [0x4190c0]
push eax
call fcn.0040f8d1
add esp, 0xc
mov ecx, dword [ebp - 8]
push ecx
call fcn.0040ba01
add esp, 4
push fcn.0040a511
mov edx, dword [ebp - 0x14]
push edx
call fcn.0040d751
add esp, 8
mov eax, dword [0x4190d4]
or eax, dword [ebp - 0xc]
mov dword [0x4190bc], eax
mov ecx, dword [0x419128]
sub ecx, dword [ebp - 8]
mov dword [ebp - 8], ecx
jmp 0x40a05d
mov edx, dword [0x4190bc]
add edx, dword [0x4190d0]
mov dword [0x4190c8], edx
je 0x40a18a
mov eax, dword [ebp - 0xc]
sub eax, dword [0x419114]
mov dword [0x419128], eax
je 0x40a18a
mov dword [ebp - 0x48], 1
jmp 0x40a191
mov dword [ebp - 0x48], 0
mov ecx, dword [0x41911c]
push ecx
mov edx, dword [0x4190e0]
push edx
call fcn.00411ab1
add esp, 8
test eax, eax
jne 0x40a1c4
mov eax, dword [ebp - 0xc]
push eax
call fcn.0040ec41
add esp, 4
test eax, eax
jne 0x40a1c4
mov dword [ebp - 0x4c], 0
jmp 0x40a1cb
mov dword [ebp - 0x4c], 1
mov ecx, dword [ebp - 0x48]
cmp ecx, dword [ebp - 0x4c]
je 0x40a1dc
mov dword [ebp - 0x50], 1
jmp 0x40a1e3
mov dword [ebp - 0x50], 0
mov edx, dword [ebp - 0x10]
imul edx, dword [0x41912c]
mov dword [0x419118], edx
push fcn.0040a511
mov eax, dword [ebp - 0x10]
push eax
call fcn.0040d751
add esp, 8
cmp eax, dword [0x419118]
je 0x40a215
mov dword [ebp - 0x54], 1
jmp 0x40a21c
mov dword [ebp - 0x54], 0
mov ecx, dword [ebp - 0x50]
cmp ecx, dword [ebp - 0x54]
jae 0x40a22d
mov dword [ebp - 0x58], 1
jmp 0x40a234
mov dword [ebp - 0x58], 0
mov edx, dword [ebp - 8]
sub edx, dword [ebp - 0x18]
je 0x40a255
mov eax, dword [ebp - 4]
push eax
call fcn.0040ec41
add esp, 4
test eax, eax
je 0x40a255
mov dword [ebp - 0x5c], 1
jmp 0x40a25c
mov dword [ebp - 0x5c], 0
mov ecx, dword [ebp - 0x58]
cmp ecx, dword [ebp - 0x5c]
jbe 0x40a4e6
push fcn.0040a511
mov edx, dword [0x4190e4]
push edx
call fcn.0040d751
add esp, 8
mov esi, dword [0x419118]
add esi, dword [ebp + 8]
mov eax, dword [0x419128]
push eax
mov ecx, dword [0x4190d4]
push ecx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
cmp esi, eax
jne 0x40a2e3
mov dword [ebp - 0x80], 0x86
mov dword [ebp - 0x98], 0x3b
mov edx, dword [0x4190cc]
push edx
mov eax, dword [ebp - 4]
push eax
call fcn.00411ab1
add esp, 8
mov ecx, dword [0x419118]
xor ecx, dword [0x419128]
mov dword [0x419114], ecx
mov edx, dword [ebp - 0x80]
add edx, dword [0x419118]
mov dword [0x4190bc], edx
jmp 0x40a316
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x41912c], eax
mov ecx, dword [0x41911c]
mov dword [0x419130], ecx
mov edx, dword [0x419130]
mov dword [ebp - 4], edx
mov eax, dword [0x4190cc]
imul eax, dword [0x419120]
mov dword [ebp - 0x20], eax
mov esi, dword [0x4190d0]
xor esi, dword [0x4190d0]
mov ecx, dword [0x419124]
push ecx
mov edx, dword [ebp - 4]
push edx
mov eax, dword [0x4190bc]
push eax
call dword [sym.imp.GDI32.dll_PolylineTo]
cmp esi, eax
je 0x40a346
mov dword [ebp - 0x60], 1
jmp 0x40a34d
mov dword [ebp - 0x60], 0
cmp dword [ebp - 0x60], 0
je 0x40a393
mov ecx, dword [0x4190c4]
push ecx
mov edx, dword [0x419120]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [ebp - 8]
and ecx, dword [0x4190c0]
cmp eax, ecx
jne 0x40a37d
mov dword [ebp - 0x64], 1
jmp 0x40a384
mov dword [ebp - 0x64], 0
cmp dword [ebp - 0x64], 0
je 0x40a393
mov dword [ebp - 0x68], 1
jmp 0x40a39a
mov dword [ebp - 0x68], 0
cmp dword [ebp - 0x68], 0
je 0x40a3d9
mov esi, dword [ebp - 0xc]
and esi, dword [ebp - 0x10]
mov edx, dword [ebp - 0x20]
push edx
mov eax, dword [0x4190bc]
push eax
call dword [sym.imp.ole32.dll_CoTreatAsClass]
cmp esi, eax
je 0x40a3c3
mov dword [ebp - 0x6c], 1
jmp 0x40a3ca
mov dword [ebp - 0x6c], 0
cmp dword [ebp - 0x6c], 0
je 0x40a3d9
mov dword [ebp - 0x70], 1
jmp 0x40a3e0
mov dword [ebp - 0x70], 0
mov ecx, dword [0x4190d8]
sub ecx, dword [0x419114]
mov dword [0x4190d8], ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 0x10]
push eax
call fcn.00411ab1
add esp, 8
cmp eax, dword [0x4190d8]
jae 0x40a413
mov dword [ebp - 0x74], 1
jmp 0x40a41a
mov dword [ebp - 0x74], 0
mov ecx, dword [ebp - 0x70]
cmp ecx, dword [ebp - 0x74]
jne 0x40a473
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [0x419118]
push eax
mov ecx, dword [ebp - 0x9c]
push ecx
mov edx, dword [0x4190cc]
push edx
mov eax, dword [0x41912c]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [0x4190cc], eax
mov eax, dword [0x4190d0]
xor edx, edx
div dword [0x419118]
mov dword [0x4190cc], eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [ebp - 4], eax
jmp 0x40a316
mov esi, dword [0x4190cc]
sub esi, dword [ebp + 8]
push fcn.0040a511
mov eax, dword [ebp - 0x18]
push eax
call fcn.0040d751
add esp, 8
cmp esi, eax
jae 0x40a4e1
mov dword [ebp - 0xa0], 0xe0
mov dword [ebp - 0x84], 0xcc
mov ecx, dword [0x4190d8]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [0x419118], eax
mov eax, dword [0x4190e4]
push eax
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 0x84], eax
mov ecx, dword [0x4190bc]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
mov dword [0x41911c], edx
jmp 0x40a473
jmp 0x40a15d
mov eax, dword [0x41911c]
xor eax, dword [0x41911c]
mov dword [ebp - 4], eax
mov ecx, dword [0x419118]
push ecx
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
pop esi
mov esp, ebp
pop ebp
ret