LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/utils.c
// Function: generate_filename
void generate_filename(const char *in_name, char *out_name, char *extension)
{
   char tmp_name[FILENAME_MAX];
   int len;
   int i;
   strcpy(tmp_name, in_name);
   len = strlen(tmp_name);
   for (i = len - 1; i > 0; i--) {
      if (tmp_name[i] == '.') {
         break;
      }
   }
   if (i <= 0) {
      i = len;
   }
   tmp_name[i] = '\0';
   sprintf(out_name, "%s.%s", tmp_name, extension);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
leaq -0x1020(%rbp), %r15
movq %r15, %rdi
callq 0x1070
movq %r15, %rdi
callq 0x10d0
movl %eax, %ecx
cmpl $0x2, %ecx
jl 0x2f59
decq %rcx
movl %ecx, %edx
cmpb $0x2e, -0x1020(%rbp,%rdx)
jne 0x2f43
jmp 0x2f5c
movq %rax, %rcx
movslq %ecx, %rax
movb $0x0, -0x1020(%rbp,%rax)
leaq 0xf15e(%rip), %rsi      # 0x120cc
leaq -0x1020(%rbp), %rdx
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1260
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/utils.c
// Function: basename
char *basename(const char *name)
{
   const char *base = name;
   while (*name) {
      if (*name++ == '/') {
         base = name;
      }
   }
   return (char *)base;
}

// Assembly:
movq %rdi, %rax
movb (%rdi), %cl
testb %cl, %cl
je 0x2fb2
pushq %rbp
movq %rsp, %rbp
leaq 0x1(%rax), %rdx
cmpb $0x2f, %cl
cmoveq %rdx, %rax
movb (%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x2fa1
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/utils.c
// Function: copy_file
long copy_file(const char *src_name, const char *dst_name)
{
   unsigned char *buf;
   long bytes_written;
   long bytes_read;

   bytes_read = read_file(src_name, &buf);

   if (bytes_read > 0) {
      bytes_written = write_file(dst_name, buf, bytes_read);
      if (bytes_written != bytes_read) {
         bytes_read = -1;
      }
      free(buf);
   }

   return bytes_read;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq -0x20(%rbp), %rsi
callq 0x2e09
movq %rax, %rbx
testq %rax, %rax
jle 0x3054
movq -0x20(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2eae
cmpq %rbx, %rax
movq $-0x1, %rax
cmovneq %rax, %rbx
movq %r15, %rdi
callq 0x1040
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/utils.c
// Function: dir_list_ext
void dir_list_ext(const char *dir, const char *extension, dir_list *list)
{
   char *pool;
   char *pool_ptr;
   struct dirent *entry;
   DIR *dfd;
   int idx;

   dfd = opendir(dir);
   if (dfd == NULL) {
      ERROR("Can't open '%s'\n", dir);
      exit(1);
   }

   pool = malloc(FILENAME_MAX * MAX_DIR_FILES);
   pool_ptr = pool;

   idx = 0;
   while ((entry = readdir(dfd)) != NULL && idx < MAX_DIR_FILES) {
      if (!extension || str_ends_with(entry->d_name, extension)) {
         sprintf(pool_ptr, "%s/%s", dir, entry->d_name);
         list->files[idx] = pool_ptr;
         pool_ptr += strlen(pool_ptr) + 1;
         idx++;
      }
   }
   list->count = idx;

   closedir(dfd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, -0x38(%rbp)
movq %rsi, %r12
movq %rdi, -0x30(%rbp)
callq 0x10c0
testq %rax, %rax
je 0x313b
movq %rax, %r14
movl $0x80000, %edi          # imm = 0x80000
callq 0x11d0
movq %rax, %r13
movq %r14, %rdi
callq 0x11c0
testq %rax, %rax
je 0x3117
movq %rax, %rbx
xorl %r15d, %r15d
testq %r12, %r12
je 0x30c4
leaq 0x13(%rbx), %rdi
movq %r12, %rsi
callq 0x3144
testl %eax, %eax
je 0x30fc
addq $0x13, %rbx
movq %r13, %rdi
leaq 0xf011(%rip), %rsi      # 0x120e3
movq -0x30(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1260
movslq %r15d, %r15
movq -0x38(%rbp), %rax
movq %r13, (%rax,%r15,8)
movq %r13, %rdi
callq 0x10d0
addq %rax, %r13
incq %r13
incl %r15d
movq %r14, %rdi
callq 0x11c0
testq %rax, %rax
je 0x311a
movq %rax, %rbx
cmpl $0x80, %r15d
jl 0x30af
jmp 0x311a
xorl %r15d, %r15d
movq -0x38(%rbp), %rax
movl %r15d, 0x400(%rax)
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1130
movq -0x30(%rbp), %rdi
callq 0x12c0
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/utils.c
// Function: str_ends_with
int str_ends_with(const char *str, const char *suffix)
{
   if (!str || !suffix) {
      return 0;
   }
   size_t len_str = strlen(str);
   size_t len_suffix = strlen(suffix);
   if (len_suffix > len_str) {
      return 0;
   }
   return (0 == strncmp(str + len_str - len_suffix, suffix, len_suffix));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
xorl %r15d, %r15d
orb %al, %cl
jne 0x319a
movq %rsi, %rbx
movq %rdi, %r14
callq 0x10d0
movq %rax, %r12
movq %rbx, %rdi
callq 0x10d0
cmpq %r12, %rax
ja 0x319a
addq %r12, %r14
subq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1060
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/./stb/stb_image_write.h
// Function: stbi_write_hdr_core
static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data)
{
   if (y <= 0 || x <= 0 || data == NULL)
      return 0;
   else {
      // Each component is stored separately. Allocate scratch space for full output scanline.
      unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4);
      int i, len;
      char buffer[128];
      char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n";
      s->func(s->context, header, sizeof(header)-1);

#ifdef STBI_MSC_SECURE_CRT
      len = sprintf_s(buffer, "EXPOSURE=          1.0000000000000\n\n-Y %d +X %d\n", y, x);
#else
      len = sprintf(buffer, "EXPOSURE=          1.0000000000000\n\n-Y %d +X %d\n", y, x);
#endif
      s->func(s->context, buffer, len);

      for(i=0; i < y; i++)
         stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)*x);
      STBIW_FREE(scratch);
      return 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %ecx, -0x2c(%rbp)
movl %edx, %r15d
movq %rdi, -0x40(%rbp)
testl %edx, %edx
setle %al
movq %rsi, -0x38(%rbp)
testl %esi, %esi
setle %cl
orb %al, %cl
testq %r8, %r8
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x56a8
movq -0x38(%rbp), %rax
leal (,%rax,4), %edi
movq %r8, %r12
callq 0x11d0
movq %rax, %r14
leaq 0xfeb5(%rip), %rsi      # 0x154b0
leaq -0x110(%rbp), %rax
movl $0x8, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movw $0xa, 0x40(%rax)
movq -0x40(%rbp), %r13
movq 0x8(%r13), %rdi
movq %rax, %rsi
movl $0x41, %edx
callq *(%r13)
leaq 0xfb5b(%rip), %rsi      # 0x15189
xorl %ebx, %ebx
leaq -0xc0(%rbp), %rdi
movl %r15d, %edx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x1260
movq 0x8(%r13), %rdi
leaq -0xc0(%rbp), %rsi
movl %eax, %edx
callq *(%r13)
movq -0x38(%rbp), %rax
movl %eax, %r13d
imull -0x2c(%rbp), %r13d
imull %eax, %r13d
decl %r15d
cmpl $0x0, 0x13b74(%rip)     # 0x191e4
movl %r15d, %eax
cmovel %ebx, %eax
imull %r13d, %eax
cltq
leaq (%r12,%rax,4), %r8
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x2c(%rbp), %edx
movq %r14, %rcx
callq 0x529b
incl %ebx
addl $-0x1, %r15d
jb 0x5669
movq %r14, %rdi
callq 0x1040
movl $0x1, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/./stb/stb_image_write.h
// Function: stbi_write_png
STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes)
{
   FILE *f;
   int len;
   unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
   if (png == NULL) return 0;
#ifdef STBI_MSC_SECURE_CRT
   if (fopen_s(&f, filename, "wb"))
      f = NULL;
#else
   f = fopen(filename, "wb");
#endif
   if (!f) { STBIW_FREE(png); return 0; }
   fwrite(png, 1, len, f);
   fclose(f);
   STBIW_FREE(png);
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r9d, %r10d
movl %ecx, %eax
movl %edx, %ecx
movl %esi, %edx
movq %rdi, %r14
leaq -0x14(%rbp), %r9
movq %r8, %rdi
movl %r10d, %esi
movl %eax, %r8d
callq 0x6010
testq %rax, %rax
je 0x6632
movq %rax, %rbx
leaq 0xbacb(%rip), %rsi      # 0x120c9
movq %r14, %rdi
callq 0x1230
testq %rax, %rax
je 0x6637
movq %rax, %r14
movslq -0x14(%rbp), %rdx
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x1280
movq %r14, %rdi
callq 0x10b0
movl $0x1, %r14d
jmp 0x663a
xorl %r14d, %r14d
jmp 0x6642
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1040
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/n64graphics_ci.c
// Function: raw2rgba
rgba *raw2rgba(const uint8_t *raw, int width, int height, int depth)
{
    rgba *img;
    int img_size;

    img_size = width * height * sizeof(*img);
    img = malloc(img_size);
    if (!img) {
        ERROR("Error allocating %d bytes\n", img_size);
        return NULL;
    }

    if (depth == 16) {
        for (int i = 0; i < width * height; i++) {
            img[i].red = SCALE_5_8((raw[i * 2] & 0xF8) >> 3);
            img[i].green = SCALE_5_8(((raw[i * 2] & 0x07) << 2) | ((raw[i * 2 + 1] & 0xC0) >> 6));
            img[i].blue = SCALE_5_8((raw[i * 2 + 1] & 0x3E) >> 1);
            img[i].alpha = (raw[i * 2 + 1] & 0x01) ? 0xFF : 0x00;
        }
    }
    else if (depth == 32) {
        for (int i = 0; i < width * height; i++) {
            img[i].red = raw[i * 4];
            img[i].green = raw[i * 4 + 1];
            img[i].blue = raw[i * 4 + 2];
            img[i].alpha = raw[i * 4 + 3];
        }
    }

    return img;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movl %esi, %r15d
movq %rdi, %r14
imull %edx, %r15d
leal (,%r15,4), %r13d
movslq %r13d, %rdi
callq 0x11d0
movq %rax, %rbx
testq %rax, %rax
je 0x6fd8
cmpl $0x10, %r12d
je 0x6f33
cmpl $0x20, %r12d
jne 0x6ff3
testl %r15d, %r15d
jle 0x6ff3
movl %r15d, %eax
xorl %ecx, %ecx
movb (%r14,%rcx,4), %dl
movb %dl, (%rbx,%rcx,4)
movb 0x1(%r14,%rcx,4), %dl
movb %dl, 0x1(%rbx,%rcx,4)
movb 0x2(%r14,%rcx,4), %dl
movb %dl, 0x2(%rbx,%rcx,4)
movb 0x3(%r14,%rcx,4), %dl
movb %dl, 0x3(%rbx,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x6f04
jmp 0x6ff3
testl %r15d, %r15d
jle 0x6ff3
movl %r15d, %eax
xorl %ecx, %ecx
movl $0xffff, %edx           # imm = 0xFFFF
movzbl (%r14,%rcx,2), %edi
movl %edi, %esi
shrl $0x3, %esi
movl %esi, %r8d
shll $0x8, %r8d
subl %esi, %r8d
andl %edx, %r8d
imull $0x2109, %r8d, %esi     # imm = 0x2109
shrl $0x12, %esi
movb %sil, (%rbx,%rcx,4)
andl $0x7, %edi
movzbl 0x1(%r14,%rcx,2), %esi
movl %esi, %r8d
shrl $0x6, %r8d
leal (%r8,%rdi,4), %edi
movl %edi, %r8d
shll $0x8, %r8d
subl %edi, %r8d
andl %edx, %r8d
imull $0x2109, %r8d, %edi     # imm = 0x2109
shrl $0x12, %edi
movb %dil, 0x1(%rbx,%rcx,4)
movl %esi, %edi
shrl %edi
andl $0x1f, %edi
movl %edi, %r8d
shll $0x8, %r8d
subl %edi, %r8d
andl %edx, %r8d
imull $0x2109, %r8d, %edi     # imm = 0x2109
shrl $0x12, %edi
movb %dil, 0x2(%rbx,%rcx,4)
andb $0x1, %sil
negb %sil
movb %sil, 0x3(%rbx,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x6f46
jmp 0x6ff3
movq 0x12011(%rip), %rax     # 0x18ff0
movq (%rax), %rdi
leaq 0xd499(%rip), %rsi      # 0x14482
movl %r13d, %edx
xorl %eax, %eax
callq 0x1170
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/n64graphics_ci.c
// Function: rawci2rgba
rgba *rawci2rgba(const uint8_t *rawci, const uint8_t *palette, int width, int height, int depth)
{
    uint8_t *raw_rgba;
    rgba *img = NULL;
    int raw_size;
    int pal_index_1;
    int pal_index_2;

    // first convert to raw RGBA
    raw_size = 2 * width * height;
    raw_rgba = malloc(raw_size);
    if (!raw_rgba) {
        ERROR("Error allocating %u bytes\n", raw_size);
        return NULL;
    }

    if (depth == 4) { // CI4
        for (int i = 0; i < (width * height) / 2; i++) {
            pal_index_1 = rawci[i] >> 4;
            pal_index_2 = rawci[i] & 0xF;
            raw_rgba[i * 4 + 0] = palette[pal_index_1 * 2 + 0];
            raw_rgba[i * 4 + 1] = palette[pal_index_1 * 2 + 1];
            raw_rgba[i * 4 + 2] = palette[pal_index_2 * 2 + 0];
            raw_rgba[i * 4 + 3] = palette[pal_index_2 * 2 + 1];
        }
    } else { // CI8
        for (int i = 0; i < width * height; i++) {
            pal_index_1 = rawci[i];
            raw_rgba[i * 2 + 0] = palette[pal_index_1 * 2 + 0];
            raw_rgba[i * 2 + 1] = palette[pal_index_1 * 2 + 1];
        }
    }

    // then convert to RGBA image data
    img = raw2rgba(raw_rgba, width, height, 16);

    free(raw_rgba);

    return img;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, -0x2c(%rbp)
movq %rsi, %r15
movq %rdi, %r13
movl %edx, -0x30(%rbp)
movl %edx, %ebx
movl %ecx, -0x34(%rbp)
imull %ecx, %ebx
leal (%rbx,%rbx), %r14d
movslq %r14d, %rdi
callq 0x11d0
testq %rax, %rax
je 0x70ef
movq %rax, %r12
cmpl $0x4, -0x2c(%rbp)
jne 0x7097
cmpl $0x2, %ebx
jl 0x70bf
shrl %ebx
xorl %eax, %eax
movzbl (%r13,%rax), %ecx
movl %ecx, %edx
shrl $0x3, %edx
movl %edx, %esi
andl $-0x2, %esi
movb (%r15,%rsi), %sil
movb %sil, (%r12,%rax,4)
orq $0x1, %rdx
movb (%r15,%rdx), %dl
movb %dl, 0x1(%r12,%rax,4)
andl $0xf, %ecx
movb (%r15,%rcx,2), %dl
movb %dl, 0x2(%r12,%rax,4)
movb 0x1(%r15,%rcx,2), %cl
movb %cl, 0x3(%r12,%rax,4)
incq %rax
cmpq %rax, %rbx
jne 0x7052
jmp 0x70bf
testl %ebx, %ebx
jle 0x70bf
movl %ebx, %eax
xorl %ecx, %ecx
movzbl (%r13,%rcx), %edx
movb (%r15,%rdx,2), %sil
movb %sil, (%r12,%rcx,2)
movb 0x1(%r15,%rdx,2), %dl
movb %dl, 0x1(%r12,%rcx,2)
incq %rcx
cmpq %rcx, %rax
jne 0x709f
movq %r12, %rdi
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %edx
movl $0x10, %ecx
callq 0x6eaf
movq %rax, %rbx
movq %r12, %rdi
callq 0x1040
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x11efa(%rip), %rax     # 0x18ff0
movq (%rax), %rdi
leaq 0xd39d(%rip), %rsi      # 0x1449d
movl %r14d, %edx
xorl %eax, %eax
callq 0x1170
xorl %eax, %eax
jmp 0x70e0
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/n64graphics_ci.c
// Function: rgba2png
int rgba2png(const char *png_filename, const rgba *img, int width, int height)
{
    int ret = 0;
    INFO("Saving RGBA %dx%d to \"%s\"\n", width, height, png_filename);

    // convert to format stb_image_write expects
    uint8_t *data = malloc(4 * width*height);
    if (data) {
        for (int j = 0; j < height; j++) {
            for (int i = 0; i < width; i++) {
                int idx = j*width + i;
                data[4 * idx] = img[idx].red;
                data[4 * idx + 1] = img[idx].green;
                data[4 * idx + 2] = img[idx].blue;
                data[4 * idx + 3] = img[idx].alpha;
            }
        }

        ret = stbi_write_png(png_filename, width, height, 4, data, 0);

        free(data);
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r12
movq %rdi, %r15
leaq 0x11ce8(%rip), %rax     # 0x191c8
cmpl $0x0, (%rax)
je 0x74fb
leaq 0xd04f(%rip), %rdi      # 0x1453b
movl %r14d, %esi
movl %ebx, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x10e0
movl %r14d, %eax
imull %ebx, %eax
shll $0x2, %eax
movslq %eax, %rdi
callq 0x11d0
testq %rax, %rax
je 0x75bf
movq %rax, %r13
movq %r15, -0x30(%rbp)
testl %ebx, %ebx
jle 0x7598
movl %r14d, %eax
movl %ebx, %ecx
addq $0x3, %r12
leaq (,%rax,4), %rdx
leal (,%r14,4), %esi
xorl %edi, %edi
xorl %r8d, %r8d
testl %r14d, %r14d
jle 0x758b
movl %edi, %r9d
xorl %r10d, %r10d
movb -0x3(%r12,%r10,4), %r11b
movl %r9d, %r15d
movb %r11b, (%r13,%r15)
movb -0x2(%r12,%r10,4), %r11b
leal 0x1(%r9), %r15d
movb %r11b, (%r13,%r15)
movb -0x1(%r12,%r10,4), %r11b
leal 0x2(%r9), %r15d
movb %r11b, (%r13,%r15)
movb (%r12,%r10,4), %r11b
leal 0x3(%r9), %r15d
movb %r11b, (%r13,%r15)
incq %r10
addl $0x4, %r9d
cmpq %r10, %rax
jne 0x7549
incq %r8
addq %rdx, %r12
addl %esi, %edi
cmpq %rcx, %r8
jne 0x753e
movq -0x30(%rbp), %rdi
movl %r14d, %esi
movl %ebx, %edx
movl $0x4, %ecx
movq %r13, %r8
xorl %r9d, %r9d
callq 0x65c6
movl %eax, %ebx
movq %r13, %rdi
callq 0x1040
movl %ebx, %eax
jmp 0x75c1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/n64graphics_ci.c
// Function: getPaletteFilename
char* getPaletteFilename(char* ci_filename)
{
    int bin_filename_len;
    int extension_len;
    char* pal_bin_filename;
    char* extension_loc;
    char* extension;

    // Write Palette file
    bin_filename_len = strlen(ci_filename);
    extension_loc = strrchr(ci_filename, '.');
    extension_len = (int)(extension_loc - ci_filename);
    extension = malloc(extension_len);
    memcpy(extension, extension_loc, extension_len);
    pal_bin_filename = malloc(bin_filename_len + 4); // +4 to include ".pal"
    if (!pal_bin_filename) {
        ERROR("Error allocating bytes for palette filename\n");
    }
    memcpy(pal_bin_filename, ci_filename, bin_filename_len);
    strcpy(pal_bin_filename + bin_filename_len, ".pal");
    //strcpy(pal_bin_filename + bin_filename_len, extension);

    free(extension);

    return pal_bin_filename;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10d0
movq %rax, %r14
shlq $0x20, %r14
movabsq $0x400000000, %rdi      # imm = 0x400000000
addq %r14, %rdi
sarq $0x20, %rdi
callq 0x11d0
movq %rax, %r15
testq %rax, %rax
je 0x764f
sarq $0x20, %r14
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11b0
movl $0x6c61702e, (%r15,%r14) # imm = 0x6C61702E
movb $0x0, 0x4(%r15,%r14)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x133e
jmp 0x7621
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]libcperciva/tests/sysendian/main.c
// Function: fill_testcases
static void
fill_testcases(struct tests * tests)
{
	uint16_t val16;
	uint32_t val32;
	uint64_t val64;
	size_t i;

	/* Load 16-bit tests. */
	for (i = 0; i < 2; i++) {
		tests->val16[i] = tests16[i].val;
		memcpy(&val16, tests16[i].be_arr, 2);
		tests->val16_be[i] = val16;
		memcpy(&val16, tests16[i].le_arr, 2);
		tests->val16_le[i] = val16;
	}

	/* Load 32-bit tests. */
	for (i = 0; i < 4; i++) {
		tests->val32[i] = tests32[i].val;
		memcpy(&val32, tests32[i].be_arr, 4);
		tests->val32_be[i] = val32;
		memcpy(&val32, tests32[i].le_arr, 4);
		tests->val32_le[i] = val32;
	}

	/* Load 64-bit tests. */
	for (i = 0; i < 8; i++) {
		tests->val64[i] = tests64[i].val;
		memcpy(&val64, tests64[i].be_arr, 8);
		tests->val64_be[i] = val64;
		memcpy(&val64, tests64[i].le_arr, 8);
		tests->val64_le[i] = val64;
	}
}

// Assembly:
movb $0x1, %al
xorl %ecx, %ecx
leaq 0x4287(%rip), %rdx      # 0x6100
leaq (%rcx,%rcx,2), %rsi
movzwl (%rdx,%rsi,2), %r8d
movw %r8w, (%rdi,%rcx,2)
movzwl 0x2(%rdx,%rsi,2), %r8d
movw %r8w, 0x4(%rdi,%rcx,2)
movzwl 0x4(%rdx,%rsi,2), %esi
movw %si, 0x8(%rdi,%rcx,2)
movl $0x1, %ecx
testb $0x1, %al
movl $0x0, %eax
jne 0x1e79
movq $-0x10, %rax
leaq 0x425f(%rip), %rcx      # 0x6118
movl -0x8(%rcx), %edx
movl %edx, 0x1c(%rdi,%rax)
movl -0x4(%rcx), %edx
movl %edx, 0x2c(%rdi,%rax)
movl (%rcx), %edx
movl %edx, 0x3c(%rdi,%rax)
addq $0xc, %rcx
addq $0x4, %rax
jne 0x1eb9
movq $-0x40, %rax
leaq 0x426b(%rip), %rcx      # 0x6150
movq -0x10(%rcx), %rdx
movq %rdx, 0x80(%rdi,%rax)
movq -0x8(%rcx), %rdx
movq %rdx, 0xc0(%rdi,%rax)
movq (%rcx), %rdx
movq %rdx, 0x100(%rdi,%rax)
addq $0x18, %rcx
addq $0x8, %rax
jne 0x1ee5
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]libcperciva/tests/sysendian/main.c
// Function: perftest_func
static int
perftest_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct tests * tests = cookie;
	size_t nreps_i;

	(void)buf; /* UNUSED */

	if (buflen == 32) {
		for (nreps_i = 0; nreps_i < nreps; nreps_i++)
			PERFTEST_FULL(tests, 32);
	} else if (buflen == 64) {
		for (nreps_i = 0; nreps_i < nreps; nreps_i++)
			PERFTEST_FULL(tests, 64);
	}

	/* Success! */
	return (0);
}

// Assembly:
cmpq $0x20, %rdx
je 0x1f6b
cmpq $0x40, %rdx
jne 0x1fa5
testq %rcx, %rcx
je 0x1fa5
xorl %eax, %eax
xorl %edx, %edx
movq 0x40(%rdi,%rdx,8), %rsi
movq 0x40(%rdi,%rdx,8), %rsi
movq 0x80(%rdi,%rdx,8), %rsi
bswapq %rsi
movq %rsi, -0x8(%rsp)
movq 0xc0(%rdi,%rdx,8), %rsi
movq %rsi, -0x8(%rsp)
movq -0x8(%rsp), %rsi
incq %rdx
cmpq $0x8, %rdx
jne 0x1f2c
incq %rax
cmpq %rcx, %rax
jne 0x1f2a
jmp 0x1fa5
testq %rcx, %rcx
je 0x1fa5
xorl %eax, %eax
movq $-0x10, %rdx
movl 0x1c(%rdi,%rdx), %esi
movl 0x1c(%rdi,%rdx), %esi
movl 0x2c(%rdi,%rdx), %esi
bswapl %esi
movl %esi, -0xc(%rsp)
movl 0x3c(%rdi,%rdx), %esi
movl %esi, -0xc(%rsp)
movl -0xc(%rsp), %esi
addq $0x4, %rdx
jne 0x1f79
incq %rax
cmpq %rcx, %rax
jne 0x1f72
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]libcperciva/tests/sysendian/main.c
// Function: print_arr
static void
print_arr(const char * str, const uint8_t * arr, size_t n)
{
	size_t i;

	printf("%s", str);
	for (i = 0; i < n; i++)
		printf("%02x ", arr[i]);
	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x1452(%rip), %rdi      # 0x3412
xorl %eax, %eax
callq 0x10d0
testq %rbx, %rbx
je 0x1fed
leaq 0x11b5(%rip), %r15      # 0x3188
xorl %r12d, %r12d
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x10d0
incq %r12
cmpq %r12, %rbx
jne 0x1fd6
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
nop
// File: /workspace/github_c_makefile_star2_O3/smilingthax[P]libfontembed/main.c
// Function: main
int main(int argc,char **argv)
{
  const char *fn=TESTFONT;
  if (argc==2) {
    fn=argv[1];
  }
  OTF_FILE *otf=otf_load(fn);
  assert(otf);
  printf("width(4): %d\n",otf_get_width(otf,4));


  if (strcmp(fn,"test.ttf")!=0) {
    example_write_fontdescr(otf,"test.ttf");
  } else {
    example_write_fontdescr(otf,NULL);
  }

  // show_post(otf);

  // show_name(otf);

  // show_cmap(otf);
  // printf("%d %d\n",otf_from_unicode(otf,'A'),0);

  // ... name 6 -> FontName  /20(cid)
  // ? StemV Flags(?) from FontName

  otf_close(otf);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0x3425
movq 0x8(%rsi), %r14
jmp 0x342c
leaq 0x6c72(%rip), %r14      # 0xa09e
movq %r14, %rdi
callq 0x3d62
testq %rax, %rax
je 0x3494
movq %rax, %rbx
movq %rax, %rdi
movl $0x4, %esi
callq 0x452a
leaq 0x6c9d(%rip), %rdi      # 0xa0ed
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x6c9b(%rip), %rsi      # 0xa0fb
movq %r14, %rdi
callq 0x21e0
testl %eax, %eax
je 0x3478
leaq 0x6c88(%rip), %rsi      # 0xa0fb
movq %rbx, %rdi
jmp 0x347d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x30ac
movq %rbx, %rdi
callq 0x3c90
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x6c37(%rip), %rdi      # 0xa0d2
leaq 0x6b67(%rip), %rsi      # 0xa009
leaq 0x6c2d(%rip), %rcx      # 0xa0d6
movl $0x94, %edx
callq 0x20e0
nop
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/run_hmmannot.c
// Function: annot_worker_for
static void annot_worker_for(void *_data, long i, int tid) // kt_for() callback
{
    annot_step_t *annot_s = (annot_step_t *) _data;
    int exit_code, wexit_st;

    char cmd[4096];
    sprintf(cmd, "%s --noali --cpu 1 -o /dev/null --tblout %s %s %s", annot_s->shared->nhmmscan, annot_s->temp_out[i], annot_s->shared->nhmmdb, annot_s->temp_in[i]);

    exit_code = run_system_cmd(cmd, 3);
    if (exit_code == -1) {
        fprintf(stderr, "[E::%s] failed to execute command: %s\n", __func__, cmd);
        exit(EXIT_FAILURE);
    }
    
    wexit_st = WEXITSTATUS(exit_code);
    if (wexit_st) {
        fprintf(stderr, "[E::%s] command with non-zero exit code: %d\n", __func__, wexit_st);
        exit(EXIT_FAILURE);
    }

    return;
}

// Assembly:
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq 0x18(%rdi), %rax
movq (%rax,%rsi,8), %rcx
movq (%rdi), %rax
movq 0x10(%rdi), %rdi
movq 0x8(%rax), %rdx
movq 0x10(%rax), %r8
movq (%rdi,%rsi,8), %r9
leaq 0x377f(%rip), %rsi      # 0x74ca
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2360
movq %rbx, %rdi
movl $0x3, %esi
callq 0x55b3
cmpl $-0x1, %eax
je 0x3d7d
shrl $0x8, %eax
andl $0xff, %eax
jne 0x3d85
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
movq %rsp, %rdi
callq 0x25e8
movl %eax, %edi
callq 0x25be
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_db_destroy
void hmm_annot_db_destroy(hmm_annot_db_t *annot_db)
{
    if (!annot_db) return;
    size_t i;
    kh_str_t *h_gnames = (kh_str_t *) annot_db->h_gnames;
    kh_str_destroy(h_gnames);
    for (i = 0; i < annot_db->n_gene; ++i)
        free(annot_db->gnames[i]);
    free(annot_db->gnames);
    kh_str_t *h_snames = (kh_str_t *) annot_db->h_snames;
    kh_str_destroy(h_snames);
    for (i = 0; i < annot_db->n_seg; ++i)
        free(annot_db->snames[i]);
    free(annot_db->snames);
    free(annot_db->a);
    free(annot_db->index);
    free(annot_db);
}

// Assembly:
testq %rdi, %rdi
je 0x3e70
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %r14
testq %r14, %r14
je 0x3dcd
movq 0x10(%r14), %rsi
movq 0x18(%r14), %r15
movq %r15, %rdi
callq 0x59a7
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x59a7
movq %r15, %rdi
movq %r14, %rsi
callq 0x59a7
cmpl $0x0, 0x18(%rbx)
je 0x3dee
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2050
incq %r14
movl 0x18(%rbx), %eax
cmpq %rax, %r14
jb 0x3dd6
movq 0x20(%rbx), %rdi
callq 0x2050
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x3e27
movq 0x10(%r14), %rsi
movq 0x18(%r14), %r15
movq %r15, %rdi
callq 0x59a7
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x59a7
movq %r15, %rdi
movq %r14, %rsi
callq 0x59a7
cmpl $0x0, 0x1c(%rbx)
je 0x3e48
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2050
incq %r14
movl 0x1c(%rbx), %eax
cmpq %rax, %r14
jb 0x3e30
movq 0x28(%rbx), %rdi
callq 0x2050
movq 0x10(%rbx), %rdi
callq 0x2050
movq 0x48(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_bed6_db_destroy
void hmm_annot_bed6_db_destroy(hmm_annot_bed6_db_t *annot_db)
{
    size_t i;
    for (i = 0; i < annot_db->n_seg; ++i)
        free(annot_db->snames[i]);
    free(annot_db->snames);
    free(annot_db->a);
    free(annot_db);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
je 0x3ea7
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2050
incq %r14
cmpq 0x18(%rbx), %r14
jb 0x3e91
movq 0x28(%rbx), %rdi
callq 0x2050
movq 0x10(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_gname2id
uint32_t hmm_annot_gname2id(hmm_annot_db_t *annot_db, char *gname)
{
    kh_str_t *h_gnames;
    khint32_t k;
    h_gnames = (kh_str_t *) annot_db->h_gnames;
    k = kh_str_get(h_gnames, gname);
    return k < kh_end(h_gnames)? kh_val(h_gnames, k) : UINT32_MAX;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x30(%rdi), %r8
movq 0x10(%r8), %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x48f7
movq %rsi, %r14
movl (%r8), %ecx
movl $0x1, %eax
shll %cl, %eax
movsbl (%rsi), %r9d
testl %r9d, %r9d
je 0x487e
movb 0x1(%r14), %dl
testb %dl, %dl
je 0x4881
leaq 0x2(%r14), %rsi
movl %r9d, %edi
shll $0x5, %edi
subl %r9d, %edi
movsbl %dl, %r9d
addl %edi, %r9d
movb (%rsi), %dl
incq %rsi
testb %dl, %dl
jne 0x4863
jmp 0x4881
xorl %r9d, %r9d
imull $0x9e3779b9, %r9d, %ebp # imm = 0x9E3779B9
movl %ecx, 0xc(%rsp)
negb %cl
shrl %cl, %ebp
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %ebx
movq 0x8(%r8), %r12
movl %ebp, %r13d
movl %r13d, %eax
shrl $0x5, %eax
movl (%r12,%rax,4), %eax
btl %r13d, %eax
jae 0x48d1
movl %r13d, %eax
leaq (%rax,%rax,2), %rax
movq (%r15,%rax,4), %rdi
movq %r14, %rsi
callq 0x2200
testl %eax, %eax
je 0x48d8
incl %r13d
andl %ebx, %r13d
cmpl %ebp, %r13d
jne 0x489f
movq 0x10(%rsp), %rdx
jmp 0x48db
movl %r13d, %edx
movl %edx, %eax
movl 0xc(%rsp), %ecx
shrl %cl, %eax
testl %eax, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x48f7
movl %edx, %eax
leaq (%rax,%rax,2), %rax
movl 0x8(%r15,%rax,4), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_sname2id
uint32_t hmm_annot_sname2id(hmm_annot_db_t *annot_db, char *sname)
{
    kh_str_t *h_snames;
    khint32_t k;
    h_snames = (kh_str_t *) annot_db->h_snames;
    k = kh_str_get(h_snames, sname);
    return k < kh_end(h_snames)? kh_val(h_snames, k) : UINT32_MAX;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x38(%rdi), %r8
movq 0x10(%r8), %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x49e0
movq %rsi, %r14
movl (%r8), %ecx
movl $0x1, %eax
shll %cl, %eax
movsbl (%rsi), %r9d
testl %r9d, %r9d
je 0x4967
movb 0x1(%r14), %dl
testb %dl, %dl
je 0x496a
leaq 0x2(%r14), %rsi
movl %r9d, %edi
shll $0x5, %edi
subl %r9d, %edi
movsbl %dl, %r9d
addl %edi, %r9d
movb (%rsi), %dl
incq %rsi
testb %dl, %dl
jne 0x494c
jmp 0x496a
xorl %r9d, %r9d
imull $0x9e3779b9, %r9d, %ebp # imm = 0x9E3779B9
movl %ecx, 0xc(%rsp)
negb %cl
shrl %cl, %ebp
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %ebx
movq 0x8(%r8), %r12
movl %ebp, %r13d
movl %r13d, %eax
shrl $0x5, %eax
movl (%r12,%rax,4), %eax
btl %r13d, %eax
jae 0x49ba
movl %r13d, %eax
leaq (%rax,%rax,2), %rax
movq (%r15,%rax,4), %rdi
movq %r14, %rsi
callq 0x2200
testl %eax, %eax
je 0x49c1
incl %r13d
andl %ebx, %r13d
cmpl %ebp, %r13d
jne 0x4988
movq 0x10(%rsp), %rdx
jmp 0x49c4
movl %r13d, %edx
movl %edx, %eax
movl 0xc(%rsp), %ecx
shrl %cl, %eax
testl %eax, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x49e0
movl %edx, %eax
leaq (%rax,%rax,2), %rax
movl 0x8(%r15,%rax,4), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_cmpfunc5
static int hmm_annot_cmpfunc5(const void *a, const void *b)
{
    hmm_annot_t *x, *y;
    x = (hmm_annot_t *) a;
    y = (hmm_annot_t *) b;

    if (x->sid != y->sid)
        return (x->sid > y->sid) - (x->sid < y->sid);
    if (x->og_type != y->og_type)
        return (x->og_type > y->og_type) - (x->og_type < y->og_type);
    if (x->gid != y->gid)
        return (x->gid > y->gid) - (x->gid < y->gid);
    return (x->score < y->score) - (x->score > y->score);
}

// Assembly:
movl 0x4c(%rsi), %eax
cmpl %eax, 0x4c(%rdi)
jne 0x4cee
movl 0x48(%rdi), %eax
movl %eax, %edx
shrl $0x1d, %edx
andl $0x3, %edx
movl 0x48(%rsi), %ecx
movl %ecx, %r8d
shrl $0x1d, %r8d
andl $0x3, %r8d
cmpl %r8d, %edx
jne 0x4cee
movl $0x1fffffff, %edx       # imm = 0x1FFFFFFF
andl %edx, %eax
andl %edx, %ecx
cmpl %ecx, %eax
jne 0x4cee
movsd 0x38(%rdi), %xmm0
movsd 0x38(%rsi), %xmm1
ucomisd %xmm0, %xmm1
seta %al
ucomisd %xmm1, %xmm0
seta %cl
jmp 0x4cf4
seta %al
setb %cl
movzbl %al, %eax
movzbl %cl, %ecx
subl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_db_index_query
hmm_annot_t *hmm_annot_db_index_query(hmm_annot_db_t *annot_db, uint32_t id, uint32_t *n)
{
    hmm_annot_t *q = 0;
    *n = 0;
    if (id < annot_db->n_idx) {
        q = &annot_db->a[annot_db->index[id] >> 32];
        *n = (uint32_t) annot_db->index[id];
    }
    return q;
}

// Assembly:
movl $0x0, (%rdx)
cmpl %esi, 0x44(%rdi)
jbe 0x4d4d
movq 0x48(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
addq 0x10(%rdi), %rax
movl %ecx, (%rdx)
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_formatted_print_index_list
void hmm_annot_formatted_print_index_list(hmm_annot_db_t *annot_db, uint64_t *index_list, size_t n, FILE *fo,
        OG_TYPE_t og_type, double max_evalue, int header)
{
    uint32_t i, j, n_annot;
    int score;
    hmm_annot_t *annot;
    hmm_annot_db_sort(annot_db, ORDER_SID_CO);
    if (header)
        print_hmm_annot_bed6_header(fo);
    for (i = 0; i < n; ++i) {
        annot = hmm_annot_db_index_query(annot_db, index_list[i], &n_annot);
        for (j = 0; j < n_annot; ++j) {
            if (annot[j].og_type != (uint32_t) og_type || 
                    annot[j].evalue > max_evalue) continue;
            score = lround(annot[j].score);
            score = MIN(score, MAX_BED_SCORE);
            fprintf(fo, "%s\t%u\t%u\t%s\t%d\t%c\n", annot[j].sname, annot[j].alifrom, 
                    annot[j].alito, annot[j].gname, score, annot[j].strand? '-' : '+');
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movsd %xmm0, 0x20(%rsp)
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, (%rsp)
movl $0x6, %esi
callq 0x4ac1
testl %ebp, %ebp
je 0x4e2b
leaq 0x286c(%rip), %rsi      # 0x7688
movq %r14, %rdi
movl $0x3e8, %edx            # imm = 0x3E8
xorl %eax, %eax
callq 0x2220
movq %r14, 0x18(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x4f2c
movl $0x3e8, %r12d           # imm = 0x3E8
xorl %eax, %eax
xorl %r15d, %r15d
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rax
movq (%rsp), %rcx
cmpl %eax, 0x44(%rcx)
jbe 0x4f1b
movl %eax, %eax
movq (%rsp), %rcx
movq 0x48(%rcx), %rcx
movq (%rcx,%rax,8), %rax
testl %eax, %eax
je 0x4f1b
movq (%rsp), %rcx
movq 0x10(%rcx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %eax
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rbp
addq $0x48, %rbp
shlq $0x4, %rax
leaq (%rax,%rax,4), %r13
xorl %r14d, %r14d
movl (%rbp,%r14), %eax
shrl $0x1d, %eax
andl $0x3, %eax
cmpl %ebx, %eax
jne 0x4f12
movsd -0x18(%rbp,%r14), %xmm0
ucomisd 0x20(%rsp), %xmm0
ja 0x4f12
movsd -0x10(%rbp,%r14), %xmm0
callq 0x20e0
movq %rax, %r10
cmpl %r12d, %r10d
cmovgel %r12d, %r10d
movq -0x48(%rbp,%r14), %r9
movq -0x40(%rbp,%r14), %rdx
movl -0x30(%rbp,%r14), %ecx
movl -0x2c(%rbp,%r14), %r8d
movl (%rbp,%r14), %eax
shrl $0x1f, %eax
leal 0x2b(,%rax,2), %r11d
movq 0x18(%rsp), %rdi
leaq 0x2724(%rip), %rsi      # 0x7627
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x2220
addq $0x10, %rsp
addq $0x50, %r14
cmpq %r14, %r13
jne 0x4e9f
incl %r15d
movq %r15, %rax
cmpq 0x8(%rsp), %r15
jb 0x4e47
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_formatted_print_sname_list
void hmm_annot_formatted_print_sname_list(hmm_annot_db_t *annot_db, char **sname_list, size_t n, FILE *fo,
        OG_TYPE_t og_type, double max_evalue, int header)
{
    uint32_t i, j, n_annot;
    int score;
    hmm_annot_t *annot;
    hmm_annot_db_sort(annot_db, ORDER_SID_CO);
    if (header)
        print_hmm_annot_bed6_header(fo);
    for (i = 0; i < n; ++i) {
        annot = hmm_annot_db_sname_query(annot_db, sname_list[i], &n_annot);
        for (j = 0; j < n_annot; ++j) {
            if (annot[j].og_type != (uint32_t) og_type ||
                    annot[j].evalue > max_evalue) continue;
            score = lround(annot[j].score);
            score = MIN(score, MAX_BED_SCORE);
            fprintf(fo, "%s\t%u\t%u\t%s\t%d\t%c\n", annot[j].sname, annot[j].alifrom,
                    annot[j].alito, annot[j].gname, score, annot[j].strand? '-' : '+');
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movsd %xmm0, 0x20(%rsp)
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, (%rsp)
movl $0x6, %esi
callq 0x4ac1
testl %ebp, %ebp
je 0x4f8a
leaq 0x270d(%rip), %rsi      # 0x7688
movq %r14, %rdi
movl $0x3e8, %edx            # imm = 0x3E8
xorl %eax, %eax
callq 0x2220
movq %r14, 0x18(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x5094
movl $0x3e8, %r12d           # imm = 0x3E8
xorl %eax, %eax
xorl %r15d, %r15d
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq (%rsp), %r14
movq %r14, %rdi
callq 0x4906
cmpl %eax, 0x44(%r14)
jbe 0x5083
movq (%rsp), %rcx
movq 0x48(%rcx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
testl %eax, %eax
je 0x5083
movq (%rsp), %rcx
movq 0x10(%rcx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %eax
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rbp
addq $0x48, %rbp
shlq $0x4, %rax
leaq (%rax,%rax,4), %r14
xorl %r13d, %r13d
movl (%rbp,%r13), %eax
shrl $0x1d, %eax
andl $0x3, %eax
cmpl %ebx, %eax
jne 0x507a
movsd -0x18(%rbp,%r13), %xmm0
ucomisd 0x20(%rsp), %xmm0
ja 0x507a
movsd -0x10(%rbp,%r13), %xmm0
callq 0x20e0
movq %rax, %r10
cmpl %r12d, %r10d
cmovgel %r12d, %r10d
movq -0x48(%rbp,%r13), %r9
movq -0x40(%rbp,%r13), %rdx
movl -0x30(%rbp,%r13), %ecx
movl -0x2c(%rbp,%r13), %r8d
movl (%rbp,%r13), %eax
shrl $0x1f, %eax
leal 0x2b(,%rax,2), %r11d
movq 0x18(%rsp), %rdi
leaq 0x25bc(%rip), %rsi      # 0x7627
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x2220
addq $0x10, %rsp
addq $0x50, %r13
cmpq %r13, %r14
jne 0x5007
incl %r15d
movq %r15, %rax
cmpq 0x8(%rsp), %r15
jb 0x4fa6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_print_bed6
void hmm_annot_print_bed6(hmm_annot_bed6_db_t *annots, FILE *fo, int header)
{
    if (!annots->n) return;

    if (header)
        print_hmm_annot_bed6_header(fo);
    size_t i;
    hmm_annot_bed6_t *bed6;
    
    qsort(annots->a, annots->n, sizeof(hmm_annot_bed6_t), annot_bed6_cmpfunc);
    
    for (i = 0; i < annots->n; ++i) {
        bed6 = &annots->a[i];
        fprintf(fo, "%s\t%u\t%u\t%s\t%d\t%c\n", bed6->sname, bed6->alifrom,
                bed6->alito, bed6->gname, bed6->score, bed6->strand);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x5373
movq %rdi, %r14
testl %edx, %edx
je 0x5305
leaq 0x2395(%rip), %rsi      # 0x7688
movq %rbx, %rdi
movl $0x3e8, %edx            # imm = 0x3E8
xorl %eax, %eax
callq 0x2220
movq (%r14), %rsi
movq 0x10(%r14), %rdi
leaq 0x6d(%rip), %rcx        # 0x537d
movl $0x20, %edx
callq 0x20d0
cmpq $0x0, (%r14)
je 0x5373
movl $0x1c, %r12d
leaq 0x22fa(%rip), %r15      # 0x7627
xorl %r13d, %r13d
movq 0x10(%r14), %rax
movl -0x8(%rax,%r12), %ecx
movl -0x4(%rax,%r12), %r8d
movq -0x1c(%rax,%r12), %rdx
movq -0x14(%rax,%r12), %r9
movl (%rax,%r12), %r10d
movsbl -0xc(%rax,%r12), %r11d
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x2220
addq $0x10, %rsp
incq %r13
addq $0x20, %r12
cmpq (%r14), %r13
jb 0x5330
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: annot_bed6_cmpfunc
static int annot_bed6_cmpfunc(const void *a, const void *b)
{
    hmm_annot_bed6_t *x, *y;
    x = (hmm_annot_bed6_t *) a;
    y = (hmm_annot_bed6_t *) b;
    int c;
    c = strcmp(x->sname, y->sname);
    if (c) return c;
    c = (x->alifrom > y->alifrom) - (x->alifrom < y->alifrom);
    if (c) return c;
    return (x->alito > y->alito) - (x->alito < y->alito);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq (%rsi), %rsi
callq 0x2200
testl %eax, %eax
jne 0x53b6
movl 0x14(%r14), %ecx
xorl %eax, %eax
cmpl 0x14(%rbx), %ecx
seta %al
sbbl $0x0, %eax
jne 0x53b6
movl 0x18(%r14), %ecx
xorl %eax, %eax
cmpl 0x18(%rbx), %ecx
seta %al
sbbl $0x0, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/misc.c
// Function: make_tempfile
char *make_tempfile(char *temp_dir, char *file_template, const char *suffix)
{
    sprintf(file_template, "%s/tmpXXXXXXXXXX%s", temp_dir, suffix);
    int ret = mkstemps(file_template, strlen(suffix));
    if (ret >= 0) {
        // need to close the file descriptor
        close(ret);
        return strdup(file_template);
    }
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %rdx
leaq 0x2168(%rip), %rsi      # 0x76d8
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2360
movq %r14, %rdi
callq 0x2130
movq %rbx, %rdi
movl %eax, %esi
callq 0x2030
testl %eax, %eax
js 0x55a9
movl %eax, %edi
callq 0x21b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x23b0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/misc.c
// Function: check_executable
void check_executable(char *exe)
{
    char cmd[4096];
    sprintf(cmd, "command -v %s 1>/dev/null 2>/dev/null", exe);

    int exit_code = run_system_cmd(cmd, 1);
    if (exit_code == -1 || WEXITSTATUS(exit_code)) {
        fprintf(stderr, "[E::%s] executable %s is not available\n", __func__, exe);
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdi, %rbx
leaq 0x20f9(%rip), %rsi      # 0x76eb
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2360
movq %r14, %rdi
callq 0x2140
testl $0xff00, %eax           # imm = 0xFF00
jne 0x561c
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2692
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/misc.c
// Function: open_outstream
FILE *open_outstream(char *prefix, char *suffix)
{
    FILE *fo;
    char *out;

    MYMALLOC(out, strlen(prefix) + strlen(suffix) + 1);
    sprintf(out, "%s%s", prefix, suffix);
    fo = fopen(out, "w");
    if (!fo) {
        fprintf(stderr, "[E::%s] failed to open file '%s' to write: %s\n", __func__, out, strerror(errno));
        exit(EXIT_FAILURE);
    }
    free(out);

    return fo;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x2130
movq %rax, %rbx
movq %r14, %rdi
callq 0x2130
leaq (%rbx,%rax), %rdi
incq %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x2040(%rip), %rsi      # 0x774a
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2360
leaq 0x1c28(%rip), %rsi      # 0x7349
movq %rbx, %rdi
callq 0x2310
testq %rax, %rax
je 0x5742
movq %rax, %r14
movq %rbx, %rdi
callq 0x2050
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x26bd
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/kthread.c
// Function: kt_forpool_init
void *kt_forpool_init(int n_threads)
{
	kt_forpool_t *fp;
	int i;
	fp = (kt_forpool_t*)calloc(1, sizeof(kt_forpool_t));
	fp->n_threads = fp->n_pending = n_threads;
	fp->tid = (pthread_t*)calloc(fp->n_threads, sizeof(pthread_t));
	fp->w = (kto_worker_t*)calloc(fp->n_threads, sizeof(kto_worker_t));
	for (i = 0; i < fp->n_threads; ++i) fp->w[i].t = fp;
	pthread_mutex_init(&fp->mutex, 0);
	pthread_cond_init(&fp->cv_m, 0);
	pthread_cond_init(&fp->cv_s, 0);
	for (i = 0; i < fp->n_threads; ++i) pthread_create(&fp->tid[i], 0, kt_fp_worker, &fp->w[i]);
	pthread_mutex_lock(&fp->mutex);
	while (fp->n_pending) pthread_cond_wait(&fp->cv_m, &fp->mutex);
	pthread_mutex_unlock(&fp->mutex);
	return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r14d
movl $0x1, %edi
movl $0xb8, %esi
callq 0x21f0
movq %rax, %rbx
movl %r14d, 0x4(%rax)
movl %r14d, (%rax)
movslq %r14d, %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x21f0
movq %rax, 0x10(%rbx)
movl $0x18, %esi
movq %r15, %rdi
callq 0x21f0
movq %rax, 0x18(%rbx)
testl %r15d, %r15d
jle 0x5fc6
movl %r14d, %ecx
incl %r14d
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %r14d
shlq $0x4, %r14
leaq (%r14,%r14,2), %rcx
movdqa 0x195b(%rip), %xmm1     # 0x78b0
xorl %edx, %edx
movdqa 0x1961(%rip), %xmm2     # 0x78c0
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x1961(%rip), %xmm4     # 0x78d0
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x5fa5
movq %rbx, (%rax,%rdx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x5fb9
movq %rbx, 0x18(%rax,%rdx)
paddq %xmm4, %xmm1
addq $0x30, %rdx
cmpq %rdx, %rcx
jne 0x5f6f
leaq 0x30(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x23d0
leaq 0x58(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2250
movq %rbx, %rdi
addq $0x88, %rdi
xorl %esi, %esi
callq 0x2250
cmpl $0x0, (%rbx)
jle 0x602f
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x10(%rbx), %rdi
addq %r13, %rdi
movq 0x18(%rbx), %rcx
addq %rbp, %rcx
xorl %esi, %esi
leaq 0x4d(%rip), %rdx        # 0x6064
callq 0x22e0
incq %r12
movslq (%rbx), %rax
addq $0x18, %rbp
addq $0x8, %r13
cmpq %rax, %r12
jl 0x6000
movq %r14, %rdi
callq 0x23e0
cmpl $0x0, 0x4(%rbx)
je 0x604a
movq %r15, %rdi
movq %r14, %rsi
callq 0x2100
jmp 0x6037
movq %r14, %rdi
callq 0x2260
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/kthread.c
// Function: kt_fp_worker
static void *kt_fp_worker(void *data)
{
	kto_worker_t *w = (kto_worker_t*)data;
	kt_forpool_t *fp = w->t;
	for (;;) {
		long i;
		int action;
		pthread_mutex_lock(&fp->mutex);
		if (--fp->n_pending == 0)
			pthread_cond_signal(&fp->cv_m);
		w->action = 0;
		while (w->action == 0) pthread_cond_wait(&fp->cv_s, &fp->mutex);
		action = w->action;
		pthread_mutex_unlock(&fp->mutex);
		if (action < 0) break;
		for (;;) { // process jobs allocated to this worker
			i = __sync_fetch_and_add(&w->i, fp->n_threads);
			if (i >= fp->n) break;
			fp->func(fp->data, i, w - fp->w);
		}
		while ((i = kt_fp_steal_work(fp)) >= 0) // steal jobs allocated to other workers
			fp->func(fp->data, i, w - fp->w);
	}
	pthread_exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r13
leaq 0x30(%r13), %r14
leaq 0x58(%r13), %rax
movq %rax, (%rsp)
leaq 0x88(%r13), %r12
movq $-0x1, %r15
movq %r14, %rdi
callq 0x23e0
decl 0x4(%r13)
jne 0x60a6
movq (%rsp), %rdi
callq 0x21e0
movl $0x0, 0x10(%rbx)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2100
movl 0x10(%rbx), %ebp
testl %ebp, %ebp
je 0x60ad
movq %r14, %rdi
callq 0x2260
testl %ebp, %ebp
js 0x618a
movslq (%r13), %rsi
lock
xaddq %rsi, 0x8(%rbx)
cmpq 0x8(%r13), %rsi
movabsq $0x7fffffffffffffff, %rbp # imm = 0x7FFFFFFFFFFFFFFF
jge 0x612d
movq 0x28(%r13), %rdi
movq %rbx, %rax
subq 0x18(%r13), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %edx # imm = 0xAAAAAAAB
callq *0x20(%r13)
movslq (%r13), %rsi
lock
xaddq %rsi, 0x8(%rbx)
cmpq 0x8(%r13), %rsi
jl 0x60e9
jmp 0x612d
movq 0x28(%r13), %rdi
movq %rbx, %rax
subq 0x18(%r13), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %edx # imm = 0xAAAAAAAB
callq *0x20(%r13)
movslq (%r13), %rsi
movq 0x18(%r13), %rax
testq %rsi, %rsi
jle 0x6166
leaq 0x8(%rax), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edi, %edi
movq %rbp, %r8
movq (%rdx), %r9
cmpq %r9, %r8
cmovgl %edi, %ecx
cmovgeq %r9, %r8
incq %rdi
addq $0x18, %rdx
cmpq %rdi, %rsi
jne 0x6148
movslq %ecx, %rcx
jmp 0x616d
movq $-0x1, %rcx
leaq (%rcx,%rcx,2), %rcx
lock
xaddq %rsi, 0x8(%rax,%rcx,8)
cmpq 0x8(%r13), %rsi
cmovgeq %r15, %rsi
testq %rsi, %rsi
jns 0x6114
jmp 0x608f
xorl %edi, %edi
callq 0x2270