LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/include/sir/impl.h
// Function: sir_strlcat
static inline size_t
_sir_strlcat(char *dst, const char *src, size_t dsize)
{
  const char *odst  = dst;
  const char *osrc  = src;
  size_t      n     = dsize;
  size_t      dlen;

  /*
   * Find the end of dst and adjust bytes
   * left, but don't go past the end.
   */

  while (n-- != 0 && *dst != '\0')
    dst++;

  dlen  =   dst - odst;
  n     = dsize - dlen;

  if (n-- == 0)
    return dlen + strlen(src);

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

  *dst = '\0';

  return dlen + (src - osrc); /* count does not include NUL */
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x17(%rsp)
je 0x8630
movq 0x48(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x863a
jmp 0x864a
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x8601
movq 0x48(%rsp), %rax
movq 0x30(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
subq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, 0x20(%rsp)
cmpq $0x0, %rax
jne 0x86a8
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x2130
movq %rax, %rcx
movq 0x8(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x8719
jmp 0x86aa
movq 0x40(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x86f7
cmpq $0x0, 0x20(%rsp)
je 0x86e7
movq 0x40(%rsp), %rax
movb (%rax), %cl
movq 0x48(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x48(%rsp)
movb %cl, (%rax)
movq 0x20(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x86aa
movq 0x48(%rsp), %rax
movb $0x0, (%rax)
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirhelpers.c
// Function: sir_fopen
int _sir_fopen(FILE* restrict* restrict streamptr, const char* restrict filename,
    const char* restrict mode) {
    if (_sir_validptrptr(streamptr) && _sir_validstr(filename) && _sir_validstr(mode)) {
#if defined(__HAVE_STDC_SECURE_OR_EXT1__)
        int ret = fopen_s(streamptr, filename, mode);
        if (0 != ret) {
            (void)_sir_handleerr(ret);
            return -1;
        }
        return 0;
#else
        *streamptr = fopen(filename, mode);
        if (!*streamptr) {
            (void)_sir_handleerr(errno);
            return -1;
        }
        return 0;
#endif
    }

    return -1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x88e2(%rip), %rdx      # 0x11036
leaq 0x87ec(%rip), %rcx      # 0x10f47
movl $0x114, %r8d            # imm = 0x114
callq 0x8830
testb $0x1, %al
jne 0x876f
jmp 0x881c
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x88b6(%rip), %rdx      # 0x11036
leaq 0x87c0(%rip), %rcx      # 0x10f47
movl $0x114, %r8d            # imm = 0x114
callq 0x7ff0
testb $0x1, %al
jne 0x879b
jmp 0x881c
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x888a(%rip), %rdx      # 0x11036
leaq 0x8794(%rip), %rcx      # 0x10f47
movl $0x114, %r8d            # imm = 0x114
callq 0x7ff0
testb $0x1, %al
jne 0x87c4
jmp 0x881c
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2380
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x8812
callq 0x2070
movl (%rax), %edi
leaq 0x883f(%rip), %rsi      # 0x11036
leaq 0x8749(%rip), %rdx      # 0x10f47
movl $0x11f, %ecx            # imm = 0x11F
callq 0x3c00
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x8824
movl $0x0, 0x24(%rsp)
jmp 0x8824
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
leaq 0x4c(%rsp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x21c0
xorl %edi, %edi
leaq 0x4c(%rsp), %rsi
callq 0x2360
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x8901
callq 0x2070
movl (%rax), %edi
leaq 0x875f(%rip), %rsi      # 0x11041
leaq 0x865e(%rip), %rdx      # 0x10f47
movl $0x136, %ecx            # imm = 0x136
callq 0x3c00
andb $0x1, %al
movb %al, 0x97(%rsp)
jmp 0x89e4
leaq 0x10(%rsp), %rdi
leaq 0x4c(%rsp), %rsi
movl $0x3c, %edx
callq 0x22a0
movl 0x1c(%rsp), %eax
andl $-0xb, %eax
movl %eax, 0x1c(%rsp)
xorl %esi, %esi
leaq 0x10(%rsp), %rdx
movl %esi, %edi
callq 0x2370
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x8963
callq 0x2070
movl (%rax), %edi
leaq 0x86fd(%rip), %rsi      # 0x11041
leaq 0x85fc(%rip), %rdx      # 0x10f47
movl $0x13c, %ecx            # imm = 0x13C
callq 0x3c00
andb $0x1, %al
movb %al, 0x97(%rsp)
jmp 0x89e4
callq 0x2240
movl %eax, 0xc(%rsp)
xorl %eax, %eax
cmpq 0x88(%rsp), %rax
je 0x8988
movl 0xc(%rsp), %eax
movb %al, %cl
movq 0x88(%rsp), %rax
movb %cl, (%rax)
xorl %esi, %esi
leaq 0x4c(%rsp), %rdx
movl %esi, %edi
callq 0x2370
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x89a9
movl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x89d1
callq 0x2070
movl (%rax), %edi
leaq 0x868a(%rip), %rsi      # 0x11041
leaq 0x8589(%rip), %rdx      # 0x10f47
movl $0x144, %ecx            # imm = 0x144
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, 0x97(%rsp)
movb 0x97(%rsp), %al
andb $0x1, %al
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x8a54
movq $0x0, 0x40(%rsp)
jmp 0x8b5f
cmpq $0x0, 0x30(%rsp)
jne 0x8a6b
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x8b5f
movq 0x30(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x8b55
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x2450
movq %rax, 0x28(%rsp)
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x8b55
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
callq 0x2130
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x21d0
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
addq 0x18(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq 0x30(%rsp), %rsi
callq 0x2450
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x8b21
jmp 0x8aeb
movq 0x10(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x8b1f
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movb (%rax), %cl
movq 0x20(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x20(%rsp)
movb %cl, (%rax)
jmp 0x8aeb
jmp 0x8ac5
jmp 0x8b23
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movb (%rax), %al
movq 0x20(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x20(%rsp)
movb %al, (%rcx)
movsbl %al, %eax
cmpl $0x0, %eax
je 0x8b53
jmp 0x8b23
jmp 0x8b55
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x8b8f
movq $0x0, 0x20(%rsp)
jmp 0x8c62
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x8c4a
cmpq $0x0, 0x8(%rsp)
jbe 0x8be8
callq 0x2480
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rdx
subq $0x1, %rdx
movzbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x8c0f
callq 0x2480
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x8c35
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movb (%rax,%rcx), %dl
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rsp)
movb %dl, (%rax,%rcx)
jmp 0x8c37
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x8ba1
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movb %dl, %al
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movb %al, 0x2f(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x8c9a
movq $0x0, 0x40(%rsp)
jmp 0x8d3e
cmpq $0x0, 0x30(%rsp)
jne 0x8cb1
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x8d3e
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x2450
movq %rax, 0x20(%rsp)
cmpb $0x0, 0x2f(%rsp)
je 0x8cd4
cmpq $0x0, 0x20(%rsp)
jne 0x8ce0
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x8d3e
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movsbl 0x2f(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
callq 0x2130
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x21d0
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %esi
movq %rax, %rdx
callq 0x8a00
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movsbl 0x2f(%rsp), %edx
callq 0x8c70
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movb %dl, %al
movb %sil, %cl
movq %rdi, 0x18(%rsp)
movb %cl, 0x17(%rsp)
movb %al, 0x16(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x8d79
movq $0x0, 0x20(%rsp)
jmp 0x8ddc
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpb $0x0, 0x17(%rsp)
je 0x8d91
cmpb $0x0, 0x16(%rsp)
jne 0x8d9d
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x8ddc
jmp 0x8d9f
movq 0x8(%rsp), %rdi
movsbl 0x17(%rsp), %esi
callq 0x2140
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x8dd2
movb 0x16(%rsp), %cl
movq 0x8(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x8(%rsp)
movb %cl, (%rax)
jmp 0x8d9f
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movb %dl, %al
movb %sil, %dl
movq %rdi, 0x28(%rsp)
movb %dl, 0x27(%rsp)
movb %al, 0x26(%rsp)
movl %ecx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x8e3a
cmpb $0x0, 0x27(%rsp)
je 0x8e3a
cmpb $0x0, 0x26(%rsp)
je 0x8e3a
cmpl $0x0, 0x20(%rsp)
jne 0x8e46
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x8eb7
jmp 0x8e48
movq 0x10(%rsp), %rcx
movslq 0x20(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xf(%rsp)
jae 0x8e7c
movq 0x18(%rsp), %rdi
movsbl 0x27(%rsp), %esi
callq 0x2140
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x8e86
jmp 0x8ead
movb 0x26(%rsp), %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x8e48
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x819e(%rip), %rdx      # 0x11088
leaq 0x81a5(%rip), %rcx      # 0x11096
movl $0x5b, %r8d
callq 0x8f70
andb $0x1, %al
movb %al, 0xf(%rsp)
testb $0x1, 0xf(%rsp)
je 0x8f5e
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x21c0
movq 0x10(%rsp), %rax
movl $0x100000, 0x4(%rax)    # imm = 0x100000
movq 0x10(%rsp), %rax
movw $0x100, (%rax)          # imm = 0x100
movq 0x10(%rsp), %rax
movl $0x100000, 0xc(%rax)    # imm = 0x100000
movq 0x10(%rsp), %rax
movw $0x100, 0x8(%rax)       # imm = 0x100
movq 0x10(%rsp), %rax
movl $0x100000, 0x14(%rax)   # imm = 0x100000
movq 0x10(%rsp), %rax
movw $0x100, 0x10(%rax)      # imm = 0x100
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_once
bool _sir_once(sir_once* once, sir_once_fn func) {
#if !defined(__WIN__)
    int ret = pthread_once(once, func);
    return 0 == ret ? true : _sir_handleerr(ret);
#else /* __WIN__ */
    return (FALSE != InitOnceExecuteOnce(once, func, NULL, NULL)) ? true
        : _sir_handlewin32err(GetLastError());
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2440
movl %eax, 0x4(%rsp)
xorl %eax, %eax
cmpl 0x4(%rsp), %eax
jne 0x9303
movl $0x1, %eax
movl %eax, (%rsp)
jmp 0x9327
movl 0x4(%rsp), %edi
leaq 0x7fb4(%rip), %rsi      # 0x112c2
leaq 0x7d81(%rip), %rdx      # 0x11096
movl $0x223, %ecx            # imm = 0x223
callq 0x3c00
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
movl (%rsp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_locksection
void* _sir_locksection(sir_mutex_id mid) {
    sir_mutex* m = NULL;
    void* sec    = NULL;

    bool enter = _sir_mapmutexid(mid, &m, &sec) && _sir_mutexlock(m);
    SIR_ASSERT(enter);

    return enter ? sec : NULL;
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl 0x24(%rsp), %edi
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xaaf0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0x968c
jmp 0x969a
movq 0x18(%rsp), %rdi
callq 0xcb30
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
andb $0x1, %al
movb %al, 0xf(%rsp)
testb $0x1, 0xf(%rsp)
je 0x96b6
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
jmp 0x96be
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x96be
movq (%rsp), %rax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_reset_tls
void _sir_reset_tls(void) {
    _sir_resetstr(_sir_tid);
    (void)memset(&_sir_last_thrd_chk, 0, sizeof(sir_time));
    _sir_last_timestamp = 0;
    _sir_reset_tls_error();
}

// Assembly:
pushq %rax
movq %fs:0x0, %rax
leaq -0x30(%rax), %rdi
callq 0x9e20
movq %fs:0x0, %rax
leaq -0x20(%rax), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x21c0
movq %fs:0x0, %rax
leaq -0x10(%rax), %rax
movq $0x0, (%rax)
callq 0x4510
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_syslog_reset
void _sir_syslog_reset(sir_syslog_dest* ctx) {
#if !defined(SIR_NO_SYSTEM_LOGGERS)
    if (_sir_validptr(ctx)) {
        uint32_t old       = ctx->_state.mask;
        ctx->_state.mask   = 0U;
        ctx->_state.logger = NULL;
        _sir_selflog("state reset; mask was %08"PRIx32, old);
    }
#else
    SIR_UNUSED(ctx);
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x7f19(%rip), %rdx      # 0x11683
leaq 0x7925(%rip), %rcx      # 0x11096
movl $0x487, %r8d            # imm = 0x487
callq 0x8f70
testb $0x1, %al
jne 0x9782
jmp 0x97b9
movq 0x10(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x10(%rax)
movl 0xc(%rsp), %esi
leaq 0x7ee3(%rip), %rdi      # 0x11695
movb $0x0, %al
callq 0x9730
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_unlocksection
void _sir_unlocksection(sir_mutex_id mid) {
    sir_mutex* m = NULL;
    void* sec    = NULL;

    bool leave = _sir_mapmutexid(mid, &m, &sec) && _sir_mutexunlock(m);
    SIR_ASSERT_UNUSED(leave, leave);
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl 0x24(%rsp), %edi
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xaaf0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0x9adc
jmp 0x9aea
movq 0x18(%rsp), %rdi
callq 0xcc70
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
andb $0x1, %al
movb %al, 0xf(%rsp)
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movl $0x1, %esi
leaq 0x7919(%rip), %rdx      # 0x117ad
leaq 0x71fb(%rip), %rcx      # 0x11096
movl $0x145, %r8d            # imm = 0x145
callq 0xa720
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0x9eb5
jmp 0x9f0e
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x78e7(%rip), %rdx      # 0x117ad
leaq 0x71c9(%rip), %rcx      # 0x11096
movl $0x145, %r8d            # imm = 0x145
callq 0x8f70
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0x9ee7
jmp 0x9f0e
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x78b5(%rip), %rdx      # 0x117ad
leaq 0x7197(%rip), %rcx      # 0x11096
movl $0x145, %r8d            # imm = 0x145
callq 0x8f70
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
andb $0x1, %al
movb %al, 0xf(%rsp)
testb $0x1, 0xf(%rsp)
je 0x9f85
movq 0x18(%rsp), %rax
movzwl (%rax), %eax
movq 0x10(%rsp), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
je 0x9f68
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
movzwl (%rax), %edx
movq 0x10(%rsp), %rax
movzwl (%rax), %ecx
leaq 0x7870(%rip), %rdi      # 0x117bf
movb $0x0, %al
callq 0x9730
movq 0x10(%rsp), %rax
movw (%rax), %cx
movq 0x18(%rsp), %rax
movw %cx, (%rax)
jmp 0x9f83
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
movzwl (%rax), %edx
leaq 0x7868(%rip), %rdi      # 0x117e4
movb $0x0, %al
callq 0x9730
jmp 0x9f85
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movl $0x1, %esi
leaq 0x781e(%rip), %rdx      # 0x11812
leaq 0x709b(%rip), %rcx      # 0x11096
movl $0x153, %r8d            # imm = 0x153
callq 0xa720
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0xa015
jmp 0xa06e
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x77ec(%rip), %rdx      # 0x11812
leaq 0x7069(%rip), %rcx      # 0x11096
movl $0x153, %r8d            # imm = 0x153
callq 0x8f70
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0xa047
jmp 0xa06e
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x77ba(%rip), %rdx      # 0x11812
leaq 0x7037(%rip), %rcx      # 0x11096
movl $0x153, %r8d            # imm = 0x153
callq 0x8f70
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
andb $0x1, %al
movb %al, 0xf(%rsp)
testb $0x1, 0xf(%rsp)
je 0xa0dc
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
je 0xa0c0
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
movl (%rax), %edx
movq 0x10(%rsp), %rax
movl (%rax), %ecx
leaq 0x7779(%rip), %rdi      # 0x11822
movb $0x0, %al
callq 0x9730
movq 0x10(%rsp), %rax
movl (%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0xa0da
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
movl (%rax), %edx
leaq 0x7775(%rip), %rdi      # 0x11848
movb $0x0, %al
callq 0x9730
jmp 0xa0dc
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_sysloglevels
bool _sir_sysloglevels(sirinit* si, const sir_update_config_data* data) {
    bool updated = _sir_updatelevels(SIR_DESTNAME_SYSLOG, &si->d_syslog.levels, data->levels);
    if (updated) {
        _sir_setbitshigh(&si->d_syslog._state.mask, SIRSL_UPDATED | SIRSL_LEVELS);
        updated = _sir_syslog_updated(si, data);
        _sir_setbitslow(&si->d_syslog._state.mask, SIRSL_UPDATED | SIRSL_LEVELS);
    }
    return updated;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rsi
addq $0x10, %rsi
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x702c(%rip), %rdi      # 0x111c3
callq 0x9e70
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
je 0xa1ec
movq 0x10(%rsp), %rdi
addq $0x10, %rdi
addq $0x8, %rdi
movl $0x22, %esi
callq 0xa200
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xa220
andb $0x1, %al
movb %al, 0x7(%rsp)
movq 0x10(%rsp), %rdi
addq $0x10, %rdi
addq $0x8, %rdi
movl $0x22, %esi
callq 0xa490
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_syslogopts
bool _sir_syslogopts(sirinit* si, const sir_update_config_data* data) {
    bool updated = _sir_updateopts(SIR_DESTNAME_SYSLOG, &si->d_syslog.opts, data->opts);
    if (updated) {
        _sir_setbitshigh(&si->d_syslog._state.mask, SIRSL_UPDATED | SIRSL_OPTIONS);
        updated = _sir_syslog_updated(si, data);
        _sir_setbitslow(&si->d_syslog._state.mask, SIRSL_UPDATED | SIRSL_OPTIONS);
    }
    return updated;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rsi
addq $0x10, %rsi
addq $0x4, %rsi
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
leaq 0x6cd8(%rip), %rdi      # 0x111c3
callq 0x9fd0
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
je 0xa540
movq 0x10(%rsp), %rdi
addq $0x10, %rdi
addq $0x8, %rdi
movl $0x24, %esi
callq 0xa200
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xa220
andb $0x1, %al
movb %al, 0x7(%rsp)
movq 0x10(%rsp), %rdi
addq $0x10, %rdi
addq $0x8, %rdi
movl $0x24, %esi
callq 0xa490
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_writeinit
bool _sir_writeinit(const sir_update_config_data* data, sirinit_update update) {
    (void)_sir_seterror(_SIR_E_NOERROR);

    if (!_sir_sanity() || !_sir_validupdatedata(data) || !_sir_validfnptr(update))
        return false;

    _SIR_LOCK_SECTION(sirconfig, _cfg, SIRMI_CONFIG, false);

    bool updated = update(&_cfg->si, data);
    if (!updated)
        _sir_selflog("error: update routine failed!");

    _SIR_UNLOCK_SECTION(SIRMI_CONFIG);
    return updated;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl $0x80010000, %edi       # imm = 0x80010000
leaq 0x690b(%rip), %rsi      # 0x11295
leaq 0x6705(%rip), %rdx      # 0x11096
movl $0x1b0, %ecx            # imm = 0x1B0
callq 0x3940
callq 0x9d10
testb $0x1, %al
jne 0xa9a6
jmp 0xa9f0
movq 0x18(%rsp), %rdi
leaq 0x68e3(%rip), %rsi      # 0x11295
leaq 0x66dd(%rip), %rdx      # 0x11096
movl $0x1b2, %ecx            # imm = 0x1B2
callq 0x7ad0
testb $0x1, %al
jne 0xa9c9
jmp 0xa9f0
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x68bb(%rip), %rdx      # 0x11295
leaq 0x66b5(%rip), %rcx      # 0x11096
movl $0x1b2, %r8d            # imm = 0x1B2
callq 0xaa80
testb $0x1, %al
jne 0xa9f7
movb $0x0, 0x27(%rsp)
jmp 0xaa6e
xorl %edi, %edi
callq 0x9650
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xaa2f
movl $0x800f0000, %edi       # imm = 0x800F0000
leaq 0x687e(%rip), %rsi      # 0x11295
leaq 0x6678(%rip), %rdx      # 0x11096
movl $0x1b5, %ecx            # imm = 0x1B5
callq 0x3940
movb $0x0, 0x27(%rsp)
jmp 0xaa6e
jmp 0xaa31
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq *%rax
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x7(%rsp)
jne 0xaa5d
leaq 0x684e(%rip), %rdi      # 0x112a4
movb $0x0, %al
callq 0x9730
xorl %edi, %edi
callq 0x9aa0
movb 0x7(%rsp), %al
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/sirinternal.c
// Function: sir_mapmutexid
bool _sir_mapmutexid(sir_mutex_id mid, sir_mutex** m, void** section) {
    sir_mutex* tmpm;
    void* tmpsec;

    switch (mid) {
        case SIRMI_CONFIG:
            tmpm   = &cfg_mutex;
            tmpsec = &_sir_cfg;
            break;
        case SIRMI_FILECACHE:
            tmpm   = &fc_mutex;
            tmpsec = &_sir_fc;
            break;
        case SIRMI_PLUGINCACHE:
            tmpm   = &pc_mutex;
            tmpsec = &_sir_pc;
            break;
#if !defined(SIR_NO_TEXT_STYLING)
        case SIRMI_TEXTSTYLE:
            tmpm   = &ts_mutex;
            tmpsec = &sir_text_style_section;
            break;
#endif
        default: // GCOVR_EXCL_START
#if !defined(SIR_NO_TEXT_STYLING)
            SIR_ASSERT(false);
#endif
            tmpm   = NULL;
            tmpsec = NULL;
            break;
    } // GCOVR_EXCL_STOP

    *m = tmpm;

    if (section)
        *section = tmpsec;

    return *m != NULL && (!section || *section != NULL);
}

// Assembly:
movl %edi, -0x4(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl -0x4(%rsp), %eax
movq %rax, -0x30(%rsp)
subq $0x3, %rax
ja 0xab8a
movq -0x30(%rsp), %rax
leaq 0x6537(%rip), %rcx      # 0x11050
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb9cf(%rip), %rax      # 0x164f8
movq %rax, -0x20(%rsp)
leaq 0xb9eb(%rip), %rax      # 0x16520
movq %rax, -0x28(%rsp)
jmp 0xab9c
leaq 0xbc6d(%rip), %rax      # 0x167b0
movq %rax, -0x20(%rsp)
leaq 0xbc89(%rip), %rax      # 0x167d8
movq %rax, -0x28(%rsp)
jmp 0xab9c
leaq 0xbd03(%rip), %rax      # 0x16860
movq %rax, -0x20(%rsp)
leaq 0xbd1f(%rip), %rax      # 0x16888
movq %rax, -0x28(%rsp)
jmp 0xab9c
leaq 0xbd99(%rip), %rax      # 0x16910
movq %rax, -0x20(%rsp)
leaq 0xb94d(%rip), %rax      # 0x164d0
movq %rax, -0x28(%rsp)
jmp 0xab9c
movq $0x0, -0x20(%rsp)
movq $0x0, -0x28(%rsp)
movq -0x20(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x18(%rsp)
je 0xabbe
movq -0x28(%rsp), %rcx
movq -0x18(%rsp), %rax
movq %rcx, (%rax)
movq -0x10(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, -0x31(%rsp)
je 0xabf5
movb $0x1, %al
cmpq $0x0, -0x18(%rsp)
movb %al, -0x32(%rsp)
je 0xabed
movq -0x18(%rsp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, -0x32(%rsp)
movb -0x32(%rsp), %al
movb %al, -0x31(%rsp)
movb -0x31(%rsp), %al
andb $0x1, %al
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_init_common_static
bool _sir_init_common_static(void) {
#if defined(__HAVE_ATOMIC_H__)
    atomic_init(&_sir_magic, 0);
#endif

#if defined(__WIN__)
    (void)QueryPerformanceFrequency(&_sir_perfcntr_freq);
#endif

    bool created = _sir_mutexcreate(&cfg_mutex);
    SIR_ASSERT(created);

    _sir_eqland(created, _sir_mutexcreate(&fc_mutex));
    SIR_ASSERT(created);

    _sir_eqland(created, _sir_mutexcreate(&pc_mutex));
    SIR_ASSERT(created);

#if !defined(SIR_NO_TEXT_STYLING)
    _sir_eqland(created, _sir_mutexcreate(&ts_mutex));
    SIR_ASSERT(created);
#endif

    return created;
}

// Assembly:
pushq %rax
movq $0x0, 0xb8e4(%rip) # 0x164f0
leaq 0xb8e5(%rip), %rdi      # 0x164f8
callq 0xca10
andb $0x1, %al
movb %al, 0x7(%rsp)
leaq 0xbb8b(%rip), %rdi      # 0x167b0
callq 0xca10
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x6(%rsp)
jne 0xac39
jmp 0xac41
movb 0x7(%rsp), %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
andb $0x1, %al
movb %al, 0x7(%rsp)
leaq 0xbc0e(%rip), %rdi      # 0x16860
callq 0xca10
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x5(%rsp)
jne 0xac66
jmp 0xac6e
movb 0x7(%rsp), %al
movb %al, 0x5(%rsp)
movb 0x5(%rsp), %al
andb $0x1, %al
movb %al, 0x7(%rsp)
leaq 0xbc91(%rip), %rdi      # 0x16910
callq 0xca10
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x4(%rsp)
jne 0xac93
jmp 0xac9b
movb 0x7(%rsp), %al
movb %al, 0x4(%rsp)
movb 0x4(%rsp), %al
andb $0x1, %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
andb $0x1, %al
popq %rcx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_gethostname
bool _sir_gethostname(char name[SIR_MAXHOST]) {
#if !defined(__WIN__)
    int ret = gethostname(name, SIR_MAXHOST - 1);
    return 0 == ret ? true : _sir_handleerr(errno);
#else
    WSADATA wsad = {0};
    int ret      = WSAStartup(MAKEWORD(2, 2), &wsad);
    if (0 != ret)
        return _sir_handlewin32err(ret);

    if (SOCKET_ERROR == gethostname(name, SIR_MAXHOST)) {
        int err = WSAGetLastError();
        WSACleanup();
        return _sir_handlewin32err(err);
    }

    WSACleanup();
    return true;
#endif /* !__WIN__ */
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0xff, %esi
callq 0x23d0
movl %eax, 0xc(%rsp)
xorl %eax, %eax
cmpl 0xc(%rsp), %eax
jne 0xb59f
movl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xb5c7
callq 0x2070
movl (%rax), %edi
leaq 0x614c(%rip), %rsi      # 0x116f9
leaq 0x5ae2(%rip), %rdx      # 0x11096
movl $0x58c, %ecx            # imm = 0x58C
callq 0x3c00
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_clock_gettime
bool _sir_clock_gettime(int clock, time_t* tbuf, long* msecbuf) {
    if (tbuf) {
#if defined(SIR_MSEC_POSIX)
        struct timespec ts = {0};
        int ret            = clock_gettime(clock, &ts);
        SIR_ASSERT(0 == ret);

        if (0 == ret) {
            *tbuf = ts.tv_sec;
            if (msecbuf)
                *msecbuf = ts.tv_nsec / 1000000L;
        } else {
            if (msecbuf)
                *msecbuf = 0L;
            return _sir_handleerr(errno);
        }
#elif defined(SIR_MSEC_WIN32)
        SIR_UNUSED(clock);
        static const ULONGLONG uepoch = (ULONGLONG)116444736e9;

        FILETIME ftutc = {0};
        GetSystemTimePreciseAsFileTime(&ftutc);

        ULARGE_INTEGER ftnow = {0};
        ftnow.HighPart = ftutc.dwHighDateTime;
        ftnow.LowPart  = ftutc.dwLowDateTime;
        ftnow.QuadPart = (ULONGLONG)((ftnow.QuadPart - uepoch) / 10000000ULL);

        *tbuf = (time_t)ftnow.QuadPart;

        SYSTEMTIME st = {0};
        if (FileTimeToSystemTime(&ftutc, &st)) {
            if (msecbuf)
                *msecbuf = (long)st.wMilliseconds;
        } else {
            if (msecbuf)
                *msecbuf = 0L;
            return _sir_handlewin32err(GetLastError());
        }
#else
        SIR_UNUSED(clock);
        (void)time(tbuf);
        if (msecbuf)
            *msecbuf = 0L;
#endif
        return true;
    }
    return false;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0xb69c
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x21c0
movl 0x30(%rsp), %edi
leaq 0x10(%rsp), %rsi
callq 0x20f0
movl %eax, 0xc(%rsp)
xorl %eax, %eax
cmpl 0xc(%rsp), %eax
jne 0xb65a
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x20(%rsp)
je 0xb658
movq 0x18(%rsp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
jmp 0xb695
cmpq $0x0, 0x20(%rsp)
je 0xb66e
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
callq 0x2070
movl (%rax), %edi
leaq 0x6034(%rip), %rsi      # 0x116b0
leaq 0x5a13(%rip), %rdx      # 0x11096
movl $0x4b4, %ecx            # imm = 0x4B4
callq 0x3c00
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xb6a1
movb $0x1, 0x37(%rsp)
jmp 0xb6a1
movb $0x0, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_msec_since
double _sir_msec_since(const sir_time* when, sir_time* out) {
    if (!_sir_validptr(out))
        return 0.0;
#if !defined(__WIN__)
    out->sec = 0;
    out->msec = 0L;

    bool gettime = _sir_clock_gettime(SIR_INTERVALCLOCK, &out->sec, &out->msec);
    SIR_ASSERT(gettime);

    if (!_sir_validptrnofail(when) || !gettime || (out->sec < when->sec ||
        (out->sec == when->sec && out->msec < when->msec)))
        return 0.0;

    return ((((double)out->sec) * 1e3) + (double)out->msec) -
           ((((double)when->sec) * 1e3) + (double)when->msec);
#else /* __WIN__ */
    SIR_ASSERT(_sir_perfcntr_freq.QuadPart > 0LL);

    if (_sir_perfcntr_freq.QuadPart <= 0LL)
        (void)QueryPerformanceFrequency(&_sir_perfcntr_freq);

    (void)QueryPerformanceCounter(&out->counter);

    if (!_sir_validptrnofail(when) || out->counter.QuadPart <= when->counter.QuadPart)
        return 0.0;

    double msec_ratio = ((double)_sir_perfcntr_freq.QuadPart) / 1e3;
    return ((double)(out->counter.QuadPart - when->counter.QuadPart)) / msec_ratio;
#endif
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
leaq 0x5f64(%rip), %rdx      # 0x116c3
leaq 0x5930(%rip), %rcx      # 0x11096
movl $0x4d9, %r8d            # imm = 0x4D9
callq 0x8f70
testb $0x1, %al
jne 0xb783
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0xb87e
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x10(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x8, %rdx
movl $0x7, %edi
callq 0xb5e0
andb $0x1, %al
movb %al, 0xf(%rsp)
movq 0x18(%rsp), %rdi
xorl %esi, %esi
leaq 0x5efb(%rip), %rdx      # 0x116c3
leaq 0x58c7(%rip), %rcx      # 0x11096
movl $0x4e2, %r8d            # imm = 0x4E2
callq 0x8f70
testb $0x1, %al
jne 0xb7e0
jmp 0xb81f
testb $0x1, 0xf(%rsp)
je 0xb81f
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
cmpq (%rcx), %rax
jl 0xb81f
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
cmpq (%rcx), %rax
jne 0xb82a
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jge 0xb82a
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0xb87e
movq 0x10(%rsp), %rax
cvtsi2sdq (%rax), %xmm0
movq 0x10(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm1
movsd 0x5839(%rip), %xmm2     # 0x11080
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x18(%rsp), %rax
cvtsi2sdq (%rax), %xmm1
movq 0x18(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm2
movsd 0x5814(%rip), %xmm3     # 0x11080
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_formattedlevelstr
const char* _sir_formattedlevelstr(sir_level level) {
    static const size_t low  = 0;
    static const size_t high = SIR_NUMLEVELS - 1;

    const char* retval = SIR_UNKNOWN;

    _SIR_DECLARE_BIN_SEARCH(low, high);
    _SIR_BEGIN_BIN_SEARCH()

    if (sir_level_to_str_map[_mid].level == level) {
        retval = sir_level_to_str_map[_mid].fmt;
        break;
    }

    _SIR_ITERATE_BIN_SEARCH((sir_level_to_str_map[_mid].level < level ? 1 : -1));
    _SIR_END_BIN_SEARCH();

    return retval;
}

// Assembly:
movw %di, %ax
movw %ax, -0x2(%rsp)
leaq 0x4a38(%rip), %rax      # 0x10387
movq %rax, -0x10(%rsp)
movq $0x0, -0x18(%rsp)
movq $0x7, -0x20(%rsp)
movq -0x18(%rsp), %rax
addq -0x20(%rsp), %rax
shrq %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rcx
leaq 0xaacc(%rip), %rax      # 0x16450
shlq $0x4, %rcx
addq %rcx, %rax
movzwl (%rax), %eax
movzwl -0x2(%rsp), %ecx
cmpl %ecx, %eax
jne 0xb9b8
movq -0x28(%rsp), %rcx
leaq 0xaaad(%rip), %rax      # 0x16450
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rsp)
jmp 0xba5b
movq -0x18(%rsp), %rax
cmpq -0x20(%rsp), %rax
jne 0xb9c9
jmp 0xba5b
movq -0x28(%rsp), %rcx
leaq 0xaa7b(%rip), %rax      # 0x16450
shlq $0x4, %rcx
addq %rcx, %rax
movzwl (%rax), %edx
movzwl -0x2(%rsp), %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x1, %eax
cmpl %esi, %edx
cmovll %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jle 0xba19
movq -0x28(%rsp), %rax
subq $0x1, %rax
cmpq -0x18(%rsp), %rax
jb 0xba19
movq -0x28(%rsp), %rax
subq $0x1, %rax
movq %rax, -0x20(%rsp)
jmp 0xba3d
movq -0x28(%rsp), %rax
addq $0x1, %rax
cmpq -0x20(%rsp), %rax
ja 0xba39
movq -0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0xba3b
jmp 0xba5b
jmp 0xba3d
movq -0x18(%rsp), %rax
addq -0x20(%rsp), %rax
shrq %rax
movq %rax, -0x28(%rsp)
movb $0x1, %al
testb $0x1, %al
jne 0xb978
jmp 0xba5b
movq -0x10(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/include/sir/helpers.h
// Function: FNV64_1a
static inline
uint64_t FNV64_1a(const char* str) {
    uint64_t hash = 14695981039346656037ULL;
    for (const char* c = str; *c; c++) {
        hash ^= (uint64_t)(unsigned char)(*c);
        hash *= 1099511628211ULL; /* unsigned-integer-overflow */
    }
    return hash;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movabsq $-0x340d631b7bdddcdb, %rax # imm = 0xCBF29CE484222325
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
cmpb $0x0, (%rax)
je 0xbacf
movq -0x18(%rsp), %rax
movzbl (%rax), %eax
xorq -0x10(%rsp), %rax
movq %rax, -0x10(%rsp)
movabsq $0x100000001b3, %rax    # imm = 0x100000001B3
imulq -0x10(%rsp), %rax
movq %rax, -0x10(%rsp)
movq -0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0xba8e
movq -0x10(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirinternal.c
// Function: sir_syslog_open
bool _sir_syslog_open(sir_syslog_dest* ctx) {
#if !defined(SIR_NO_SYSTEM_LOGGERS)
    if (!_sir_bittest(ctx->_state.mask, SIRSL_IS_INIT)) {
        _sir_selflog("not initialized; ignoring");
        return _sir_seterror(_SIR_E_INVALID);
    }

    if (_sir_bittest(ctx->_state.mask, SIRSL_IS_OPEN)) {
        _sir_selflog("log already open; ignoring");
        return true;
    }

    _sir_selflog("opening log (levels: %04"PRIx16", options: %08"PRIx32")", ctx->levels,
        ctx->opts);

# if defined(SIR_OS_LOG_ENABLED)
    ctx->_state.logger = (void*)os_log_create(ctx->identity, ctx->category);
    _sir_selflog("opened os_log ('%s', '%s')", ctx->identity, ctx->category);
# elif defined(SIR_SYSLOG_ENABLED)
    int logopt   = LOG_NDELAY | (_sir_bittest(ctx->opts, SIRO_NOPID) ? 0 : LOG_PID);
    int facility = LOG_USER;

    openlog(ctx->identity, logopt, facility);
    _sir_selflog("opened syslog('%s', %x, %x)", ctx->identity, logopt, facility);
# elif defined(SIR_EVENTLOG_ENABLED)
    DWORD reg = EventRegister(&SIR_EVENTLOG_GUID, NULL, NULL,
        (PREGHANDLE)&ctx->_state.logger);
    if (ERROR_SUCCESS == reg) {
        _sir_selflog("opened eventlog('%s')", ctx->identity);
    } else {
        /* not fatal; logging calls will just silently fail. */
        _sir_selflog("failed to open eventlog! error: %lu", reg);
        (void)_sir_handlewin32err(reg);
    }
# endif

    _sir_setbitshigh(&ctx->_state.mask, SIRSL_IS_OPEN);
    return true;
#else
    SIR_UNUSED(ctx);
    return false;
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %edi
movl $0x40, %esi
callq 0xbf30
testb $0x1, %al
jne 0xc6c5
leaq 0x4e6c(%rip), %rdi      # 0x11502
movb $0x0, %al
callq 0x9730
movl $0x800c0000, %edi       # imm = 0x800C0000
leaq 0x4e73(%rip), %rsi      # 0x1151c
leaq 0x49e6(%rip), %rdx      # 0x11096
movl $0x399, %ecx            # imm = 0x399
callq 0x3940
andb $0x1, %al
movb %al, 0x17(%rsp)
jmp 0xc78d
movq 0x8(%rsp), %rax
movl 0x8(%rax), %edi
movl $0x1, %esi
callq 0xbf30
testb $0x1, %al
jne 0xc6dd
jmp 0xc6f5
leaq 0x4e49(%rip), %rdi      # 0x1152d
movb $0x0, %al
callq 0x9730
movb $0x1, 0x17(%rsp)
jmp 0xc78d
movq 0x8(%rsp), %rax
movzwl (%rax), %esi
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edx
leaq 0x4e3c(%rip), %rdi      # 0x11548
movb $0x0, %al
callq 0x9730
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
movl $0x2000, %esi           # imm = 0x2000
callq 0xbf30
movb %al, %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
orl $0x8, %eax
movl %eax, 0x4(%rsp)
movl $0x8, (%rsp)
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl 0x4(%rsp), %esi
movl (%rsp), %edx
callq 0x23c0
movq 0x8(%rsp), %rsi
addq $0x18, %rsi
movl 0x4(%rsp), %edx
movl (%rsp), %ecx
leaq 0x4e04(%rip), %rdi      # 0x11572
movb $0x0, %al
callq 0x9730
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0xa200
movb $0x1, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirmutex.c
// Function: sir_mutexcreate
bool _sir_mutexcreate(sir_mutex* mutex) {
    if (_sir_validptr(mutex)) {
        pthread_mutexattr_t attr;
        int op = pthread_mutexattr_init(&attr);
        if (0 == op) {
            op = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
            if (0 == op) {
                op = pthread_mutex_init(mutex, &attr);
                if (0 == op)
                    return true;
            }
        }

        (void)_sir_handleerr(op);
    }

    return false;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x4e85(%rip), %rdx      # 0x118af
leaq 0x4e8f(%rip), %rcx      # 0x118c0
movl $0x27, %r8d
callq 0xcac0
testb $0x1, %al
jne 0xca42
jmp 0xcaae
leaq 0x4(%rsp), %rdi
callq 0x23f0
movl %eax, (%rsp)
xorl %eax, %eax
cmpl (%rsp), %eax
jne 0xca93
leaq 0x4(%rsp), %rdi
movl $0x1, %esi
callq 0x2180
movl %eax, (%rsp)
xorl %eax, %eax
cmpl (%rsp), %eax
jne 0xca91
movq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x2420
movl %eax, (%rsp)
xorl %eax, %eax
cmpl (%rsp), %eax
jne 0xca8f
movb $0x1, 0x17(%rsp)
jmp 0xcab3
jmp 0xca91
jmp 0xca93
movl (%rsp), %edi
leaq 0x4e12(%rip), %rsi      # 0x118af
leaq 0x4e1c(%rip), %rdx      # 0x118c0
movl $0x33, %ecx
callq 0x3c00
movb $0x0, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirmutex.c
// Function: sir_mutexlock
bool _sir_mutexlock(sir_mutex* mutex) {
    if (_sir_validptr(mutex)) {
        int op = pthread_mutex_lock(mutex);
        return 0 == op ? true : _sir_handleerr(op);
    }

    return false;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x4d81(%rip), %rdx      # 0x118cb
leaq 0x4d6f(%rip), %rcx      # 0x118c0
movl $0x3a, %r8d
callq 0xcac0
testb $0x1, %al
jne 0xcb62
jmp 0xcbb7
movq 0x8(%rsp), %rdi
callq 0x2470
movl %eax, 0x4(%rsp)
xorl %eax, %eax
cmpl 0x4(%rsp), %eax
jne 0xcb82
movl $0x1, %eax
movl %eax, (%rsp)
jmp 0xcba6
movl 0x4(%rsp), %edi
leaq 0x4d3e(%rip), %rsi      # 0x118cb
leaq 0x4d2c(%rip), %rdx      # 0x118c0
movl $0x3c, %ecx
callq 0x3c00
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
movl (%rsp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x17(%rsp)
jmp 0xcbbc
movb $0x0, 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/sirmutex.c
// Function: sir_mutextrylock
bool _sir_mutextrylock(sir_mutex* mutex) {
    if (_sir_validptr(mutex)) {
        int op = pthread_mutex_trylock(mutex);
        return 0 == op ? true : _sir_handleerr(op);
    }

    return false;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x4cf0(%rip), %rdx      # 0x118da
leaq 0x4ccf(%rip), %rcx      # 0x118c0
movl $0x43, %r8d
callq 0xcac0
testb $0x1, %al
jne 0xcc02
jmp 0xcc57
movq 0x8(%rsp), %rdi
callq 0x21f0
movl %eax, 0x4(%rsp)
xorl %eax, %eax
cmpl 0x4(%rsp), %eax
jne 0xcc22
movl $0x1, %eax
movl %eax, (%rsp)
jmp 0xcc46
movl 0x4(%rsp), %edi
leaq 0x4cad(%rip), %rsi      # 0x118da
leaq 0x4c8c(%rip), %rdx      # 0x118c0
movl $0x45, %ecx
callq 0x3c00
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
movl (%rsp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x17(%rsp)
jmp 0xcc5c
movb $0x0, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw (%rax,%rax)