Function at 0x4107f0
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0xc]
mov eax, dword [ebx]
test eax, eax
je 0x410a10
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x41084d
cmp eax, 0x102
je 0x410ac6
test eax, eax
je 0x41084d
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
test esi, 1
jne 0x410c60
and esi, 2
lea esi, [esi]
mov eax, dword [ebx + 0x14]
test eax, eax
jns 0x410940
test esi, esi
jne 0x410ff0
mov edi, dword [ebx + 4]
test edi, edi
je 0x410c20
mov eax, dword [ebx + 8]
add eax, 1
mov dword [ebx + 8], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
je 0x410ad0
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x102
je 0x41089c
cmp eax, 0xffffffff
jne 0x410b00
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
mov eax, dword [ebx]
test eax, eax
je 0x410950
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410930
cmp eax, 0x102
je 0x410a06
test eax, eax
je 0x410930
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
jne 0x410860
lea esi, [esi]
call sub.msvcrt.dll__errno
mov eax, dword [ebx + 0x14]
test eax, eax
js 0x41086b
add eax, 1
mov esi, 1
mov dword [ebx + 0x14], eax
jmp 0x410d9c
mov dword [esp + 8], str.StarPU_mutex_init
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov edi, eax
je 0x4109eb
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x4109bf
cmp eax, 0x102
je 0x410975
test eax, eax
je 0x4109bf
call sub.msvcrt.dll__errno
mov dword [ebp - 0x1c], eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov edx, dword [ebp - 0x1c]
mov dword [edx], eax
call sub.msvcrt.dll__errno
mov edx, dword [eax]
test edx, edx
jne 0x410a06
mov eax, dword [ebx]
test eax, eax
je 0x411105
mov dword [esp], edi
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
je 0x411035
mov dword [esp], edi
call sub.kernel32.dll_CloseHandle
sub esp, 4
test eax, eax
jne 0x410a06
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [ebx]
jmp 0x4108de
mov dword [esp + 8], str.StarPU_mutex_init
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov edi, eax
je 0x410aab
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410a7f
cmp eax, 0x102
je 0x410a35
test eax, eax
je 0x410a7f
call sub.msvcrt.dll__errno
mov dword [ebp - 0x1c], eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov edx, dword [ebp - 0x1c]
mov dword [edx], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
jne 0x410ac6
mov eax, dword [ebx]
test eax, eax
je 0x411180
mov dword [esp], edi
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
je 0x411150
mov dword [esp], edi
call sub.kernel32.dll_CloseHandle
sub esp, 4
test eax, eax
jne 0x410ac6
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [ebx]
jmp 0x410809
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov ecx, dword [eax]
test ecx, ecx
jne 0x410860
jmp 0x41089c
mov eax, dword [ebx]
test eax, eax
je 0x410b62
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410b54
cmp eax, 0x102
je 0x410c18
test eax, eax
je 0x410b54
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov ecx, dword [eax]
test ecx, ecx
jne 0x410860
mov eax, dword [ebx + 8]
sub eax, 1
mov dword [ebx + 8], eax
jmp 0x410860
mov dword [esp + 8], str.StarPU_mutex_init
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov edi, eax
je 0x410bfd
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410bd1
cmp eax, 0x102
je 0x410b87
test eax, eax
je 0x410bd1
call sub.msvcrt.dll__errno
mov dword [ebp - 0x1c], eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov edx, dword [ebp - 0x1c]
mov dword [edx], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
jne 0x410c18
mov eax, dword [ebx]
test eax, eax
je 0x4110c1
mov dword [esp], edi
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
je 0x411065
mov dword [esp], edi
call sub.kernel32.dll_CloseHandle
sub esp, 4
test eax, eax
jne 0x410c18
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [ebx]
jmp 0x410b06
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x7fffffff
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateSemaphoreA
sub esp, 0x10
test eax, eax
mov dword [ebx + 4], eax
je 0x411120
mov dword [ebx + 8], 0
jmp 0x41087e
mov edi, dword [ebx + 0x14]
test edi, edi
je 0x410d90
and esi, 2
jne 0x410ff0
mov eax, dword [ebx + 0x18]
jmp 0x410d2c
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebx + 0xc]
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x102
je 0x410c80
cmp eax, 0xffffffff
jne 0x410e90
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
mov eax, dword [ebx]
test eax, eax
je 0x410dd2
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410ff7
cmp eax, 0x102
je 0x410e84
test eax, eax
je 0x410ff7
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
je 0x410ff7
mov eax, dword [ebx + 0x18]
mov edx, dword [ebx + 0x14]
sub eax, 1
test edx, edx
mov dword [ebx + 0x18], eax
je 0x410d90
mov ecx, dword [ebx + 0xc]
add eax, 1
mov dword [ebx + 0x18], eax
test ecx, ecx
je 0x410fb0
mov eax, dword [ebx + 0x10]
add eax, 1
mov dword [ebx + 0x10], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
jne 0x410c80
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
mov edx, dword [eax]
test edx, edx
je 0x410c80
mov eax, dword [ebx + 0x18]
mov edx, dword [ebx + 0x14]
sub eax, 1
test edx, edx
mov dword [ebx + 0x18], eax
jne 0x410d2c
mov dword [ebx + 0x14], 0xffffffff
mov esi, 1
mov eax, dword [ebx]
mov dword [esp], eax
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
jne 0x410dc8
call sub.msvcrt.dll__errno
mov ebx, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [ebx], eax
call sub.msvcrt.dll__errno
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], str.StarPU_mutex_init
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov esi, eax
je 0x410e69
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410e3d
cmp eax, 0x102
je 0x410df7
test eax, eax
je 0x410e3d
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
jne 0x410e84
mov eax, dword [ebx]
test eax, eax
je 0x4110d5
mov dword [esp], esi
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
je 0x411095
mov dword [esp], esi
call sub.kernel32.dll_CloseHandle
sub esp, 4
test eax, eax
jne 0x410e84
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
mov eax, dword [ebx]
jmp 0x410cc6
mov eax, dword [ebx]
test eax, eax
je 0x410ef2
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410ee4
cmp eax, 0x102
je 0x410fa4
test eax, eax
je 0x410ee4
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
mov ecx, dword [eax]
test ecx, ecx
jne 0x410d1c
mov eax, dword [ebx + 0x10]
sub eax, 1
mov dword [ebx + 0x10], eax
jmp 0x410d1c
mov dword [esp + 8], str.StarPU_mutex_init
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov esi, eax
je 0x410f89
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x410f5d
cmp eax, 0x102
je 0x410f17
test eax, eax
je 0x410f5d
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
jne 0x410fa4
mov eax, dword [ebx]
test eax, eax
je 0x4110eb
mov dword [esp], esi
call sub.kernel32.dll_ReleaseMutex
sub esp, 4
test eax, eax
je 0x411005
mov dword [esp], esi
call sub.kernel32.dll_CloseHandle
sub esp, 4
test eax, eax
jne 0x410fa4
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
mov eax, dword [ebx]
jmp 0x410e96
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x7fffffff
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateSemaphoreA
sub esp, 0x10
test eax, eax
mov dword [ebx + 0xc], eax
je 0x411135
mov dword [ebx + 0x10], 0
jmp 0x410d3d
xor esi, esi
jmp 0x410d9c
call sub.msvcrt.dll__errno
lea esi, [esi]
jmp 0x410d1c
call sub.msvcrt.dll__errno
mov edi, eax
lea esi, [esi]
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov edi, dword [eax]
test edi, edi
je 0x410f7a
mov eax, dword [ebx]
jmp 0x410e96
call sub.msvcrt.dll__errno
mov dword [ebp - 0x1c], eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov edx, dword [ebp - 0x1c]
mov dword [edx], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
je 0x4109dc
mov eax, dword [ebx]
jmp 0x4108de
call sub.msvcrt.dll__errno
mov dword [ebp - 0x1c], eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov edx, dword [ebp - 0x1c]
mov dword [edx], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
je 0x410bee
mov eax, dword [ebx]
jmp 0x410b06
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
je 0x410e5a
mov eax, dword [ebx]
jmp 0x410cc6
mov eax, ebx
call fcn.00410790
test eax, eax
je 0x410bdb
jmp 0x410c18
mov eax, ebx
call fcn.00410790
test eax, eax
nop
je 0x410e47
jmp 0x410e84
mov eax, ebx
lea esi, [esi]
call fcn.00410790
test eax, eax
je 0x410f67
lea esi, [esi]
jmp 0x410fa4
mov eax, ebx
call fcn.00410790
test eax, eax
nop
je 0x4109c9
jmp 0x410a06
call fcn.004105f0
test eax, eax
jne 0x410860
lea esi, [esi]
jmp 0x41087e
call fcn.004105f0
test eax, eax
lea esi, [esi]
jne 0x410d1c
jmp 0x410d3d
call sub.msvcrt.dll__errno
mov dword [ebp - 0x1c], eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov edx, dword [ebp - 0x1c]
mov dword [edx], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
test eax, eax
je 0x410a9c
mov eax, dword [ebx]
jmp 0x410809
mov eax, ebx
call fcn.00410790
test eax, eax
je 0x410a89
mov eax, dword [ebx]
jmp 0x410809