LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
je 0x51f7
movq (%rsp), %rax
cmpq $0x0, (%rax)
je 0x51f7
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x5270
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x7910
movq (%rsp), %rdi
callq 0x7910
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/include/sir/helpers.h
// Function: FNV32_1a
static inline
uint32_t FNV32_1a(const uint8_t* data, size_t len) {
    uint32_t hash = 2166136261U;
    for (size_t n = 0; n < len; n++) {
        hash ^= (uint32_t)data[n];
        hash = (uint32_t)(hash * 16777619ULL);
    }
    return hash;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movl $0x811c9dc5, -0x14(%rsp) # imm = 0x811C9DC5
movq $0x0, -0x20(%rsp)
movq -0x20(%rsp), %rax
cmpq -0x10(%rsp), %rax
jae 0x530c
movq -0x8(%rsp), %rax
movq -0x20(%rsp), %rcx
movzbl (%rax,%rcx), %eax
xorl -0x14(%rsp), %eax
movl %eax, -0x14(%rsp)
movl -0x14(%rsp), %eax
imulq $0x1000193, %rax, %rax  # imm = 0x1000193
movl %eax, -0x14(%rsp)
movq -0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rsp)
jmp 0x52cb
movl -0x14(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0x5100
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0x5347
jmp 0x536e
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0xb57e(%rip), %rdx      # 0x108d6
leaq 0xb51e(%rip), %rcx      # 0x1087d
movl $0x85, %r8d
callq 0x4f70
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x27(%rsp)
testb $0x1, 0x27(%rsp)
je 0x5430
movq 0x30(%rsp), %rcx
movl 0x1c(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rcx)
cmpl $0xa, %eax
jle 0x53ae
movq 0x30(%rsp), %rax
movl $0x0, 0x1c(%rax)
movq 0x30(%rsp), %rdi
callq 0x5440
movq 0x28(%rsp), %rdi
movl $0x10e7, %esi           # imm = 0x10E7
callq 0x21d0
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rcx
movl $0x1, %esi
callq 0x23e0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x541d
callq 0x2070
movl (%rax), %edi
leaq 0xb4d8(%rip), %rsi      # 0x108d6
leaq 0xb478(%rip), %rdx      # 0x1087d
movl $0x93, %ecx
callq 0x3c00
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2280
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
sete %al
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilecache.c
// Function: sirfile_rollifneeded
void _sirfile_rollifneeded(sirfile* sf) {
    if (_sirfile_validate(sf) && _sirfile_needsroll(sf)) {
        bool rolled   = false;
        char* newpath = NULL;

        _sir_selflog("file (path: '%s', id: %"PRIx32") reached ~%d bytes in size;"
            " rolling...", sf->path, sf->id, SIR_FROLLSIZE);

        _sir_fflush(sf->f);

        if (_sirfile_roll(sf, &newpath)) {
            char header[SIR_MAXFHEADER] = {0};
            (void)snprintf(header, SIR_MAXFHEADER, SIR_FHROLLED, newpath);
            rolled = _sirfile_writeheader(sf, header);
        }

        _sir_safefree(&newpath);
        if (!rolled) /* write anyway; don't want to lose data. */
            _sir_selflog("error: failed to roll file (path: '%s', id: %"PRIx32")!",
                sf->path, sf->id);
    }
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rdi
callq 0x5100
testb $0x1, %al
jne 0x5465
jmp 0x5567
movq 0x90(%rsp), %rdi
callq 0x5760
testb $0x1, %al
jne 0x547b
jmp 0x5567
movb $0x0, 0x8f(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x90(%rsp), %rax
movq (%rax), %rsi
movq 0x90(%rsp), %rax
movl 0x18(%rax), %edx
leaq 0xb545(%rip), %rdi      # 0x109f1
movl $0x500000, %ecx         # imm = 0x500000
movb $0x0, %al
callq 0x5ff0
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x60f0
movq 0x90(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x5890
testb $0x1, %al
jne 0x54e4
jmp 0x552a
movq %rsp, %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x21c0
movq %rsp, %rdi
movq 0x80(%rsp), %rcx
movl $0x80, %esi
leaq 0xb527(%rip), %rdx      # 0x10a31
movb $0x0, %al
callq 0x2170
movq 0x90(%rsp), %rdi
movq %rsp, %rsi
callq 0x5570
andb $0x1, %al
movb %al, 0x8f(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x7910
testb $0x1, 0x8f(%rsp)
jne 0x5565
movq 0x90(%rsp), %rax
movq (%rax), %rsi
movq 0x90(%rsp), %rax
movl 0x18(%rax), %edx
leaq 0xb4f0(%rip), %rdi      # 0x10a4e
movb $0x0, %al
callq 0x5ff0
jmp 0x5567
addq $0x98, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x5100
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0x55a3
jmp 0x55cd
movq 0xf0(%rsp), %rdi
movl $0x1, %esi
leaq 0xb32e(%rip), %rdx      # 0x108e5
leaq 0xb2bf(%rip), %rcx      # 0x1087d
movl $0x9e, %r8d
callq 0x4f70
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0xef(%rsp)
testb $0x1, 0xef(%rsp)
je 0x56a2
movq $-0x1, 0xe0(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x22d0
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x21c0
movq 0xe0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xb2ce(%rip), %rdx      # 0x108fa
callq 0x56d0
andb $0x1, %al
movb %al, 0x9f(%rsp)
testb $0x1, 0x9f(%rsp)
jne 0x564e
movb $0x0, 0x107(%rsp)
jmp 0x56b2
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x21c0
leaq 0x10(%rsp), %rdi
movq 0xf0(%rsp), %rcx
leaq 0xa0(%rsp), %r8
movl $0x80, %esi
leaq 0xb294(%rip), %rdx      # 0x10914
movb $0x0, %al
callq 0x2170
movq 0xf8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5320
andb $0x1, %al
movb %al, 0xef(%rsp)
movb 0xef(%rsp), %al
andb $0x1, %al
movb %al, 0x107(%rsp)
movb 0x107(%rsp), %al
andb $0x1, %al
addq $0x108, %rsp            # imm = 0x108
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x5100
andb $0x1, %al
movb %al, 0xa7(%rsp)
testb $0x1, 0xa7(%rsp)
je 0x5863
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x90, %edx
callq 0x21c0
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x22e0
movl %eax, %edi
leaq 0x10(%rsp), %rsi
callq 0x2430
movl %eax, 0xc(%rsp)
xorl %eax, %eax
cmpl 0xc(%rsp), %eax
je 0x581a
movq 0xa8(%rsp), %rax
movq (%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2270
movl %eax, 0xc(%rsp)
xorl %eax, %eax
cmpl 0xc(%rsp), %eax
je 0x5818
callq 0x2070
movl (%rax), %edi
leaq 0xb12e(%rip), %rsi      # 0x1092a
leaq 0xb07a(%rip), %rdx      # 0x1087d
movl $0xbc, %ecx
callq 0x3c00
andb $0x1, %al
movb %al, 0xb7(%rsp)
jmp 0x5873
jmp 0x581a
movq 0x40(%rsp), %rcx
addq $0x2000, %rcx           # imm = 0x2000
movb $0x1, %al
cmpq $0x500000, %rcx         # imm = 0x500000
movb %al, 0xb(%rsp)
jge 0x5856
movq 0x40(%rsp), %rcx
addq $0x2000, %rcx           # imm = 0x2000
movl $0x500000, %eax         # imm = 0x500000
subq %rcx, %rax
cmpq $0x2000, %rax           # imm = 0x2000
setle %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
andb $0x1, %al
movb %al, 0xa7(%rsp)
movb 0xa7(%rsp), %al
andb $0x1, %al
movb %al, 0xb7(%rsp)
movb 0xb7(%rsp), %al
andb $0x1, %al
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x5100
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x6(%rsp)
jne 0x6027
jmp 0x604e
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0xaa47(%rip), %rdx      # 0x10a7f
leaq 0xa83e(%rip), %rcx      # 0x1087d
movl $0x12c, %r8d            # imm = 0x12C
callq 0x4f70
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
je 0x60d6
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0x23a0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x60a0
callq 0x2070
movl (%rax), %edi
leaq 0xa9f8(%rip), %rsi      # 0x10a7f
leaq 0xa7ef(%rip), %rdx      # 0x1087d
movl $0x134, %ecx            # imm = 0x134
callq 0x3c00
andb $0x1, %al
movb %al, 0x7(%rsp)
jmp 0x60d4
movq 0x10(%rsp), %rdi
callq 0x4ff0
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
je 0x60d2
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rsp), %rdx
leaq 0xa9c5(%rip), %rdi      # 0x10a90
movb $0x0, %al
callq 0x5ff0
jmp 0x60d4
jmp 0x60d6
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilecache.c
// Function: sirfile_update
bool _sirfile_update(sirfile* sf, const sir_update_config_data* data) {
    bool retval = _sirfile_validate(sf);

    if (retval) {
        bool updated = false;
        if (_sir_bittest(data->fields, SIRU_LEVELS)) {
            if (sf->levels != *data->levels) {
                _sir_selflog("updating file (id: %"PRIx32") levels from %04"PRIx16
                            " to %04"PRIx16, sf->id, sf->levels, *data->levels);
                sf->levels = *data->levels;
            } else {
                _sir_selflog("skipped superfluous update of file (id: %"PRIx32")"
                            " levels: %04"PRIx16, sf->id, sf->levels);
            }

            updated = true;
        }

        if (_sir_bittest(data->fields, SIRU_OPTIONS)) {
            if (sf->opts != *data->opts) {
                _sir_selflog("updating file (id: %"PRIx32") options from %08"PRIx32
                            " to %08"PRIx32, sf->id, sf->opts, *data->opts);
                sf->opts = *data->opts;
            } else {
                _sir_selflog("skipped superfluous update of file (id: %"PRIx32")"
                            " options: %08"PRIx32, sf->id, sf->opts);
            }

            updated = true;
        }

        retval = updated;
    }

    return retval;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x5100
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
je 0x62ab
movb $0x0, 0x6(%rsp)
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl $0x1, %esi
callq 0x62c0
testb $0x1, %al
jne 0x6195
jmp 0x6214
movq 0x10(%rsp), %rax
movzwl 0x8(%rax), %eax
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
je 0x61f0
movq 0x10(%rsp), %rax
movl 0x18(%rax), %esi
movq 0x10(%rsp), %rax
movzwl 0x8(%rax), %edx
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzwl (%rax), %ecx
leaq 0xa8fa(%rip), %rdi      # 0x10acc
movb $0x0, %al
callq 0x5ff0
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movw (%rax), %cx
movq 0x10(%rsp), %rax
movw %cx, 0x8(%rax)
jmp 0x620f
movq 0x10(%rsp), %rax
movl 0x18(%rax), %esi
movq 0x10(%rsp), %rax
movzwl 0x8(%rax), %edx
leaq 0xa8f4(%rip), %rdi      # 0x10afc
movb $0x0, %al
callq 0x5ff0
movb $0x1, 0x6(%rsp)
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl $0x2, %esi
callq 0x62c0
testb $0x1, %al
jne 0x622b
jmp 0x62a1
movq 0x10(%rsp), %rax
movl 0xc(%rax), %eax
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
cmpl (%rcx), %eax
je 0x627e
movq 0x10(%rsp), %rax
movl 0x18(%rax), %esi
movq 0x10(%rsp), %rax
movl 0xc(%rax), %edx
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
leaq 0xa8d3(%rip), %rdi      # 0x10b35
movb $0x0, %al
callq 0x5ff0
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xc(%rax)
jmp 0x629c
movq 0x10(%rsp), %rax
movl 0x18(%rax), %esi
movq 0x10(%rsp), %rax
movl 0xc(%rax), %edx
leaq 0xa8d1(%rip), %rdi      # 0x10b66
movb $0x0, %al
callq 0x5ff0
movb $0x1, 0x6(%rsp)
movb 0x6(%rsp), %al
andb $0x1, %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_fcache_find
sirfile* _sir_fcache_find(const sirfcache* sfc, const void* match, sir_fcache_pred pred) {
    bool valid = _sir_validptr(sfc) && _sir_validptr(match) && _sir_validfnptr(pred);

    if (valid) {
        for (size_t n = 0; n < sfc->count; n++) {
            if (pred(match, sfc->files[n]))
                return sfc->files[n];
        }
    }

    return NULL;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0xaa1a(%rip), %rdx      # 0x10d1e
leaq 0xa572(%rip), %rcx      # 0x1087d
movl $0x237, %r8d            # imm = 0x237
callq 0x5200
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x7(%rsp)
jne 0x6325
jmp 0x637e
movq 0x20(%rsp), %rdi
movl $0x1, %esi
leaq 0xa9e8(%rip), %rdx      # 0x10d1e
leaq 0xa540(%rip), %rcx      # 0x1087d
movl $0x237, %r8d            # imm = 0x237
callq 0x5200
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x7(%rsp)
jne 0x6357
jmp 0x637e
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0xa9b6(%rip), %rdx      # 0x10d1e
leaq 0xa50e(%rip), %rcx      # 0x1087d
movl $0x237, %r8d            # imm = 0x237
callq 0x5c30
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
andb $0x1, %al
movb %al, 0x17(%rsp)
testb $0x1, 0x17(%rsp)
je 0x63f4
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq 0x80(%rcx), %rax
jae 0x63f2
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rcx
movq 0x8(%rsp), %rdx
movq (%rcx,%rdx,8), %rsi
callq *%rax
testb $0x1, %al
jne 0x63cb
jmp 0x63e0
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
jmp 0x63fd
jmp 0x63e2
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x6398
jmp 0x63f4
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilecache.c
// Function: sir_fcache_shift
void _sir_fcache_shift(sirfcache* sfc, size_t idx) {
    if (_sir_validptr(sfc) && sfc->count <= SIR_MAXFILES) {
        for (size_t n = idx; n < sfc->count - 1; n++) {
            sfc->files[n] = sfc->files[n + 1];
            sfc->files[n + 1] = NULL;
        }
    }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0xa62a(%rip), %rdx      # 0x10ca9
leaq 0xa1f7(%rip), %rcx      # 0x1087d
movl $0x1e3, %r8d            # imm = 0x1E3
callq 0x5200
testb $0x1, %al
jne 0x6697
jmp 0x6705
movq 0x10(%rsp), %rax
cmpq $0x10, 0x80(%rax)
ja 0x6705
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x80(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x6703
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq $0x0, 0x8(%rax,%rcx,8)
movq (%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
jmp 0x66af
jmp 0x6705
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0xa605(%rip), %rdx      # 0x10d2f
leaq 0xa14c(%rip), %rcx      # 0x1087d
movl $0x244, %r8d            # imm = 0x244
callq 0x5200
andb $0x1, %al
movb %al, 0xf(%rsp)
testb $0x1, 0xf(%rsp)
je 0x67be
jmp 0x674b
movq 0x10(%rsp), %rax
cmpq $0x0, 0x80(%rax)
jbe 0x67ad
movq 0x10(%rsp), %rax
movq 0x80(%rax), %rax
subq $0x1, %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x51c0
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq 0x80(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x80(%rax)
jmp 0x674b
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x88, %edx
callq 0x8a00
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_getrelbasepath
bool _sir_getrelbasepath(const char* restrict path, bool* restrict relative,
    const char* restrict* restrict base_path, sir_rel_to rel_to) {
    if (!_sir_validstr(path) || !_sir_validptr(relative) ||
        !_sir_validptrptr(base_path) || !_sir_ispathrelative(path, relative))
        return false;

    if (*relative) {
        switch (rel_to) {
            case SIR_PATH_REL_TO_APP: return NULL != (*base_path = _sir_getappdir());
            case SIR_PATH_REL_TO_CWD: return NULL != (*base_path = _sir_getcwd());
            default: return _sir_seterror(_SIR_E_INVALID);
        }
    }

    return true;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0xa01c(%rip), %rdx      # 0x10f04
leaq 0x9f21(%rip), %rcx      # 0x10e10
movl $0x1c1, %r8d            # imm = 0x1C1
callq 0x6dd0
testb $0x1, %al
jne 0x6f00
jmp 0x6f65
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x9ff3(%rip), %rdx      # 0x10f04
leaq 0x9ef8(%rip), %rcx      # 0x10e10
movl $0x1c1, %r8d            # imm = 0x1C1
callq 0x6e50
testb $0x1, %al
jne 0x6f29
jmp 0x6f65
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x9fca(%rip), %rdx      # 0x10f04
leaq 0x9ecf(%rip), %rcx      # 0x10e10
movl $0x1c2, %r8d            # imm = 0x1C2
callq 0x72d0
testb $0x1, %al
jne 0x6f52
jmp 0x6f65
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x77b0
testb $0x1, %al
jne 0x6f6f
movb $0x0, 0x27(%rsp)
jmp 0x6ffb
movq 0x10(%rsp), %rax
testb $0x1, (%rax)
je 0x6ff6
movl 0x4(%rsp), %eax
movl %eax, (%rsp)
subl $0x1, %eax
je 0x6fb1
jmp 0x6f87
movl (%rsp), %eax
subl $0x2, %eax
jne 0x6fd1
jmp 0x6f91
callq 0x76b0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
xorl %eax, %eax
cmpq %rcx, %rax
setne %al
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0x6ffb
callq 0x7340
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
xorl %eax, %eax
cmpq %rcx, %rax
setne %al
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0x6ffb
movl $0x800c0000, %edi       # imm = 0x800C0000
leaq 0x9f27(%rip), %rsi      # 0x10f04
leaq 0x9e2c(%rip), %rdx      # 0x10e10
movl $0x1c9, %ecx            # imm = 0x1C9
callq 0x3940
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0x6ffb
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_pathexists
bool _sir_pathexists(const char* path, bool* exists, sir_rel_to rel_to) {
    if (!_sir_validstr(path) || !_sir_validptr(exists))
        return false;

    *exists = false;

    struct stat st = {0};
    bool stat_ret  = _sir_pathgetstat(path, &st, rel_to);
    if (!stat_ret)
        return false;

    *exists = (st.st_size != SIR_STAT_NONEXISTENT);
    return true;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movl %edx, 0x9c(%rsp)
movq 0xa8(%rsp), %rdi
movl $0x1, %esi
leaq 0x9de4(%rip), %rdx      # 0x10e26
leaq 0x9dc7(%rip), %rcx      # 0x10e10
movl $0x89, %r8d
callq 0x6dd0
testb $0x1, %al
jne 0x705a
jmp 0x7084
movq 0xa0(%rsp), %rdi
movl $0x1, %esi
leaq 0x9db8(%rip), %rdx      # 0x10e26
leaq 0x9d9b(%rip), %rcx      # 0x10e10
movl $0x89, %r8d
callq 0x6e50
testb $0x1, %al
jne 0x708e
movb $0x0, 0xb7(%rsp)
jmp 0x70fc
movq 0xa0(%rsp), %rax
movb $0x0, (%rax)
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movl $0x90, %edx
callq 0x21c0
movq 0xa8(%rsp), %rdi
movl 0x9c(%rsp), %edx
leaq 0x8(%rsp), %rsi
callq 0x6b30
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
jne 0x70da
movb $0x0, 0xb7(%rsp)
jmp 0x70fc
movl $0xffffff02, %eax       # imm = 0xFFFFFF02
cmpq %rax, 0x38(%rsp)
setne %cl
movq 0xa0(%rsp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movb $0x1, 0xb7(%rsp)
movb 0xb7(%rsp), %al
andb $0x1, %al
addq $0xb8, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_openfile
bool _sir_openfile(FILE* restrict* restrict f, const char* restrict path,
    const char* restrict mode, sir_rel_to rel_to) {
    if (!_sir_validptrptr(f) || !_sir_validstr(path) || !_sir_validstr(mode))
        return false;

    bool relative         = false;
    const char* base_path = NULL;

    if (!_sir_getrelbasepath(path, &relative, &base_path, rel_to))
        return false;

    if (relative) {
        char abs_path[SIR_MAXPATH] = {0};
        (void)snprintf(abs_path, SIR_MAXPATH, "%s/%s", base_path, path);

        int ret = _sir_fopen(f, abs_path, mode);
        _sir_safefree(&base_path);
        return 0 == ret;
    }

    return 0 == _sir_fopen(f, path, mode);
}

// Assembly:
subq $0x1048, %rsp           # imm = 0x1048
movq %rdi, 0x1038(%rsp)
movq %rsi, 0x1030(%rsp)
movq %rdx, 0x1028(%rsp)
movl %ecx, 0x1024(%rsp)
movq 0x1038(%rsp), %rdi
movl $0x1, %esi
leaq 0x9cec(%rip), %rdx      # 0x10e36
leaq 0x9cbf(%rip), %rcx      # 0x10e10
movl $0x99, %r8d
callq 0x72d0
testb $0x1, %al
jne 0x7162
jmp 0x71b8
movq 0x1030(%rsp), %rdi
movl $0x1, %esi
leaq 0x9cc0(%rip), %rdx      # 0x10e36
leaq 0x9c93(%rip), %rcx      # 0x10e10
movl $0x99, %r8d
callq 0x6dd0
testb $0x1, %al
jne 0x718e
jmp 0x71b8
movq 0x1028(%rsp), %rdi
movl $0x1, %esi
leaq 0x9c94(%rip), %rdx      # 0x10e36
leaq 0x9c67(%rip), %rcx      # 0x10e10
movl $0x99, %r8d
callq 0x6dd0
testb $0x1, %al
jne 0x71c5
movb $0x0, 0x1047(%rsp)
jmp 0x72bf
movb $0x0, 0x1023(%rsp)
movq $0x0, 0x1018(%rsp)
movq 0x1030(%rsp), %rdi
movl 0x1024(%rsp), %ecx
leaq 0x1023(%rsp), %rsi
leaq 0x1018(%rsp), %rdx
callq 0x6ec0
testb $0x1, %al
jne 0x720e
movb $0x0, 0x1047(%rsp)
jmp 0x72bf
testb $0x1, 0x1023(%rsp)
je 0x7290
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x21c0
leaq 0x10(%rsp), %rdi
movq 0x1018(%rsp), %rcx
movq 0x1030(%rsp), %r8
movl $0x1000, %esi           # imm = 0x1000
leaq 0x9bd6(%rip), %rdx      # 0x10e20
movb $0x0, %al
callq 0x2170
movq 0x1038(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x1028(%rsp), %rdx
callq 0x8730
movl %eax, 0xc(%rsp)
leaq 0x1018(%rsp), %rdi
callq 0x7910
xorl %eax, %eax
cmpl 0xc(%rsp), %eax
sete %al
andb $0x1, %al
movb %al, 0x1047(%rsp)
jmp 0x72bf
movq 0x1038(%rsp), %rdi
movq 0x1030(%rsp), %rsi
movq 0x1028(%rsp), %rdx
callq 0x8730
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, 0x1047(%rsp)
movb 0x1047(%rsp), %al
andb $0x1, %al
addq $0x1048, %rsp           # imm = 0x1048
retq
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
callq 0x73a0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x98dd(%rip), %rdx      # 0x10eac
leaq 0x983a(%rip), %rcx      # 0x10e10
movl $0x17d, %r8d            # imm = 0x17D
callq 0x6dd0
testb $0x1, %al
jne 0x75fa
leaq 0x18(%rsp), %rdi
callq 0x7910
movq $0x0, 0x20(%rsp)
jmp 0x7646
movq 0x18(%rsp), %rdi
callq 0x7650
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21d0
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x2210
movq %rax, 0x8(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x7910
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_getbasename
char* _sir_getbasename(char* restrict path) {
    if (!_sir_validstr(path))
        return ".";

#if !defined(__WIN__)
    return basename(path);
#else /* __WIN__ */
    return PathFindFileNameA(path);
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x9865(%rip), %rdx      # 0x10ecf
leaq 0x979f(%rip), %rcx      # 0x10e10
movl $0x198, %r8d            # imm = 0x198
callq 0x6dd0
testb $0x1, %al
jne 0x768e
leaq 0x8cce(%rip), %rax      # 0x10355
movq %rax, 0x10(%rsp)
jmp 0x769d
movq 0x8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
callq 0x73a0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x97f1(%rip), %rdx      # 0x10ec0
leaq 0x973a(%rip), %rcx      # 0x10e10
movl $0x18b, %r8d            # imm = 0x18B
callq 0x6dd0
testb $0x1, %al
jne 0x76fa
leaq 0x18(%rsp), %rdi
callq 0x7910
movq $0x0, 0x20(%rsp)
jmp 0x7746
movq 0x18(%rsp), %rdi
callq 0x7750
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21d0
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x2210
movq %rax, 0x8(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x7910
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirfilesystem.c
// Function: sir_getdirname
char* _sir_getdirname(char* restrict path) {
    if (!_sir_validstr(path))
        return ".";

#if !defined(__WIN__)
    return dirname(path);
#else /* __WIN__ */
    (void)PathRemoveFileSpecA((LPSTR)path);
    return path;
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x9776(%rip), %rdx      # 0x10ee0
leaq 0x969f(%rip), %rcx      # 0x10e10
movl $0x1a3, %r8d            # imm = 0x1A3
callq 0x6dd0
testb $0x1, %al
jne 0x778e
leaq 0x8bce(%rip), %rax      # 0x10355
movq %rax, 0x10(%rsp)
jmp 0x779d
movq 0x8(%rsp), %rdi
callq 0x21a0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x9721(%rip), %rdx      # 0x10ef0
leaq 0x963a(%rip), %rcx      # 0x10e10
movl $0x1af, %r8d            # imm = 0x1AF
callq 0x6dd0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x6(%rsp)
jne 0x77f0
jmp 0x7817
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x96ef(%rip), %rdx      # 0x10ef0
leaq 0x9608(%rip), %rcx      # 0x10e10
movl $0x1af, %r8d            # imm = 0x1AF
callq 0x6e50
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
je 0x7864
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x7850
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x7e, %eax
jne 0x785a
movq 0x10(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x785a
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
jmp 0x7862
movq 0x8(%rsp), %rax
movb $0x1, (%rax)
jmp 0x7864
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x968e(%rip), %rdx      # 0x10f18
leaq 0x957f(%rip), %rcx      # 0x10e10
movl $0x285, %r8d            # imm = 0x285
callq 0x6dd0
testb $0x1, %al
jne 0x78a7
movb $0x0, 0x17(%rsp)
jmp 0x78fc
movq 0x8(%rsp), %rdi
callq 0x2080
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x78c4
movl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x78ec
callq 0x2070
movl (%rax), %edi
leaq 0x9646(%rip), %rsi      # 0x10f18
leaq 0x9537(%rip), %rdx      # 0x10e10
movl $0x289, %ecx            # imm = 0x289
callq 0x3c00
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirhelpers.c
// Function: _sir_safefree
void __sir_safefree(void** pp) {
    if (!pp || !*pp)
        return;

    free(*pp);
    *pp = NULL;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
je 0x7926
movq (%rsp), %rax
cmpq $0x0, (%rax)
jne 0x7928
jmp 0x793f
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x2050
movq (%rsp), %rax
movq $0x0, (%rax)
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
je 0x7966
movq (%rsp), %rcx
xorl %eax, %eax
cmpl (%rcx), %eax
jle 0x7968
jmp 0x79a7
movq (%rsp), %rax
movl (%rax), %edi
callq 0x21e0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x799d
callq 0x2070
movl (%rax), %edi
leaq 0x95ac(%rip), %rsi      # 0x10f38
leaq 0x95b4(%rip), %rdx      # 0x10f47
movl $0x31, %ecx
callq 0x3c00
movq (%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
je 0x79c6
movq (%rsp), %rax
cmpq $0x0, (%rax)
jne 0x79c8
jmp 0x7a06
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x2110
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x79fb
callq 0x2070
movl (%rax), %edi
leaq 0x956a(%rip), %rsi      # 0x10f54
leaq 0x9556(%rip), %rdx      # 0x10f47
movl $0x3b, %ecx
callq 0x3c00
movq (%rsp), %rax
movq $0x0, (%rax)
popq %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
movl $0x2, %eax
cmpl 0x10(%rsp), %eax
jl 0x7a48
movl $0x9, %edi
leaq 0x9535(%rip), %rsi      # 0x10f64
leaq 0x9511(%rip), %rdx      # 0x10f47
movl $0x43, %ecx
callq 0x3c00
andb $0x1, %al
movb %al, 0x17(%rsp)
jmp 0x7abb
movl 0x10(%rsp), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0x20e0
movl %eax, 0xc(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0xc(%rsp), %eax
jne 0x7a78
callq 0x2070
movq %rax, %rcx
movl $0x9, %eax
cmpl (%rcx), %eax
je 0x7a83
movl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x7aab
callq 0x2070
movl (%rax), %edi
leaq 0x94d3(%rip), %rsi      # 0x10f64
leaq 0x94af(%rip), %rdx      # 0x10f47
movl $0x51, %ecx
callq 0x3c00
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movw %di, %ax
movw %ax, 0x24(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movzwl 0x24(%rsp), %ecx
movl $0xff, %eax
cmpl %ecx, %eax
je 0x7e88
movzwl 0x24(%rsp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x7e88
movzwl 0x24(%rsp), %edi
movl $0x40, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
movzwl 0x24(%rsp), %edi
movl $0x80, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
movzwl 0x24(%rsp), %edi
movl $0x20, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
movzwl 0x24(%rsp), %edi
movl $0x10, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
movzwl 0x24(%rsp), %edi
movl $0x8, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
movzwl 0x24(%rsp), %edi
movl $0x4, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
movzwl 0x24(%rsp), %edi
movl $0x2, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
movzwl 0x24(%rsp), %edi
movl $0x1, %esi
callq 0x7d80
testb $0x1, %al
jne 0x7e79
jmp 0x7e8f
movzwl 0x24(%rsp), %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
cmpl $0x0, %eax
jne 0x7e8f
movb $0x1, 0x27(%rsp)
jmp 0x7ec0
movzwl 0x24(%rsp), %esi
leaq 0x90ec(%rip), %rdi      # 0x10f87
movb $0x0, %al
callq 0x8070
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl $0x80080000, %edi       # imm = 0x80080000
callq 0x3940
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirhelpers.c
// Function: _sir_validopts
bool __sir_validopts(sir_options opts, const char* func, const char* file,
    uint32_t line) {
    if ((SIRO_ALL == opts || SIRO_MSGONLY == opts) ||
        ((_sir_bittest(opts, SIRO_NOTIME)          ||
         _sir_bittest(opts, SIRO_NOHOST)           ||
         _sir_bittest(opts, SIRO_NOLEVEL)          ||
         _sir_bittest(opts, SIRO_NONAME)           ||
         _sir_bittest(opts, SIRO_NOMSEC)           ||
         _sir_bittest(opts, SIRO_NOPID)            ||
         _sir_bittest(opts, SIRO_NOTID)            ||
         _sir_bittest(opts, SIRO_NOHDR))           &&
         ((opts & ~(SIRO_MSGONLY | SIRO_NOHDR)) == 0U)))
         return true;

    _sir_selflog("invalid options: %08"PRIx32, opts);
    return __sir_seterror(_SIR_E_OPTIONS, func, file, line);
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
xorl %eax, %eax
cmpl 0x20(%rsp), %eax
je 0x7fa5
movl $0x7f00, %eax           # imm = 0x7F00
cmpl 0x20(%rsp), %eax
je 0x7fa5
movl 0x20(%rsp), %edi
movl $0x100, %esi            # imm = 0x100
callq 0x7d80
testb $0x1, %al
jne 0x7f97
movl 0x20(%rsp), %edi
movl $0x400, %esi            # imm = 0x400
callq 0x7d80
testb $0x1, %al
jne 0x7f97
movl 0x20(%rsp), %edi
movl $0x800, %esi            # imm = 0x800
callq 0x7d80
testb $0x1, %al
jne 0x7f97
movl 0x20(%rsp), %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x7d80
testb $0x1, %al
jne 0x7f97
movl 0x20(%rsp), %edi
movl $0x200, %esi            # imm = 0x200
callq 0x7d80
testb $0x1, %al
jne 0x7f97
movl 0x20(%rsp), %edi
movl $0x2000, %esi           # imm = 0x2000
callq 0x7d80
testb $0x1, %al
jne 0x7f97
movl 0x20(%rsp), %edi
movl $0x4000, %esi           # imm = 0x4000
callq 0x7d80
testb $0x1, %al
jne 0x7f97
movl 0x20(%rsp), %edi
movl $0x10000, %esi          # imm = 0x10000
callq 0x7d80
testb $0x1, %al
jne 0x7f97
jmp 0x7fac
movl 0x20(%rsp), %eax
andl $0xfffe80ff, %eax       # imm = 0xFFFE80FF
cmpl $0x0, %eax
jne 0x7fac
movb $0x1, 0x27(%rsp)
jmp 0x7fdc
movl 0x20(%rsp), %esi
leaq 0x8ff9(%rip), %rdi      # 0x10fb0
movb $0x0, %al
callq 0x8070
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl $0x80070000, %edi       # imm = 0x80070000
callq 0x3940
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirhelpers.c
// Function: _sir_validlevel
bool __sir_validlevel(sir_level level, const char* func, const char* file,
    uint32_t line) {
    if (SIRL_INFO   == level || SIRL_DEBUG == level ||
        SIRL_NOTICE == level || SIRL_WARN  == level ||
        SIRL_ERROR  == level || SIRL_CRIT  == level ||
        SIRL_ALERT  == level || SIRL_EMERG == level)
        return true;

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

// Assembly:
subq $0x28, %rsp
movw %di, %ax
movw %ax, 0x24(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movzwl 0x24(%rsp), %ecx
movl $0x40, %eax
cmpl %ecx, %eax
je 0x810a
movzwl 0x24(%rsp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
je 0x810a
movzwl 0x24(%rsp), %ecx
movl $0x20, %eax
cmpl %ecx, %eax
je 0x810a
movzwl 0x24(%rsp), %ecx
movl $0x10, %eax
cmpl %ecx, %eax
je 0x810a
movzwl 0x24(%rsp), %ecx
movl $0x8, %eax
cmpl %ecx, %eax
je 0x810a
movzwl 0x24(%rsp), %ecx
movl $0x4, %eax
cmpl %ecx, %eax
je 0x810a
movzwl 0x24(%rsp), %ecx
movl $0x2, %eax
cmpl %ecx, %eax
je 0x810a
movzwl 0x24(%rsp), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x8111
movb $0x1, 0x27(%rsp)
jmp 0x8142
movzwl 0x24(%rsp), %esi
leaq 0x8e7f(%rip), %rdi      # 0x10f9c
movb $0x0, %al
callq 0x8070
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl $0x80080000, %edi       # imm = 0x80080000
callq 0x3940
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirhelpers.c
// Function: _sir_validtextattr
bool __sir_validtextattr(sir_textattr attr, const char* func, const char* file,
    uint32_t line) {
    switch(attr) {
        case SIRTA_NORMAL:
        case SIRTA_BOLD:
        case SIRTA_DIM:
        case SIRTA_EMPH:
        case SIRTA_ULINE:
            return true;
        default: {
            _sir_selflog("invalid text attr: %d", attr);
            return __sir_seterror(_SIR_E_TEXTATTR, func, file, line);
        }
    }
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl 0x20(%rsp), %eax
subl $0x4, %eax
ja 0x8178
jmp 0x8171
movb $0x1, 0x27(%rsp)
jmp 0x81a8
movl 0x20(%rsp), %esi
leaq 0x8e43(%rip), %rdi      # 0x10fc6
movb $0x0, %al
callq 0x8070
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl $0x80110000, %edi       # imm = 0x80110000
callq 0x3940
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirhelpers.c
// Function: _sir_validcolormode
bool __sir_validcolormode(sir_colormode mode, const char* func, const char* file,
    uint32_t line) {
    switch (mode) {
        case SIRCM_16:
        case SIRCM_256:
        case SIRCM_RGB:
            return true;
        case SIRCM_INVALID:
        default: {
            _sir_selflog("invalid color mode: %d", mode);
            return __sir_seterror(_SIR_E_COLORMODE, func, file, line);
        }
    }
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x8(%rsp)
subl $0x3, %eax
jb 0x8380
jmp 0x8375
movl 0x8(%rsp), %eax
subl $0x3, %eax
je 0x8387
jmp 0x8389
movb $0x1, 0x27(%rsp)
jmp 0x83b9
jmp 0x8389
movl 0x20(%rsp), %esi
leaq 0x8c71(%rip), %rdi      # 0x11005
movb $0x0, %al
callq 0x8070
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl $0x80100000, %edi       # imm = 0x80100000
callq 0x3940
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x8c23(%rip), %rdx      # 0x1101c
leaq 0x8b47(%rip), %rcx      # 0x10f47
movl $0xea, %r8d
callq 0x7d10
testb $0x1, %al
jne 0x8411
jmp 0x845d
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x8bfa(%rip), %rdx      # 0x1101c
leaq 0x8b1e(%rip), %rcx      # 0x10f47
movl $0xea, %r8d
callq 0x7ff0
testb $0x1, %al
jne 0x843a
jmp 0x845d
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x8470
movq %rax, 0x8(%rsp)
movl $0x0, 0x34(%rsp)
jmp 0x8465
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/include/sir/impl.h
// Function: sir_strlcpy
static inline size_t
_sir_strlcpy(char *dst, const char *src, size_t dsize)
{
  const char *osrc   = src;
  size_t      nleft  = dsize;

  /*
   * Copy as many bytes as will fit.
   */

  if (nleft != 0) {
    while (--nleft != 0) {
      if ((*dst++ = *src++) == '\0')
        break;
    }
  }

  /*
   * Not enough room in dst, add
   * NUL and traverse rest of src.
   */

  if (nleft == 0) {
    if (dsize != 0)
      *dst = '\0'; /* NUL-terminate dst */
    while (*src++);
  }

  return src - osrc - 1; /* count does not include NUL */
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rax
movq %rax, -0x28(%rsp)
cmpq $0x0, -0x28(%rsp)
je 0x84e5
jmp 0x849d
movq -0x28(%rsp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rsp)
cmpq $0x0, %rax
je 0x84e3
movq -0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rsp)
movb (%rax), %al
movq -0x8(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rsp)
movb %al, (%rcx)
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x84e1
jmp 0x84e3
jmp 0x849d
jmp 0x84e5
cmpq $0x0, -0x28(%rsp)
jne 0x8519
cmpq $0x0, -0x18(%rsp)
je 0x84fd
movq -0x8(%rsp), %rax
movb $0x0, (%rax)
jmp 0x84ff
movq -0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rsp)
cmpb $0x0, (%rax)
je 0x8517
jmp 0x84ff
jmp 0x8519
movq -0x10(%rsp), %rax
movq -0x20(%rsp), %rcx
subq %rcx, %rax
subq $0x1, %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x8ad0(%rip), %rdx      # 0x11029
leaq 0x89e7(%rip), %rcx      # 0x10f47
movl $0xff, %r8d
callq 0x7d10
testb $0x1, %al
jne 0x8571
jmp 0x85bd
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x8aa7(%rip), %rdx      # 0x11029
leaq 0x89be(%rip), %rcx      # 0x10f47
movl $0xff, %r8d
callq 0x7ff0
testb $0x1, %al
jne 0x859a
jmp 0x85bd
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x85d0
movq %rax, 0x8(%rsp)
movl $0x0, 0x34(%rsp)
jmp 0x85c5
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop