Function at 0x4161d0
Capabilities:
Allocate thread local storage
Set thread local storage value

Disassembly:
push 0xffffffffffffffff
push 0x46bfdd
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4860f0]
xor eax, esp
push eax
lea eax, [esp + 0x24]
mov dword fs:[0], eax
mov ebx, dword [esp + 0x34]
mov dword [ebx], vtable.MessageLoop.0
xor eax, eax
mov dword [esp + 0x2c], eax
lea ebp, [ebx + 0x68]
or edi, 0xffffffff
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], eax
cmp dword [ebp + 0x1c], eax
jne 0x416220
mov dword [esp + 0x20], edi
jmp 0x41622d
mov eax, dword [ebp + 0x10]
sub eax, dword [ebp + 0xc]
sar eax, 2
mov dword [esp + 0x20], eax
inc dword [ebp + 0x18]
lea esi, [esp + 0x18]
mov byte [esp + 0x2c], 0xa
call fcn.004190d0
test eax, eax
je 0x416257
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx]
call eax
lea esi, [esp + 0x18]
call fcn.004190d0
test eax, eax
jne 0x416242
mov byte [esp + 0x2c], 9
mov eax, dword [esp + 0x18]
add dword [eax + 0x18], edi
jne 0x41626c
mov edi, eax
call fcn.00419150
xor esi, esi
mov edi, edi
call fcn.004167d0
mov ecx, ebx
call fcn.00416750
call fcn.004167d0
test al, al
je 0x41628b
inc esi
cmp esi, 0x64
jl 0x416270
mov ecx, dword [0x489d44]
xor edi, edi
cmp ecx, 2
je 0x416301
push edi
push 1
push 0x489d44
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
cmp eax, edi
je 0x4162cf
mov edx, dword [0x489d44]
cmp edx, 2
je 0x416301
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4162c0
push edi
call esi
mov eax, dword [0x489d44]
cmp eax, 2
jne 0x4162c0
jmp 0x416301
mov dword [0x489d48], edi
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x489d48], eax
mov dword [0x489d4c], 0x489d48
push 0x489d48
mov dword [0x489d44], 2
call fcn.00419380
add esp, 4
mov ecx, dword [0x489d4c]
mov edx, dword [ecx]
push edi
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebx + 0x100]
cmp eax, edi
je 0x416324
push eax
call fcn.004567f0
add esp, 4
mov eax, dword [ebx + 0xf4]
push eax
mov dword [ebx + 0x100], edi
mov dword [ebx + 0x104], edi
mov dword [ebx + 0x108], edi
call fcn.004567f0
add esp, 4
lea eax, [ebx + 0xc8]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea esi, [ebx + 0xa8]
call fcn.00417230
mov esi, dword [esi]
push esi
call fcn.004567f0
add esp, 4
cmp dword [ebx + 0xa4], 0x10
jb 0x416380
mov eax, dword [ebx + 0x90]
push eax
call fcn.004567f0
add esp, 4
mov dword [ebx + 0xa4], 0xf
mov dword [ebx + 0xa0], edi
mov byte [ebx + 0x90], 0
mov eax, dword [ebp + 0xc]
cmp eax, edi
je 0x4163a7
push eax
call fcn.004567f0
add esp, 4
mov dword [ebp + 0xc], edi
mov dword [ebp + 0x10], edi
mov dword [ebp + 0x14], edi
mov ebp, dword [ebp]
push ebp
call fcn.004567f0
mov byte [esp + 0x30], 3
mov eax, dword [ebx + 0x64]
add esp, 4
cmp eax, edi
je 0x4163e9
lea esi, [eax + 4]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x4163e9
cmp esi, edi
je 0x4163e9
lea ecx, [esi - 4]
cmp ecx, edi
je 0x4163e9
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
lea esi, [ebx + 0x44]
call fcn.00417230
mov ecx, dword [esi]
push ecx
call fcn.004567f0
mov eax, dword [ebx + 0x34]
add esp, 4
cmp eax, edi
je 0x41640c
push eax
call fcn.004567f0
add esp, 4
mov edx, dword [ebx + 0x28]
push edx
mov dword [ebx + 0x34], edi
mov dword [ebx + 0x38], edi
mov dword [ebx + 0x3c], edi
call fcn.004567f0
add esp, 4
lea esi, [ebx + 8]
call fcn.00417230
mov eax, dword [esi]
push eax
call fcn.004567f0
add esp, 4
mov dword [ebx], vtable.base::MessagePump::Delegate.0
mov ecx, dword [esp + 0x24]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 4