LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests_shared.c
// Function: rmfile
void rmfile(const char* filename, bool leave_logs) {
    /* skip if leave_logs is true. */
    if (leave_logs) {
        TEST_MSG(SIR_WHITE("skipping deletion of '%s' (%s)"), filename, SIR_CL_LEAVELOGSFLAG);
        return;
    }

    struct stat st;
    if (0 != stat(filename, &st)) {
        /* ignore errors if the file doesn't exist. */
        if (ENOENT == errno)
            return;
        HANDLE_OS_ERROR(true, "failed to stat %s!", filename);
        return;
    }

    if (!_sir_deletefile(filename))
        HANDLE_OS_ERROR(false, "failed to delete %s!", filename);
    else
        TEST_MSG(SIR_DGRAY("deleted %s (%ld bytes)"), filename, (long)st.st_size);
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
testl %esi, %esi
je 0x3ff1
leaq 0xc40a(%rip), %rsi      # 0x103df
leaq 0xc3a7(%rip), %rcx      # 0x10383
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
jmp 0x3410
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x32e0
testl %eax, %eax
je 0x4015
callq 0x3080
movl (%rax), %edi
cmpl $0x2, %edi
jne 0x402f
addq $0x90, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0xbc5c
testb %al, %al
je 0x4050
movq 0x30(%rsp), %rcx
leaq 0xc444(%rip), %rsi      # 0x10471
jmp 0x3fdc
leaq 0xc3de(%rip), %rsi      # 0x10414
leaq 0xc2cf(%rip), %rdx      # 0x1030c
movl $0x133, %ecx            # imm = 0x133
callq 0x9e45
leaq 0xc3cd(%rip), %rsi      # 0x1041b
jmp 0x4076
callq 0x3080
movl (%rax), %edi
leaq 0xc3b6(%rip), %rsi      # 0x10414
leaq 0xc2a7(%rip), %rdx      # 0x1030c
movl $0x138, %ecx            # imm = 0x138
callq 0x9e45
leaq 0xc3cf(%rip), %rsi      # 0x10445
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3410
xorl %edi, %edi
xorl %esi, %esi
addq $0x90, %rsp
popq %rbx
jmp 0x3ac9
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests_shared.c
// Function: enumfiles
bool enumfiles(const char* path, const char* search, bool del, unsigned* count) {
#if !defined(__WIN__)
    DIR* d = opendir(path);
    if (!d)
        return print_test_error(false, false);

    rewinddir(d);
    const struct dirent* di = readdir(d);
    if (!di) {
        (void)closedir(d);
        return print_test_error(false, false);
    }

    while (NULL != di) {
        if (strstr(di->d_name, search)) {
            if (del) {
                char filepath[SIR_MAXPATH];
                _sir_snprintf_trunc(filepath, SIR_MAXPATH, "%s%s", path, di->d_name);
                rmfile(filepath, false);
            }
            (*count)++;
        }
        di = readdir(d);
    }

    (void)closedir(d);
    d = NULL;
#else /* __WIN__ */
    WIN32_FIND_DATA finddata = {0};
    char buf[SIR_MAXPATH]    = {0};

    (void)snprintf(buf, SIR_MAXPATH, "%s/*", path);

    HANDLE enumerator = FindFirstFile(buf, &finddata);
    if (INVALID_HANDLE_VALUE == enumerator)
        return false;

    do {
        if (strstr(finddata.cFileName, search)) {
            if (del) {
                char filepath[SIR_MAXPATH];
                _sir_snprintf_trunc(filepath, SIR_MAXPATH, "%s%s", path, finddata.cFileName);
                rmfile(filepath, false);
            }
            (*count)++;
        }
    } while (FindNextFile(enumerator, &finddata) > 0);

    FindClose(enumerator);
    enumerator = NULL;
#endif
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
callq 0x3150
testq %rax, %rax
je 0x40da
movq %rax, %r12
movq %rax, %rdi
callq 0x3230
movq %r12, %rdi
callq 0x3370
testq %rax, %rax
jne 0x4150
movq %r12, %rdi
callq 0x3240
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
callq 0x3ac9
jmp 0x4162
addq $0x13, %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x35b0
testq %rax, %rax
je 0x4148
testb %bpl, %bpl
je 0x4146
movq $0x1000, 0x8(%rsp)      # imm = 0x1000
movq 0x8(%rsp), %rsi
movq %r13, (%rsp)
movl $0x1000, %ecx           # imm = 0x1000
leaq 0x10(%rsp), %r13
movq %r13, %rdi
pushq $0x1
popq %rdx
leaq 0xdee6(%rip), %r8       # 0x1200f
movq %r15, %r9
xorl %eax, %eax
callq 0x3040
testl %eax, %eax
jne 0x413c
movq 0x8(%rsp), %rax
movq %r13, %rdi
xorl %esi, %esi
callq 0x3fbf
incl (%rbx)
movq %r12, %rdi
callq 0x3370
movq %rax, %r13
testq %rax, %rax
jne 0x40e7
movq %r12, %rdi
callq 0x3240
movb $0x1, %bl
movl %ebx, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_exceedmaxsize
bool sirtest_exceedmaxsize(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    char toobig[SIR_MAXMESSAGE + 100] = {0};
    (void)memset(toobig, 'a', SIR_MAXMESSAGE + 100);
    toobig[SIR_MAXMESSAGE + 99] = '\0';

    _sir_eqland(pass, sir_info("%s", toobig));

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1180, %rsp           # imm = 0x1180
leaq 0x8(%rsp), %rbx
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 0x94a9
movl %eax, %ebx
leaq 0x110(%rsp), %r14
pushq $0x61
popq %rsi
movl $0x1064, %edx           # imm = 0x1064
movq %r14, %rdi
callq 0x31f0
movb $0x0, 0x1063(%r14)
leaq 0xbea2(%rip), %rdi      # 0x10228
movq %r14, %rsi
xorl %eax, %eax
callq 0x95a2
movl %eax, %ebp
callq 0x94ae
andb %bpl, %al
andb %bl, %al
movzbl %al, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x1180, %rsp           # imm = 0x1180
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failnooutputdest
bool sirtest_failnooutputdest(void) {
    INIT(si, 0, 0, 0, 0);
    bool pass = si_init;

    _sir_eqland(pass, !sir_notice("this goes nowhere!"));

    if (pass) {
        static const char* logfilename = MAKE_LOG_NAME("nodestination.log");
        PRINT_EXPECTED_ERROR();

        _sir_eqland(pass, sir_stdoutlevels(SIRL_INFO));
        _sir_eqland(pass, sir_info("this goes to stdout"));
        _sir_eqland(pass, sir_stdoutlevels(SIRL_NONE));

        sirfileid fid = sir_addfile(logfilename, SIRL_INFO, SIRO_DEFAULT);
        _sir_eqland(pass, 0U != fid);
        _sir_eqland(pass, sir_info("this goes to %s", logfilename));
        _sir_eqland(pass, sir_filelevels(fid, SIRL_NONE));
        _sir_eqland(pass, !sir_notice("this goes nowhere!"));

        if (0U != fid)
            _sir_eqland(pass, sir_remfile(fid));

        rmfile(logfilename, cl_cfg.leave_logs);
    }

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
leaq 0x10(%rsp), %r14
xorl %ebx, %ebx
movl $0x108, %edx            # imm = 0x108
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x100000, %eax         # imm = 0x100000
movl %eax, 0x4(%r14)
movl %eax, 0xc(%r14)
movq %r14, %rdi
callq 0x94a9
movl %eax, %ebp
leaq 0xc0cf(%rip), %rdi      # 0x10975
xorl %eax, %eax
callq 0x9651
xorb $0x1, %al
andb %bpl, %al
cmpb $0x1, %al
jne 0x4976
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
pushq $0x40
popq %r14
movl %r14d, %edi
callq 0x9b3b
movb %al, 0xf(%rsp)
leaq 0xc0c6(%rip), %rdi      # 0x109a1
xorl %eax, %eax
callq 0x95a2
movl %eax, %ebx
xorl %edi, %edi
callq 0x9b3b
movl %eax, %r15d
leaq 0xc093(%rip), %r12      # 0x10988
movq %r12, %rdi
movl %r14d, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x9a6b
movl %eax, %r14d
testl %eax, %eax
setne %bpl
leaq 0xc0a0(%rip), %rdi      # 0x109b5
movq %r12, %rsi
xorl %eax, %eax
callq 0x95a2
movl %eax, %r12d
movl %r14d, %edi
xorl %esi, %esi
callq 0x9a7f
movl %eax, %r13d
leaq 0xc03f(%rip), %rdi      # 0x10975
xorl %eax, %eax
callq 0x9651
notb %al
andb %r13b, %al
andb %r12b, %al
andb %r15b, %bpl
andb %al, %bpl
andb 0xf(%rsp), %bl
andb %bpl, %bl
testl %r14d, %r14d
je 0x4963
movl %r14d, %edi
callq 0x9a70
andb %bl, %al
movl %eax, %ebx
movzbl 0x16f9e(%rip), %esi     # 0x1b908
leaq 0xc017(%rip), %rdi      # 0x10988
callq 0x3fbf
callq 0x94ae
andb %bl, %al
movzbl %al, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failnulls
bool sirtest_failnulls(void) {
    INIT_BASE(si, SIRL_ALL, 0, 0, 0, "", false);
    bool pass = true;

    _sir_eqland(pass, !sir_init(NULL));

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, sir_init(&si));
    _sir_eqland(pass, !sir_info(NULL)); //-V618 //-V575

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, 0U == sir_addfile(NULL, SIRL_ALL, SIRO_MSGONLY));

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, !sir_remfile(0U));

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsp, %rbx
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)
xorl %edi, %edi
callq 0x94a9
movl %eax, %ebx
xorb $0x1, %bl
testb %al, %al
jne 0x49de
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
movq %rsp, %rdi
callq 0x94a9
movl %eax, %ebp
andb %bl, %bpl
xorl %edi, %edi
xorl %eax, %eax
callq 0x95a2
movl %eax, %ebx
xorb $0x1, %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x4a0b
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
xorl %edi, %edi
movl $0xff, %esi
movl $0x7f00, %edx           # imm = 0x7F00
callq 0x9a6b
testl %eax, %eax
sete %al
andb %al, %bl
cmpb $0x1, %bl
jne 0x4a32
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
xorl %edi, %edi
callq 0x9a70
xorb $0x1, %al
andb %al, %bl
cmpb $0x1, %bl
jne 0x4a4c
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
callq 0x94ae
andb %al, %bl
movzbl %bl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failemptymessage
bool sirtest_failemptymessage(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    _sir_eqland(pass, !sir_debug("%s", ""));

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsp, %rbx
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 0x94a9
movl %eax, %ebx
leaq 0xb785(%rip), %rdi      # 0x10228
leaq 0xb81d(%rip), %rsi      # 0x102c7
xorl %eax, %eax
callq 0x94cd
movl %eax, %ebp
xorb $0x1, %bpl
callq 0x94ae
andb %bl, %al
andb %bpl, %al
movzbl %al, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failinvalidfilename
bool sirtest_failinvalidfilename(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    _sir_eqland(pass, 0U == sir_addfile("bad file!/name", SIRL_ALL, SIRO_MSGONLY));

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsp, %rbx
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 0x94a9
movl %eax, %ebx
leaq 0xbc4f(%rip), %rdi      # 0x10a4c
movl $0xff, %esi
movl $0x7f00, %edx           # imm = 0x7F00
callq 0x9a6b
testl %eax, %eax
sete %bpl
andb %bl, %bpl
cmpb $0x1, %bpl
jne 0x4e25
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
callq 0x94ae
andb %al, %bpl
movzbl %bpl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failfilebadpermission
bool sirtest_failfilebadpermission(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

#if !defined(__WIN__)
    static const char* path = "/noperms";
#else /* __WIN__ */
# if defined(__CYGWIN__)
    static const char* path = "/cygdrive/c/Windows/System32/noperms";
# else
    static const char* path;
    if (get_wineversion()) {
        path = "Z:\\noperms";
    } else {
        path = "C:\\Windows\\System32\\noperms";
    }
# endif
#endif

    _sir_eqland(pass, 0U == sir_addfile(path, SIRL_ALL, SIRO_MSGONLY));

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsp, %rbx
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 0x94a9
movl %eax, %ebx
leaq 0xbbdd(%rip), %rdi      # 0x10a5b
movl $0xff, %esi
movl $0x7f00, %edx           # imm = 0x7F00
callq 0x9a6b
testl %eax, %eax
sete %bpl
andb %bl, %bpl
cmpb $0x1, %bpl
jne 0x4ea6
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
callq 0x94ae
andb %al, %bpl
movzbl %bpl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failremovebadfile
bool sirtest_failremovebadfile(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    sirfileid invalidid = 9999999;
    _sir_eqland(pass, !sir_remfile(invalidid));

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsp, %rbx
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 0x94a9
movl %eax, %ebp
movl $0x98967f, %edi         # imm = 0x98967F
callq 0x9a70
movl %eax, %ebx
xorb $0x1, %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x5122
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
callq 0x94ae
andb %al, %bl
movzbl %bl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_rollandarchivefile
bool sirtest_rollandarchivefile(void) {
    bool pass = true;

    _sir_eqland(pass, roll_and_archive("rollandarchive1", ".log"));
    _sir_eqland(pass, roll_and_archive("rollandarchive2", ""));

    return pass;
}

// Assembly:
pushq %rbx
leaq 0xb9bd(%rip), %rdi      # 0x10b02
leaq 0xb92b(%rip), %rsi      # 0x10a77
callq 0x516a
movl %eax, %ebx
leaq 0xb9b8(%rip), %rdi      # 0x10b12
leaq 0xb166(%rip), %rsi      # 0x102c7
callq 0x516a
andb %bl, %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failwithoutinit
bool sirtest_failwithoutinit(void) {
    bool pass = !sir_info("sir isn't initialized; this needs to fail");

    if (pass)
        PRINT_EXPECTED_ERROR();

    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbx
leaq 0xb5b6(%rip), %rdi      # 0x10b22
xorl %eax, %eax
callq 0x95a2
movl %eax, %ebx
testb %al, %al
jne 0x5583
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
xorb $0x1, %bl
movzbl %bl, %edi
xorl %esi, %esi
popq %rbx
jmp 0x3ac9
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_isinitialized
bool sirtest_isinitialized(void) {

    bool pass = true;

    TEST_MSG_0("checking sir_isinitialized before initialization...");
    _sir_eqland(pass, !sir_isinitialized());

    INIT(si, SIRL_ALL, 0, 0, 0);
    _sir_eqland(pass, si_init);

    TEST_MSG_0("checking sir_isinitialized after initialization...");
    _sir_eqland(pass, sir_isinitialized());

    _sir_eqland(pass, sir_cleanup());

    TEST_MSG_0("checking sir_isinitialized after cleanup...");
    _sir_eqland(pass, !sir_isinitialized());

    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
leaq 0xb5a5(%rip), %rsi      # 0x10b4c
pushq $0x1
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x3410
callq 0x94b3
movl %eax, %ebx
leaq 0x8(%rsp), %r14
movl $0x108, %edx            # imm = 0x108
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x100000, %eax         # imm = 0x100000
movl %eax, 0x4(%r14)
movw $0xff, (%r14)
movl %eax, 0xc(%r14)
xorb $0x1, %bl
movq %r14, %rdi
callq 0x94a9
movl %eax, %r14d
leaq 0xb58c(%rip), %rsi      # 0x10b82
movl %ebp, %edi
xorl %eax, %eax
callq 0x3410
callq 0x94b3
movl %eax, %r15d
callq 0x94ae
movl %eax, %r12d
leaq 0xb5a1(%rip), %rsi      # 0x10bb7
movl %ebp, %edi
xorl %eax, %eax
callq 0x3410
callq 0x94b3
xorb $0x1, %al
andb %r15b, %r12b
andb %al, %r12b
andb %bl, %r14b
andb %r12b, %r14b
movzbl %r14b, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failinittwice
bool sirtest_failinittwice(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    INIT(si2, SIRL_ALL, 0, 0, 0);
    _sir_eqland(pass, !si2_init);

    if (pass)
        PRINT_EXPECTED_ERROR();

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
leaq 0x110(%rsp), %rbx
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x100000, %r14d        # imm = 0x100000
movl %r14d, 0x4(%rbx)
movw $0xff, %r15w
movw %r15w, (%rbx)
movl %r14d, 0xc(%rbx)
movq %rbx, %rdi
callq 0x94a9
movl %eax, %ebp
leaq 0x8(%rsp), %rbx
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31f0
movl %r14d, 0x4(%rbx)
movw %r15w, (%rbx)
movl %r14d, 0xc(%rbx)
movq %rbx, %rdi
callq 0x94a9
movl %eax, %ebx
xorb $0x1, %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x56d1
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
callq 0x94ae
andb %al, %bl
movzbl %bl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failinvalidinitdata
bool sirtest_failinvalidinitdata(void) {
    sirinit si;

    /* fill with bad data. */
    (void)memset(&si, 0xab, sizeof(sirinit));

    TEST_MSG_0("calling sir_init with invalid data...");
    bool pass = !sir_init(&si);

    if (pass)
        PRINT_EXPECTED_ERROR();

    (void)sir_cleanup();
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
leaq 0x8(%rsp), %rbx
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
movl $0xab, %esi
callq 0x31f0
leaq 0xb4cf(%rip), %rsi      # 0x10be5
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x3410
movq %rbx, %rdi
callq 0x94a9
movl %eax, %ebx
testb %al, %al
jne 0x5738
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
xorb $0x1, %bl
callq 0x94ae
movzbl %bl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x110, %rsp            # imm = 0x110
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_initcleanupinit
bool sirtest_initcleanupinit(void) {
    INIT(si1, SIRL_ALL, 0, 0, 0);
    bool pass = si1_init;

    _sir_eqland(pass, sir_info("init called once; testing output..."));
    _sir_eqland(pass, sir_cleanup());

    INIT(si2, SIRL_ALL, 0, 0, 0);
    _sir_eqland(pass, si2_init);

    _sir_eqland(pass, sir_info("init called again after re-init; testing output..."));
    _sir_eqland(pass, sir_cleanup());

    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
leaq 0x110(%rsp), %rbx
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x100000, %r12d        # imm = 0x100000
movl %r12d, 0x4(%rbx)
movw $0xff, %r13w
movw %r13w, (%rbx)
movl %r12d, 0xc(%rbx)
movq %rbx, %rdi
callq 0x94a9
movl %eax, %ebx
leaq 0xb46a(%rip), %rdi      # 0x10c0d
xorl %eax, %eax
callq 0x95a2
movl %eax, %ebp
callq 0x94ae
movl %eax, %r14d
leaq 0x8(%rsp), %r15
movl $0x108, %edx            # imm = 0x108
movq %r15, %rdi
xorl %esi, %esi
callq 0x31f0
movl %r12d, 0x4(%r15)
movw %r13w, (%r15)
movl %r12d, 0xc(%r15)
movq %r15, %rdi
callq 0x94a9
movl %eax, %r15d
leaq 0xb44b(%rip), %rdi      # 0x10c31
xorl %eax, %eax
callq 0x95a2
movl %eax, %r12d
callq 0x94ae
andb %r12b, %al
andb %r14b, %r15b
andb %al, %r15b
andb %bl, %bpl
andb %r15b, %bpl
movzbl %bpl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_initmakeinit
bool sirtest_initmakeinit(void) {
    bool pass = true;

    sirinit si;
    _sir_eqland(pass, sir_makeinit(&si));
    _sir_eqland(pass, sir_init(&si));
    _sir_eqland(pass, sir_info("initialized with sir_makeinit"));
    _sir_eqland(pass, sir_cleanup());

    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x94a4
movl %eax, %ebp
movq %rbx, %rdi
callq 0x94a9
movl %eax, %ebx
leaq 0xb418(%rip), %rdi      # 0x10c64
xorl %eax, %eax
callq 0x95a2
movl %eax, %r14d
callq 0x94ae
andb %r14b, %al
andb %bpl, %bl
andb %al, %bl
movzbl %bl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_failaftercleanup
bool sirtest_failaftercleanup(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    _sir_eqland(pass, sir_cleanup());
    _sir_eqland(pass, !sir_info("already cleaned up; this needs to fail"));

    if (pass)
        PRINT_EXPECTED_ERROR();

    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsp, %rbx
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 0x94a9
movl %eax, %ebp
callq 0x94ae
movl %eax, %ebx
leaq 0xb3c6(%rip), %rdi      # 0x10c82
xorl %eax, %eax
callq 0x95a2
xorb $0x1, %al
andb %bpl, %bl
andb %al, %bl
cmpb $0x1, %bl
jne 0x58d9
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x3ac9
movzbl %bl, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: filter_error
bool filter_error(bool pass, uint16_t err) {
    if (!pass) {
        char msg[SIR_MAXERROR] = {0};
        if (sir_geterror(msg) != err)
            return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
testl %edi, %edi
jne 0x78e0
movl %esi, %ebx
movq %rsp, %r14
xorl %ebp, %ebp
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movq %r14, %rdi
callq 0x94b8
cmpw %bx, %ax
jne 0x78e3
movb $0x1, %bpl
movl %ebp, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_getcpucount
bool sirtest_getcpucount(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    TEST_MSG_0("checking processor counting function...");

    const long cpus = _sir_nprocs_test();
    _sir_eqland(pass, 0 < cpus);

    TEST_MSG("processor(s) detected: %ld", cpus);

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
leaq 0x8(%rsp), %rbx
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 0x94a9
movl %eax, %ebx
leaq 0xa5ad(%rip), %rsi      # 0x13236
pushq $0x1
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x3410
movl %ebp, %edi
callq 0xdeac
testq %rax, %rax
setg %r14b
leaq 0xa5b6(%rip), %rsi      # 0x13260
movl %ebp, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3410
callq 0x94ae
andb %bl, %al
andb %r14b, %al
movzbl %al, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_getversioninfo
bool sirtest_getversioninfo(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    TEST_MSG_0("checking version retrieval functions...");

    const char* str = sir_getversionstring();
    _sir_eqland(pass, _sir_validstrnofail(str));

    TEST_MSG("version as string: '%s'", _SIR_PRNSTR(str));

    uint32_t hex = sir_getversionhex();
    _sir_eqland(pass, 0 != hex);

    TEST_MSG("version as hex: 0x%08"PRIx32"", hex);

    bool prerel = sir_isprerelease();
    TEST_MSG("prerelease: %s", prerel ? "true" : "false");

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsp, %rbx
xorl %r14d, %r14d
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 0x94a9
movl %eax, %ebx
leaq 0xa564(%rip), %rsi      # 0x1327d
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x3410
callq 0x9d3a
testq %rax, %rax
je 0x8d36
cmpb $0x0, (%rax)
setne %r14b
jmp 0x8d3d
leaq 0xa584(%rip), %rax      # 0x132c1
leaq 0xa563(%rip), %rsi      # 0x132a7
pushq $0x1
popq %rbp
movl %ebp, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3410
callq 0x9d42
testl %eax, %eax
setne %r15b
leaq 0xa563(%rip), %rsi      # 0x132c8
movl %ebp, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x3410
callq 0x9d48
leaq 0x9991(%rip), %rcx      # 0x1270d
leaq 0x998f(%rip), %rdx      # 0x12712
testb %al, %al
cmovneq %rcx, %rdx
leaq 0xa551(%rip), %rsi      # 0x132e1
movl %ebp, %edi
xorl %eax, %eax
callq 0x3410
callq 0x94ae
andb %r14b, %al
andb %bl, %al
andb %r15b, %al
movzbl %al, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: sirtest_threadpool
bool sirtest_threadpool(void) {
    INIT(si, SIRL_ALL, SIRO_NOTIME | SIRO_NOHOST | SIRO_NONAME, 0, 0);
    bool pass = si_init;

    static const size_t num_jobs = 30;
    sir_threadpool* pool         = NULL;

    _sir_eqland(pass, _sir_threadpool_create(&pool, NUM_THREADS));
    if (pass) {
        /* dispatch a whole bunch of jobs. */
        for (size_t n = 0; n < num_jobs; n++) {
            sir_threadpool_job* job = calloc(1, sizeof(sir_threadpool_job));
            _sir_eqland(pass, NULL != job);
            if (job) {
                job->fn = &threadpool_pseudojob;
                job->data = (void*)(n + 1);
                _sir_eqland(pass, _sir_threadpool_add_job(pool, job));
                _sir_eqland(pass, sir_info("dispatched job (fn: %"PRIxPTR", data: %p)",
                    (uintptr_t)job->fn, job->data));
            }
        }

        sir_sleep_msec(1000);

        _sir_eqland(pass, sir_info("destroying thread pool..."));
        _sir_eqland(pass, _sir_threadpool_destroy(&pool));
    }

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
leaq 0x10(%rsp), %r14
xorl %ebx, %ebx
movl $0x108, %edx            # imm = 0x108
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x1500, 0x4(%r14)      # imm = 0x1500
movw $0xff, (%r14)
movl $0x100000, 0xc(%r14)    # imm = 0x100000
movq %r14, %rdi
callq 0x94a9
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
andq $0x0, (%rdi)
pushq $0x4
popq %rsi
callq 0xf100
andb %bpl, %al
cmpb $0x1, %al
jne 0x8ebf
movb $0x1, %r13b
pushq $0x1
popq %rbx
pushq $0x10
popq %r14
xorl %r15d, %r15d
cmpq $0x1e, %r15
je 0x8e93
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32b0
testq %rax, %rax
je 0x8e8b
movq %rax, %r12
leaq 0x94(%rip), %rax        # 0x8ee2
movq %rax, (%r12)
incq %r15
movq %r15, 0x8(%r12)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0xf48b
movl %eax, %ebp
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq 0xa479(%rip), %rdi      # 0x132f2
xorl %eax, %eax
callq 0x95a2
andb %r13b, %bpl
andb %al, %bpl
movl %ebp, %r13d
jmp 0x8e2e
incq %r15
xorl %r13d, %r13d
jmp 0x8e2e
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x3f05
leaq 0xa471(%rip), %rdi      # 0x13315
xorl %eax, %eax
callq 0x95a2
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0xf2fb
movl %eax, %ebx
andb %bpl, %bl
andb %r13b, %bl
callq 0x94ae
andb %bl, %al
movzbl %al, %edi
xorl %esi, %esi
callq 0x3ac9
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/tests/tests.c
// Function: threadpool_pseudojob
static bool threadpool_pseudojob(void* arg) {
    char thread_name[SIR_MAXPID] = {0};

    _sir_snprintf_trunc(thread_name, SIR_MAXPID, "pool.%p", arg);
    (void)_sir_setthreadname(thread_name);

    (void)sir_debug("start of pseudo job that does nothing (arg: %p)", arg);
    sir_sleep_msec(1000);
    (void)sir_debug("end of pseudo job that does nothing (arg: %p)", arg);

    return true;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x10, 0x8(%rsp)
movq 0x8(%rsp), %rsi
leaq 0xadde(%rip), %r8       # 0x13ce8
pushq $0x1
popq %rdx
pushq $0x10
popq %rcx
movq %rbx, %r9
xorl %eax, %eax
callq 0x3040
testl %eax, %eax
jne 0x8f23
movq 0x8(%rsp), %rax
leaq 0x10(%rsp), %rdi
callq 0xde59
leaq 0xadbc(%rip), %rdi      # 0x13cf0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x94cd
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x3f05
leaq 0xadd1(%rip), %rdi      # 0x13d20
movq %rbx, %rsi
xorl %eax, %eax
callq 0x94cd
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sirthreadpool.c
// Function: sir_threadpool_destroy
bool _sir_threadpool_destroy(sir_threadpool** pool) {
    if (!pool || !*pool)
        return _sir_seterror(_SIR_E_INVALID);

    bool locked = _sir_mutexlock(&(*pool)->mutex);
    SIR_ASSERT(locked);

    if (locked) {
        _sir_selflog("broadcasting signal to condition var...");
        (*pool)->cancel = true;

        bool bcast = _sir_condbroadcast(&(*pool)->cond);
        SIR_ASSERT_UNUSED(bcast, bcast);

        bool unlock = _sir_mutexunlock(&(*pool)->mutex);
        SIR_ASSERT_UNUSED(unlock, unlock);
    }

    bool destroy = true;
    for (size_t n = 0; n < (*pool)->num_threads; n++) {
        SIR_ASSERT(0 != (*pool)->threads[n]);
        if (0 == (*pool)->threads[n])
            continue;
        _sir_selflog("joining thread %zu of %zu...", n + 1, (*pool)->num_threads);
#if !defined(__WIN__)
        int join = pthread_join((*pool)->threads[n], NULL);
        SIR_ASSERT(0 == join);
        _sir_eqland(destroy, 0 == join);
#else /* __WIN__ */
        DWORD join = WaitForSingleObject((*pool)->threads[n], INFINITE);
        SIR_ASSERT(WAIT_OBJECT_0 == join);
        _sir_eqland(destroy, WAIT_OBJECT_0 == join);
#endif
    }

    _sir_eqland(destroy, _sir_queue_destroy(&(*pool)->jobs));
    SIR_ASSERT(destroy);

    _sir_eqland(destroy, _sir_conddestroy(&(*pool)->cond));
    SIR_ASSERT(destroy);

    _sir_eqland(destroy, _sir_mutexdestroy(&(*pool)->mutex));
    SIR_ASSERT(destroy);

    _sir_safefree(&(*pool)->threads);
    _sir_safefree(pool);

    return destroy;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xf36b
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xf36b
addq $0x48, %rdi
callq 0xdfc7
testb %al, %al
je 0xf33c
movq (%rbx), %rdi
movb $0x1, 0x70(%rdi)
addq $0x18, %rdi
callq 0xf57a
movq (%rbx), %rdi
addq $0x48, %rdi
callq 0xe04f
movb $0x1, %r12b
xorl %r14d, %r14d
movq (%rbx), %rdi
cmpq 0x8(%rdi), %r14
jae 0xf390
movq (%rdi), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0xf366
xorl %esi, %esi
callq 0x3550
testl %eax, %eax
sete %al
andb %al, %r12b
incq %r14
jmp 0xf342
leaq 0x56ae(%rip), %rsi      # 0x14a20
leaq 0x5697(%rip), %rdx      # 0x14a10
movl $0x800c0000, %edi       # imm = 0x800C0000
movl $0x8a, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9d4c
addq $0x10, %rdi
callq 0xf81a
movl %eax, %ebp
movq (%rbx), %rdi
addq $0x18, %rdi
callq 0xf5be
movl %eax, %r14d
movq (%rbx), %rdi
addq $0x48, %rdi
callq 0xe093
movl %eax, %r15d
andb %r14b, %r15b
andb %r12b, %bpl
andb %bpl, %r15b
movq (%rbx), %rdi
callq 0xbcac
movq %rbx, %rdi
callq 0xbcac
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sirthreadpool.c
// Function: sir_threadpool_add_job
bool _sir_threadpool_add_job(sir_threadpool* pool, sir_threadpool_job* job) {
    bool retval = false;

    if (pool && pool->jobs && job && job->fn && job->data) {
        bool locked = _sir_mutexlock(&pool->mutex);
        SIR_ASSERT(locked);

        if (locked) {
            if (_sir_queue_push(pool->jobs, job)) {
                retval = _sir_condbroadcast(&pool->cond);
                _sir_selflog("added job; new size: %zu", _sir_queue_size(pool->jobs));
            }

            bool unlocked = _sir_mutexunlock(&pool->mutex);
            SIR_ASSERT_UNUSED(unlocked, unlocked);
        }
    }

    return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xf4f1
movq %rsi, %r12
xorl %ebx, %ebx
testq %rsi, %rsi
je 0xf4f3
movq %rdi, %r14
cmpq $0x0, 0x10(%rdi)
je 0xf4f3
cmpq $0x0, (%r12)
je 0xf4f1
cmpq $0x0, 0x8(%r12)
je 0xf4f1
leaq 0x48(%r14), %r15
movq %r15, %rdi
callq 0xdfc7
testb %al, %al
je 0xf4f1
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0xf8d9
testb %al, %al
je 0xf501
leaq 0x18(%r14), %rdi
callq 0xf57a
movl %eax, %ebx
movq 0x10(%r14), %rdi
callq 0xf8ab
jmp 0xf503
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %ebx, %ebx
movq %r15, %rdi
callq 0xe04f
jmp 0xf4f3
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sircondition.c
// Function: sir_condcreate
bool _sir_condcreate(sir_condition* cond) {
    bool valid = _sir_validptr(cond);

    if (valid) {
#if !defined(__WIN__)
        int op = pthread_cond_init(cond, NULL);
        valid = 0 == op ? true : _sir_handleerr(op);
#else
        InitializeConditionVariable(cond);
#endif
    }

    return valid;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x551d(%rip), %rsi      # 0x14a38
pushq $0x25
popq %rdx
callq 0xf556
testb %al, %al
je 0xf54e
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3360
testl %eax, %eax
je 0xf552
leaq 0x54fc(%rip), %rsi      # 0x14a38
leaq 0x5505(%rip), %rdx      # 0x14a48
pushq $0x2a
popq %rcx
movl %eax, %edi
popq %rbx
jmp 0x9e45
xorl %eax, %eax
jmp 0xf554
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sircondition.c
// Function: sir_condbroadcast
bool _sir_condbroadcast(sir_condition* cond) {
    bool valid = _sir_validptr(cond);

    if (valid) {
#if !defined(__WIN__)
        int op = pthread_cond_broadcast(cond);
        valid = 0 == op ? true : _sir_handleerr(op);
#else
        WakeAllConditionVariable(cond);
#endif
    }

    return valid;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x54d2(%rip), %rsi      # 0x14a57
pushq $0x45
popq %rdx
callq 0xf556
testb %al, %al
je 0xf5b6
movq %rbx, %rdi
callq 0x30c0
testl %eax, %eax
je 0xf5ba
leaq 0x54b3(%rip), %rsi      # 0x14a57
leaq 0x549d(%rip), %rdx      # 0x14a48
pushq $0x4a
popq %rcx
movl %eax, %edi
popq %rbx
jmp 0x9e45
xorl %eax, %eax
jmp 0xf5bc
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sircondition.c
// Function: sir_conddestroy
bool _sir_conddestroy(sir_condition* cond) {
    bool valid = _sir_validptr(cond);

    if (valid) {
#if !defined(__WIN__)
        int op = pthread_cond_destroy(cond);
        valid = 0 == op ? true : _sir_handleerr(op);
#else
        SIR_UNUSED(cond);
#endif
    }

    return valid;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x54a1(%rip), %rsi      # 0x14a6a
pushq $0x54
popq %rdx
callq 0xf556
testb %al, %al
je 0xf5fa
movq %rbx, %rdi
callq 0x3490
testl %eax, %eax
je 0xf5fe
leaq 0x5482(%rip), %rsi      # 0x14a6a
leaq 0x5459(%rip), %rdx      # 0x14a48
pushq $0x59
popq %rcx
movl %eax, %edi
popq %rbx
jmp 0x9e45
xorl %eax, %eax
jmp 0xf600
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sircondition.c
// Function: sir_condwait_timeout
bool _sir_condwait_timeout(sir_condition* cond, sir_mutex* mutex,
    const sir_wait* howlong) {
    bool valid = _sir_validptr(cond) && _sir_validptr(mutex) && _sir_validptr(howlong);

    if (valid) {
#if !defined(__WIN__)
        int op = pthread_cond_timedwait(cond, mutex, howlong);
        valid = 0 == op ? true : ETIMEDOUT == op ? false : _sir_handleerr(op);
#else
        valid = (FALSE != SleepConditionVariableCS(cond, mutex, *howlong))
            ? true : _sir_handlewin32err(GetLastError());
#endif
    }

    return valid;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x5464(%rip), %rsi      # 0x14a7b
pushq $0x76
popq %rdx
callq 0xf556
testb %al, %al
je 0xf666
leaq 0x5451(%rip), %rsi      # 0x14a7b
pushq $0x76
popq %rdx
movq %r14, %rdi
callq 0xf556
testb %al, %al
je 0xf666
leaq 0x543b(%rip), %rsi      # 0x14a7b
pushq $0x76
popq %rdx
movq %rbx, %rdi
callq 0xf556
testb %al, %al
je 0xf666
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3460
testl %eax, %eax
je 0xf66e
cmpl $0x6e, %eax
jne 0xf672
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movb $0x1, %al
jmp 0xf668
leaq 0x5402(%rip), %rsi      # 0x14a7b
leaq 0x53c8(%rip), %rdx      # 0x14a48
pushq $0x7b
popq %rcx
movl %eax, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x9e45
nop
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sirqueue.c
// Function: sir_queue_node_create
sir_queue_node* _sir_queue_node_create(void* data) {
    sir_queue_node* retval = calloc(1, sizeof(sir_queue_node));
    if (!retval)
        (void)_sir_handleerr(errno);
    else
        retval->data = data;

    return retval;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x32b0
movq %rax, %rbx
testq %rax, %rax
je 0xf6e8
movq %r14, 0x8(%rbx)
jmp 0xf705
callq 0x3080
movl (%rax), %edi
leaq 0x53b9(%rip), %rsi      # 0x14aaf
leaq 0x53c9(%rip), %rdx      # 0x14ac6
pushq $0x27
popq %rcx
callq 0x9e45
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sirqueue.c
// Function: sir_queue_node_destroy
bool _sir_queue_node_destroy(sir_queue_node** node, void** data) {
    bool valid = _sir_validptrptr(node) && _sir_validptr(*node);

    if (valid) {
        if (data)
            *data = (*node)->data;

        _sir_safefree(node);
    }

    return valid;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x53b0(%rip), %rsi      # 0x14ad1
pushq $0x2f
popq %rdx
callq 0xf76b
testb %al, %al
je 0xf761
movq (%rbx), %rdi
leaq 0x539a(%rip), %rdx      # 0x14ad1
pushq $0x1
popq %rsi
pushq $0x2f
popq %rcx
callq 0xf78f
testb %al, %al
je 0xf761
testq %r14, %r14
je 0xf755
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, (%r14)
movq %rbx, %rdi
callq 0xbcac
movb $0x1, %al
jmp 0xf763
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sirqueue.c
// Function: sir_queue_create
bool _sir_queue_create(sir_queue** q) {
    bool valid = _sir_validptrptr(q);

    if (valid) {
        *q = calloc(1, sizeof(sir_queue));
        if (!_sir_validptrnofail(*q))
            (void)_sir_handleerr(errno);
    }

    return valid && _sir_validptrnofail(*q);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x531d(%rip), %rsi      # 0x14ae9
pushq $0x3c
popq %rdx
callq 0xf76b
testb %al, %al
je 0xf816
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0x32b0
movq %rax, %rcx
movq %rax, (%rbx)
movb $0x1, %al
testq %rcx, %rcx
jne 0xf818
callq 0x3080
movl (%rax), %edi
leaq 0x52eb(%rip), %rsi      # 0x14ae9
leaq 0x52c1(%rip), %rdx      # 0x14ac6
pushq $0x41
popq %rcx
callq 0x9e45
cmpq $0x0, (%rbx)
setne %al
jmp 0xf818
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sirqueue.c
// Function: sir_queue_destroy
bool _sir_queue_destroy(sir_queue** q) {
    bool valid = _sir_validptrptr(q) && _sir_validptr(*q);

    if (valid) {
        sir_queue_node* next = (*q)->head;
        while (next) {
            sir_queue_node* this_node = next;
            void* data                = NULL;
            next                      = this_node->next;

            if (_sir_queue_node_destroy(&this_node, &data))
                _sir_safefree(&data);
        }

        _sir_safefree(q);
    }

    return valid;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x52cc(%rip), %rsi      # 0x14afb
pushq $0x48
popq %rdx
callq 0xf76b
testb %al, %al
je 0xf891
movq (%rbx), %rdi
leaq 0x52b6(%rip), %rdx      # 0x14afb
pushq $0x1
popq %rsi
pushq $0x48
popq %rcx
callq 0xf78f
testb %al, %al
je 0xf891
movq (%rbx), %rax
movq (%rax), %r12
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
testq %r12, %r12
je 0xf895
movq %r12, 0x10(%rsp)
andq $0x0, 0x8(%rsp)
movq (%r12), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0xf710
testb %al, %al
je 0xf864
movq %r15, %rdi
callq 0xbcac
jmp 0xf864
xorl %eax, %eax
jmp 0xf89f
movq %rbx, %rdi
callq 0xbcac
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aremmell[P]libsir/src/sirqueue.c
// Function: sir_queue_push
bool _sir_queue_push(sir_queue* q, void* data) {
    bool retval = false;

    if (_sir_validptr(q)) {
        if (!q->head) {
            q->head = _sir_queue_node_create(data);
            retval = NULL != q->head;
        } else {
            sir_queue_node* next = q->head;
            while (next) {
                if (!next->next) {
                    next->next = _sir_queue_node_create(data);
                    if (next->next) {
                        retval = true;
                        break;
                    }
                }
                next = next->next;
            }
        }
    }

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x5221(%rip), %rdx      # 0x14b0e
pushq $0x1
popq %rsi
pushq $0x70
popq %rcx
callq 0xf78f
testb %al, %al
je 0xf92a
movq (%r14), %r15
testq %r15, %r15
je 0xf92e
testq %r15, %r15
setne %bpl
je 0xf940
movq %r15, %r14
movq (%r15), %r15
testq %r15, %r15
jne 0xf904
movq %rbx, %rdi
callq 0xf6c8
movq %rax, (%r14)
testq %rax, %rax
je 0xf904
jmp 0xf940
xorl %ebp, %ebp
jmp 0xf940
movq %rbx, %rdi
callq 0xf6c8
movq %rax, (%r14)
testq %rax, %rax
setne %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_09/scdu.c
// Function: crypt_std
void crypt_std(char *text, size_t n)
{
	int i, c;
	char base;

	for (i = 0; i < n; i++) {
		if ((text[i] >= 'a') && (text[i] <= 'z'))
			base = 'a';
		else if ((text[i] >= 'A') && (text[i] <= 'Z'))
			base = 'A';
		else
			continue;
		
		c = text[i] - base;
		c = (c + 1) % 26;
		text[i] = c + base;
	}
}

// Assembly:
xorl %ecx, %ecx
movb $0x1a, %dl
cmpq %rcx, %rsi
je 0x11f9
movb (%rdi,%rcx), %al
leal -0x61(%rax), %r9d
movb $0x61, %r8b
cmpb $0x1a, %r9b
jb 0x11e2
leal -0x41(%rax), %r9d
movb $0x41, %r8b
cmpb $0x19, %r9b
ja 0x11f4
subb %r8b, %al
incb %al
cbtw
idivb %dl
movsbl %ah, %eax
addb %r8b, %al
movb %al, (%rdi,%rcx)
incq %rcx
jmp 0x11c0
retq
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_09/scdu.c
// Function: load_funcs
void load_funcs(char *module, func_t *crypt, func_t *decrypt)
{
	void *handler;

	if (module == NULL) {
		/* Use standard functions */
		*crypt = crypt_std;
		*decrypt = decrypt_std;

		return;
	}

	/* Try to load external functions */
	handler = dlopen(module, RTLD_NOW | RTLD_GLOBAL);
	if (!handler) {
		fprintf(stderr,
			"cannot load module %s\n", module);
		exit(EXIT_FAILURE);
	}

	*crypt = (func_t) dlsym(handler, "mod_crypt");
	if (!*crypt) {
		fprintf(stderr,
			"cannot find crypt() function: %s\n", dlerror());
		exit(EXIT_FAILURE);
	}

	*decrypt = (func_t) dlsym(handler, "mod_decrypt");
	if (!*crypt) {
		fprintf(stderr,
			"cannot find decrypt() function: %s\n", dlerror());
		exit(EXIT_FAILURE);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
testq %rdi, %rdi
je 0x12ab
movq %rdi, %r15
movl $0x102, %esi            # imm = 0x102
callq 0x1060
testq %rax, %rax
je 0x12cb
movq %rax, %r12
leaq 0xdb0(%rip), %rsi       # 0x201b
movq %rax, %rdi
callq 0x1090
movq %rax, (%r14)
testq %rax, %rax
je 0x12e1
leaq 0xdc5(%rip), %rsi       # 0x2047
movq %r12, %rdi
callq 0x1090
movq %rax, (%rbx)
cmpq $0x0, (%r14)
jne 0x12bf
movq 0x2d5e(%rip), %rax      # 0x3ff8
movq (%rax), %rbx
callq 0x1030
leaq 0xdaa(%rip), %rsi       # 0x2053
jmp 0x12f7
leaq -0xf6(%rip), %rax       # 0x11bc
movq %rax, (%r14)
leaq -0xc2(%rip), %rax       # 0x11fa
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x2d26(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd28(%rip), %rsi       # 0x2004
movq %r15, %rdx
jmp 0x12fd
movq 0x2d10(%rip), %rax      # 0x3ff8
movq (%rax), %rbx
callq 0x1030
leaq 0xd2e(%rip), %rsi       # 0x2025
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rdi
callq 0x10a0