// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x148, %rsp            # imm = 0x148
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x4210
movl $0x100000, 0x44(%rsp)   # imm = 0x100000
movw $0xff, 0x40(%rsp)
movl $0x100000, 0x4c(%rsp)   # imm = 0x100000
movw $0x0, 0x48(%rsp)
leaq 0x1260a(%rip), %rdi     # 0x1d2c7
xorl %esi, %esi
leaq 0x14083(%rip), %rdx     # 0x1ed49
leaq 0x12860(%rip), %rcx     # 0x1d52d
movl $0x44a, %r8d            # imm = 0x44A
callq 0x5ce0
testb $0x1, %al
jne 0xacde
jmp 0xacfe
leaq 0x40(%rsp), %rdi
addq $0xe8, %rdi
movl $0x20, %ecx
leaq 0x125d1(%rip), %rdx     # 0x1d2c7
movq %rcx, %rsi
callq 0x14f50
movb $0x0, 0x3f(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xf560
andb $0x1, %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
leaq 0x14039(%rip), %rdi     # 0x1ed5d
movb $0x0, %al
callq 0x4180
leaq 0x1405f(%rip), %rdi     # 0x1ed91
movb $0x0, %al
callq 0x4180
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x4210
leaq 0x10(%rsp), %rdi
callq 0x19590
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0xad63
jmp 0xad6b
movb 0x3e(%rsp), %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %cl
movb 0x3e(%rsp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edi
movzbl %al, %esi
callq 0x4da0
testb $0x1, 0x3e(%rsp)
je 0xaf2d
leaq 0x14020(%rip), %rdi     # 0x1edbf
movb $0x0, %al
callq 0x4180
leaq 0x10(%rsp), %rdi
callq 0x196b0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0xadbf
jmp 0xadc7
movb 0x3e(%rsp), %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %cl
movb 0x3e(%rsp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edi
movzbl %al, %esi
callq 0x4da0
leaq 0x13ffd(%rip), %rdi     # 0x1eded
movb $0x0, %al
callq 0x4180
leaq 0x10(%rsp), %rdi
callq 0x197f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xd(%rsp)
jne 0xae10
jmp 0xae18
movb 0x3e(%rsp), %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %cl
movb 0x3e(%rsp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edi
movzbl %al, %esi
callq 0x4da0
leaq 0x13fde(%rip), %rdi     # 0x1ee1f
movb $0x0, %al
callq 0x4180
leaq 0x10(%rsp), %rdi
callq 0x19750
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xc(%rsp)
jne 0xae61
jmp 0xae69
movb 0x3e(%rsp), %al
movb %al, 0xc(%rsp)
movb 0xc(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %cl
movb 0x3e(%rsp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edi
movzbl %al, %esi
callq 0x4da0
leaq 0x13fc3(%rip), %rdi     # 0x1ee55
movb $0x0, %al
callq 0x4180
leaq 0x10(%rsp), %rdi
callq 0x197f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xb(%rsp)
jne 0xaeb2
jmp 0xaeba
movb 0x3e(%rsp), %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %cl
movb 0x3e(%rsp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edi
movzbl %al, %esi
callq 0x4da0
leaq 0x13f9b(%rip), %rdi     # 0x1ee7e
movb $0x0, %al
callq 0x4180
leaq 0x10(%rsp), %rdi
callq 0x19890
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xa(%rsp)
jne 0xaf03
jmp 0xaf0b
movb 0x3e(%rsp), %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %cl
movb 0x3e(%rsp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edi
movzbl %al, %esi
callq 0x4da0
movb 0x3e(%rsp), %cl
leaq 0x13fb1(%rip), %rdi     # 0x1eee9
leaq 0x13f69(%rip), %rax     # 0x1eea8
testb $0x1, %cl
cmovneq %rax, %rdi
movb 0x3e(%rsp), %cl
leaq 0x1217e(%rip), %rsi     # 0x1d0cf
leaq 0x1215e(%rip), %rax     # 0x1d0b6
testb $0x1, %cl
cmovneq %rax, %rsi
movb $0x0, %al
callq 0x4180
leaq 0x13fbd(%rip), %rdi     # 0x1ef2a
movb $0x0, %al
callq 0x4180
leaq 0x13fd7(%rip), %rdi     # 0x1ef52
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
callq 0x19590
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x9(%rsp)
jne 0xafa0
movb 0x3e(%rsp), %al
movb %al, 0x9(%rsp)
movb 0x9(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
leaq 0x13fd9(%rip), %rdi     # 0x1ef8a
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
callq 0x196b0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x8(%rsp)
jne 0xafd6
movb 0x3e(%rsp), %al
movb %al, 0x8(%rsp)
movb 0x8(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
leaq 0x13fd9(%rip), %rdi     # 0x1efc0
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
callq 0x19750
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x7(%rsp)
jne 0xb00c
movb 0x3e(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
leaq 0x13fdc(%rip), %rdi     # 0x1eff9
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
callq 0x197f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x6(%rsp)
jne 0xb042
movb 0x3e(%rsp), %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
leaq 0x13fde(%rip), %rdi     # 0x1f031
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
callq 0x19890
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x5(%rsp)
jne 0xb078
movb 0x3e(%rsp), %al
movb %al, 0x5(%rsp)
movb 0x5(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %cl
leaq 0x14017(%rip), %rdi     # 0x1f0a4
leaq 0x13fd6(%rip), %rax     # 0x1f06a
testb $0x1, %cl
cmovneq %rax, %rdi
movb 0x3e(%rsp), %cl
leaq 0x12029(%rip), %rsi     # 0x1d0cf
leaq 0x12009(%rip), %rax     # 0x1d0b6
testb $0x1, %cl
cmovneq %rax, %rsi
movb $0x0, %al
callq 0x4180
callq 0xf580
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x4(%rsp)
jne 0xb0cf
jmp 0xb0d7
movb 0x3e(%rsp), %al
movb %al, 0x4(%rsp)
movb 0x4(%rsp), %al
andb $0x1, %al
movb %al, 0x3e(%rsp)
movb 0x3e(%rsp), %al
xorl %esi, %esi
andb $0x1, %al
movzbl %al, %edi
callq 0x4da0
andb $0x1, %al
addq $0x148, %rsp            # imm = 0x148
retq
nopl (%rax,%rax)