// File: /workspace/github_c_makefile_star2_O3/aremmell[P]libsir/tests/tests.c
// Function: sirtest_mutexsanity
bool sirtest_mutexsanity(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    TEST_MSG_0(SIR_WHITEB("create, lock, unlock, destroy"));
    (void)printf(INDENT_ITEM SIR_WHITE("creating mutex...") SIR_EOL);

#if !defined(__IMPORTC__)
    sir_mutex m1 = SIR_MUTEX_INIT;
#else
    sir_mutex m1 = {0};
#endif
    _sir_eqland(pass, _sir_mutexcreate(&m1));

    (void)print_test_error(pass, pass);

    if (pass) {
        (void)printf(INDENT_ITEM SIR_WHITE("locking (wait)...") SIR_EOL);
        _sir_eqland(pass, _sir_mutexlock(&m1));

        (void)print_test_error(pass, pass);

        (void)printf(INDENT_ITEM SIR_WHITE("entered; unlocking...") SIR_EOL);
        _sir_eqland(pass, _sir_mutexunlock(&m1));

        (void)print_test_error(pass, pass);

        (void)printf(INDENT_ITEM SIR_WHITE("locking (without wait)...") SIR_EOL);
        _sir_eqland(pass, _sir_mutextrylock(&m1));

        (void)print_test_error(pass, pass);

        (void)printf(INDENT_ITEM SIR_WHITE("unlocking...") SIR_EOL);
        _sir_eqland(pass, _sir_mutexunlock(&m1));

        (void)print_test_error(pass, pass);

        (void)printf(INDENT_ITEM SIR_WHITE("destroying...") SIR_EOL);
        _sir_eqland(pass, _sir_mutexdestroy(&m1));

        (void)print_test_error(pass, pass);

    }
    PASSFAIL_MSG(pass, "\t--- create, lock, unlock, destroy: %s ---" SIR_EOL SIR_EOL, PRN_PASS(pass));

    TEST_MSG_0(SIR_WHITEB("invalid arguments"));
    (void)printf(INDENT_ITEM SIR_WHITE("create with NULL pointer...") SIR_EOL);
    _sir_eqland(pass, !_sir_mutexcreate(NULL));
    (void)printf(INDENT_ITEM SIR_WHITE("lock with NULL pointer...") SIR_EOL);
    _sir_eqland(pass, !_sir_mutexlock(NULL));
    (void)printf(INDENT_ITEM SIR_WHITE("trylock with NULL pointer...") SIR_EOL);
    _sir_eqland(pass, !_sir_mutextrylock(NULL));
    (void)printf(INDENT_ITEM SIR_WHITE("unlock with NULL pointer...") SIR_EOL);
    _sir_eqland(pass, !_sir_mutexunlock(NULL));
    (void)printf(INDENT_ITEM SIR_WHITE("destroy with NULL pointer...") SIR_EOL);
    _sir_eqland(pass, !_sir_mutexdestroy(NULL));
    PASSFAIL_MSG(pass, "\t--- pass invalid arguments: %s ---" SIR_EOL SIR_EOL, PRN_PASS(pass));

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass); //-V1020
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
leaq 0x28(%rsp), %rbx
xorl %r15d, %r15d
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x100000, %eax         # imm = 0x100000
movl %eax, 0x4(%rbx)
movw $0xff, (%rbx)
movl %eax, 0xc(%rbx)
movq %rbx, %rdi
callq 0x9a21
movl %eax, %ebx
leaq 0xbc1c(%rip), %rsi      # 0x12c05
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
leaq 0xbc3d(%rip), %rsi      # 0x12c39
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq $0x0, 0x20(%rdi)
callq 0xe884
andb %bl, %al
movzbl %al, %ebp
movl %ebp, %edi
movl %ebp, %esi
callq 0x3b6d
leaq 0xa098(%rip), %rbx      # 0x110cf
leaq 0xbd53(%rip), %r14      # 0x12d91
cmpb $0x1, %bpl
jne 0x7139
leaq 0xbc18(%rip), %rsi      # 0x12c67
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
movq %rsp, %r15
movq %r15, %rdi
callq 0xe908
movzbl %al, %ebp
movl %ebp, %edi
movl %ebp, %esi
callq 0x3b6d
leaq 0xbc1c(%rip), %rsi      # 0x12c95
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
movq %r15, %rdi
callq 0xe9a6
andb %al, %bpl
movzbl %bpl, %ebp
movl %ebp, %edi
movl %ebp, %esi
callq 0x3b6d
leaq 0xbc23(%rip), %rsi      # 0x12cc7
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
movq %r15, %rdi
callq 0xe957
andb %al, %bpl
movzbl %bpl, %ebp
movl %ebp, %edi
movl %ebp, %esi
callq 0x3b6d
leaq 0xbc2e(%rip), %rsi      # 0x12cfd
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
movq %r15, %rdi
callq 0xe9a6
andb %al, %bpl
movzbl %bpl, %ebp
movl %ebp, %edi
movl %ebp, %esi
callq 0x3b6d
leaq 0xbc2c(%rip), %rsi      # 0x12d26
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
movq %r15, %rdi
callq 0xe9f5
andb %al, %bpl
movzbl %bpl, %ebp
movl %ebp, %edi
movl %ebp, %esi
callq 0x3b6d
testb %bpl, %bpl
je 0x7136
leaq 0x9f8c(%rip), %rdx      # 0x110b6
movb $0x1, %r15b
leaq 0xbc1c(%rip), %r14      # 0x12d50
jmp 0x713c
xorl %r15d, %r15d
movq %rbx, %rdx
movl $0x1, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x3400
leaq 0xbc80(%rip), %rsi      # 0x12dd2
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
leaq 0xbc95(%rip), %rsi      # 0x12dfa
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
xorl %edi, %edi
callq 0xe884
movl %eax, %ebp
xorb $0x1, %bpl
andb %r15b, %bpl
leaq 0xbcaa(%rip), %rsi      # 0x12e32
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
xorl %edi, %edi
callq 0xe908
movl %eax, %r15d
leaq 0xbcc3(%rip), %rsi      # 0x12e68
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
xorl %edi, %edi
callq 0xe957
movl %eax, %r14d
leaq 0xbcdf(%rip), %rsi      # 0x12ea1
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
xorl %edi, %edi
callq 0xe9a6
movl %eax, %r12d
leaq 0xbcfa(%rip), %rsi      # 0x12ed9
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
xorl %edi, %edi
callq 0xe9f5
orb %r12b, %al
orb %r15b, %r14b
orb %al, %r14b
xorb $0x1, %r14b
andb %bpl, %r14b
leaq 0xbd09(%rip), %rax      # 0x12f12
leaq 0xbd3c(%rip), %rsi      # 0x12f4c
testb $0x1, %r14b
cmovneq %rax, %rsi
leaq 0x9e97(%rip), %rax      # 0x110b6
cmovneq %rax, %rbx
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3400
callq 0x9a26
andb %r14b, %al
movzbl %al, %edi
xorl %esi, %esi
callq 0x3b6d
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq