LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/termbox[P]termbox/demo/paint.c
// Function: main
int main(int argv, char **argc) {
    (void)argc; (void)argv;
    int code = tb_init();
    if (code < 0) {
        fprintf(stderr, "termbox init failed, code: %d\n", code);
        return -1;
    }

    tb_select_input_mode(TB_INPUT_ESC | TB_INPUT_MOUSE);
    int w = tb_width();
    int h = tb_height();
    reallocBackBuffer(w, h);
    updateAndRedrawAll(-1, -1);
    for (;;) {
        struct tb_event ev;
        int mx = -1;
        int my = -1;
        int t = tb_poll_event(&ev);
        if (t == -1) {
            tb_shutdown();
            fprintf(stderr, "termbox poll event error\n");
            return -1;
        }

        switch (t) {
        case TB_EVENT_KEY:
            if (ev.key == TB_KEY_ESC) {
                tb_shutdown();
                return 0;
            }
            break;
        case TB_EVENT_MOUSE:
            if (ev.key == TB_KEY_MOUSE_LEFT) {
                mx = ev.x;
                my = ev.y;
            }
            break;
        case TB_EVENT_RESIZE:
            reallocBackBuffer(ev.w, ev.h);
            break;
        }
        updateAndRedrawAll(mx, my);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
callq 0x3f9d
testl %eax, %eax
js 0x37f2
movl $0x5, %edi
callq 0x4c8f
callq 0x4c23
movl %eax, %ebx
callq 0x4c2a
movl %ebx, %edi
movl %eax, %esi
callq 0x36f9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3608
movq %rsp, %rbx
leaq 0x2889(%rip), %r14      # 0x6010
movq %rbx, %rdi
callq 0x49b8
incl %eax
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpl $0x4, %eax
ja 0x37dc
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
cmpw $0x1b, 0x2(%rsp)
jne 0x37dc
jmp 0x37e3
movl 0x8(%rsp), %edi
movl 0xc(%rsp), %esi
callq 0x36f9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0x37dc
cmpw $-0x17, 0x2(%rsp)
jne 0x37dc
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
callq 0x3608
jmp 0x3787
callq 0x3fb9
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x57f7(%rip), %rcx      # 0x8ff0
movq (%rcx), %rdi
leaq 0x285d(%rip), %rsi      # 0x6060
movl %eax, %edx
xorl %eax, %eax
callq 0x3170
jmp 0x3813
callq 0x3290
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x37ea
nop
// File: /workspace/github_c_makefile_star2_O3/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_02/atof.c
// Function: main
int main(void)
{
  char line[MAXLEN];

  get_line(line, MAXLEN);
  printf("%s", line);

  printf("%f", atof(line));

  return 0;
}

// Assembly:
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl $0x1, %ebx
callq 0x1040
cmpl $0xa, %eax
je 0x118a
movb %al, -0x1(%rsp,%rbx)
incq %rbx
cmpq $0x1f4, %rbx            # imm = 0x1F4
jne 0x1169
movl $0x1f3, %ebx            # imm = 0x1F3
jmp 0x118f
movb $0xa, -0x1(%rsp,%rbx)
movb $0x0, (%rsp,%rbx)
leaq 0xe96(%rip), %rdi       # 0x2030
movq %rsp, %rbx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
movq %rbx, %rdi
callq 0x1215
leaq 0xe7d(%rip), %rdi       # 0x2033
movb $0x1, %al
callq 0x1030
xorl %eax, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_02/atof.c
// Function: get_line
int get_line(char line[], unsigned int max_line_len)
{
  int i = 0, c;

  while (i < max_line_len - 1 && (c = getchar()) != '\n')
  {
    line[i] = c;
    ++i;
  }

  if (c == '\n')
  {
    line[i++] = c;
  }

  line[i] = '\0';

  return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
decl %ebp
je 0x11f6
movl %ebp, %r15d
xorl %r14d, %r14d
callq 0x1040
cmpl $0xa, %eax
je 0x11fa
movb %al, (%rbx,%r14)
incq %r14
cmpq %r14, %r15
jne 0x11de
jmp 0x1203
xorl %ebp, %ebp
jmp 0x1203
leal 0x1(%r14), %ebp
movb $0xa, (%rbx,%r14)
movslq %ebp, %rax
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_02/atof.c
// Function: atof
double atof(char s[])
{
  double val, power;
  int i, sign, exp_sign = 1, exp_pwr = 0;

  for (i = 0; isspace(s[i]); ++i)
    ;

  sign = (s[i] == '-') ? -1 : 1;

  if (s[i] == '+' || s[i] == '-')
  {
    ++i;
  }

  for (val = 0.0; isdigit(s[i]); ++i)
  {
    val = 10.0 * val + (s[i] - '0');
  }

  if (s[i] == '.')
  {
    ++i;
  }

  for (power = 1.0; isdigit(s[i]); ++i)
  {
    val = 10.0 * val + (s[i] - '0');
    power *= 10;
  }

  if (s[i] == 'e' || s[i] == 'E')
  {
    if (s[++i] == '-')
    {
      exp_sign = -1;
      ++i;
    }
  }

  while (isdigit(s[i]))
  {
    exp_pwr = 10 * exp_pwr + (s[i] - '0');
    ++i;
  }

  while (exp_pwr)
  {
    if (exp_sign == -1)
    {
      power *= 10;
    }
    else
    {
      power /= 10;
    }

    --exp_pwr;
  }

  return sign * val / power;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1050
movq (%rax), %rcx
movq $-0x1, %r8
movq %rbx, %rdx
movsbq (%rdx), %rax
incq %rdx
incq %r8
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x122b
xorl %esi, %esi
cmpb $0x2d, %al
sete %sil
xorl %edi, %edi
cmpb $0x2b, %al
sete %dil
cmpq %rdi, %rsi
cmovaq %rsi, %rdi
addq %r8, %rdi
movl %edi, %esi
movsbq (%rbx,%rsi), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
jne 0x126a
xorpd %xmm0, %xmm0
jmp 0x12b3
leal -0x2b(%rax), %edi
xorl %r9d, %r9d
testb $-0x3, %dil
sete %r9b
addl %r9d, %r8d
addq %r9, %rdx
xorpd %xmm0, %xmm0
movsd 0xd7e(%rip), %xmm1      # 0x2008
movl %r8d, %edi
movsbl %sil, %esi
addl $-0x30, %esi
xorps %xmm2, %xmm2
cvtsi2sd %esi, %xmm2
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movsbq (%rdx), %rsi
incl %edi
incq %rdx
testb $0x8, 0x1(%rcx,%rsi,2)
jne 0x128d
xorl %edx, %edx
cmpb $0x2e, %sil
sete %dl
movl %edi, %r8d
addq %r8, %rdx
movsbq (%rbx,%rdx), %rdi
testb $0x8, 0x1(%rcx,%rdi,2)
jne 0x12d8
movsd 0xd3a(%rip), %xmm1      # 0x2010
jmp 0x1327
xorl %r9d, %r9d
cmpb $0x2e, %sil
sete %r9b
addq %r8, %r9
leaq (%rbx,%r9), %rsi
incq %rsi
movsd 0xd1b(%rip), %xmm1      # 0x2010
movsd 0xd0b(%rip), %xmm2      # 0x2008
movsbl %dil, %edi
addl $-0x30, %edi
xorps %xmm3, %xmm3
cvtsi2sd %edi, %xmm3
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
movsbq (%rsi), %rdi
incl %edx
incq %rsi
testb $0x8, 0x1(%rcx,%rdi,2)
jne 0x12fd
movzbl %dil, %esi
orl $0x20, %esi
cmpl $0x65, %esi
jne 0x134a
movl %edx, %esi
addl $0x2, %edx
cmpb $0x2d, 0x1(%rbx,%rsi)
leaq 0x1(%rsi), %rdi
sete %sil
cmovnel %edi, %edx
jmp 0x134c
xorl %esi, %esi
movslq %edx, %rdx
movsbq (%rbx,%rdx), %r8
testb $0x8, 0x1(%rcx,%r8,2)
je 0x13a1
leaq (%rdx,%rbx), %rdi
incq %rdi
xorl %edx, %edx
movsbl %r8b, %r8d
leal (%rdx,%rdx,4), %edx
leal (%r8,%rdx,2), %edx
addl $-0x30, %edx
movsbq (%rdi), %r8
incq %rdi
testb $0x8, 0x1(%rcx,%r8,2)
jne 0x1365
testl %edx, %edx
je 0x13a1
movsd 0xc7a(%rip), %xmm2      # 0x2008
testb %sil, %sil
jne 0x1399
divsd %xmm2, %xmm1
jmp 0x139d
mulsd %xmm2, %xmm1
decl %edx
jne 0x138e
cmpb $0x2d, %al
jne 0x13ad
xorpd 0xc73(%rip), %xmm0      # 0x2020
divsd %xmm1, %xmm0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/scca/scca.c
// Function: screen_init
static void screen_init(void)
{
  initscr();
  atexit((void *)endwin);
  noecho();
  keypad(stdscr, TRUE);
}

// Assembly:
pushq %rax
callq 0x10a0
movq 0x2724(%rip), %rdi      # 0x3fe8
callq 0x1b20
callq 0x1080
movq 0x26fb(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
movl $0x1, %esi
popq %rax
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/scca/scca.c
// Function: cipher_applied
static unsigned char cipher_applied(unsigned char plain)
{
  unsigned char c;

  if (isupper(plain)) {
    c = allowed_char[plain];
    if (cipher[c] == ' ') {
      return plain;
    } else {
      return cipher[c];
    }
  } else {
    return plain;
  }
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x11b0
movq (%rax), %rcx
movl %ebx, %eax
testb $0x1, 0x1(%rcx,%rax,2)
je 0x1b16
leaq 0x2711(%rip), %rcx      # 0x4210
movzbl (%rcx,%rax,4), %eax
leaq 0x2606(%rip), %rcx      # 0x4110
movzbl (%rax,%rcx), %eax
cmpb $0x20, %al
movzbl %bl, %ebx
cmovnel %eax, %ebx
movl %ebx, %eax
popq %rbx
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: lodepng_load_file
unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename)
{
  FILE* file;
  long size;

  /*provide some proper output values if error will happen*/
  *out = 0;
  *outsize = 0;

  file = fopen(filename, "rb");
  if(!file) return 78;

  /*get filesize:*/
  fseek(file , 0 , SEEK_END);
  size = ftell(file);
  rewind(file);

  /*read contents of the file into the vector*/
  *outsize = 0;
  *out = (unsigned char*)lodepng_malloc((size_t)size);
  if(size && (*out)) (*outsize) = fread(*out, 1, (size_t)size, file);

  fclose(file);
  if(!(*out) && size) return 83; /*the above malloc failed*/
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, (%rdi)
movq %rax, (%rsi)
leaq 0xd869(%rip), %rsi      # 0xeb18
movq %rdx, %rdi
callq 0x1170
testq %rax, %rax
je 0x133a
movq %rax, %r15
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1150
movq %r15, %rdi
callq 0x1110
movq %rax, %r12
movq %r15, %rdi
callq 0x10d0
movq $0x0, (%r14)
movq %r12, %rdi
callq 0x1140
movq %rax, (%rbx)
testq %r12, %r12
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x131c
movl $0x1, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1080
movq %rax, (%r14)
movq %r15, %rdi
callq 0x1090
cmpq $0x0, (%rbx)
movl $0x53, %eax
cmovnel %r13d, %eax
testq %r12, %r12
cmovel %r13d, %eax
jmp 0x133f
movl $0x4e, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: append_symbol_coins
static unsigned append_symbol_coins(Coin* coins, const unsigned* frequencies, unsigned numcodes, size_t sum)
{
  unsigned i;
  unsigned j = 0; /*index of present symbols*/
  for(i = 0; i < numcodes; i++)
  {
    if(frequencies[i] != 0) /*only include symbols that are present*/
    {
      coins[j].weight = frequencies[i] / (float)sum;
      uivector_push_back(&coins[j].symbols, i);
      j++;
    }
  }
  return 0;
}

// Assembly:
testl %edx, %edx
je 0x1885
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rcx, %rcx
js 0x1801
cvtsi2ss %rcx, %xmm0
jmp 0x1816
movq %rcx, %rax
shrq %rax
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
movl %edx, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movl (%rbx,%r13,4), %eax
testl %eax, %eax
je 0x186f
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
divss 0x4(%rsp), %xmm0
movl %ebp, %eax
shlq $0x5, %rax
leaq (%r14,%rax), %r15
movss %xmm0, 0x18(%r14,%rax)
movq 0x8(%r14,%rax), %rsi
incq %rsi
movq %r15, %rdi
callq 0xa370
testl %eax, %eax
je 0x186d
movq (%r15), %rax
movq 0x8(%r15), %rcx
movl %r13d, -0x4(%rax,%rcx,4)
incl %ebp
incq %r13
cmpq %r13, %r12
jne 0x1824
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: lodepng_crc32
unsigned lodepng_crc32(const unsigned char* buf, size_t len)
{
  unsigned c = 0xffffffffL;
  size_t n;

  for(n = 0; n < len; n++)
  {
    c = lodepng_crc32_table[(c ^ buf[n]) & 0xff] ^ (c >> 8);
  }
  return c ^ 0xffffffffL;
}

// Assembly:
testq %rsi, %rsi
je 0x45c3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
leaq 0x9cda(%rip), %rdx      # 0xe280
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
cmpq %rcx, %rsi
jne 0x45a6
notl %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: lodepng_chunk_append
unsigned lodepng_chunk_append(unsigned char** out, size_t* outlength, const unsigned char* chunk)
{
  unsigned i;
  unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12;
  unsigned char *chunk_start, *new_buffer;
  size_t new_length = (*outlength) + total_chunk_length;
  if(new_length < total_chunk_length || new_length < (*outlength)) return 77; /*integer overflow happened*/

  new_buffer = (unsigned char*)lodepng_realloc(*out, new_length);
  if(!new_buffer) return 83; /*alloc fail*/
  (*out) = new_buffer;
  (*outlength) = new_length;
  chunk_start = &(*out)[new_length - total_chunk_length];

  for(i = 0; i < total_chunk_length; i++) chunk_start[i] = chunk[i];

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movzbl (%rdx), %r13d
shll $0x18, %r13d
movzbl 0x1(%rdx), %r15d
shll $0x10, %r15d
leal (%r15,%r13), %eax
movzbl 0x2(%rdx), %r14d
shll $0x8, %r14d
orl %r14d, %eax
movzbl 0x3(%rdx), %ecx
leal (%rcx,%rax), %ebp
addl $0xc, %ebp
movq (%rsi), %rax
movq %rbp, %r12
movl $0x4d, %edx
addq %rax, %r12
jb 0x47da
movq %rax, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq (%rdi), %rdi
movq %r12, %rsi
callq 0x1160
testq %rax, %rax
je 0x47d5
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq 0x20(%rsp), %rcx
movq %r12, (%rcx)
xorl %edx, %edx
testl %ebp, %ebp
je 0x47da
addq 0x8(%rsp), %rax
orl %r15d, %r13d
orl %r14d, %r13d
movq 0x10(%rsp), %rcx
leal (%rcx,%r13), %edx
addl $0xb, %edx
incq %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1130
xorl %edx, %edx
jmp 0x47da
movl $0x53, %edx
movl %edx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: LodePNGText_cleanup
static void LodePNGText_cleanup(LodePNGInfo* info)
{
  size_t i;
  for(i = 0; i < info->text_num; i++)
  {
    string_cleanup(&info->text_keys[i]);
    string_cleanup(&info->text_strings[i]);
  }
  lodepng_free(info->text_keys);
  lodepng_free(info->text_strings);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x48(%rdi)
je 0x4b5d
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x50(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
movq 0x58(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
incq %r15
cmpq 0x48(%rbx), %r15
jb 0x4b32
movq 0x50(%rbx), %rdi
callq 0x1030
movq 0x58(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: string_set
static void string_set(char** out, const char* in)
{
  size_t insize = strlen(in), i = 0;
  if(string_resize(out, insize))
  {
    for(i = 0; i < insize; i++)
    {
      (*out)[i] = in[i];
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x10a0
movq %rax, %r15
movq (%r14), %rdi
leaq 0x1(%rax), %rsi
callq 0x1160
testq %rax, %rax
je 0x4cc4
movb $0x0, (%rax,%r15)
movq %rax, (%r14)
testq %r15, %r15
je 0x4cc4
xorl %eax, %eax
movb (%rbx,%rax), %cl
movq (%r14), %rdx
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x4cb3
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: lodepng_color_mode_equal
static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColorMode* b)
{
  size_t i;
  if(a->colortype != b->colortype) return 0;
  if(a->bitdepth != b->bitdepth) return 0;
  if(a->key_defined != b->key_defined) return 0;
  if(a->key_defined)
  {
    if(a->key_r != b->key_r) return 0;
    if(a->key_g != b->key_g) return 0;
    if(a->key_b != b->key_b) return 0;
  }
  if(a->palettesize != b->palettesize) return 0;
  for(i = 0; i < a->palettesize * 4; i++)
  {
    if(a->palette[i] != b->palette[i]) return 0;
  }
  return 1;
}

// Assembly:
movl (%rdi), %ecx
xorl %eax, %eax
cmpl (%rsi), %ecx
jne 0x570d
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x570d
movl 0x18(%rdi), %ecx
cmpl 0x18(%rsi), %ecx
jne 0x570d
testl %ecx, %ecx
je 0x56d5
movl 0x1c(%rdi), %ecx
cmpl 0x1c(%rsi), %ecx
jne 0x570d
movl 0x20(%rdi), %ecx
cmpl 0x20(%rsi), %ecx
jne 0x570d
movl 0x24(%rdi), %ecx
cmpl 0x24(%rsi), %ecx
jne 0x570d
movq 0x10(%rdi), %rcx
cmpq 0x10(%rsi), %rcx
jne 0x570d
shlq $0x2, %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x570d
movq 0x8(%rdi), %rdx
movq 0x8(%rsi), %rsi
xorl %edi, %edi
movb (%rdx,%rdi), %r8b
cmpb (%rsi,%rdi), %r8b
jne 0x570b
incq %rdi
cmpq %rdi, %rcx
jne 0x56f7
jmp 0x570d
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: color_tree_cleanup
static void color_tree_cleanup(ColorTree* tree)
{
  int i;
  for(i = 0; i < 16; i++)
  {
    if(tree->children[i])
    {
      color_tree_cleanup(tree->children[i]);
      lodepng_free(tree->children[i]);
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x60f0
callq 0x60cf
movq (%rbx,%r14,8), %rdi
callq 0x1030
incq %r14
cmpq $0x10, %r14
jne 0x60d9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: addChunk_tIME
static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time)
{
  unsigned error = 0;
  unsigned char* data = (unsigned char*)lodepng_malloc(7);
  if(!data) return 83; /*alloc fail*/
  data[0] = (unsigned char)(time->year / 256);
  data[1] = (unsigned char)(time->year % 256);
  data[2] = (unsigned char)time->month;
  data[3] = (unsigned char)time->day;
  data[4] = (unsigned char)time->hour;
  data[5] = (unsigned char)time->minute;
  data[6] = (unsigned char)time->second;
  error = addChunk(out, "tIME", data, 7);
  lodepng_free(data);
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x7, %edi
callq 0x1140
testq %rax, %rax
je 0x983f
movq %rax, %rbp
movdqu (%r14), %xmm0
movl (%r14), %eax
movb %ah, (%rbp)
pand 0x48bf(%rip), %xmm0     # 0xe0b0
packuswb %xmm0, %xmm0
packuswb %xmm0, %xmm0
movd %xmm0, 0x1(%rbp)
movb 0x10(%r14), %al
movb %al, 0x5(%rbp)
movb 0x14(%r14), %al
movb %al, 0x6(%rbp)
leaq 0x8(%rbx), %rsi
leaq 0x616d(%rip), %rcx      # 0xf984
movq %rbx, %rdi
movl $0x7, %edx
movq %rbp, %r8
callq 0x47eb
testl %eax, %eax
jne 0x9833
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %rbp, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: generateFixedLitLenTree
static unsigned generateFixedLitLenTree(HuffmanTree* tree)
{
  unsigned i, error = 0;
  unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned));
  if(!bitlen) return 83; /*alloc fail*/

  /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/
  for(i =   0; i <= 143; i++) bitlen[i] = 8;
  for(i = 144; i <= 255; i++) bitlen[i] = 9;
  for(i = 256; i <= 279; i++) bitlen[i] = 7;
  for(i = 280; i <= 287; i++) bitlen[i] = 8;

  error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15);

  lodepng_free(bitlen);
  return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x480, %edi            # imm = 0x480
callq 0x1140
testq %rax, %rax
je 0xa4b1
movq %rax, %rbx
xorl %eax, %eax
movaps 0x3c89(%rip), %xmm0     # 0xe0c0
movups %xmm0, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x90, %rax
jne 0xa437
movl $0x90, %eax
movaps 0x3c7d(%rip), %xmm1     # 0xe0d0
movups %xmm1, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0xa453
movl $0x100, %eax            # imm = 0x100
movaps 0x3c71(%rip), %xmm1     # 0xe0e0
movups %xmm1, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x118, %rax            # imm = 0x118
jne 0xa46f
movups %xmm0, 0x460(%rbx)
movups %xmm0, 0x470(%rbx)
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0xa515
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: generateFixedDistanceTree
static unsigned generateFixedDistanceTree(HuffmanTree* tree)
{
  unsigned i, error = 0;
  unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned));
  if(!bitlen) return 83; /*alloc fail*/

  /*there are 32 distance codes, but 30-31 are unused*/
  for(i = 0; i < NUM_DISTANCE_SYMBOLS; i++) bitlen[i] = 5;
  error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15);

  lodepng_free(bitlen);
  return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x80, %edi
callq 0x1140
testq %rax, %rax
je 0xa50d
movq %rax, %rbx
xorl %eax, %eax
movaps 0x3c15(%rip), %xmm0     # 0xe0f0
movups %xmm0, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x20, %rax
jne 0xa4db
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0xa515
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: HuffmanTree_makeFromLengths
static unsigned HuffmanTree_makeFromLengths(HuffmanTree* tree, const unsigned* bitlen,
                                            size_t numcodes, unsigned maxbitlen)
{
  unsigned i;
  tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned));
  if(!tree->lengths) return 83; /*alloc fail*/
  for(i = 0; i < numcodes; i++) tree->lengths[i] = bitlen[i];
  tree->numcodes = (unsigned)numcodes; /*number of symbols*/
  tree->maxbitlen = maxbitlen;
  return HuffmanTree_makeFromLengths2(tree);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq (,%rdx,4), %rdi
callq 0x1140
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xa56e
testq %r15, %r15
je 0xa556
xorl %ecx, %ecx
movl (%r12,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
movl %ecx, %edx
cmpq %r15, %rdx
jb 0xa545
movl %r15d, 0x1c(%r14)
movl %ebx, 0x18(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa57f
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: getHash
static unsigned getHash(const unsigned char* data, size_t size, size_t pos)
{
  unsigned result = 0;
  if (pos + 2 < size)
  {
    /*A simple shift and xor hash is used. Since the data of PNGs is dominated
    by zeroes due to the filters, a better hash does not have a significant
    effect on speed in traversing the chain, and causes more time spend on
    calculating the hash.*/
    result ^= (unsigned)(data[pos + 0] << 0u);
    result ^= (unsigned)(data[pos + 1] << 4u);
    result ^= (unsigned)(data[pos + 2] << 8u);
  } else {
    size_t amount, i;
    if(pos >= size) return 0;
    amount = size - pos;
    for(i = 0; i < amount; i++) result ^= (unsigned)(data[pos + i] << (i * 8u));
  }
  return result & HASH_BIT_MASK;
}

// Assembly:
leaq 0x2(%rdx), %rax
cmpq %rsi, %rax
jae 0xb105
movzbl (%rdi,%rdx), %eax
movzbl 0x1(%rdi,%rdx), %ecx
shll $0x4, %ecx
xorl %eax, %ecx
movzbl 0x2(%rdi,%rdx), %eax
shll $0x8, %eax
xorl %ecx, %eax
jmp 0xb126
xorl %eax, %eax
cmpq %rsi, %rdx
jae 0xb129
xorl %ecx, %ecx
xorl %eax, %eax
movzbl (%rdi,%rdx), %r8d
shll %cl, %r8d
xorl %r8d, %eax
incq %rdx
addl $0x8, %ecx
cmpq %rdx, %rsi
jne 0xb110
movzwl %ax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/lodepng.c
// Function: addPaddingBits
static void addPaddingBits(unsigned char* out, const unsigned char* in,
                           size_t olinebits, size_t ilinebits, unsigned h)
{
  /*The opposite of the removePaddingBits function
  olinebits must be >= ilinebits*/
  unsigned y;
  size_t diff = olinebits - ilinebits;
  size_t obp = 0, ibp = 0; /*bit pointers*/
  for(y = 0; y < h; y++)
  {
    size_t x;
    for(x = 0; x < ilinebits; x++)
    {
      unsigned char bit = readBitFromReversedStream(&ibp, in);
      setBitOfReversedStream(&obp, out, bit);
    }
    /*obp += diff; --> no, fill in some value in the padding bits too, to avoid
    "Use of uninitialised value of size ###" warning from valgrind*/
    for(x = 0; x < diff; x++) setBitOfReversedStream(&obp, out, 0);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, -0x8(%rsp)
testl %r8d, %r8d
je 0xbe5c
movq %rcx, %rax
movq -0x8(%rsp), %rdx
subq %rcx, %rdx
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %r14d, %r14d
testq %rax, %rax
je 0xbe1c
leaq (%r14,%rax), %rbx
movq %rax, %r15
movq %r11, %r12
movq %r12, %rcx
shrq $0x3, %rcx
movl %r12d, %ebp
notb %bpl
movzbl (%rsi,%rcx), %r13d
movzbl %bpl, %r9d
andl $0x7, %r9d
movl %r14d, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %bpl
shlb %cl, %bpl
btl %r9d, %r13d
jae 0xbdfe
movq %r14, %rcx
shrq $0x3, %rcx
orb %bpl, (%rdi,%rcx)
jmp 0xbe0c
notb %bpl
movq %r14, %rcx
shrq $0x3, %rcx
andb %bpl, (%rdi,%rcx)
incq %r14
incq %r12
decq %r15
jne 0xbdc3
addq %rax, %r11
jmp 0xbe1f
movq %r14, %rbx
cmpq %rax, -0x8(%rsp)
je 0xbe4d
leaq (%rdx,%rbx), %r14
movq %rdx, %r15
movl %ebx, %ecx
notb %cl
movb $-0x2, %r9b
rolb %cl, %r9b
movq %rbx, %rcx
shrq $0x3, %rcx
andb %r9b, (%rdi,%rcx)
incq %rbx
decq %r15
jne 0xbe2d
movq %r14, %rbx
incl %r10d
movq %rbx, %r14
cmpl %r8d, %r10d
jne 0xbdb4
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/main.c
// Function: print_usage
void print_usage(int argc, char **argv) {
    printf("usage: %s [options] <in.png> <out.png>\n", argv[0]);
    printf("\n");
    printf("options:\n");
    printf("  -o, --orientation     [row|column|both] (row)\n");
    printf("  -m, --method          [light|dark|all] (light)\n");
    printf("  -c, --comparator      [avg|mul|max|min|xor] (min)\n");
    printf("  -t, --threshold       [0..255] (210)\n");
    printf("\n");
}

// Assembly:
pushq %rax
movq (%rsi), %rsi
leaq 0x3055(%rip), %rdi      # 0xf9b4
xorl %eax, %eax
callq 0x10c0
movl $0xa, %edi
callq 0x1040
leaq 0x3192(%rip), %rdi      # 0xfb09
callq 0x1060
leaq 0x318f(%rip), %rdi      # 0xfb12
callq 0x1060
leaq 0x31b3(%rip), %rdi      # 0xfb42
callq 0x1060
leaq 0x31d8(%rip), %rdi      # 0xfb73
callq 0x1060
leaq 0x3200(%rip), %rdi      # 0xfba7
callq 0x1060
movl $0xa, %edi
popq %rax
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/read_write.c
// Function: read_image
struct image * read_image(const char * const file) {
    unsigned error;
    FILE * src;
    if(NULL == (src = fopen(file, "rb"))) {
        printf("unable to open source file: %s\n", file);
    }

    image_t * img = (image_t*)malloc(sizeof(image_t));
    img->height = 0;
    img->width = 0;
    img->channels = 4;

    error = lodepng_decode32_file(&(img->buffer), &(img->width), &(img->height), file);
    if(error) printf("error %u: %s\n", error, lodepng_error_text(error));

    return img;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1e8e(%rip), %rsi      # 0xeb18
callq 0x1170
testq %rax, %rax
jne 0xcca5
leaq 0x2f33(%rip), %rdi      # 0xfbce
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movl $0x18, %edi
callq 0x1140
movq %rax, %r14
leaq 0xc(%rax), %rdx
leaq 0x8(%rax), %rsi
movq $0x0, 0x8(%rax)
movl $0x4, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rcx
callq 0x7d2c
testl %eax, %eax
je 0xccf4
movl %eax, %ebx
movl %eax, %edi
callq 0xa352
leaq 0x2f06(%rip), %rdi      # 0xfbee
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10c0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/read_write.c
// Function: write_image
void write_image(image_t * img, const char * const file) {
    FILE * dest;
    if(NULL == (dest = fopen(file, "wb"))) {
        printf("unable to open destination file: %s\n", file);
    }

    unsigned error = lodepng_encode32_file(file, img->buffer, img->width, img->height);
    if(error) printf("error %u: %s\n", error, lodepng_error_text(error));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1e0b(%rip), %rsi      # 0xeb1b
movq %rbx, %rdi
callq 0x1170
testq %rax, %rax
jne 0xcd2e
leaq 0x2ed8(%rip), %rdi      # 0xfbfc
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movq (%r14), %rsi
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
movq %rbx, %rdi
callq 0xa330
testl %eax, %eax
je 0xcd68
movl %eax, %ebx
movl %eax, %edi
callq 0xa352
leaq 0x2e99(%rip), %rdi      # 0xfbee
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/sorting.c
// Function: create_sort_plan
sort_plan_t * create_sort_plan(const struct image * img, const context_t * ctx, enum orientation_e o) {
    sort_plan_t * plan = (sort_plan_t*)malloc(sizeof(sort_plan_t));
    plan->next_step_ptr = NULL;
    plan->orientation = o;
    plan->context_ptr = ctx;
    plan->run_length = (ROW == o) ? img->width  : img->height;
    plan->run_count     = (ROW == o) ? img->height : img->width;
    switch(ctx->run_type) {
    case DARK:
        plan->run_processor_fn = dark_run_processor;
        break;
    case LIGHT:
        plan->run_processor_fn = light_run_processor;
        break;
    case ALL:
    default:
        plan->run_processor_fn = default_run_processor;
        break;
    }
    switch(ctx->comparison) {
    case AVG:
        plan->compare_fn = AVG_CMP;
        plan->sort_val_fn = AVG_VAL;
        break;
    case MUL:
        plan->compare_fn = MUL_CMP;
        plan->sort_val_fn = MUL_VAL;
        break;
    case MAX:
        plan->compare_fn = MAX_CMP;
        plan->sort_val_fn = MAX_VAL;
        break;
    case MIN:
        plan->compare_fn = MIN_CMP;
        plan->sort_val_fn = MIN_VAL;
        break;
    case XOR:
    default:
        plan->compare_fn = XOR_CMP;
        plan->sort_val_fn = XOR_VAL;
        break;
    }
    return plan;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x38, %edi
callq 0x1140
movq $0x0, 0x30(%rax)
movl %ebp, 0x8(%rax)
movq %rbx, 0x28(%rax)
xorl %ecx, %ecx
xorl %edx, %edx
cmpl $0x1, %ebp
sete %cl
setne %dl
movl 0x8(%r14,%rdx,4), %edx
movl %edx, 0x4(%rax)
movl 0x8(%r14,%rcx,4), %ecx
movl %ecx, (%rax)
movl 0x8(%rbx), %ecx
cmpl $0x2, %ecx
leaq 0x257(%rip), %rdx       # 0xd227
leaq 0x43e(%rip), %rsi       # 0xd415
cmoveq %rdx, %rsi
cmpl $0x1, %ecx
leaq 0x44(%rip), %rcx        # 0xd029
cmovneq %rsi, %rcx
movq %rcx, 0x10(%rax)
movl 0x4(%rbx), %edx
cmpq $0x3, %rdx
ja 0xd00e
leaq 0x5db3(%rip), %rcx      # 0x12db0
movq (%rcx,%rdx,8), %rcx
leaq 0x5dc8(%rip), %rsi      # 0x12dd0
movq (%rsi,%rdx,8), %rdx
jmp 0xd01c
leaq 0x55b(%rip), %rdx       # 0xd570
leaq 0x53b(%rip), %rcx       # 0xd557
movq %rcx, 0x20(%rax)
movq %rdx, 0x18(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/sorting.c
// Function: dark_run_processor
void dark_run_processor(pixel_t * pixels, const sort_plan_t * plan_ptr) {
    const int length = plan_ptr->run_length, threshold = plan_ptr->context_ptr->threshold;
    pixel_t * cursor = pixels;
    while(length > (cursor - pixels)) {
        pixel_t * start = cursor + get_first_non_dark(cursor, plan_ptr->sort_val_fn, length - (cursor - pixels), threshold);
        pixel_t * end = start + get_first_dark(start, plan_ptr->sort_val_fn, length - (start - pixels), threshold);
        sort_run(start, end - start, plan_ptr->compare_fn);
        cursor = end;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movslq 0x4(%rsi), %r15
testq %r15, %r15
jle 0xd158
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rax), %rbp
xorl %eax, %eax
movq 0x20(%rsp), %rcx
movq %r15, 0x10(%rsp)
movl %r15d, %r14d
subl %eax, %r14d
movl $0x0, %ebx
testl %r14d, %r14d
jle 0xd0b3
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r13
movl %r14d, %r12d
movq %rcx, 0x8(%rsp)
movq %rcx, %r15
xorl %ebx, %ebx
movq %r15, %rdi
callq *%r13
cltq
cmpq %rax, %rbp
jl 0xd0a9
incq %rbx
addq $0x4, %r15
cmpq %rbx, %r12
jne 0xd08d
movl %r14d, %ebx
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rcx
cmpl %r14d, %ebx
cmovll %ebx, %r14d
movslq %r14d, %rax
leaq (%rcx,%rax,4), %rdi
movq %rdi, %rax
subq 0x20(%rsp), %rax
shrq $0x2, %rax
movl %r15d, %r14d
subl %eax, %r14d
testl %r14d, %r14d
jle 0xd10f
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r13
movl %r14d, %r15d
negq %r15
movq %rdi, 0x8(%rsp)
movq %rdi, %r12
xorl %ebx, %ebx
movq %r12, %rdi
callq *%r13
cltq
cmpq %rax, %rbp
jge 0xd113
decq %rbx
addq $0x4, %r12
cmpq %rbx, %r15
jne 0xd0f1
movl %r14d, %ebx
jmp 0xd115
xorl %ebx, %ebx
jmp 0xd11f
negl %ebx
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rdi
cmpl %r14d, %ebx
cmovll %ebx, %r14d
movslq %r14d, %rsi
leaq (%rdi,%rsi,4), %rbx
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rcx
movl $0x4, %edx
callq 0x1070
movq %rbx, %rcx
movq %rbx, %rax
subq 0x20(%rsp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
jl 0xd067
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/sorting.c
// Function: light_run_processor
void light_run_processor(pixel_t * pixels, const sort_plan_t * plan) {
    const int length = plan->run_length, threshold = plan->context_ptr->threshold;
    pixel_t * cursor = pixels;
    while(length > (cursor - pixels)) {
        pixel_t * start = cursor + get_first_non_light(cursor, plan->sort_val_fn, length - (cursor - pixels), threshold);
        pixel_t * end = start + get_first_light(start, plan->sort_val_fn, length - (start - pixels), threshold);
        sort_run(start, end - start, plan->compare_fn);
        cursor = end;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movslq 0x4(%rsi), %r15
testq %r15, %r15
jle 0xd356
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x10(%rax), %rbp
xorl %eax, %eax
movq 0x20(%rsp), %rcx
movq %r15, 0x10(%rsp)
movl %r15d, %r14d
subl %eax, %r14d
movl $0x0, %ebx
testl %r14d, %r14d
jle 0xd2b1
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r13
movl %r14d, %r12d
movq %rcx, 0x8(%rsp)
movq %rcx, %r15
xorl %ebx, %ebx
movq %r15, %rdi
callq *%r13
cltq
cmpq %rax, %rbp
jg 0xd2a7
incq %rbx
addq $0x4, %r15
cmpq %rbx, %r12
jne 0xd28b
movl %r14d, %ebx
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rcx
cmpl %r14d, %ebx
cmovll %ebx, %r14d
movslq %r14d, %rax
leaq (%rcx,%rax,4), %rdi
movq %rdi, %rax
subq 0x20(%rsp), %rax
shrq $0x2, %rax
movl %r15d, %r14d
subl %eax, %r14d
testl %r14d, %r14d
jle 0xd30d
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r13
movl %r14d, %r15d
negq %r15
movq %rdi, 0x8(%rsp)
movq %rdi, %r12
xorl %ebx, %ebx
movq %r12, %rdi
callq *%r13
cltq
cmpq %rax, %rbp
jle 0xd311
decq %rbx
addq $0x4, %r12
cmpq %rbx, %r15
jne 0xd2ef
movl %r14d, %ebx
jmp 0xd313
xorl %ebx, %ebx
jmp 0xd31d
negl %ebx
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rdi
cmpl %r14d, %ebx
cmovll %ebx, %r14d
movslq %r14d, %rsi
leaq (%rdi,%rsi,4), %rbx
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rcx
movl $0x4, %edx
callq 0x1070
movq %rbx, %rcx
movq %rbx, %rax
subq 0x20(%rsp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
jl 0xd265
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pje[P]pixelsort/sorting.c
// Function: min_val
VAL_FN MIN_VAL(const pixel_t * a) {
    int min = 256;
    for(int c = 0, len = CHANNELS; c < len; ++c) {
        if(((unsigned char *)a)[c] < min) min = ((unsigned char *)a)[c];
    }
    return min;
}

// Assembly:
movl $0x100, %eax            # imm = 0x100
xorl %ecx, %ecx
movl %eax, %edx
movzbl (%rdi,%rcx), %eax
cmpl %eax, %edx
cmovll %edx, %eax
incq %rcx
cmpq $0x3, %rcx
jne 0xd542
retq
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_init_file
int tb_init_file(const char *path) {
    if (global.initialized) {
        return TB_ERR_INIT_ALREADY;
    }
    int ttyfd = open(path, O_RDWR);
    if (ttyfd < 0) {
        global.last_errno = errno;
        return TB_ERR_INIT_OPEN;
    }
    global.ttyfd_open = 1;
    return tb_init_fd(ttyfd);
}

// Assembly:
pushq %rax
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
cmpl $0x0, 0x1f387(%rip)     # 0x25c8c
je 0x6909
popq %rcx
retq
movl $0x2, %esi
xorl %eax, %eax
callq 0x64f0
testl %eax, %eax
js 0x692d
movl $0x1, 0x1f151(%rip)     # 0x25a74
movl %eax, %edi
movl %eax, %esi
popq %rax
jmp 0x6948
callq 0x6060
movl (%rax), %eax
movl %eax, 0x1f34e(%rip)     # 0x25c88
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x6907
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: send_init_escape_codes
static int send_init_escape_codes(void) {
    int rv;
    if_err_return(rv, bytebuf_puts(&global.out, global.caps[TB_CAP_ENTER_CA]));
    if_err_return(rv,
        bytebuf_puts(&global.out, global.caps[TB_CAP_ENTER_KEYPAD]));
    if_err_return(rv,
        bytebuf_puts(&global.out, global.caps[TB_CAP_HIDE_CURSOR]));
    return TB_OK;
}

// Assembly:
pushq %rbx
movq 0x1ec2c(%rip), %rbx     # 0x25b70
movq %rbx, %rdi
callq 0x6160
leaq 0x1ecbd(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8535
testl %eax, %eax
jne 0x6f87
movq 0x1ec5f(%rip), %rbx     # 0x25bc8
movq %rbx, %rdi
callq 0x6160
leaq 0x1ec98(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8535
testl %eax, %eax
je 0x6f89
popq %rbx
retq
movq 0x1ebf8(%rip), %rbx     # 0x25b88
movq %rbx, %rdi
callq 0x6160
leaq 0x1ec71(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
popq %rbx
jmp 0x8535
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: send_clear
static int send_clear(void) {
    int rv;

    if_err_return(rv, send_attr(global.fg, global.bg));
    if_err_return(rv,
        bytebuf_puts(&global.out, global.caps[TB_CAP_CLEAR_SCREEN]));

    if_err_return(rv, send_cursor_if(global.cursor_x, global.cursor_y));
    if_err_return(rv, bytebuf_flush(&global.out, global.wfd));

    global.last_x = -1;
    global.last_y = -1;

    return TB_OK;
}

// Assembly:
pushq %rbx
movzwl 0x1eae5(%rip), %edi     # 0x25a98
movzwl 0x1eae0(%rip), %esi     # 0x25a9a
callq 0x7763
testl %eax, %eax
jne 0x7020
movq 0x1ebc6(%rip), %rbx     # 0x25b90
movq %rbx, %rdi
callq 0x6160
leaq 0x1ec37(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8535
testl %eax, %eax
jne 0x7020
movl 0x1ea9a(%rip), %edi     # 0x25a88
movl 0x1ea98(%rip), %esi     # 0x25a8c
callq 0x7bf0
testl %eax, %eax
jne 0x7020
movl 0x1ea6d(%rip), %edi     # 0x25a70
callq 0x7cb7
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x7020
movq $-0x1, 0x1ea72(%rip) # 0x25a90
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: update_term_size
static int update_term_size(void) {
    int rv, ioctl_errno;

    if (global.ttyfd < 0) {
        return TB_OK;
    }

    struct winsize sz;
    memset(&sz, 0, sizeof(sz));

    // Try ioctl TIOCGWINSZ
    if (ioctl(global.ttyfd, TIOCGWINSZ, &sz) == 0) {
        global.width = sz.ws_col;
        global.height = sz.ws_row;
        return TB_OK;
    }
    ioctl_errno = errno;

    // Try >cursor(9999,9999), >u7, <u6
    if_ok_return(rv, update_term_size_via_esc());

    global.last_errno = ioctl_errno;
    return TB_ERR_RESIZE_IOCTL;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0xe8, %rsp
movl 0x1ea37(%rip), %edi     # 0x25a68
testl %edi, %edi
js 0x7147
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
xorl %ebx, %ebx
movl $0x5413, %esi           # imm = 0x5413
xorl %eax, %eax
callq 0x6240
testl %eax, %eax
je 0x7158
callq 0x6060
movl (%rax), %ebp
movl 0x1ea08(%rip), %edi     # 0x25a70
leaq 0x17686(%rip), %rsi     # 0x1e6f5
movl $0x10, %edx
callq 0x6120
cmpq $0x10, %rax
jne 0x714b
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl 0x1e9bc(%rip), %edi     # 0x25a6c
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
sarl $0x6, %eax
cltq
orq %rdx, 0x60(%rsp,%rax,8)
leaq 0x10(%rsp), %r8
movq $0x0, (%r8)
movq $0xf4240, 0x8(%r8)      # imm = 0xF4240
incl %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6390
cmpl $0x1, %eax
jne 0x714b
movl 0x1e96f(%rip), %edi     # 0x25a6c
leaq 0x20(%rsp), %rsi
movl $0x3f, %edx
callq 0x62b0
testq %rax, %rax
jle 0x714b
movb $0x0, 0x20(%rsp,%rax)
leaq 0x175e9(%rip), %rsi     # 0x1e706
xorl %ebx, %ebx
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
leaq 0x4(%rsp), %rcx
xorl %eax, %eax
callq 0x63f0
cmpl $0x2, %eax
jne 0x714b
movl 0x4(%rsp), %eax
movl %eax, 0x1e93e(%rip)     # 0x25a80
movl (%rsp), %eax
jmp 0x7168
xorl %ebx, %ebx
jmp 0x716e
movl %ebp, 0x1eb37(%rip)     # 0x25c88
movl $0xfffffff5, %ebx       # imm = 0xFFFFFFF5
jmp 0x716e
movzwl 0xa(%rsp), %eax
movl %eax, 0x1e91d(%rip)     # 0x25a80
movzwl 0x8(%rsp), %eax
movl %eax, 0x1e916(%rip)     # 0x25a84
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: init_cellbuf
static int init_cellbuf(void) {
    int rv;
    if_err_return(rv, cellbuf_init(&global.back, global.width, global.height));
    if_err_return(rv, cellbuf_init(&global.front, global.width, global.height));
    if_err_return(rv, cellbuf_clear(&global.back));
    if_err_return(rv, cellbuf_clear(&global.front));
    return TB_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x1e8f6(%rip), %r13     # 0x25a80
movslq 0x1e8f3(%rip), %r12     # 0x25a84
movq %r13, %r15
imulq %r12, %r15
shlq $0x3, %r15
movl $0x1, %edi
movq %r15, %rsi
callq 0x62f0
movq %rax, 0x1ea80(%rip)     # 0x25c30
movl $0xfffffffb, %r14d      # imm = 0xFFFFFFFB
testq %rax, %rax
je 0x724e
movq %rax, %rbx
movl %r13d, 0x1ea5f(%rip)    # 0x25c28
movl %r12d, 0x1ea5c(%rip)    # 0x25c2c
movl $0x1, %edi
movq %r15, %rsi
callq 0x62f0
movq %rax, 0x1ea5c(%rip)     # 0x25c40
testq %rax, %rax
je 0x724e
movl %r13d, 0x1ea48(%rip)    # 0x25c38
movl %r12d, 0x1ea45(%rip)    # 0x25c3c
imull %r13d, %r12d
testl %r12d, %r12d
jle 0x724b
movsd 0x1e890(%rip), %xmm0    # 0x25a98
movl %r12d, %ecx
xorl %edx, %edx
movl $0x20, (%rbx,%rdx,8)
movss %xmm0, 0x4(%rbx,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x720d
testl %r12d, %r12d
jle 0x724b
movsd 0x1e869(%rip), %xmm0    # 0x25a98
xorl %r14d, %r14d
xorl %edx, %edx
movl $0x20, (%rax,%rdx,8)
movss %xmm0, 0x4(%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x7234
jmp 0x724e
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: send_cursor_if
static int send_cursor_if(int x, int y) {
    int rv;
    char nbuf[32];
    if (x < 0 || y < 0) {
        return TB_OK;
    }
    send_literal(rv, "\x1b[");
    send_num(rv, nbuf, y + 1);
    send_literal(rv, ";");
    send_num(rv, nbuf, x + 1);
    send_literal(rv, "H");
    return TB_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %eax
orl %edi, %eax
js 0x7cac
movl %esi, %ebp
movl %edi, %ebx
leaq 0x1e003(%rip), %rdi     # 0x25c10
leaq 0x16b03(%rip), %rsi     # 0x1e717
movl $0x2, %edx
callq 0x8535
testl %eax, %eax
jne 0x7cae
incl %ebp
movq %rsp, %r14
movl %ebp, %edi
movq %r14, %rsi
callq 0x13b6e
movslq %eax, %rdx
leaq 0x1dfd1(%rip), %rdi     # 0x25c10
movq %r14, %rsi
callq 0x8535
testl %eax, %eax
jne 0x7cae
leaq 0x1dfbe(%rip), %rdi     # 0x25c10
leaq 0x16ac5(%rip), %rsi     # 0x1e71e
movl $0x1, %edx
callq 0x8535
testl %eax, %eax
jne 0x7cae
incl %ebx
movq %rsp, %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x13b6e
movslq %eax, %rdx
leaq 0x1df90(%rip), %rdi     # 0x25c10
movq %r14, %rsi
callq 0x8535
testl %eax, %eax
jne 0x7cae
leaq 0x1df7d(%rip), %rdi     # 0x25c10
leaq 0x16c25(%rip), %rsi     # 0x1e8bf
movl $0x1, %edx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x8535
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: bytebuf_flush
static int bytebuf_flush(struct bytebuf_t *b, int fd) {
    if (b->len <= 0) {
        return TB_OK;
    }
    ssize_t write_rv = write(fd, b->buf, b->len);
    if (write_rv < 0 || (size_t)write_rv != b->len) {
        // Note, errno will be 0 on partial write
        global.last_errno = errno;
        return TB_ERR;
    }
    b->len = 0;
    return TB_OK;
}

// Assembly:
pushq %rbx
movq 0x1df59(%rip), %rdx     # 0x25c18
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x7cff
movq 0x1df43(%rip), %rsi     # 0x25c10
callq 0x6120
testq %rax, %rax
js 0x7ced
cmpq 0x1df3a(%rip), %rax     # 0x25c18
jne 0x7ced
movq $0x0, 0x1df2d(%rip) # 0x25c18
jmp 0x7cff
callq 0x6060
movl (%rax), %eax
movl %eax, 0x1df8e(%rip)     # 0x25c88
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: resize_cellbufs
static int resize_cellbufs(void) {
    int rv;
    if_err_return(rv,
        cellbuf_resize(&global.back, global.width, global.height));
    if_err_return(rv,
        cellbuf_resize(&global.front, global.width, global.height));
    if_err_return(rv, cellbuf_clear(&global.front));
    if_err_return(rv, send_clear());
    return TB_OK;
}

// Assembly:
pushq %rax
movl 0x1dd67(%rip), %esi     # 0x25a80
movl 0x1dd65(%rip), %edx     # 0x25a84
leaq 0x1df02(%rip), %rdi     # 0x25c28
callq 0x13a46
testl %eax, %eax
jne 0x7d4b
movl 0x1dd4b(%rip), %esi     # 0x25a80
movl 0x1dd49(%rip), %edx     # 0x25a84
leaq 0x1def6(%rip), %rdi     # 0x25c38
callq 0x13a46
testl %eax, %eax
je 0x7d4d
popq %rcx
retq
movl 0x1dee9(%rip), %ecx     # 0x25c3c
imull 0x1dede(%rip), %ecx     # 0x25c38
testl %ecx, %ecx
jle 0x7d86
movq 0x1dedb(%rip), %rax     # 0x25c40
movsd 0x1dd2b(%rip), %xmm0    # 0x25a98
movl %ecx, %ecx
xorl %edx, %edx
movl $0x20, (%rax,%rdx,8)
movss %xmm0, 0x4(%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x7d71
popq %rax
jmp 0x6fab
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_set_cursor
int tb_set_cursor(int cx, int cy) {
    if_not_init_return();
    int rv;
    if (cx < 0)
        cx = 0;
    if (cy < 0)
        cy = 0;
    if (global.cursor_x == -1) {
        if_err_return(rv,
            bytebuf_puts(&global.out, global.caps[TB_CAP_SHOW_CURSOR]));
    }
    if_err_return(rv, send_cursor_if(cx, cy));
    global.cursor_x = cx;
    global.cursor_y = cy;
    return TB_OK;
}

// Assembly:
cmpl $0x0, 0x1def9(%rip)     # 0x25c8c
je 0x7dcd
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %ebp, %ebp
testl %edi, %edi
cmovlel %ebp, %ebx
testl %esi, %esi
cmovgl %esi, %ebp
cmpl $-0x1, 0x1dcda(%rip)    # 0x25a88
je 0x7dd3
movl %ebx, %edi
movl %ebp, %esi
callq 0x7bf0
testl %eax, %eax
jne 0x7df8
movl %ebx, 0x1dcc5(%rip)     # 0x25a88
movl %ebp, 0x1dcc3(%rip)     # 0x25a8c
xorl %eax, %eax
jmp 0x7df8
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
retq
movq 0x1dda6(%rip), %r14     # 0x25b80
movq %r14, %rdi
callq 0x6160
leaq 0x1de27(%rip), %rdi     # 0x25c10
movq %r14, %rsi
movq %rax, %rdx
callq 0x8535
testl %eax, %eax
je 0x7db0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_hide_cursor
int tb_hide_cursor(void) {
    if_not_init_return();
    int rv;
    if (global.cursor_x >= 0) {
        if_err_return(rv,
            bytebuf_puts(&global.out, global.caps[TB_CAP_HIDE_CURSOR]));
    }
    global.cursor_x = -1;
    global.cursor_y = -1;
    return TB_OK;
}

// Assembly:
cmpl $0x0, 0x1de88(%rip)     # 0x25c8c
je 0x7e45
cmpl $0x0, 0x1dc7b(%rip)     # 0x25a88
js 0x7e37
pushq %rbx
movq 0x1dd71(%rip), %rbx     # 0x25b88
movq %rbx, %rdi
callq 0x6160
leaq 0x1ddea(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8535
testl %eax, %eax
popq %rbx
je 0x7e37
retq
movq $-0x1, 0x1dc46(%rip) # 0x25a88
xorl %eax, %eax
retq
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
retq