Function at 0x10031be9
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xac
movzx eax, byte [ebp + 0x28]
test eax, eax
je 0x10031dfe
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp + 0x2c]
mov dword [ebp - 0x80], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x58], eax
lea eax, [ebp + 0x1c]
mov dword [ebp - 0x90], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp + 0x34]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x90]
movzx eax, byte [eax]
test eax, eax
je 0x10031def
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x88], eax
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x94], eax
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x88]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x94]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 4]
cmp dword [eax], 0
jne 0x10031cb3
mov eax, 0x5493
test eax, eax
jne 0x10031cb3
and dword [ebp - 0x30], 0
jmp 0x10031cba
mov dword [ebp - 0x30], 1
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
imul eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x38]
mov dword [ecx], eax
mov eax, dword [ebp - 0x38]
mov eax, dword [eax]
mov ecx, dword [ebp - 4]
imul eax, dword [ecx]
mov ecx, dword [ebp - 4]
cmp eax, dword [ecx]
jge 0x10031ce3
mov dword [ebp - 0x20], 1
jmp 0x10031ce7
and dword [ebp - 0x20], 0
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp dword [ebp - 0x20], eax
je 0x10031cfa
mov dword [ebp - 0x14], 1
jmp 0x10031cfe
and dword [ebp - 0x14], 0
imul eax, dword [ebp - 0x14], 0xf5f4
cmp eax, 0xffff
jne 0x10031d15
mov dword [ebp - 0x28], 1
jmp 0x10031d19
and dword [ebp - 0x28], 0
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp dword [ebp - 0x28], eax
jl 0x10031d2c
mov dword [ebp - 0x18], 1
jmp 0x10031d30
and dword [ebp - 0x18], 0
cmp dword [ebp - 0x18], 0x2afd77cc
jg 0x10031d42
mov dword [ebp - 0x1c], 1
jmp 0x10031d46
and dword [ebp - 0x1c], 0
mov eax, dword [ebp - 4]
mov eax, dword [eax]
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax]
mov dword [ebp - 0xa0], eax
push 3
mov ecx, dword [ebp - 0x10]
call fcn.1000f94c
mov ecx, dword [ebp - 0x1c]
mov dword [eax], ecx
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov dword [ebp - 0xa4], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov dword [ebp - 0xac], eax
push 3
mov ecx, dword [ebp - 0x10]
call fcn.1000f94c
mov ecx, dword [ebp - 0xc]
mov ecx, dword [ecx]
cmp dword [eax], ecx
jge 0x10031da8
mov dword [ebp - 0x2c], 1
jmp 0x10031dac
and dword [ebp - 0x2c], 0
cmp dword [ebp - 0x2c], 1
jbe 0x10031dca
push 2
mov ecx, dword [ebp - 0x10]
call fcn.1000f94c
cmp dword [eax], 0
je 0x10031dca
mov dword [ebp - 0x34], 1
jmp 0x10031dce
and dword [ebp - 0x34], 0
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
cmp dword [ebp - 0x34], eax
je 0x10031de1
mov dword [ebp - 0x3c], 1
jmp 0x10031de5
and dword [ebp - 0x3c], 0
mov eax, dword [ebp - 0x78]
mov ecx, dword [ebp - 0x3c]
mov dword [eax], ecx
jmp 0x10031df9
push 0
push 0
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x10031e91
mov eax, dword [ebp + 0x30]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x74], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x4c], eax
lea eax, [ebp + 0x24]
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x44]
movzx eax, byte [eax]
test eax, eax
je 0x10031e6d
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x64]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 8]
mov dword [eax], 0
jmp 0x10031e4e
mov eax, dword [ebp - 8]
mov eax, dword [eax]
inc eax
mov ecx, dword [ebp - 8]
mov dword [ecx], eax
mov eax, dword [ebp - 8]
cmp dword [eax], 2
jge 0x10031e6b
mov eax, dword [ebp - 8]
push dword [eax]
mov ecx, dword [ebp - 0x6c]
call fcn.1000f94c
mov dword [eax], 0x1f9c28ad
jmp 0x10031e43
jmp 0x10031e91
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x84], eax
mov eax, dword [ebp - 0x84]
movzx eax, byte [eax]
test eax, eax
je 0x10031e91
push 0
call dword [sym.imp.GDI32.dll_CreatePenIndirect]
mov esp, ebp
pop ebp
ret