Function at 0x4049c0
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4606cc
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
push edi
mov eax, dword [0x47c008]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x14], edi
mov dword [edi], vtable.nbase::MessageLoop.0
xor ebx, ebx
mov dword [ebp - 4], 9
mov dword [ebp - 0x10], ebx
nop
mov ecx, edi
call fcn.00404d10
cmp dword [edi + 0x54], 0
jne 0x404a96
lea esi, [edi + 0x2c]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [edi + 0x28], 0
jne 0x404a32
mov byte [ebp - 4], 9
test esi, esi
je 0x404a96
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x404a96
lea eax, [edi + 0x18]
lea ebx, [edi + 0x44]
cmp ebx, eax
je 0x404a84
mov ecx, dword [eax]
mov edx, dword [ebx]
mov dword [ebx], ecx
mov dword [eax], edx
mov ecx, dword [ebx]
test ecx, ecx
je 0x404a4c
mov dword [ecx], ebx
mov ecx, dword [eax]
test ecx, ecx
je 0x404a54
mov dword [ecx], eax
mov edx, dword [ebx + 4]
mov ecx, dword [eax + 4]
mov dword [ebx + 4], ecx
mov dword [eax + 4], edx
mov edx, dword [ebx + 8]
mov ecx, dword [eax + 8]
mov dword [ebx + 8], ecx
mov dword [eax + 8], edx
mov edx, dword [ebx + 0xc]
mov ecx, dword [eax + 0xc]
mov dword [ebx + 0xc], ecx
mov dword [eax + 0xc], edx
mov edx, dword [ebx + 0x10]
mov ecx, dword [eax + 0x10]
mov dword [ebx + 0x10], ecx
mov dword [eax + 0x10], edx
mov byte [ebp - 4], 9
test esi, esi
je 0x404a93
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [ebp - 0x10]
mov ecx, edi
call fcn.00404d10
test al, al
je 0x404aae
inc ebx
mov dword [ebp - 0x10], ebx
cmp ebx, 0x64
jl 0x404a00
mov ecx, edi
call fcn.00405b00
mov ecx, dword [edi + 0xb0]
mov eax, dword [ecx]
call dword [eax + 0x18]
mov esi, dword [edi + 0xb4]
or ebx, 0xffffffff
mov dword [edi + 0xb4], 0
mov dword [edi + 0xb0], 0
test esi, esi
je 0x404b04
lea eax, [esi + 4]
mov ecx, ebx
lock xadd dword [eax], ecx
jne 0x404b04
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lea eax, [esi + 8]
mov edx, ebx
lock xadd dword [eax], edx
jne 0x404b04
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
call fcn.00406080
push 0
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov byte [ebp - 4], 8
mov esi, dword [edi + 0xb4]
test esi, esi
je 0x404b44
lea eax, [esi + 4]
mov ecx, ebx
lock xadd dword [eax], ecx
jne 0x404b44
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lea eax, [esi + 8]
mov edx, ebx
lock xadd dword [eax], edx
jne 0x404b44
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov eax, dword [edi + 0xa4]
test eax, eax
je 0x404b75
push eax
call fcn.0044d735
add esp, 4
mov dword [edi + 0xa4], 0
mov dword [edi + 0xa8], 0
mov dword [edi + 0xac], 0
mov eax, dword [edi + 0x90]
test eax, eax
je 0x404ba6
push eax
call fcn.0044d735
add esp, 4
mov dword [edi + 0x90], 0
mov dword [edi + 0x94], 0
mov dword [edi + 0x98], 0
mov byte [ebp - 4], 5
mov ebx, dword [edi + 0x6c]
test ebx, ebx
je 0x404c0a
mov eax, dword [edi + 0x70]
mov dword [ebp - 0x10], eax
cmp ebx, eax
je 0x404bea
lea esi, [ebx + 0x20]
mov edi, edi
mov ecx, dword [esi]
test ecx, ecx
je 0x404be0
mov edx, dword [ecx]
lea eax, [esi - 0x10]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov eax, dword [ebp - 0x10]
mov dword [esi], 0
add ebx, 0x28
add esi, 0x28
cmp ebx, eax
jne 0x404bc0
push dword [edi + 0x6c]
call fcn.0044d735
add esp, 4
mov dword [edi + 0x6c], 0
mov dword [edi + 0x70], 0
mov dword [edi + 0x74], 0
lea ecx, [edi + 0x58]
call fcn.004062a0
push dword [edi + 0x58]
call fcn.0044d735
add esp, 4
mov dword [edi + 0x58], 0
lea ecx, [edi + 0x44]
call fcn.004062a0
push dword [edi + 0x44]
call fcn.0044d735
add esp, 4
mov dword [edi + 0x44], 0
lea eax, [edi + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea ecx, [edi + 0x18]
call fcn.004062a0
push dword [edi + 0x18]
call fcn.0044d735
mov dword [edi + 0x18], 0
add esp, 4
mov byte [ebp - 4], 0
mov ebx, dword [edi + 0x10]
test ebx, ebx
je 0x404c92
or esi, 0xffffffff
lea eax, [ebx + 4]
mov ecx, esi
lock xadd dword [eax], ecx
jne 0x404c92
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax]
lea eax, [ebx + 8]
lock xadd dword [eax], esi
dec esi
jne 0x404c92
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 4]
mov dword [edi], vtable.nbase::MessagePump::Delegate.0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret