Function at 0x401190
Capabilities:
Check mutex on windows
Get thread local storage value
Set registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x36c
mov eax, dword [0x4860f0]
xor eax, esp
mov dword [esp + 0x368], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
lea ecx, [esp + 0x18]
push ecx
mov dword [0x489c30], eax
call fcn.00401b50
lea edx, [esp + 0x18]
push edx
call fcn.00401d00
lea eax, [esp + 0x18]
push eax
mov ecx, str.SetAutoStart
call fcn.00402050
test eax, eax
je 0x401222
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0x1c]
push edx
mov ecx, str.SetAutoStart
call fcn.00401f90
push eax
call section..text
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
add esp, 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40147a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40147a
lea ecx, [esp + 0x18]
push ecx
mov ecx, str.NotAutoStart
call fcn.00402050
test eax, eax
je 0x401251
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0x1c]
push eax
mov ecx, str.NotAutoStart
call fcn.00401f90
push eax
call fcn.00401080
jmp 0x4011f6
lea ecx, [esp + 0x18]
push ecx
mov ecx, str.Silence
call fcn.00402050
lea edx, [esp + 0x18]
push edx
mov ecx, str.Update
call fcn.00402050
push str.GameHallInstallMutex
push 1
xor esi, esi
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov edi, eax
mov dword [esp + 0x44], edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4012cc
mov eax, dword [0x489cf4]
push eax
push esi
call dword [sym.imp.USER32.dll_FindWindowW]
mov esi, eax
test esi, esi
je 0x4012be
push 1
push esi
call dword [sym.imp.USER32.dll_ShowWindow]
push esi
call dword [sym.imp.USER32.dll_SetForegroundWindow]
push esi
call dword [sym.imp.USER32.dll_BringWindowToTop]
test edi, edi
je 0x40147a
push edi
jmp 0x401474
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], esi
mov eax, 0x2001f
mov ecx, str.SoftwareMicrosoftWindows_NTCurrentVersionAppCompatFlagsCompatibility_AssistantPersisted
lea esi, [esp + 0x10]
call fcn.00401ae0
test eax, eax
jne 0x401346
xor ecx, ecx
push 0x208
push ecx
lea edx, [esp + 0x16a]
push edx
mov word [esp + 0x16c], cx
call fcn.00459a90
add esp, 0xc
push 0x104
lea eax, [esp + 0x164]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov eax, dword [esp + 0x10]
push 4
lea ecx, [esp + 0x10]
push ecx
push 4
push 0
lea edx, [esp + 0x170]
push edx
push eax
mov dword [esp + 0x24], 1
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov eax, dword [ebp + 8]
call fcn.0041b100
lea ecx, [esp + 0x48]
push ecx
call fcn.00415f10
push 0x38c
call fcn.00456a8e
add esp, 4
test eax, eax
je 0x401373
push eax
call fcn.004042d0
mov esi, eax
jmp 0x401375
xor esi, esi
mov dword [esp + 0xc], esi
test esi, esi
je 0x40138a
lea edx, [esi + 0x2a0]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push SysReAllocString
push SysReAllocString
push SysReAllocString
push SysReAllocString
push 0x100
push 0x96c80000
push str.InstallFrame
push 0
mov eax, esi
mov dword [0x489c34], esi
mov dword [esi + 0x300], 1
mov dword [esi + 0x304], ebx
call fcn.0041ecc0
mov edi, esi
call fcn.0041ef80
push esi
call fcn.0041edf0
push 1
push 1
call fcn.0041ed90
cmp dword [esi + 0x284], 0
jne 0x4013f5
mov dword [esi + 0x284], 1
mov edi, dword [esi + 0x298]
test edi, edi
je 0x401408
push 0
xor eax, eax
call fcn.0040c7c0
mov al, 1
xor bl, bl
mov ecx, esi
call fcn.00404050
add esi, 0x29c
call fcn.00417160
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push eax
call fcn.00416ee0
mov ecx, dword [0x489c38]
test ecx, ecx
je 0x401449
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov dword [0x489c38], 0
lea eax, [esp + 0xc]
call fcn.004014a0
lea ecx, [esp + 0x48]
push ecx
call fcn.004161d0
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40146b
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x44]
test eax, eax
je 0x40147a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x18]
call fcn.00401c70
mov ecx, dword [esp + 0x374]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.004567fb
mov esp, ebp
pop ebp
ret 0x10