LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: trimTrailingSpace(char*, unsigned int)
char *trimTrailingSpace(char* str, unsigned int maxSize)
{
	size_t sln = strlen(str);
	size_t actualLen = maxSize < sln ? maxSize : sln;

	// Trim trailing space
	char *end = str + actualLen - 1;
	while (end > str && isspace(*end)) end--;

	// Write new null terminator character
	end[1] = '\0';

	return str;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x30f0
movl %ebp, %ecx
cmpq %rcx, %rax
cmovbq %rax, %rcx
addq %rbx, %rcx
decq %rcx
movq %rcx, %r14
cmpq %rbx, %rcx
jbe 0xd1db
movsbl (%r14), %edi
callq 0x3060
leaq -0x1(%r14), %rcx
testl %eax, %eax
jne 0xd1c2
movb $0x0, 0x1(%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: parsePsid(unsigned char*, PsidHeader&)
unsigned int parsePsid(unsigned char *buf, PsidHeader &psidHdr_)
{
	char *buffer = (char *) buf;

	if (buf) {
		memset(psidHdr_.title, 0, sizeof(psidHdr_.title));
		strncpy(psidHdr_.title, trimTrailingSpace(buffer + PSID_NAME, 32), 32);
		psidHdr_.title[PSID_NAME + 32] = 0;
		strncpy(psidHdr_.author, trimTrailingSpace(buffer + PSID_AUTHOR, 32), 32);
		psidHdr_.author[PSID_AUTHOR + 32] = 0;
		strncpy(psidHdr_.copyright, trimTrailingSpace(buffer + PSID_COPYRIGHT, 32), 32);
		psidHdr_.copyright[PSID_COPYRIGHT + 32] = 0;
	} else {
		memset(psidHdr_.title, 0, sizeof(psidHdr_.title));
		memset(psidHdr_.author, 0, 32);
		memset(psidHdr_.copyright, 0, 32);
		memset(psidHdr_.copyright, 0, 32);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
leaq 0x34(%rsi), %r15
testq %rdi, %rdi
je 0xd299
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x200, %edx            # imm = 0x200
movq %r15, %rdi
xorl %esi, %esi
callq 0x3130
leaq 0x16(%r14), %r12
movq %r12, %rdi
movl $0x20, %esi
callq 0xd1a5
movl $0x20, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3120
movb %bpl, 0x6a(%rbx)
leaq 0x234(%rbx), %r15
leaq 0x36(%r14), %r12
movq %r12, %rdi
movl $0x20, %esi
callq 0xd1a5
movl $0x20, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3120
movb %bpl, 0x28a(%rbx)
leaq 0x434(%rbx), %r15
addq $0x56, %r14
movq %r14, %rdi
movl $0x20, %esi
callq 0xd1a5
movl $0x20, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3120
movb %bpl, 0x4aa(%rbx)
jmp 0xd2b9
movl $0x220, %edx            # imm = 0x220
movq %r15, %rdi
xorl %esi, %esi
callq 0x3130
xorps %xmm0, %xmm0
movups %xmm0, 0x434(%rbx)
movups %xmm0, 0x444(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: readFile(char*, unsigned char**, unsigned long*)
unsigned int readFile(char *fName, unsigned char **bufferPtr, size_t *bLen)
{
	std::FILE *file = (std::FILE *) 0;

	if (!fName)
		return 2;

	try {
		size_t flen;
		file = std::fopen(fName, "rb");
		if (!file)
			return 3;
		std::fseek(file, 0, SEEK_END);
		flen = std::ftell(file);
		if (flen > MAX_BUFFER_SIZE) flen = MAX_BUFFER_SIZE;
		std::fseek(file, 0, SEEK_SET);
		*bufferPtr = inputBuffer;
		size_t r = std::fread(*bufferPtr, flen, 1, file);
		*bLen = flen;
		fclose(file);
	} catch(char *str) {
		std::cerr << "Error opening " << fName << std::endl;
		std::cerr << "    exception: " << str << std::endl;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xd66a
movq %rdx, %rbx
movq %rsi, %r12
leaq 0x1b0a(%rip), %rsi      # 0xf10c
callq 0x3270
testq %rax, %rax
je 0xd672
movq %rax, %r15
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3250
movq %r15, %rdi
callq 0x3030
movl $0x10000, %r13d         # imm = 0x10000
cmpq %r13, %rax
cmovbq %rax, %r13
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3250
leaq 0x197b7(%rip), %rdi     # 0x26e00
movq %rdi, (%r12)
movl $0x1, %edx
movq %r13, %rsi
movq %r15, %rcx
callq 0x32e0
movq %r13, (%rbx)
movq %r15, %rdi
callq 0x3220
jmp 0xd678
movl $0x2, %r14d
jmp 0xd678
movl $0x3, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: machineInit(unsigned int, unsigned int)
TED *machineInit(unsigned int sampleRate, unsigned int filterOrder)
{
	ted = new TED;
	ted->initFilter(sampleRate, filterOrder);
	cpu = new CPU(ted, ted->Ram + 0xff09, ted->Ram + 0x100);
	ted->cpuptr = cpu;
	ted->loadroms();
	machineReset();
	return ted;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl $0xb71e0, %edi          # imm = 0xB71E0
callq 0x3230
movq %rax, %r15
movq %rax, %rdi
callq 0x9a6c
movq %r15, 0x195ab(%rip)     # 0x26df0
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xc7ee
movl $0xa8, %edi
callq 0x3230
movq %rax, %rbx
movq 0x1958b(%rip), %rsi     # 0x26df0
leaq 0x55ec9(%rsi), %rdx
leaq 0x460c0(%rsi), %rcx
movq %rax, %rdi
callq 0x41d0
movq %rbx, 0x2957e(%rip)     # 0x36e00
movq 0x19567(%rip), %rdi     # 0x26df0
movq %rbx, 0x45fb8(%rdi)
callq 0x9fde
movq 0x19554(%rip), %rdi     # 0x26df0
callq 0x9dc8
movq 0x29558(%rip), %rdi     # 0x36e00
callq 0x43fa
movq 0x1953c(%rip), %rax     # 0x26df0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0xa8, %esi
movq %rbx, %rdi
jmp 0xd8d7
movq %rax, %r14
movl $0xb71e0, %esi          # imm = 0xB71E0
movq %r15, %rdi
callq 0x3240
movq %r14, %rdi
callq 0x3360
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: machineShutDown()
void machineShutDown()
{
	if(ted) {
		delete ted;
		ted = 0;
	}
	if (cpu) {
		delete cpu;
		cpu = 0;
	}
}

// Assembly:
pushq %rbx
movq 0x1947e(%rip), %rdi     # 0x26df0
testq %rdi, %rdi
je 0xd988
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x19468(%rip) # 0x26df0
movq 0x29471(%rip), %rbx     # 0x36e00
testq %rbx, %rbx
je 0xd9b4
movq %rbx, %rdi
callq 0x8088
movl $0xa8, %esi
movq %rbx, %rdi
callq 0x3240
movq $0x0, 0x2944c(%rip) # 0x36e00
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayPause()
void tedplayPause()
{
	if (player && playState == 1) {
		player->pause();
		player->lock();
		playState = 2;
	}
}

// Assembly:
movq 0x2944b(%rip), %rdi     # 0x36e08
testq %rdi, %rdi
je 0xd9ed
cmpl $0x1, 0x29447(%rip)     # 0x36e10
jne 0xd9ed
pushq %rax
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x2942f(%rip), %rdi     # 0x36e08
movq (%rdi), %rax
callq *0x38(%rax)
movl $0x2, 0x29427(%rip)     # 0x36e10
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayPlay()
void tedplayPlay()
{
	if (player && !(playState == 1)) {
		player->unlock();
		if (!playState)
			ted->oscillatorReset();
		player->play();
		playState = 1;
	}
}

// Assembly:
movq 0x29413(%rip), %rdi     # 0x36e08
testq %rdi, %rdi
je 0xda3a
cmpl $0x1, 0x2940f(%rip)     # 0x36e10
je 0xda3a
pushq %rax
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x0, 0x293ff(%rip)     # 0x36e10
jne 0xda1f
movq 0x193d6(%rip), %rdi     # 0x26df0
callq 0xbd5c
movq 0x293e2(%rip), %rdi     # 0x36e08
movq (%rdi), %rax
callq *0x10(%rax)
movl $0x1, 0x293da(%rip)     # 0x36e10
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayStop()
void tedplayStop()
{
	if (player && playState) {
		player->stop();
		player->lock();
	}
	cpu->setPC(playerStartAddress);
	playState = 0;
}

// Assembly:
pushq %rax
movq 0x293c5(%rip), %rdi     # 0x36e08
testq %rdi, %rdi
je 0xda64
cmpl $0x0, 0x293c1(%rip)     # 0x36e10
je 0xda64
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x293aa(%rip), %rdi     # 0x36e08
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x29395(%rip), %rdi     # 0x36e00
movl $0xfe00, %esi           # imm = 0xFE00
callq 0x448e
movl $0x0, 0x29391(%rip)     # 0x36e10
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedPlaySetWaveform(unsigned int, unsigned int)
void tedPlaySetWaveform(unsigned int channel, unsigned int wave)
{
	bool wasPlaying = (playState == 1);
	
	if (wasPlaying)
		tedplayPause();
	if (ted) {
		ted->selectWaveForm(channel, wave);
	}
	if (wasPlaying)
		tedplayPlay();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl 0x29305(%rip), %r14d    # 0x36e10
cmpl $0x1, %r14d
jne 0xdb16
callq 0xd9b6
movq 0x192d3(%rip), %rdi     # 0x26df0
testq %rdi, %rdi
je 0xdb2b
movl %ebp, %esi
movl %ebx, %edx
callq 0xc790
cmpl $0x1, %r14d
jne 0xdb3a
popq %rbx
popq %r14
popq %rbp
jmp 0xd9ee
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayClose()
void tedplayClose()
{
	if (player) {
		player->stop();
		delete player;
		player = 0;
	}
	machineShutDown();
}

// Assembly:
movq 0x292c2(%rip), %rdi     # 0x36e08
testq %rdi, %rdi
je 0xd96a
pushq %rax
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x292ab(%rip), %rdi     # 0x36e08
testq %rdi, %rdi
je 0xdb68
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x29295(%rip) # 0x36e08
addq $0x8, %rsp
jmp 0xd96a
// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/tedplay.cpp
// Function: copyPetsciiToAsc(char*, char*, unsigned int)
static void copyPetsciiToAsc(char* to, char* from, unsigned int size)
{
	if (size) {
		unsigned int i = size - 1;
		do {
			to[i] = convertToAscii((unsigned char)from[i], false);
		} while (i--);
	}
}

// Assembly:
movl $0x1f, %eax
movb (%rsi,%rax), %cl
testb %cl, %cl
je 0xddeb
cmpb $0x1a, %cl
ja 0xddef
orb $0x60, %cl
jmp 0xde1a
movb $0x20, %cl
jmp 0xde1a
cmpb $0x1f, %cl
ja 0xddf9
orb $0x40, %cl
jmp 0xde1a
leal -0x41(%rcx), %edx
cmpb $0x19, %dl
ja 0xde06
orb $0x20, %cl
jmp 0xde1a
leal 0x3f(%rcx), %edx
movzbl %cl, %r8d
andb $0x5f, %cl
cmpb $0x1a, %dl
movzbl %cl, %ecx
cmovael %r8d, %ecx
movb %cl, (%rdi,%rax)
addq $-0x1, %rax
jb 0xddda
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3333(%rip), %rsi      # 0x6427
callq 0x6662
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x33a3(%rip), %rsi      # 0x64df
callq 0x6662
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3664
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 0x5d83(%rip), %rdx      # 0x9387
cmovneq %r14, %rdx
movl $0x100, %esi            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
callq 0x56fc
movw $0x0, 0x118(%rbx)
movl -0x8(%r14), %ecx
cmpl $0x800c0000, %ecx       # imm = 0x800C0000
jne 0x36b1
movw $0xc, 0x118(%rbx)
leaq 0xa680(%rip), %rax      # 0xdcc0
addq $0x11a, %rbx            # imm = 0x11A
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 0x56fc
movq %fs:0x0, %rax
movl $0x800b0000, %ecx       # imm = 0x800B0000
movq %rcx, -0x150(%rax)
leaq 0x5ed2(%rip), %rcx      # 0x9555
movq %rcx, -0x48(%rax)
leaq 0x5e83(%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, %edi
movl $0xb, %edx
movl $0x800c0000, %r8d       # imm = 0x800C0000
xorl %esi, %esi
leaq 0xa546(%rip), %rax      # 0xdc10
cmpq %rdi, %rsi
je 0x36a9
cmpl %ecx, %r8d
setb %r8b
leaq -0x1(%rdx), %r9
cmpq %rsi, %r9
setb %r10b
orb %r8b, %r10b
cmpb $0x1, %r10b
jne 0x36f8
cmpq %rdi, %rdx
jae 0x36a9
incq %rdx
movq %rdx, %rsi
movq %rdi, %r9
leaq (%r9,%rsi), %rdx
shrq %rdx
movq %rdx, %r10
shlq $0x4, %r10
movl (%r10,%rax), %r8d
movq %r9, %rdi
cmpl %ecx, %r8d
jne 0x36ca
movl %ecx, %edx
shrl $0x10, %edx
andl $0x7fff, %edx           # imm = 0x7FFF
movw %dx, 0x118(%rbx)
cmpl $0x80170000, %ecx       # imm = 0x80170000
jne 0x373f
addq $0x11a, %rbx            # imm = 0x11A
leaq 0x5e2d(%rip), %rdx      # 0x9567
jmp 0x364b
addq %r10, %rax
jmp 0x3640
// File: /workspace/github_c_makefile_star2_O3/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 0x5c19(%rip), %rcx      # 0x9387
movq %rcx, -0x48(%rax)
movq %rcx, -0x40(%rax)
movl $0x0, -0x38(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6066(%rip), %rsi      # 0x9801
leaq 0x606c(%rip), %rdx      # 0x980e
movl $0x80010000, %edi       # imm = 0x80010000
movl $0x28, %ecx
callq 0x31c0
callq 0x62a2
testb %al, %al
je 0x3824
movl $0x1, %edi
callq 0x5f5f
testq %rax, %rax
je 0x3807
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 0x382b
movl %eax, %ebx
movl $0x1, %edi
callq 0x60fa
movl %ebx, %eax
jmp 0x3826
leaq 0x5ff3(%rip), %rsi      # 0x9801
leaq 0x5ff9(%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_O3/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 0x5e55(%rip), %rsi      # 0x981d
leaq 0x5e3f(%rip), %rdx      # 0x980e
movl $0x80010000, %edi       # imm = 0x80010000
movl $0x39, %ecx
callq 0x31c0
callq 0x62a2
xorb $0x1, %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
jne 0x3a56
leaq 0x5e28(%rip), %rsi      # 0x981d
leaq 0x5e12(%rip), %rdx      # 0x980e
movq %rbx, %rdi
movl $0x3b, %ecx
callq 0x54c9
testb %al, %al
je 0x3a56
movl $0x1, %edi
callq 0x5f5f
testq %rax, %rax
je 0x3a39
movq %rax, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x3a5f
movl %eax, %ebx
movl $0x1, %edi
callq 0x60fa
movl %ebx, %eax
jmp 0x3a58
leaq 0x5ddd(%rip), %rsi      # 0x981d
leaq 0x5dc7(%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_O3/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 0x5d1c(%rip), %rsi      # 0x982d
leaq 0x5cf6(%rip), %rdx      # 0x980e
movl $0x80010000, %edi       # imm = 0x80010000
movl $0x46, %ecx
callq 0x31c0
callq 0x62a2
xorb $0x1, %al
testl %ebx, %ebx
sete %cl
orb %al, %cl
jne 0x3b7d
movl $0x1, %edi
callq 0x5f5f
testq %rax, %rax
je 0x3b60
movq %rax, %rdi
movl %ebx, %esi
callq 0x3b81
movl %eax, %ebx
movl $0x1, %edi
callq 0x60fa
movl %ebx, %eax
jmp 0x3b7f
leaq 0x5cc6(%rip), %rsi      # 0x982d
leaq 0x5ca0(%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_O3/aremmell[P]libsir/include/sir/helpers.h
// Function: sirfile_writeheader
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 0x41c4
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x41e4
movq (%rbx), %rax
testq %rax, %rax
je 0x41e4
cmpb $0x0, (%rax)
je 0x41e4
cmpl $0x0, 0x18(%rbx)
je 0x41e4
movq %rsi, %r14
testq %rsi, %rsi
je 0x41c7
cmpb $0x0, (%r14)
je 0x41c7
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 0x41f5
leaq 0x5741(%rip), %rdx      # 0x987c
leaq 0x20(%rsp), %r15
movl $0x40, %esi
movq %r15, %rdi
movq %rax, %rcx
callq 0x2320
testq %rax, %rax
je 0x41e4
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r12
movaps %xmm0, 0x70(%r12)
movaps %xmm0, 0x60(%r12)
movaps %xmm0, 0x50(%r12)
movaps %xmm0, 0x40(%r12)
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq %r15, (%rsp)
leaq 0x56fb(%rip), %r8       # 0x9896
movl $0x80, %esi
movl $0x80, %ecx
movq %r12, %rdi
movl $0x1, %edx
movq %r14, %r9
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3ead
jmp 0x41e6
xorl %eax, %eax
retq
leaq 0x5699(%rip), %rsi      # 0x9867
leaq 0x5639(%rip), %rdx      # 0x980e
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x9e, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x2080
movl (%rax), %edi
leaq 0x57c5(%rip), %rsi      # 0x99c8
leaq 0x57cd(%rip), %rdx      # 0x99d7
movl $0x196, %ecx            # imm = 0x196
callq 0x32bc
jmp 0x41e4
// File: /workspace/github_c_makefile_star2_O3/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 0x3e9c
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3e9c
addq $0x10, %rdi
callq 0x543f
movq (%rbx), %rdi
callq 0x53e0
movq %rbx, %rdi
popq %rbx
jmp 0x53e0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4ab9
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x4aa8
leaq (%rbx,%rax,8), %r14
addq $-0x8, %r14
movq %r14, %rdi
callq 0x3e71
movq $0x0, (%r14)
movq 0x80(%rbx), %rax
decq %rax
movq %rax, 0x80(%rbx)
jne 0x4a7e
movl $0x88, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5973
jmp 0x4ad6
leaq 0x4ed3(%rip), %rsi      # 0x9993
leaq 0x4d47(%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_O3/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 0x50bc
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x5212
cmpb $0x0, (%rax)
je 0x5212
movq %rax, %rdi
callq 0x5244
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 0x5231
leaq 0x483c(%rip), %rsi      # 0x9a55
leaq 0x47d2(%rip), %rdx      # 0x99f2
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x17d, %ecx            # imm = 0x17D
callq 0x31c0
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x53e0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x50bc
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x52ba
cmpb $0x0, (%rax)
je 0x52ba
movq %rax, %rdi
callq 0x52ec
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 0x52d9
leaq 0x47a8(%rip), %rsi      # 0x9a69
leaq 0x472a(%rip), %rdx      # 0x99f2
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x18b, %ecx            # imm = 0x18B
callq 0x31c0
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x53e0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rax
testq %rdi, %rdi
je 0x5348
movzbl (%rdi), %eax
testl %eax, %eax
je 0x5348
testq %rsi, %rsi
je 0x5369
cmpl $0x2f, %eax
je 0x5343
cmpl $0x7e, %eax
jne 0x537e
cmpb $0x2f, 0x1(%rdi)
jne 0x537e
movb $0x0, (%rsi)
jmp 0x5381
leaq 0x474a(%rip), %rsi      # 0x9a99
leaq 0x469c(%rip), %rdx      # 0x99f2
movl $0x800a0000, %edi       # imm = 0x800A0000
movl $0x1af, %ecx            # imm = 0x1AF
callq 0x31c0
xorl %eax, %eax
jmp 0x5383
leaq 0x4729(%rip), %rsi      # 0x9a99
leaq 0x467b(%rip), %rdx      # 0x99f2
movl $0x800b0000, %edi       # imm = 0x800B0000
jmp 0x535b
movb $0x1, (%rsi)
movb $0x1, %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x53b9
cmpb $0x0, (%rdi)
je 0x53b9
callq 0x2090
testl %eax, %eax
je 0x53da
callq 0x2080
movl (%rax), %edi
leaq 0x471a(%rip), %rsi      # 0x9ac1
leaq 0x4644(%rip), %rdx      # 0x99f2
movl $0x289, %ecx            # imm = 0x289
popq %rax
jmp 0x32bc
leaq 0x4701(%rip), %rsi      # 0x9ac1
leaq 0x462b(%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 0x53d8
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x543e
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
testl %edi, %edi
js 0x543d
callq 0x21d0
cmpl $-0x1, %eax
jne 0x5437
callq 0x2080
movl (%rax), %edi
leaq 0x46ab(%rip), %rsi      # 0x9ad1
leaq 0x46b3(%rip), %rdx      # 0x9ae0
movl $0x31, %ecx
callq 0x32bc
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5480
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x547f
callq 0x2110
testl %eax, %eax
je 0x5478
callq 0x2080
movl (%rax), %edi
leaq 0x4686(%rip), %rsi      # 0x9aed
leaq 0x4672(%rip), %rdx      # 0x9ae0
movl $0x3b, %ecx
callq 0x32bc
movq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x54a5
leaq 0x466a(%rip), %rsi      # 0x9afd
leaq 0x4646(%rip), %rdx      # 0x9ae0
movl $0x9, %edi
popq %rax
jmp 0x32bc
movl $0x3, %esi
xorl %eax, %eax
callq 0x20e0
cmpl $-0x1, %eax
jne 0x54c5
callq 0x2080
movl $0x51, %ecx
cmpl $0x9, (%rax)
je 0x548c
movb $0x1, %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x55e0
cmpl $0xff, %edi
je 0x55e0
testb $-0x2, %dil
je 0x55e3
movzwl %di, %eax
cmpl $0x100, %eax            # imm = 0x100
jae 0x55f3
movb $0x1, %al
retq
movzwl %di, %eax
cmpl $0x100, %eax            # imm = 0x100
setb %al
testb %dil, %al
jne 0x55e0
movl $0x80080000, %edi       # imm = 0x80080000
jmp 0x31c0
// File: /workspace/github_c_makefile_star2_O3/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:
cmpl $0x2, %edi
je 0x5694
cmpl $0x1, %edi
je 0x5688
testl %edi, %edi
jne 0x569e
movb $0x1, %al
leal -0x1e(%rsi), %edi
cmpl $0x8, %edi
jae 0x56b9
retq
movb $0x1, %al
cmpl $0x101, %esi            # imm = 0x101
jb 0x5687
jmp 0x569e
movb $0x1, %al
cmpl $0x1000000, %esi        # imm = 0x1000000
jb 0x5687
pushq %rax
movl $0x80120000, %edi       # imm = 0x80120000
movq %rdx, %rsi
movq %rcx, %rdx
movl %r8d, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0x8, %rsp
retq
cmpl $0x27, %esi
je 0x5687
cmpl $0x100, %esi            # imm = 0x100
je 0x5687
movl %esi, %edi
andl $-0x8, %edi
cmpl $0x28, %edi
je 0x5687
addl $-0x31, %esi
cmpl $0x3b, %esi
jae 0x569e
movabsq $0x7f9fe0000000001, %rdi # imm = 0x7F9FE0000000001
btq %rsi, %rdi
jb 0x5687
jmp 0x569e
// File: /workspace/github_c_makefile_star2_O3/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 0x573f
testq %rdx, %rdx
je 0x572a
cmpb $0x0, (%rdx)
je 0x572a
testq %rsi, %rsi
je 0x5767
decq %rsi
xorl %eax, %eax
cmpq %rax, %rsi
je 0x5763
movb (%rdx,%rax), %cl
movb %cl, (%rdi,%rax)
incq %rax
testb %cl, %cl
jne 0x5716
jmp 0x5767
leaq 0x43ef(%rip), %rsi      # 0x9b20
leaq 0x43a8(%rip), %rdx      # 0x9ae0
movl $0x800a0000, %edi       # imm = 0x800A0000
jmp 0x5752
leaq 0x43da(%rip), %rsi      # 0x9b20
leaq 0x4393(%rip), %rdx      # 0x9ae0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0xea, %ecx
callq 0x31c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x5769
movb $0x0, (%rdi,%rax)
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x57f0
testq %rdx, %rdx
je 0x57db
movb (%rdx), %r8b
testb %r8b, %r8b
je 0x57db
movq %rdi, %rcx
testq %rsi, %rsi
je 0x57a0
leaq (%rdi,%rsi), %rax
movq %rsi, %r9
movq %rdi, %rcx
cmpb $0x0, (%rcx)
je 0x57a0
incq %rcx
decq %r9
jne 0x5790
movq %rax, %rcx
movq %rcx, %r9
subq %rdi, %r9
xorl %eax, %eax
cmpq %rsi, %r9
je 0x5812
notq %r9
addq %rsi, %r9
incq %rdx
testq %r9, %r9
je 0x57c6
movb %r8b, (%rcx)
incq %rcx
decq %r9
jmp 0x57c9
xorl %r9d, %r9d
movb (%rdx), %r8b
incq %rdx
testb %r8b, %r8b
jne 0x57b6
movb $0x0, (%rcx)
xorl %eax, %eax
jmp 0x5812
leaq 0x434b(%rip), %rsi      # 0x9b2d
leaq 0x42f7(%rip), %rdx      # 0x9ae0
movl $0x800a0000, %edi       # imm = 0x800A0000
jmp 0x5803
leaq 0x4336(%rip), %rsi      # 0x9b2d
leaq 0x42e2(%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_O3/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 0x58eb
callq 0x2080
movl (%rax), %edi
leaq 0x4268(%rip), %rsi      # 0x9b45
leaq 0x41fc(%rip), %rdx      # 0x9ae0
movl $0x136, %ecx            # imm = 0x136
jmp 0x5960
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 0x5949
callq 0x2230
testq %rbx, %rbx
je 0x5934
movb %al, (%rbx)
movq %rsp, %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x2360
movl $0x144, %ebp            # imm = 0x144
testl %eax, %eax
je 0x596f
callq 0x2080
movl (%rax), %edi
leaq 0x41ee(%rip), %rsi      # 0x9b45
leaq 0x4182(%rip), %rdx      # 0x9ae0
movl %ebp, %ecx
callq 0x32bc
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
movb $0x1, %al
jmp 0x5965
// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5a1c
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0x5a1c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2450
testq %rax, %rax
je 0x5a1c
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 0x5a0b
cmpq %rax, %r12
jae 0x5a03
movq %rax, %rcx
subq %r12, %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb %sil, (%r14,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x59f0
addq %rdx, %r14
movq %rax, %r12
addq %r13, %r12
jmp 0x59d3
xorl %eax, %eax
movb (%r12,%rax), %cl
movb %cl, (%r14,%rax)
incq %rax
testb %cl, %cl
jne 0x5a0d
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5a86
movb (%rbx), %bpl
testb %bpl, %bpl
je 0x5a80
xorl %r14d, %r14d
callq 0x2480
xorl %ecx, %ecx
testq %r14, %r14
je 0x5a5c
movq (%rax), %rdx
movzbl -0x1(%rbx,%r14), %esi
testb $0x20, 0x1(%rdx,%rsi,2)
je 0x5a6a
movq (%rax), %rdx
movzbl %bpl, %esi
testb $0x20, 0x1(%rdx,%rsi,2)
jne 0x5a71
movb %bpl, (%rbx,%rcx)
incq %rcx
movb 0x1(%rbx,%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x5a47
jmp 0x5a82
xorl %ecx, %ecx
movb $0x0, (%rbx,%rcx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5b00
movl %edx, %ebp
movq %rsi, %r14
testq %rsi, %rsi
sete %al
testb %bpl, %bpl
sete %cl
orb %al, %cl
jne 0x5b00
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2450
testq %rax, %rax
je 0x5b00
movq %rax, %r15
movsbl %bpl, %ebp
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
movq %rax, %rsi
callq 0x21c0
movq 0x82ad(%rip), %rcx      # 0xdd90
movq %r15, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq *%rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2450
movq %rax, %r15
testq %rax, %rax
jne 0x5ac9
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %r14
testq %rdi, %rdi
je 0x5b48
movl %edx, %ebx
testb %sil, %sil
sete %al
testb %bl, %bl
sete %cl
orb %al, %cl
jne 0x5b48
movsbl %sil, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x2140
testq %rax, %rax
je 0x5b48
movb %bl, (%rax)
incq %rax
movq %rax, %rdi
jmp 0x5b32
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5ba5
movsbl %sil, %ebp
movslq %ecx, %r15
xorl %r14d, %r14d
movl %ebp, %esi
callq 0x2140
testq %rax, %rax
je 0x5ba8
movq %rax, %rdi
incq %rdi
movb %bl, (%rax)
incq %r14
cmpq %r14, %r15
jne 0x5b84
movq %r15, %r14
jmp 0x5ba8
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/aremmell[P]libsir/src/sirinternal.c
// Function: sir_makeinit
bool _sir_makeinit(sirinit* si) {
    bool retval = _sir_validptr(si);

    if (retval) {
        (void)memset(si, 0, sizeof(sirinit));

        si->d_stdout.opts   = SIRO_DEFAULT;
        si->d_stdout.levels = SIRL_DEFAULT;

        si->d_stderr.opts   = SIRO_DEFAULT;
        si->d_stderr.levels = SIRL_DEFAULT;

#if !defined(SIR_NO_SYSTEM_LOGGERS)
        si->d_syslog.opts   = SIRO_DEFAULT;
        si->d_syslog.levels = SIRL_DEFAULT;
#else
        si->d_syslog.opts   = SIRO_MSGONLY;
        si->d_syslog.levels = SIRL_NONE;
#endif
    }

    return retval;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5bef
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21b0
movl $0x100000, %eax         # imm = 0x100000
movl %eax, 0x4(%rbx)
movw $0x100, %cx             # imm = 0x100
movw %cx, (%rbx)
movl %eax, 0xc(%rbx)
movw %cx, 0x8(%rbx)
movl %eax, 0x14(%rbx)
movw %cx, 0x10(%rbx)
jmp 0x5c0c
leaq 0x3fa2(%rip), %rsi      # 0x9b98
leaq 0x3fa9(%rip), %rdx      # 0x9ba6
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x5b, %ecx
callq 0x31c0
testq %rbx, %rbx
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aremmell[P]libsir/src/sirinternal.c
// Function: sir_cleanup
bool _sir_isinitialized(void) {
#if defined(__HAVE_ATOMIC_H__)
    if (_SIR_MAGIC == atomic_load(&_sir_magic))
        return true;
#else
    if (_SIR_MAGIC == _sir_magic)
        return true;
#endif
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x83bf(%rip), %rax      # 0xe4e0
cmpq $0x60906090, %rax       # imm = 0x60906090
je 0x614e
leaq 0x3a9e(%rip), %rsi      # 0x9bce
leaq 0x3a6f(%rip), %rdx      # 0x9ba6
movl $0x80020000, %edi       # imm = 0x80020000
movl $0x11a, %ecx            # imm = 0x11A
callq 0x31c0
testb %al, %al
je 0x6295
leaq 0x864b(%rip), %rdi      # 0xe7a0
callq 0x7790
testb %al, %al
je 0x6244
leaq 0x865f(%rip), %rdi      # 0xe7c8
callq 0x4a66
movl %eax, %ebx
leaq 0x8629(%rip), %rdi      # 0xe7a0
callq 0x782e
leaq 0x86cd(%rip), %rdi      # 0xe850
callq 0x7790
testb %al, %al
je 0x625e
leaq 0x86e1(%rip), %rdi      # 0xe878
callq 0x8064
movl %eax, %r15d
leaq 0x86aa(%rip), %rdi      # 0xe850
callq 0x782e
leaq 0x8336(%rip), %rdi      # 0xe4e8
callq 0x7790
testb %al, %al
je 0x6278
testb $0x1, 0x8362(%rip)      # 0xe528
je 0x61cd
callq 0x2070
movl $0x0, 0x8351(%rip)      # 0xe528
leaq 0x8332(%rip), %r14      # 0xe510
xorl %r12d, %r12d
movq %r12, 0x8348(%rip)      # 0xe530
callq 0x8693
movl %eax, %ebp
andb %r15b, %bpl
andb %bl, %bpl
xorl %eax, %eax
xchgq %rax, 0x82e2(%rip)      # 0xe4e0
movq %fs:0x0, %rax
movb $0x0, -0x30(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movq %r12, -0x10(%rax)
callq 0x3747
movl $0x290, %edx            # imm = 0x290
movq %r14, %rdi
xorl %esi, %esi
callq 0x21b0
leaq 0x82ab(%rip), %rdi      # 0xe4e8
callq 0x782e
jmp 0x6297
leaq 0x3976(%rip), %rsi      # 0x9bc1
leaq 0x3954(%rip), %rdx      # 0x9ba6
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0xd9, %ecx
jmp 0x6290
leaq 0x395c(%rip), %rsi      # 0x9bc1
leaq 0x393a(%rip), %rdx      # 0x9ba6
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0xe2, %ecx
jmp 0x6290
leaq 0x3942(%rip), %rsi      # 0x9bc1
leaq 0x3920(%rip), %rdx      # 0x9ba6
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0xe9, %ecx
callq 0x31c0
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aremmell[P]libsir/src/sirinternal.c
// Function: sir_updatelevels
static
bool _sir_updatelevels(const char* name, sir_levels* old, const sir_levels* new) {
    bool retval = _sir_validstr(name) && _sir_validptr(old) && _sir_validptr(new);
    if (retval) {
        if (*old != *new) {
            _sir_selflog("updating %s levels from %04"PRIx16" to %04"PRIx16, name, *old, *new);
            *old = *new;
        } else {
            _sir_selflog("skipped superfluous update of %s levels: %04"PRIx16, name, *old);
        }
    }
    return retval;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x6358
cmpb $0x0, (%rdi)
je 0x6358
testq %rsi, %rsi
je 0x636d
testq %rdx, %rdx
je 0x636d
movzwl (%rdx), %ecx
movb $0x1, %al
cmpw %cx, (%rsi)
je 0x638c
movw %cx, (%rsi)
jmp 0x638c
leaq 0x3a07(%rip), %rsi      # 0x9d66
leaq 0x3840(%rip), %rdx      # 0x9ba6
movl $0x800a0000, %edi       # imm = 0x800A0000
jmp 0x6380
leaq 0x39f2(%rip), %rsi      # 0x9d66
leaq 0x382b(%rip), %rdx      # 0x9ba6
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x145, %ecx            # imm = 0x145
callq 0x31c0
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/aremmell[P]libsir/src/sirinternal.c
// Function: sir_updateopts
static
bool _sir_updateopts(const char* name, sir_options* old, const sir_options* new) {
    bool retval = _sir_validstr(name) && _sir_validptr(old) && _sir_validptr(new);
    if (retval) {
        if (*old != *new) {
            _sir_selflog("updating %s options from %08"PRIx32" to %08"PRIx32, name, *old, *new);
            *old = *new;
        } else {
            _sir_selflog("skipped superfluous update of %s options: %08"PRIx32, name, *old);
        }
    }
    return retval;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x63c3
cmpb $0x0, (%rdi)
je 0x63c3
testq %rsi, %rsi
je 0x63d8
testq %rdx, %rdx
je 0x63d8
movl (%rdx), %ecx
movb $0x1, %al
cmpl %ecx, (%rsi)
je 0x63f7
movl %ecx, (%rsi)
jmp 0x63f7
leaq 0x39ae(%rip), %rsi      # 0x9d78
leaq 0x37d5(%rip), %rdx      # 0x9ba6
movl $0x800a0000, %edi       # imm = 0x800A0000
jmp 0x63eb
leaq 0x3999(%rip), %rsi      # 0x9d78
leaq 0x37c0(%rip), %rdx      # 0x9ba6
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x153, %ecx            # imm = 0x153
callq 0x31c0
xorl %eax, %eax
popq %rcx
retq