Function at 0x505c00
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6424c0
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push esi
push edi
mov eax, dword [0x6ddc7c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [edi], vtable.nbase::MessageLoop.0
xor esi, esi
mov ecx, edi
call fcn.005061c0
mov ecx, edi
call fcn.00506b00
mov ecx, edi
call fcn.005061c0
test al, al
je 0x505c4f
inc esi
cmp esi, 0x64
jl 0x505c30
lea esi, [edi + 0x9c]
xor ebx, ebx
test esi, esi
je 0x505c5e
inc dword [esi + 4]
mov edx, dword [edi + 0xa8]
mov eax, edx
mov ecx, dword [edi + 0xa4]
sub eax, ecx
sar eax, 2
test eax, eax
je 0x505cac
mov eax, edx
sub eax, ecx
sar eax, 2
cmp ebx, eax
jb 0x505c83
inc ebx
jmp 0x505ca1
mov eax, dword [ecx + ebx*4]
inc ebx
mov dword [ebp - 0x10], eax
test eax, eax
je 0x505ca1
mov eax, dword [eax]
mov ecx, dword [ebp - 0x10]
call dword [eax]
mov edx, dword [edi + 0xa8]
mov ecx, dword [edi + 0xa4]
mov eax, edx
sub eax, ecx
sar eax, 2
cmp ebx, eax
jb 0x505c75
mov dword [ebp - 4], 0
test esi, esi
je 0x505cc6
dec dword [esi + 4]
cmp dword [esi + 4], 1
jge 0x505cc6
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov dword [ebp - 4], 0xffffffff
mov ebx, dword [edi + 0xb0]
mov eax, dword [ebx]
mov edx, dword [eax + 0x18]
cmp eax, vtable.nbase::MessageLoopProxy.0
jne 0x506153
lea esi, [ebx + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebx + 0x24], 0
test esi, esi
je 0x505cff
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [edi + 0xb0], 0
or ebx, 0xffffffff
mov esi, dword [edi + 0xb4]
mov dword [edi + 0xb4], 0
test esi, esi
je 0x505d3f
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x505d3f
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x505d3f
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
call fcn.00507210
push 0
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov esi, dword [edi + 0xb4]
test esi, esi
je 0x505d77
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x505d77
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x505d77
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov eax, dword [edi + 0xa4]
test eax, eax
je 0x505dd2
mov ecx, dword [edi + 0xac]
sub ecx, eax
and ecx, 0xfffffffc
cmp ecx, 0x1000
jb 0x505daa
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x50614e
mov eax, edx
push ecx
push eax
call fcn.005ff7fe
mov dword [edi + 0xa4], 0
add esp, 8
mov dword [edi + 0xa8], 0
mov dword [edi + 0xac], 0
mov eax, dword [edi + 0x90]
test eax, eax
je 0x505e2d
mov ecx, dword [edi + 0x98]
sub ecx, eax
and ecx, 0xfffffffc
cmp ecx, 0x1000
jb 0x505e05
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x50614e
mov eax, edx
push ecx
push eax
call fcn.005ff7fe
mov dword [edi + 0x90], 0
add esp, 8
mov dword [edi + 0x94], 0
mov dword [edi + 0x98], 0
mov ecx, dword [edi + 0x6c]
test ecx, ecx
je 0x505ea4
mov edx, dword [edi + 0x70]
push ecx
call fcn.00507a80
mov ecx, dword [edi + 0x74]
mov eax, 0x92492493
mov esi, dword [edi + 0x6c]
add esp, 4
sub ecx, esi
imul ecx
add edx, ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax*8]
sub ecx, eax
shl ecx, 3
cmp ecx, 0x1000
jb 0x505e85
mov edx, dword [esi - 4]
add ecx, 0x23
sub esi, edx
lea eax, [esi - 4]
cmp eax, 0x1f
ja 0x50614e
mov esi, edx
push ecx
push esi
call fcn.005ff7fe
mov dword [edi + 0x6c], 0
add esp, 8
mov dword [edi + 0x70], 0
mov dword [edi + 0x74], 0
mov ecx, dword [edi + 0x68]
test ecx, ecx
je 0x505ef5
nop dword [eax + eax]
mov eax, dword [edi + 0x64]
dec eax
add ecx, eax
mov eax, dword [edi + 0x60]
dec eax
and ecx, eax
mov eax, dword [edi + 0x5c]
mov esi, dword [eax + ecx*4]
mov ecx, dword [esi + 0x34]
add esi, 0x10
test ecx, ecx
je 0x505ee1
mov edx, dword [ecx]
cmp ecx, esi
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [esi + 0x24], 0
add dword [edi + 0x68], 0xffffffff
jne 0x505eee
mov dword [edi + 0x64], 0
mov ecx, dword [edi + 0x68]
test ecx, ecx
jne 0x505eb0
mov esi, dword [edi + 0x60]
test esi, esi
je 0x505f1a
nop dword [eax]
mov eax, dword [edi + 0x5c]
dec esi
mov eax, dword [eax + esi*4]
test eax, eax
je 0x505f16
push 0x38
push eax
call fcn.005ff7fe
add esp, 8
test esi, esi
jne 0x505f00
mov eax, dword [edi + 0x5c]
test eax, eax
je 0x505f4f
mov ecx, dword [edi + 0x60]
shl ecx, 2
cmp ecx, 0x1000
jb 0x505f45
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x50614e
mov eax, edx
push ecx
push eax
call fcn.005ff7fe
add esp, 8
mov dword [edi + 0x60], 0
mov dword [edi + 0x5c], 0
push 8
push dword [edi + 0x58]
call fcn.005ff7fe
mov dword [edi + 0x58], 0
add esp, 8
mov ecx, dword [edi + 0x54]
test ecx, ecx
je 0x505fc9
mov edx, ecx
nop word [eax + eax]
mov eax, dword [edi + 0x50]
dec eax
add ecx, eax
mov eax, dword [edi + 0x4c]
dec eax
and ecx, eax
mov eax, dword [edi + 0x48]
mov esi, dword [eax + ecx*4]
mov ecx, dword [esi + 0x34]
add esi, 0x10
test ecx, ecx
je 0x505fb4
mov edx, dword [ecx]
cmp ecx, esi
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [esi + 0x24], 0
mov edx, dword [edi + 0x54]
lea eax, [edx - 1]
mov dword [edi + 0x54], eax
test eax, eax
jne 0x505fc1
mov dword [edi + 0x50], eax
mov ecx, eax
mov edx, eax
test ecx, ecx
jne 0x505f80
mov esi, dword [edi + 0x4c]
test esi, esi
je 0x505fea
mov eax, dword [edi + 0x48]
dec esi
mov eax, dword [eax + esi*4]
test eax, eax
je 0x505fe6
push 0x38
push eax
call fcn.005ff7fe
add esp, 8
test esi, esi
jne 0x505fd0
mov eax, dword [edi + 0x48]
test eax, eax
je 0x50601f
mov ecx, dword [edi + 0x4c]
shl ecx, 2
cmp ecx, 0x1000
jb 0x506015
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x50614e
mov eax, edx
push ecx
push eax
call fcn.005ff7fe
add esp, 8
mov dword [edi + 0x4c], 0
mov dword [edi + 0x48], 0
push 8
push dword [edi + 0x44]
call fcn.005ff7fe
add esp, 8
mov dword [edi + 0x44], 0
lea eax, [edi + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov ecx, dword [edi + 0x28]
test ecx, ecx
je 0x50609d
mov edx, ecx
mov eax, dword [edi + 0x24]
dec eax
add ecx, eax
mov eax, dword [edi + 0x20]
dec eax
and ecx, eax
mov eax, dword [edi + 0x1c]
mov esi, dword [eax + ecx*4]
mov ecx, dword [esi + 0x34]
add esi, 0x10
test ecx, ecx
je 0x506088
mov edx, dword [ecx]
cmp ecx, esi
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [esi + 0x24], 0
mov edx, dword [edi + 0x28]
lea eax, [edx - 1]
mov dword [edi + 0x28], eax
test eax, eax
jne 0x506095
mov dword [edi + 0x24], eax
mov ecx, eax
mov edx, eax
test ecx, ecx
jne 0x506054
mov esi, dword [edi + 0x20]
test esi, esi
je 0x5060be
mov eax, dword [edi + 0x1c]
dec esi
mov eax, dword [eax + esi*4]
test eax, eax
je 0x5060ba
push 0x38
push eax
call fcn.005ff7fe
add esp, 8
test esi, esi
jne 0x5060a4
mov eax, dword [edi + 0x1c]
test eax, eax
je 0x5060ef
mov ecx, dword [edi + 0x20]
shl ecx, 2
cmp ecx, 0x1000
jb 0x5060e5
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x50614e
mov eax, edx
push ecx
push eax
call fcn.005ff7fe
add esp, 8
mov dword [edi + 0x20], 0
mov dword [edi + 0x1c], 0
push 8
push dword [edi + 0x18]
call fcn.005ff7fe
mov dword [edi + 0x18], 0
add esp, 8
mov esi, dword [edi + 0x10]
test esi, esi
je 0x506136
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x506136
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], ebx
dec ebx
jne 0x506136
mov eax, dword [esi]
mov ecx, esi
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
call fcn.0061f5be
mov ecx, ebx
call edx
jmp 0x505cff