Function at 0x403780
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x46088c
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
push edi
mov eax, dword [0x47c020]
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.00403ad0
cmp dword [edi + 0x54], 0
jne 0x403856
lea esi, [edi + 0x2c]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [edi + 0x28], 0
jne 0x4037f2
mov byte [ebp - 4], 9
test esi, esi
je 0x403856
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x403856
lea eax, [edi + 0x18]
lea ebx, [edi + 0x44]
cmp ebx, eax
je 0x403844
mov ecx, dword [eax]
mov edx, dword [ebx]
mov dword [ebx], ecx
mov dword [eax], edx
mov ecx, dword [ebx]
test ecx, ecx
je 0x40380c
mov dword [ecx], ebx
mov ecx, dword [eax]
test ecx, ecx
je 0x403814
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 0x403853
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [ebp - 0x10]
mov ecx, edi
call fcn.00403ad0
test al, al
je 0x40386e
inc ebx
mov dword [ebp - 0x10], ebx
cmp ebx, 0x64
jl 0x4037c0
mov ecx, edi
call fcn.004048c0
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 0x4038c4
lea eax, [esi + 4]
mov ecx, ebx
lock xadd dword [eax], ecx
jne 0x4038c4
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lea eax, [esi + 8]
mov edx, ebx
lock xadd dword [eax], edx
jne 0x4038c4
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
call fcn.00404e40
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 0x403904
lea eax, [esi + 4]
mov ecx, ebx
lock xadd dword [eax], ecx
jne 0x403904
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lea eax, [esi + 8]
mov edx, ebx
lock xadd dword [eax], edx
jne 0x403904
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov eax, dword [edi + 0xa4]
test eax, eax
je 0x403935
push eax
call fcn.0044da7e
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 0x403966
push eax
call fcn.0044da7e
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 0x4039ca
mov eax, dword [edi + 0x70]
mov dword [ebp - 0x10], eax
cmp ebx, eax
je 0x4039aa
lea esi, [ebx + 0x20]
mov edi, edi
mov ecx, dword [esi]
test ecx, ecx
je 0x4039a0
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 0x403980
push dword [edi + 0x6c]
call fcn.0044da7e
add esp, 4
mov dword [edi + 0x6c], 0
mov dword [edi + 0x70], 0
mov dword [edi + 0x74], 0
lea ecx, [edi + 0x58]
call fcn.00405060
push dword [edi + 0x58]
call fcn.0044da7e
add esp, 4
mov dword [edi + 0x58], 0
lea ecx, [edi + 0x44]
call fcn.00405060
push dword [edi + 0x44]
call fcn.0044da7e
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.00405060
push dword [edi + 0x18]
call fcn.0044da7e
mov dword [edi + 0x18], 0
add esp, 4
mov byte [ebp - 4], 0
mov ebx, dword [edi + 0x10]
test ebx, ebx
je 0x403a52
or esi, 0xffffffff
lea eax, [ebx + 4]
mov ecx, esi
lock xadd dword [eax], ecx
jne 0x403a52
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax]
lea eax, [ebx + 8]
lock xadd dword [eax], esi
dec esi
jne 0x403a52
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