LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_emerg
bool sir_emerg(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_EMERG, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2e5a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2e96
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x1, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2eb5
leaq 0x6663(%rip), %rsi      # 0x9500
leaq 0x661c(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x7e, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_sysloglevels
bool sir_sysloglevels(sir_levels levels) {
#if !defined(SIR_NO_SYSTEM_LOGGERS)
    _sir_defaultlevels(&levels, sir_syslog_def_lvls);
    sir_update_config_data data = {SIRU_LEVELS, &levels, NULL, NULL, NULL};
    return _sir_writeinit(&data, _sir_sysloglevels);
#else
    SIR_UNUSED(levels);
    return _sir_seterror(_SIR_E_UNAVAIL);
#endif
}

// Assembly:
subq $0x38, %rsp
cmpl $0x100, %edi            # imm = 0x100
movl $0x3f, %eax
cmovnel %edi, %eax
leaq 0xe(%rsp), %rcx
movw %ax, (%rcx)
leaq 0x10(%rsp), %rdi
movl $0x1, (%rdi)
movq %rcx, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
leaq 0x34d3(%rip), %rsi      # 0x65c7
callq 0x680e
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_syslogopts
bool sir_syslogopts(sir_options opts) {
#if !defined(SIR_NO_SYSTEM_LOGGERS)
    _sir_defaultopts(&opts, sir_syslog_def_opts);
    sir_update_config_data data = {SIRU_OPTIONS, NULL, &opts, NULL, NULL};
    return _sir_writeinit(&data, _sir_syslogopts);
#else
    SIR_UNUSED(opts);
    return _sir_seterror(_SIR_E_UNAVAIL);
#endif
}

// Assembly:
subq $0x38, %rsp
cmpl $0x100000, %edi         # imm = 0x100000
movl $0x7f00, %eax           # imm = 0x7F00
cmovnel %edi, %eax
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x10(%rsp), %rdi
movl $0x2, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rcx, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
leaq 0x3545(%rip), %rsi      # 0x6681
callq 0x680e
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirerrors.c
// Function: _sir_seterror
bool __sir_seterror(uint32_t err, const char* func, const char* file, uint32_t line) {
    if (_sir_validerror(err)) {
        _sir_te.lasterror = err;
        _sir_te.loc.func  = func;
        _sir_te.loc.file  = file;
        _sir_te.loc.line  = line;

        if (_SIR_E_PLATFORM != err) {
            _sir_te.os_code = 0;
            _sir_resetstr(_sir_te.os_msg);
        }
    }
#if defined(DEBUG) && defined(SIR_SELFLOG)
    if (_SIR_E_NOERROR != err) {
        char errmsg[SIR_MAXERROR] = {0};
        _sir_geterror(errmsg);
        __sir_selflog(func, file, line, "%s", errmsg);
    }
#endif
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edi, %eax
andl $0x8fffffff, %eax       # imm = 0x8FFFFFFF
testl %edi, %edi
setns %cl
cmpl $0x8fff0001, %eax       # imm = 0x8FFF0001
setae %al
orb %cl, %al
jne 0x3229
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movq %fs:0x0, %rax
movl %ebp, -0x150(%rax)
movq %r15, -0x48(%rax)
movq %r14, -0x40(%rax)
movl %ebx, -0x38(%rax)
cmpl $0x80170000, %ebp       # imm = 0x80170000
je 0x3229
leaq -0x150(%rax), %rax
movl $0x0, 0x4(%rax)
movb $0x0, 0x8(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirerrors.c
// Function: sir_geterrorinfo
void __sir_setoserror(int code, const char* msg, const char* func, const char* file, uint32_t line) {
    _sir_te.os_code = code;
    _sir_resetstr(_sir_te.os_msg);

    if (_sir_validstrnofail(msg))
        (void)_sir_strncpy(_sir_te.os_msg, SIR_MAXERROR, msg, SIR_MAXERROR);

    (void)__sir_seterror(_SIR_E_PLATFORM, func, file, line);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x35fa
movq %rdi, %rbx
movl $0x220, %edx            # imm = 0x220
xorl %esi, %esi
callq 0x21b0
movq %fs:0x0, %rax
leaq -0x148(%rax), %r14
movups 0x100(%r14), %xmm0
movups %xmm0, (%rbx)
movl 0x110(%r14), %eax
movl %eax, 0x10(%rbx)
movl -0x4(%r14), %eax
movl %eax, 0x14(%rbx)
cmpb $0x0, (%r14)
leaq 0x18(%rbx), %rdi
leaq 0x5dc6(%rip), %rdx      # 0x9387
cmovneq %r14, %rdx
movl $0x100, %esi            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
callq 0x57c8
movw $0x0, 0x118(%rbx)
movl -0x8(%r14), %ecx
cmpl $0x800c0000, %ecx       # imm = 0x800C0000
jne 0x3647
movl $0x800c0000, %esi       # imm = 0x800C0000
leaq 0xa6cb(%rip), %rax      # 0xdcc0
jmp 0x36a9
movq %fs:0x0, %rax
movl $0x800b0000, %ecx       # imm = 0x800B0000
movq %rcx, -0x150(%rax)
leaq 0x5f3c(%rip), %rcx      # 0x9555
movq %rcx, -0x48(%rax)
leaq 0x5eed(%rip), %rcx      # 0x9514
movq %rcx, -0x40(%rax)
movl $0xec, -0x38(%rax)
movb $0x0, -0x148(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x17, %r8d
movl $0xb, %edx
movl $0x800c0000, %esi       # imm = 0x800C0000
xorl %edi, %edi
leaq 0xa5b0(%rip), %rax      # 0xdc10
cmpq %r8, %rdi
je 0x363f
cmpl %ecx, %esi
setb %sil
leaq -0x1(%rdx), %r9
cmpq %rdi, %r9
setb %r10b
orb %sil, %r10b
cmpb $0x1, %r10b
jne 0x368d
cmpq %r8, %rdx
jae 0x363f
incq %rdx
movq %rdx, %rdi
movq %r8, %r9
leaq (%r9,%rdi), %rdx
shrq %rdx
movq %rdx, %r10
shlq $0x4, %r10
movl (%r10,%rax), %esi
movq %r9, %r8
cmpl %ecx, %esi
jne 0x3660
addq %r10, %rax
movl %esi, %ecx
shrl $0x10, %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movw %cx, 0x118(%rbx)
addq $0x11a, %rbx            # imm = 0x11A
cmpl $0x80170000, %esi       # imm = 0x80170000
jne 0x36d3
leaq 0x5e96(%rip), %rdx      # 0x9567
jmp 0x36d7
movq 0x8(%rax), %rdx
movl $0x100, %esi            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x57c8
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirerrors.c
// Function: _sir_handleerr
bool __sir_handleerr(int code, const char* func, const char* file, uint32_t line) {
    if (SIR_E_NOERROR != code) {
        char message[SIR_MAXERROR] = {0};
        int finderr                = 0;
        errno                      = SIR_E_NOERROR;

#if defined(__HAVE_XSI_STRERROR_R__)
        _sir_selflog("using XSI strerror_r");
        finderr = strerror_r(code, message, SIR_MAXERROR);
# if defined(__HAVE_XSI_STRERROR_R_ERRNO__)
        _sir_selflog("using XSI strerror_r for glibc < 2.13");
        if (finderr == -1)
            finderr = errno;
# endif
#elif defined(__HAVE_GNU_STRERROR_R__)
        _sir_selflog("using GNU strerror_r");
        const char* tmp = strerror_r(code, message, SIR_MAXERROR);
        if (tmp != message)
            (void)_sir_strncpy(message, SIR_MAXERROR, tmp, SIR_MAXERROR);
#elif defined(__HAVE_STRERROR_S__)
        _sir_selflog("using strerror_s");
        finderr = (int)strerror_s(message, SIR_MAXERROR, code);
#else
        _sir_selflog("using strerror");
        const char* tmp = strerror(code);
        (void)_sir_strncpy(message, SIR_MAXERROR, tmp, strnlen(tmp, SIR_MAXERROR));
#endif
        if (0 == finderr) { //-V547
            __sir_setoserror(code, message, func, file, line);
#if defined(__HAVE_XSI_STRERROR_R__) || defined(__HAVE_STRERROR_S__)
        } else {
            /* Per my reading of the man pages, GNU strerror_r and normal strerror "can't fail";
             * they simply return a string such as "Unknown nnn error" if unable to look up an
             * error code.
             */
# if defined(__HAVE_XSI_STRERROR_R__)
            _sir_selflog("strerror_r failed! error: %d", finderr);
# elif defined(__HAVE_STRERROR_S__)
            _sir_selflog("strerror_s failed! error: %d", finderr);
# endif
#endif
        }
    }
    return false;
}

// Assembly:
cmpl $0x1, %edi
je 0x3390
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movq %rsp, %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x21b0
callq 0x2080
movl $0x1, (%rax)
movl $0x100, %edx            # imm = 0x100
movl %ebp, %edi
movq %r12, %rsi
callq 0x22d0
cmpq %r12, %rax
je 0x3324
movq %rsp, %rdi
movl $0x100, %esi            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
movq %rax, %rdx
callq 0x57c8
movq %fs:0x0, %rax
leaq -0x150(%rax), %r12
movl %ebp, 0x4(%r12)
movb $0x0, 0x8(%r12)
cmpb $0x0, (%rsp)
je 0x3361
leaq -0x148(%rax), %rdi
movq %rsp, %rdx
movl $0x100, %esi            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
callq 0x57c8
movl $0x80170000, (%r12)     # imm = 0x80170000
movq %r15, 0x108(%r12)
movq %r14, 0x110(%r12)
movl %ebx, 0x118(%r12)
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirerrors.c
// Function: sir_reset_tls_error
void _sir_reset_tls_error(void) {
    _sir_te.lasterror = _SIR_E_NOERROR;
    _sir_te.os_code   = 0;
    _sir_resetstr(_sir_te.os_msg);
    _sir_te.loc.func = SIR_UNKNOWN;
    _sir_te.loc.file = SIR_UNKNOWN;
    _sir_te.loc.line = 0U;
}

// Assembly:
pushq %rax
movq %fs:0x0, %rax
movl $0x80010000, %ecx       # imm = 0x80010000
movq %rcx, -0x150(%rax)
movb $0x0, -0x148(%rax)
leaq 0x5c70(%rip), %rcx      # 0x9387
movq %rcx, -0x48(%rax)
movq %rcx, -0x40(%rax)
movl $0x0, -0x38(%rax)
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_addfile
sirfileid _sir_addfile(const char* path, sir_levels levels, sir_options opts) {
    (void)_sir_seterror(_SIR_E_NOERROR);

    if (!_sir_sanity())
        return 0U;

    _SIR_LOCK_SECTION(sirfcache, sfc, SIRMI_FILECACHE, 0U);

    _sir_defaultlevels(&levels, sir_file_def_lvls);
    _sir_defaultopts(&opts, sir_file_def_opts);

    sirfileid retval = _sir_fcache_add(sfc, path, levels, opts);
    _SIR_UNLOCK_SECTION(SIRMI_FILECACHE);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x60ba(%rip), %rsi      # 0x9801
leaq 0x60c0(%rip), %rdx      # 0x980e
movl $0x80010000, %edi       # imm = 0x80010000
movl $0x28, %ecx
callq 0x31c0
callq 0x6430
testb %al, %al
je 0x37d0
movl $0x1, %edi
callq 0x6064
testq %rax, %rax
je 0x37b3
movzwl %r14w, %ecx
cmpl $0x100, %ecx            # imm = 0x100
movl $0xff, %edx
cmovnel %ecx, %edx
cmpl $0x100000, %ebp         # imm = 0x100000
movl $0x400, %ecx            # imm = 0x400
cmovnel %ebp, %ecx
movzwl %dx, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x37d7
movl %eax, %ebx
movl $0x1, %edi
callq 0x6248
movl %ebx, %eax
jmp 0x37d2
leaq 0x6047(%rip), %rsi      # 0x9801
leaq 0x604d(%rip), %rdx      # 0x980e
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0x2d, %ecx
callq 0x31c0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_updatefile
bool _sir_updatefile(sirfileid id, const sir_update_config_data* data) {
    (void)_sir_seterror(_SIR_E_NOERROR);

    if (!_sir_sanity() || !_sir_validfileid(id) || !_sir_validupdatedata(data))
        return false;

    _SIR_LOCK_SECTION(const sirfcache, sfc, SIRMI_FILECACHE, false);
    bool retval = _sir_fcache_update(sfc, id, data);
    _SIR_UNLOCK_SECTION(SIRMI_FILECACHE);

    return retval;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x5eaf(%rip), %rsi      # 0x981d
leaq 0x5e99(%rip), %rdx      # 0x980e
movl $0x80010000, %edi       # imm = 0x80010000
movl $0x39, %ecx
callq 0x31c0
callq 0x6430
xorb $0x1, %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
jne 0x39fc
leaq 0x5e82(%rip), %rsi      # 0x981d
leaq 0x5e6c(%rip), %rdx      # 0x980e
movq %rbx, %rdi
movl $0x3b, %ecx
callq 0x5579
testb %al, %al
je 0x39fc
movl $0x1, %edi
callq 0x6064
testq %rax, %rax
je 0x39df
movq %rax, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x3a05
movl %eax, %ebx
movl $0x1, %edi
callq 0x6248
movl %ebx, %eax
jmp 0x39fe
leaq 0x5e37(%rip), %rsi      # 0x981d
leaq 0x5e21(%rip), %rdx      # 0x980e
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0x3e, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_fcache_update
bool _sir_fcache_update(const sirfcache* sfc, sirfileid id, const sir_update_config_data* data) {
    bool retval = _sir_validptr(sfc) && _sir_validfileid(id) && _sir_validupdatedata(data);

    if (retval) {
        sirfile* found = _sir_fcache_find(sfc, (const void*)&id, _sir_fcache_pred_id);
        retval = found ? _sirfile_update(found, data) : _sir_seterror(_SIR_E_NOITEM);
    }

    return retval;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testq %rdi, %rdi
je 0x3a37
testl %ebp, %ebp
je 0x3a54
leaq 0x5f2c(%rip), %rsi      # 0x994d
leaq 0x5de6(%rip), %rdx      # 0x980e
movq %rbx, %rdi
movl $0x1bc, %ecx            # imm = 0x1BC
callq 0x5579
jmp 0x3a56
leaq 0x5f0f(%rip), %rsi      # 0x994d
leaq 0x5dc9(%rip), %rdx      # 0x980e
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x1bc, %ecx            # imm = 0x1BC
callq 0x31c0
xorl %eax, %eax
testb %al, %al
je 0x3a98
testq %r14, %r14
je 0x3a9d
movq 0x80(%r14), %rax
testq %rax, %rax
setne %cl
je 0x3abc
movq (%r14), %rdi
cmpl %ebp, 0x18(%rdi)
je 0x3abc
movl $0x1, %edx
movq %rdx, %rcx
cmpq %rdx, %rax
je 0x3a90
movq (%r14,%rcx,8), %rdi
leaq 0x1(%rcx), %rdx
cmpl %ebp, 0x18(%rdi)
jne 0x3a7b
cmpq %rax, %rcx
setb %cl
jmp 0x3abc
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x5ede(%rip), %rsi      # 0x9982
leaq 0x5d63(%rip), %rdx      # 0x980e
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x237, %ecx            # imm = 0x237
callq 0x31c0
jmp 0x3ac0
testb %cl, %cl
jne 0x3ac2
xorl %edi, %edi
testq %rdi, %rdi
je 0x3ad3
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x487d
leaq 0x5e73(%rip), %rsi      # 0x994d
leaq 0x5d2d(%rip), %rdx      # 0x980e
movl $0x80050000, %edi       # imm = 0x80050000
movl $0x1c0, %ecx            # imm = 0x1C0
popq %rbx
popq %r14
popq %rbp
jmp 0x31c0
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_remfile
bool _sir_remfile(sirfileid id) {
    (void)_sir_seterror(_SIR_E_NOERROR);

    if (!_sir_sanity() || !_sir_validfileid(id))
        return false;

    _SIR_LOCK_SECTION(sirfcache, sfc, SIRMI_FILECACHE, false);
    bool retval = _sir_fcache_rem(sfc, id);
    _SIR_UNLOCK_SECTION(SIRMI_FILECACHE);

    return retval;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x5d2f(%rip), %rsi      # 0x982d
leaq 0x5d09(%rip), %rdx      # 0x980e
movl $0x80010000, %edi       # imm = 0x80010000
movl $0x46, %ecx
callq 0x31c0
callq 0x6430
xorb $0x1, %al
testl %ebx, %ebx
sete %cl
orb %al, %cl
jne 0x3b6a
movl $0x1, %edi
callq 0x6064
testq %rax, %rax
je 0x3b4d
movq %rax, %rdi
movl %ebx, %esi
callq 0x3b6e
movl %eax, %ebx
movl $0x1, %edi
callq 0x6248
movl %ebx, %eax
jmp 0x3b6c
leaq 0x5cd9(%rip), %rsi      # 0x982d
leaq 0x5cb3(%rip), %rdx      # 0x980e
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0x4b, %ecx
callq 0x31c0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_fcache_rem
bool _sir_fcache_rem(sirfcache* sfc, sirfileid id) {
    bool retval = _sir_validptr(sfc) && _sir_validfileid(id);

    if (retval) {
        bool found = false;
        for (size_t n = 0; n < sfc->count; n++) {
            SIR_ASSERT(_sirfile_validate(sfc->files[n]));

            if (sfc->files[n]->id == id) {
                _sir_selflog("removing file (path: '%s', id: %"PRIx32"); count = %zu",
                    sfc->files[n]->path, sfc->files[n]->id, sfc->count - 1);

                _sirfile_destroy(&sfc->files[n]);
                _sir_fcache_shift(sfc, n);

                sfc->count--;
                found = true;
                break;
            }
        }

        if (!found)
            retval = _sir_seterror(_SIR_E_NOITEM);
    }

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x3b9c
leaq 0x5dda(%rip), %rsi      # 0x9960
leaq 0x5c81(%rip), %rdx      # 0x980e
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x1c7, %ecx            # imm = 0x1C7
callq 0x31c0
testq %rbx, %rbx
setne %al
testl %ebp, %ebp
setne %r14b
andb %al, %r14b
cmpb $0x1, %r14b
jne 0x3c15
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x3bd7
xorl %r15d, %r15d
movq %rbx, %rdi
movq (%rdi), %rcx
cmpl %ebp, 0x18(%rcx)
je 0x3bfe
incq %r15
addq $0x8, %rdi
cmpq %r15, %rax
jne 0x3bc3
leaq 0x5d82(%rip), %rsi      # 0x9960
leaq 0x5c29(%rip), %rdx      # 0x980e
movl $0x80050000, %edi       # imm = 0x80050000
movl $0x1dc, %ecx            # imm = 0x1DC
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x31c0
callq 0x3e77
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4a8e
decq 0x80(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/include/sir/helpers.h
// Function: sirfile_update
static inline
bool __sir_validptr(const void* restrict p, bool fail, const char* func,
    const char* file, uint32_t line) {
    bool valid = NULL != p;
    if (fail && !valid) {
        (void)__sir_seterror(_SIR_E_NULLPTR, func, file, line);
        SIR_ASSERT(!valid && fail);
    }
    return valid;
}

// Assembly:
testq %rdi, %rdi
je 0x489f
cmpq $0x0, 0x10(%rdi)
je 0x489f
movq (%rdi), %rax
testq %rax, %rax
je 0x489f
cmpb $0x0, (%rax)
je 0x489f
cmpl $0x0, 0x18(%rdi)
setne %al
jmp 0x48a1
xorl %eax, %eax
testb %al, %al
je 0x48d4
movl (%rsi), %ecx
movl %ecx, %eax
andl $0x1, %eax
je 0x48bf
movq 0x8(%rsi), %rdx
movzwl (%rdx), %edx
cmpw %dx, 0x8(%rdi)
je 0x48bf
movw %dx, 0x8(%rdi)
testb $0x2, %cl
je 0x48d4
movq 0x10(%rsi), %rax
movl (%rax), %ecx
movb $0x1, %al
cmpl %ecx, 0xc(%rdi)
je 0x48d4
movl %ecx, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sirfile_destroy
void _sirfile_destroy(sirfile** sf) {
    if (sf && *sf) {
        _sirfile_close(*sf);
        _sir_safefree(&(*sf)->path);
        _sir_safefree(sf);
    }
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x3ea2
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3ea2
addq $0x10, %rdi
callq 0x54ef
movq (%rbx), %rdi
callq 0x5490
movq %rbx, %rdi
popq %rbx
jmp 0x5490
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sirfile_write
bool _sirfile_write(sirfile* sf, const char* output) {
    bool retval = _sirfile_validate(sf) && _sir_validstr(output);

    if (retval) {
        if (sf->writes_since_size_chk++ > SIR_FILE_CHK_SIZE_WRITES) {
            sf->writes_since_size_chk = 0;
            _sirfile_rollifneeded(sf);
        }

        size_t writeLen = strnlen(output, SIR_MAXOUTPUT);
        size_t wrote    = fwrite(output, sizeof(char), writeLen, sf->f);

        SIR_ASSERT(wrote == writeLen);

        if (wrote < writeLen) {
            (void)_sir_handleerr(errno);
            clearerr(sf->f);
        }

        retval = wrote == writeLen;
    }

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
je 0x3ef5
cmpq $0x0, 0x10(%rbx)
je 0x3ef5
movq (%rbx), %rax
testq %rax, %rax
je 0x3ef5
cmpb $0x0, (%rax)
je 0x3ef5
cmpl $0x0, 0x18(%rbx)
je 0x3ef5
testq %r14, %r14
je 0x3f81
cmpb $0x0, (%r14)
setne %bpl
jmp 0x3f83
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x3f74
movl 0x1c(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x1c(%rbx)
cmpl $0xb, %eax
jl 0x3f19
movl $0x0, 0x1c(%rbx)
movq %rbx, %rdi
callq 0x3fae
movl $0x10e7, %esi           # imm = 0x10E7
movq %r14, %rdi
callq 0x21c0
movq %rax, %r15
movq 0x10(%rbx), %rcx
movl $0x1, %esi
movq %r14, %rdi
movq %rax, %rdx
callq 0x23d0
movq %rax, %r14
cmpq %r15, %rax
jae 0x3f6d
callq 0x2080
movl (%rax), %edi
leaq 0x5905(%rip), %rsi      # 0x9858
leaq 0x58b4(%rip), %rdx      # 0x980e
movl $0x93, %ecx
callq 0x32bc
movq 0x10(%rbx), %rdi
callq 0x2260
cmpq %r15, %r14
sete %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
testb %bpl, %bpl
jne 0x3ef7
leaq 0x58c5(%rip), %rsi      # 0x9858
leaq 0x5874(%rip), %rdx      # 0x980e
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x85, %ecx
callq 0x31c0
jmp 0x3ef7
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sirfile_writeheader
bool _sirfile_writeheader(sirfile* sf, const char* msg) {
    bool retval = _sirfile_validate(sf) && _sir_validstr(msg);

    if (retval) {
        time_t now = -1;
        (void)time(&now);

        char timestamp[SIR_MAXTIME] = {0};
        bool fmttime = _sir_formattime(now, timestamp, SIR_FHTIMEFORMAT);
        if (!fmttime)
            return false;

        char header[SIR_MAXFHEADER] = {0};
        (void)snprintf(header, SIR_MAXFHEADER, SIR_FHFORMAT, msg, timestamp);

        retval = _sirfile_write(sf, header);
    }

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
je 0x40e0
cmpq $0x0, 0x10(%rbx)
je 0x40e0
movq (%rbx), %rax
testq %rax, %rax
je 0x40e0
cmpb $0x0, (%rax)
je 0x40e0
cmpl $0x0, 0x18(%rbx)
je 0x40e0
testq %r14, %r14
je 0x41f6
cmpb $0x0, (%r14)
setne %bpl
jmp 0x41f8
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x41e4
leaq 0x10(%rsp), %r15
movq $-0x1, (%r15)
movq %r15, %rdi
callq 0x22b0
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq (%r15), %rax
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x60(%rsp), %rsi
callq 0x20b0
testq %rax, %rax
je 0x4152
leaq 0x5745(%rip), %rdx      # 0x987c
leaq 0x20(%rsp), %rdi
movl $0x40, %esi
movq %rax, %rcx
callq 0x2320
testq %rax, %rax
setne %r12b
jmp 0x4174
callq 0x2080
movl (%rax), %edi
leaq 0x5868(%rip), %rsi      # 0x99c8
leaq 0x5870(%rip), %rdx      # 0x99d7
movl $0x196, %ecx            # imm = 0x196
callq 0x32bc
xorl %r12d, %r12d
testb %r12b, %r12b
je 0x41e1
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r15
movaps %xmm0, 0x70(%r15)
movaps %xmm0, 0x60(%r15)
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0x56de(%rip), %r8       # 0x9896
movl $0x80, %esi
movl $0x80, %ecx
movq %r15, %rdi
movl $0x1, %edx
movq %r14, %r9
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3eb3
movl %eax, %ebp
andb %r12b, %bpl
movl %ebp, %eax
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
testb %bpl, %bpl
jne 0x40e2
leaq 0x565f(%rip), %rsi      # 0x9867
leaq 0x55ff(%rip), %rdx      # 0x980e
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x9e, %ecx
callq 0x31c0
jmp 0x40e2
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sirfile_needsroll
bool _sirfile_needsroll(sirfile* sf) {
    bool retval = _sirfile_validate(sf);

    if (retval) {
        struct stat st = {0};
        int getstat    = fstat(fileno(sf->f), &st);

        if (0 != getstat) { /* if fstat fails, try stat on the path. */
            getstat = stat(sf->path, &st);
            if (0 != getstat)
                return _sir_handleerr(errno);
        }

        retval = st.st_size + BUFSIZ >= SIR_FROLLSIZE ||
            SIR_FROLLSIZE - (st.st_size + BUFSIZ) <= BUFSIZ;
    }

    return retval;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x4252
cmpq $0x0, 0x10(%rbx)
je 0x4252
movq (%rbx), %rax
testq %rax, %rax
je 0x4252
cmpb $0x0, (%rax)
je 0x4252
cmpl $0x0, 0x18(%rbx)
setne %al
jmp 0x4254
xorl %eax, %eax
testb %al, %al
je 0x42c1
leaq 0x8(%rsp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x21b0
movq 0x10(%rbx), %rdi
callq 0x22c0
movl %eax, %edi
movq %r14, %rsi
callq 0x2430
testl %eax, %eax
je 0x42b5
movq (%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2250
testl %eax, %eax
je 0x42b5
callq 0x2080
movl (%rax), %edi
leaq 0x560a(%rip), %rsi      # 0x98ac
leaq 0x5565(%rip), %rdx      # 0x980e
movl $0xbc, %ecx
callq 0x32bc
jmp 0x42c1
cmpq $0x4fc000, 0x38(%rsp)   # imm = 0x4FC000
setge %al
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sirfile_archive
bool _sirfile_archive(sirfile* sf, const char* newpath) {
    bool retval = _sirfile_validate(sf) && _sir_validstr(newpath);

    if (retval) {
#if defined(__WIN__)
        /* apparently, need to close the old file first on windows. */
        _sirfile_close(sf);
#endif
        if (0 != rename(sf->path, newpath)) {
            retval = _sir_handleerr(errno);
        } else {
            retval = _sirfile_open(sf);
            if (retval)
                _sir_selflog("archived '%s' " SIR_R_ARROW " '%s'", sf->path, newpath);
        }
    }

    return retval;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
je 0x47bc
cmpq $0x0, 0x10(%rbx)
je 0x47bc
movq (%rbx), %rax
testq %rax, %rax
je 0x47bc
cmpb $0x0, (%rax)
je 0x47bc
cmpl $0x0, 0x18(%rbx)
je 0x47bc
testq %r14, %r14
je 0x4808
cmpb $0x0, (%r14)
setne %bpl
jmp 0x480a
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x47f5
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x2390
testl %eax, %eax
je 0x47fc
callq 0x2080
movl (%rax), %edi
leaq 0x5129(%rip), %rsi      # 0x9909
leaq 0x5027(%rip), %rdx      # 0x980e
movl $0x134, %ecx            # imm = 0x134
popq %rbx
popq %r14
popq %rbp
jmp 0x32bc
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3d81
xorl %ebp, %ebp
testb %bpl, %bpl
jne 0x47be
leaq 0x50f3(%rip), %rsi      # 0x9909
leaq 0x4ff1(%rip), %rdx      # 0x980e
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x12c, %ecx            # imm = 0x12C
callq 0x31c0
jmp 0x47be
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_fcache_destroy
bool _sir_fcache_destroy(sirfcache* sfc) {
    bool retval = _sir_validptr(sfc);

    if (retval) {
        while (sfc->count > 0) {
            size_t idx = sfc->count - 1;
            SIR_ASSERT(_sirfile_validate(sfc->files[idx]));
            _sirfile_destroy(&sfc->files[idx]);
            sfc->files[idx] = NULL;
            sfc->count--;
        }

        (void)_sir_explicit_memset(sfc, 0, sizeof(sirfcache));
    }

    return retval;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x4b36
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x4b25
leaq (%rbx,%rax,8), %r14
addq $-0x8, %r14
movq %r14, %rdi
callq 0x3e77
movq $0x0, (%r14)
movq 0x80(%rbx), %rax
decq %rax
movq %rax, 0x80(%rbx)
jne 0x4afb
movl $0x88, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5a62
jmp 0x4b53
leaq 0x4e56(%rip), %rsi      # 0x9993
leaq 0x4cca(%rip), %rdx      # 0x980e
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x244, %ecx            # imm = 0x244
callq 0x31c0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_getappbasename
char* _sir_getappbasename(void) {
    char* filename = _sir_getappfilename();
    if (!_sir_validstr(filename)) {
        _sir_safefree(&filename);
        return NULL;
    }

    const char* retval = _sir_getbasename(filename);
    char* bname = strndup(retval, strnlen(retval, SIR_MAXPATH));

    _sir_safefree(&filename);
    return bname;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
callq 0x5128
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x52b8
cmpb $0x0, (%rax)
je 0x52b8
movq 0x8(%rsp), %rdi
callq 0x52ea
movq %rax, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
callq 0x21c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2200
movq %rax, %rbx
jmp 0x52d7
leaq 0x4796(%rip), %rsi      # 0x9a55
leaq 0x472c(%rip), %rdx      # 0x99f2
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x17d, %ecx            # imm = 0x17D
callq 0x31c0
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x5490
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_getappdir
char* _sir_getappdir(void) {
    char* filename = _sir_getappfilename();
    if (!_sir_validstr(filename)) {
        _sir_safefree(&filename);
        return NULL;
    }

    const char* retval = _sir_getdirname(filename);
    char* dname = strndup(retval, strnlen(retval, SIR_MAXPATH));

    _sir_safefree(&filename);
    return dname;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
callq 0x5128
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x5362
cmpb $0x0, (%rax)
je 0x5362
movq 0x8(%rsp), %rdi
callq 0x5394
movq %rax, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
callq 0x21c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2200
movq %rax, %rbx
jmp 0x5381
leaq 0x4700(%rip), %rsi      # 0x9a69
leaq 0x4682(%rip), %rdx      # 0x99f2
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x18b, %ecx            # imm = 0x18B
callq 0x31c0
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x5490
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_ispathrelative
bool _sir_ispathrelative(const char* restrict path, bool* restrict relative) {
    bool valid = _sir_validstr(path) && _sir_validptr(relative);

    if (valid) {
#if !defined(__WIN__)
        if (path[0] == '/' || (path[0] == '~' && path[1] == '/'))
            *relative = false;
        else
            *relative = true;
#else /* __WIN__ */
        *relative = (TRUE == PathIsRelativeA(path));
#endif
    }

    return valid;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x800a0000, %edi       # imm = 0x800A0000
testq %r14, %r14
je 0x53f3
cmpb $0x0, (%r14)
je 0x53f3
testq %rbx, %rbx
setne %bpl
jne 0x540d
movl $0x800b0000, %edi       # imm = 0x800B0000
jmp 0x53f5
xorl %ebp, %ebp
leaq 0x469d(%rip), %rsi      # 0x9a99
leaq 0x45ef(%rip), %rdx      # 0x99f2
movl $0x1af, %ecx            # imm = 0x1AF
callq 0x31c0
testb %bpl, %bpl
je 0x542f
movzbl (%r14), %eax
cmpl $0x2f, %eax
je 0x5427
cmpl $0x7e, %eax
jne 0x542b
cmpb $0x2f, 0x1(%r14)
jne 0x542b
xorl %eax, %eax
jmp 0x542d
movb $0x1, %al
movb %al, (%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_deletefile
bool _sir_deletefile(const char* restrict path) {
    if (!_sir_validstr(path))
        return false;

#if !defined(__WIN__)
    return (0 == unlink(path)) ? true : _sir_handleerr(errno);
#else /* __WIN__ */
    return (FALSE != DeleteFileA(path)) ? true : _sir_handlewin32err(GetLastError());
#endif
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x546a
cmpb $0x0, (%rdi)
je 0x546a
callq 0x2090
testl %eax, %eax
je 0x548b
callq 0x2080
movl (%rax), %edi
leaq 0x4669(%rip), %rsi      # 0x9ac1
leaq 0x4593(%rip), %rdx      # 0x99f2
movl $0x289, %ecx            # imm = 0x289
popq %rax
jmp 0x32bc
leaq 0x4650(%rip), %rsi      # 0x9ac1
leaq 0x457a(%rip), %rdx      # 0x99f2
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x285, %ecx            # imm = 0x285
callq 0x31c0
xorl %eax, %eax
popq %rcx
retq
movb $0x1, %al
jmp 0x5489
nop
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_safeclose
void _sir_safeclose(int* restrict fd) {
    if (!fd || 0 > *fd)
        return;

    if (-1 == close(*fd))
        (void)_sir_handleerr(errno);

    *fd = -1;
}

// Assembly:
testq %rdi, %rdi
je 0x54ee
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
testl %edi, %edi
js 0x54ed
callq 0x21d0
cmpl $-0x1, %eax
jne 0x54e7
callq 0x2080
movl (%rax), %edi
leaq 0x45fb(%rip), %rsi      # 0x9ad1
leaq 0x4603(%rip), %rdx      # 0x9ae0
movl $0x31, %ecx
callq 0x32bc
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_safefclose
void _sir_safefclose(FILE* restrict* restrict f) {
    if (!f || !*f)
        return;

    if (0 != fclose(*f))
        (void)_sir_handleerr(errno);

    *f = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x5530
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x552f
callq 0x2110
testl %eax, %eax
je 0x5528
callq 0x2080
movl (%rax), %edi
leaq 0x45d6(%rip), %rsi      # 0x9aed
leaq 0x45c2(%rip), %rdx      # 0x9ae0
movl $0x3b, %ecx
callq 0x32bc
movq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_validfd
bool _sir_validfd(int fd) {
    /** stdin, stdout, stderr use up 0, 1, 2 */
    if (2 >= fd)
        return _sir_handleerr(EBADF);

#if !defined(__WIN__)
    int ret = fcntl(fd, F_GETFL);
#else /* __WIN__ */
# if !defined(SIR_MSVCRT_MINGW)
    invalparamfn old = _set_thread_local_invalid_parameter_handler(_sir_invalidparameter);
# endif
    struct _stat st;
    int ret = _fstat(fd, &st);
# if !defined(SIR_MSVCRT_MINGW)
    _set_thread_local_invalid_parameter_handler(old);
# endif
#endif
    return (-1 != ret || EBADF != errno) ? true : _sir_handleerr(errno);
}

// Assembly:
pushq %rax
movl $0x43, %ecx
cmpl $0x3, %edi
jge 0x5555
leaq 0x45ba(%rip), %rsi      # 0x9afd
leaq 0x4596(%rip), %rdx      # 0x9ae0
movl $0x9, %edi
popq %rax
jmp 0x32bc
movl $0x3, %esi
xorl %eax, %eax
callq 0x20e0
cmpl $-0x1, %eax
jne 0x5575
callq 0x2080
movl $0x51, %ecx
cmpl $0x9, (%rax)
je 0x553c
movb $0x1, %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: _sir_validlevels
bool __sir_validlevels(sir_levels levels, const char* func,
    const char* file, uint32_t line) {
    if ((SIRL_ALL == levels || SIRL_NONE == levels) ||
        ((_sir_bittest(levels, SIRL_INFO)           ||
         _sir_bittest(levels, SIRL_DEBUG)           ||
         _sir_bittest(levels, SIRL_NOTICE)          ||
         _sir_bittest(levels, SIRL_WARN)            ||
         _sir_bittest(levels, SIRL_ERROR)           ||
         _sir_bittest(levels, SIRL_CRIT)            ||
         _sir_bittest(levels, SIRL_ALERT)           ||
         _sir_bittest(levels, SIRL_EMERG))          &&
         ((levels & ~SIRL_ALL) == 0U)))
         return true;

    _sir_selflog("invalid levels: %04"PRIx16, levels);
    return __sir_seterror(_SIR_E_LEVELS, func, file, line);
}

// Assembly:
testl %edi, %edi
je 0x56a7
cmpl $0xff, %edi
je 0x56a7
testb $-0x2, %dil
je 0x56aa
movzwl %di, %eax
cmpl $0x100, %eax            # imm = 0x100
jae 0x56ba
movb $0x1, %al
retq
movzwl %di, %eax
cmpl $0x100, %eax            # imm = 0x100
setb %al
testb %dil, %al
jne 0x56a7
movl $0x80080000, %edi       # imm = 0x80080000
jmp 0x31c0
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: _sir_validtextcolor
bool __sir_validtextcolor(sir_colormode mode, sir_textcolor color, const char* func,
    const char* file, uint32_t line) {
    bool valid = false;
    switch (mode) {
        case SIRCM_16:
            /* in 16-color mode:
             * compare to 30..37, 39, 40..47, 49, 90..97, 100..107. */
            valid = SIRTC_DEFAULT == color ||
                    (color >= 30U && color <= 37U) || color == 39U ||
                    (color >= 40U && color <= 47U) || color == 49U ||
                    (color >= 90U && color <= 97U) || (color >= 100U && color <= 107U);
            break;
        case SIRCM_256:
            /* in 256-color mode: compare to 0..255. sir_textcolor is unsigned,
             * so only need to ensure it's <= 255. */
            valid = SIRTC_DEFAULT == color || color <= 255U;
            break;
        case SIRCM_RGB: {
            /* in RGB-color mode: mask and compare to 0x00ffffff. */
            valid = SIRTC_DEFAULT == color || ((color & 0xff000000U) == 0U);
            break;
        }
        case SIRCM_INVALID: // GCOVR_EXCL_START
        default:
            valid = false;
            break;
    } // GCOVR_EXCL_STOP

    if (!valid) {
        _sir_selflog("invalid text color for mode %d %08"PRIx32" (%"PRIu32")",
            mode, color, color);
        (void)__sir_seterror(_SIR_E_TEXTCOLOR, func, file, line);
    }

    return valid;
}

// Assembly:
pushq %rbx
cmpl $0x2, %edi
je 0x578e
cmpl $0x1, %edi
je 0x5786
testl %edi, %edi
jne 0x5799
movb $0x1, %bl
leal -0x1e(%rsi), %eax
cmpl $0x8, %eax
jb 0x579b
cmpl $0x27, %esi
je 0x579b
cmpl $0x100, %esi            # imm = 0x100
je 0x579b
movl %esi, %eax
andl $-0x8, %eax
cmpl $0x28, %eax
je 0x579b
leal -0x31(%rsi), %eax
cmpl $0x31, %eax
jae 0x577e
movabsq $0x1fe0000000001, %rdi  # imm = 0x1FE0000000001
btq %rax, %rdi
jb 0x579b
addl $-0x64, %esi
cmpl $0x8, %esi
jmp 0x5794
cmpl $0x101, %esi            # imm = 0x101
jmp 0x5794
cmpl $0x1000000, %esi        # imm = 0x1000000
setb %bl
jmp 0x579b
xorl %ebx, %ebx
testb %bl, %bl
jne 0x57b2
movl $0x80120000, %edi       # imm = 0x80120000
movq %rdx, %rsi
movq %rcx, %rdx
movl %r8d, %ecx
callq 0x31c0
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_strncpy
int _sir_strncpy(char* restrict dest, size_t destsz, const char* restrict src,
    size_t count) {
    if (_sir_validptr(dest) && _sir_validstr(src)) {
#if defined(__HAVE_STDC_SECURE_OR_EXT1__)
        int ret = strncpy_s(dest, destsz, src, count);
        if (0 != ret) {
            (void)_sir_handleerr(ret);
            return -1;
        }
        return 0;
#else
        SIR_UNUSED(count);
        size_t cpy = strlcpy(dest, src, destsz);
        SIR_ASSERT_UNUSED(cpy < destsz, cpy);
        return 0;
#endif
    }

    return -1;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x5814
testq %rdx, %rdx
je 0x57ff
cmpb $0x0, (%rdx)
je 0x57ff
testq %rsi, %rsi
je 0x5838
leaq -0x1(%rsi), %r8
xorl %eax, %eax
cmpq %rax, %r8
sete %cl
je 0x583c
movb (%rdx,%rax), %cl
movb %cl, (%rdi,%rax)
incq %rax
testb %cl, %cl
jne 0x57e3
addq %rax, %rdi
xorl %ecx, %ecx
jmp 0x583f
leaq 0x431a(%rip), %rsi      # 0x9b20
leaq 0x42d3(%rip), %rdx      # 0x9ae0
movl $0x800a0000, %edi       # imm = 0x800A0000
jmp 0x5827
leaq 0x4305(%rip), %rsi      # 0x9b20
leaq 0x42be(%rip), %rdx      # 0x9ae0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0xea, %ecx
callq 0x31c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
movb $0x1, %cl
jmp 0x583f
addq %rax, %rdi
testq %rsi, %rsi
sete %dl
xorb $0x1, %cl
xorl %eax, %eax
orb %dl, %cl
jne 0x5836
movb $0x0, (%rdi)
jmp 0x5836
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_strncat
int _sir_strncat(char* restrict dest, size_t destsz, const char* restrict src,
    size_t count) {
    if (_sir_validptr(dest) && _sir_validstr(src)) {
#if defined(__HAVE_STDC_SECURE_OR_EXT1__)
        int ret = strncat_s(dest, destsz, src, count);
        if (0 != ret) {
            (void)_sir_handleerr(ret);
            return -1;
        }
        return 0;
#else
        SIR_UNUSED(count);
        size_t cat = strlcat(dest, src, destsz);
        SIR_ASSERT_UNUSED(cat < destsz, cat);
        return 0;
#endif
    }

    return -1;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x58df
testq %rdx, %rdx
je 0x58ca
cmpb $0x0, (%rdx)
je 0x58ca
movq %rdi, %rcx
testq %rsi, %rsi
je 0x5889
leaq (%rdi,%rsi), %rax
movq %rsi, %r8
movq %rdi, %rcx
cmpb $0x0, (%rcx)
je 0x5889
incq %rcx
decq %r8
jne 0x5879
movq %rax, %rcx
movq %rcx, %r8
subq %rdi, %r8
xorl %eax, %eax
cmpq %rsi, %r8
je 0x5901
movb (%rdx), %dil
testb %dil, %dil
je 0x58c5
notq %r8
addq %rsi, %r8
incq %rdx
testq %r8, %r8
je 0x58b7
movb %dil, (%rcx)
incq %rcx
decq %r8
jmp 0x58ba
xorl %r8d, %r8d
movb (%rdx), %dil
incq %rdx
testb %dil, %dil
jne 0x58a7
movb $0x0, (%rcx)
jmp 0x5901
leaq 0x425c(%rip), %rsi      # 0x9b2d
leaq 0x4208(%rip), %rdx      # 0x9ae0
movl $0x800a0000, %edi       # imm = 0x800A0000
jmp 0x58f2
leaq 0x4247(%rip), %rsi      # 0x9b2d
leaq 0x41f3(%rip), %rdx      # 0x9ae0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0xff, %ecx
callq 0x31c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_getchar
bool _sir_getchar(char* input) {
#if defined(__WIN__)
# if defined(__EMBARCADEROC__) && (__clang_major__ < 15)
    if (input)
        *input = (char)getch();
# else
    if (input)
        *input = (char)_getch();
# endif
     return true;
#else /* !__WIN__ */
    struct termios cur = {0};
    if (0 != tcgetattr(STDIN_FILENO, &cur))
        return _sir_handleerr(errno);

    struct termios new = cur;
    new.c_lflag &= ~(ICANON | ECHO);

    if (0 != tcsetattr(STDIN_FILENO, TCSANOW, &new))
        return _sir_handleerr(errno);

    int ch = getchar();

    if (NULL != input)
        *input = (char)ch;

    return 0 == tcsetattr(STDIN_FILENO, TCSANOW, &cur) ? true
        : _sir_handleerr(errno);
#endif
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rsi
movups %xmm0, 0x2c(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
xorl %edi, %edi
callq 0x2350
testl %eax, %eax
je 0x59da
callq 0x2080
movl (%rax), %edi
leaq 0x4179(%rip), %rsi      # 0x9b45
leaq 0x410d(%rip), %rdx      # 0x9ae0
movl $0x136, %ecx            # imm = 0x136
jmp 0x5a4f
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps 0x20(%rsp), %xmm2
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
movups 0x2c(%rsp), %xmm0
movups %xmm0, 0x2c(%rdx)
movaps %xmm2, 0x20(%rdx)
movaps %xmm1, 0x10(%rdx)
andb $-0xb, 0xc(%rdx)
xorl %edi, %edi
xorl %esi, %esi
callq 0x2360
movl $0x13c, %ebp            # imm = 0x13C
testl %eax, %eax
jne 0x5a38
callq 0x2230
testq %rbx, %rbx
je 0x5a23
movb %al, (%rbx)
movq %rsp, %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x2360
movl $0x144, %ebp            # imm = 0x144
testl %eax, %eax
je 0x5a5e
callq 0x2080
movl (%rax), %edi
leaq 0x40ff(%rip), %rsi      # 0x9b45
leaq 0x4093(%rip), %rdx      # 0x9ae0
movl %ebp, %ecx
callq 0x32bc
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
movb $0x1, %al
jmp 0x5a54
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_strremove
char* _sir_strremove(char *str, const char *sub) {
    if (!str)
        return NULL;

    if (!sub)
        return str;

    char* r;
    char* q;

    if (*sub && (q = r = strstr(str, sub)) != NULL) {
        size_t len = strnlen(sub, strlen(str));
        const char* p;

        while ((r = strstr(p = r + len, sub)) != NULL)
            while (p < r)
                *q++ = *p++;

        while ((*q++ = *p++) != '\0');
    }

    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x5af5
movq %rsi, %r15
movq %rdi, %rbx
testq %rsi, %rsi
je 0x5b0a
cmpb $0x0, (%r15)
je 0x5b0a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2450
testq %rax, %rax
je 0x5b0a
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r15, %rdi
movq %rax, %rsi
callq 0x21c0
movq %rax, %r13
movq %r14, %r12
addq %rax, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2450
testq %rax, %rax
je 0x5af9
cmpq %rax, %r12
jae 0x5aed
movq %rax, %rcx
subq %r12, %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb %sil, (%r14,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x5ada
addq %rdx, %r14
movq %rax, %r12
addq %r13, %r12
jmp 0x5abd
xorl %ebx, %ebx
jmp 0x5b0a
xorl %eax, %eax
movb (%r12,%rax), %cl
movb %cl, (%r14,%rax)
incq %rax
testb %cl, %cl
jne 0x5afb
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_strsqueeze
char* _sir_strsqueeze(char *str) {
    if (!str)
        return NULL;

    unsigned long j;

    for (unsigned long i = j = 0; str[i]; ++i)
        if ((i > 0 && !isspace((unsigned char)(str[i - 1])))
                   || !isspace((unsigned char)(str[i])))
            str[j++] = str[i];

    str[j] = '\0';

    return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5b77
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x5b7b
xorl %r15d, %r15d
xorl %r14d, %r14d
testq %r15, %r15
je 0x5b4e
callq 0x2480
movq (%rax), %rax
movzbl -0x1(%rbx,%r15), %ecx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x5b61
callq 0x2480
movq (%rax), %rax
movzbl %bpl, %ecx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x5b68
movb %bpl, (%rbx,%r14)
incq %r14
movb 0x1(%rbx,%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x5b34
jmp 0x5b7e
xorl %ebx, %ebx
jmp 0x5b83
xorl %r14d, %r14d
movb $0x0, (%rbx,%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_strredact
char* _sir_strredact(char *str, const char *sub, const char c) {
    if (!str)
        return NULL;

    if (!sub)
        return str;

    char *p = strstr(str, sub);

    if (!c || !p)
        return str;

    (void)_sir_explicit_memset(p, c, strnlen(sub, strlen(str)));

    return _sir_strredact(str, sub, c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movsbl %bpl, %r15d
testq %rbx, %rbx
je 0x5bee
testq %r14, %r14
je 0x5bf0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2450
testb %bpl, %bpl
je 0x5bf0
movq %rax, %r12
testq %rax, %rax
je 0x5bf0
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
movq %rax, %rsi
callq 0x21c0
movq 0x81af(%rip), %rcx      # 0xdd90
movq %r12, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq *%rcx
jmp 0x5ba5
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_strreplace
char* _sir_strreplace(char *str, const char c, const char n) {
    if (!str)
        return NULL;

    char *i = str;

    if (!c || !n)
        return str;

    while ((i = strchr(i, c)) != NULL)
        *i++ = n;

    return str;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x5c39
movl %edx, %ebp
movq %rdi, %rbx
testb %sil, %sil
sete %al
testb %bpl, %bpl
sete %cl
orb %al, %cl
jne 0x5c3b
movsbl %sil, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2140
testq %rax, %rax
je 0x5c3b
movb %bpl, (%rax)
incq %rax
movq %rax, %rdi
jmp 0x5c21
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_strcreplace
size_t _sir_strcreplace(char *str, const char c, const char n, int32_t max) {
    char*  i   = str;
    size_t cnt = 0;

    if (!str || !c || !n || !max)
        return cnt;

    while (cnt < (size_t)max && (i = strchr(i, c)) != NULL) {
        *i++ = n;
        cnt++;
    }

    return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
testq %rdi, %rdi
sete %al
testb %sil, %sil
sete %dl
orb %al, %dl
testb %bl, %bl
sete %al
testl %ecx, %ecx
sete %r8b
orb %al, %r8b
orb %dl, %r8b
jne 0x5c98
movsbl %sil, %ebp
movslq %ecx, %r15
xorl %r14d, %r14d
movl %ebp, %esi
callq 0x2140
testq %rax, %rax
je 0x5c9b
movq %rax, %rdi
incq %rdi
movb %bl, (%rax)
incq %r14
cmpq %r14, %r15
jne 0x5c77
movq %r15, %r14
jmp 0x5c9b
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)