LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x11fe
movl %ebp, %r15d
xorl %r14d, %r14d
callq 0x1040
cmpl $0xa, %eax
sete %cl
je 0x1202
movb %al, (%rbx,%r14)
incq %r14
cmpq %r14, %r15
jne 0x11e3
jmp 0x1205
xorl %ebp, %ebp
jmp 0x1205
movl %r14d, %ebp
testb $0x1, %cl
je 0x1212
movl %ebp, %eax
incl %ebp
movb $0xa, (%rbx,%rax)
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_O1/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 0x123a
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 0x1279
xorpd %xmm0, %xmm0
jmp 0x12c2
leal -0x2b(%rax), %edi
xorl %r9d, %r9d
testb $-0x3, %dil
sete %r9b
addl %r9d, %r8d
addq %r9, %rdx
xorpd %xmm0, %xmm0
movsd 0xd6f(%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 0x129c
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 0x12e7
movsd 0xd2b(%rip), %xmm1      # 0x2010
jmp 0x1336
xorl %r9d, %r9d
cmpb $0x2e, %sil
sete %r9b
addq %r8, %r9
leaq (%rbx,%r9), %rsi
incq %rsi
movsd 0xd0c(%rip), %xmm1      # 0x2010
movsd 0xcfc(%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 0x130c
movzbl %dil, %edi
xorl %esi, %esi
orl $0x20, %edi
cmpl $0x65, %edi
jne 0x135c
movl %edx, %edi
addl $0x2, %edx
cmpb $0x2d, 0x1(%rbx,%rdi)
leaq 0x1(%rdi), %r8
sete %dil
cmovnel %r8d, %edx
jmp 0x135e
xorl %edi, %edi
movslq %edx, %r8
movsbq (%rbx,%r8), %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x138f
addq %rbx, %r8
incq %r8
xorl %esi, %esi
movsbl %dl, %edx
leal (%rsi,%rsi,4), %esi
leal (%rdx,%rsi,2), %esi
addl $-0x30, %esi
movsbq (%r8), %rdx
incq %r8
testb $0x8, 0x1(%rcx,%rdx,2)
jne 0x1375
testl %esi, %esi
je 0x13ae
movsd 0xc6d(%rip), %xmm2      # 0x2008
testb %dil, %dil
jne 0x13a6
divsd %xmm2, %xmm1
jmp 0x13aa
mulsd %xmm2, %xmm1
decl %esi
jne 0x139b
cmpb $0x2d, %al
jne 0x13ba
xorpd 0xc66(%rip), %xmm0      # 0x2020
divsd %xmm1, %xmm0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2720(%rip), %rdi      # 0x3fe8
callq 0x1b30
callq 0x1080
movq 0x26f7(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
movl $0x1, %esi
popq %rax
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O1/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 0x1b21
leaq 0x2706(%rip), %rcx      # 0x4210
movzbl (%rcx,%rax,4), %eax
leaq 0x25fb(%rip), %rcx      # 0x4110
movzbl (%rax,%rcx), %eax
cmpb $0x20, %al
movzbl %bl, %ebx
cmovnel %eax, %ebx
movl %ebx, %eax
popq %rbx
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O1/WereCatf[P]Gonzales/dhtsensor.c
// Function: sleepMillis
void sleepMillis(uint32_t millis) {
  struct timespec sleep;
  sleep.tv_sec = millis / 1000;
  sleep.tv_nsec = (millis % 1000) * 1000000L;
  while(clock_nanosleep(CLOCK_MONOTONIC, 0, &sleep, &sleep) && errno == EINTR);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %eax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
shrq $0x26, %rax
movq %rsp, %rbx
movq %rax, (%rbx)
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %edi
imull $0xf4240, %edi, %eax    # imm = 0xF4240
movq %rax, 0x8(%rbx)
movl $0x1, %edi
xorl %esi, %esi
movq %rbx, %rdx
movq %rbx, %rcx
callq 0x2110
testl %eax, %eax
je 0x2266
callq 0x2040
cmpl $0x4, (%rax)
je 0x2246
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xd7b9(%rip), %rsi      # 0xea58
movq %rdx, %rdi
callq 0x1160
testq %rax, %rax
je 0x132a
movq %rax, %r15
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1140
movq %r15, %rdi
callq 0x1100
movq %rax, %r12
movq %r15, %rdi
callq 0x10d0
movq $0x0, (%r14)
movq %r12, %rdi
callq 0x1130
movq %rax, (%rbx)
testq %r12, %r12
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x130c
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 0x132f
movl $0x4e, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x186d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rcx, %rcx
js 0x17e9
cvtsi2ss %rcx, %xmm0
jmp 0x17fe
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 0x1857
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 0x9e97
testl %eax, %eax
je 0x1855
movq (%r15), %rax
movq 0x8(%r15), %rcx
movl %r13d, -0x4(%rax,%rcx,4)
incl %ebp
incq %r13
cmpq %r13, %r12
jne 0x180c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x400f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
leaq 0xa1ce(%rip), %rdx      # 0xe1c0
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
cmpq %rcx, %rsi
jne 0x3ff2
notl %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/pje[P]pixelsort/lodepng.c
// Function: lodepng_chunk_check_crc
unsigned lodepng_chunk_check_crc(const unsigned char* chunk)
{
  unsigned length = lodepng_chunk_length(chunk);
  unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]);
  /*the CRC is taken of the data and the 4 chunk type letters, not the length*/
  unsigned checksum = lodepng_crc32(&chunk[4], length + 4);
  if(CRC != checksum) return 1;
  else return 0;
}

// Assembly:
movl (%rdi), %r9d
bswapl %r9d
leal 0x8(%r9), %edx
movzbl (%rdi,%rdx), %eax
movzbl 0x1(%rdi,%rdx), %esi
movzbl 0x2(%rdi,%rdx), %ecx
movzbl 0x3(%rdi,%rdx), %edx
addl $0x4, %r9d
je 0x4100
pushq %rbx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r10d, %r10d
leaq 0xa0e1(%rip), %r11      # 0xe1c0
movb 0x4(%rdi,%r10), %bl
xorb %r8b, %bl
movzbl %bl, %ebx
shrl $0x8, %r8d
xorl (%r11,%rbx,4), %r8d
incq %r10
cmpq %r10, %r9
jne 0x40df
notl %r8d
popq %rbx
jmp 0x4103
xorl %r8d, %r8d
shll $0x10, %esi
shll $0x18, %eax
orl %esi, %eax
shll $0x8, %ecx
orl %eax, %ecx
orl %edx, %ecx
xorl %eax, %eax
cmpl %r8d, %ecx
setne %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4226
movq %rax, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq (%rdi), %rdi
movq %r12, %rsi
callq 0x1150
testq %rax, %rax
je 0x4221
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq 0x20(%rsp), %rcx
movq %r12, (%rcx)
xorl %edx, %edx
testl %ebp, %ebp
je 0x4226
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 0x1120
xorl %edx, %edx
jmp 0x4226
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_O1/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 0x45bb
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 0x4590
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_O1/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 0x1150
testq %rax, %rax
je 0x4722
movb $0x0, (%rax,%r15)
movq %rax, (%r14)
testq %r15, %r15
je 0x4722
xorl %eax, %eax
movb (%rbx,%rax), %cl
movq (%r14), %rdx
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x4711
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pje[P]pixelsort/lodepng.c
// Function: LodePNGIText_cleanup
static void LodePNGIText_cleanup(LodePNGInfo* info)
{
  size_t i;
  for(i = 0; i < info->itext_num; i++)
  {
    string_cleanup(&info->itext_keys[i]);
    string_cleanup(&info->itext_langtags[i]);
    string_cleanup(&info->itext_transkeys[i]);
    string_cleanup(&info->itext_strings[i]);
  }
  lodepng_free(info->itext_keys);
  lodepng_free(info->itext_langtags);
  lodepng_free(info->itext_transkeys);
  lodepng_free(info->itext_strings);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x60(%rdi)
je 0x4792
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x68(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
movq 0x70(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
movq 0x78(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
movq 0x80(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
incq %r15
cmpq 0x60(%rbx), %r15
jb 0x4742
movq 0x68(%rbx), %rdi
callq 0x1030
movq 0x70(%rbx), %rdi
callq 0x1030
movq 0x78(%rbx), %rdi
callq 0x1030
movq 0x80(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/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 0x518b
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x518b
movl 0x18(%rdi), %ecx
cmpl 0x18(%rsi), %ecx
jne 0x518b
testl %ecx, %ecx
je 0x5153
movl 0x1c(%rdi), %ecx
cmpl 0x1c(%rsi), %ecx
jne 0x518b
movl 0x20(%rdi), %ecx
cmpl 0x20(%rsi), %ecx
jne 0x518b
movl 0x24(%rdi), %ecx
cmpl 0x24(%rsi), %ecx
jne 0x518b
movq 0x10(%rdi), %rcx
cmpq 0x10(%rsi), %rcx
jne 0x518b
shlq $0x2, %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x518b
movq 0x8(%rdi), %rdx
movq 0x8(%rsi), %rsi
xorl %edi, %edi
movb (%rdx,%rdi), %r8b
cmpb (%rsi,%rdi), %r8b
jne 0x5189
incq %rdi
cmpq %rdi, %rcx
jne 0x5175
jmp 0x518b
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5b67
callq 0x5b46
movq (%rbx,%r14,8), %rdi
callq 0x1030
incq %r14
cmpq $0x10, %r14
jne 0x5b50
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movl $0x7, %edi
callq 0x1130
testq %rax, %rax
je 0x928c
movq %rax, %r14
movzwl (%r15), %eax
rolw $0x8, %ax
movw %ax, (%r14)
movb 0x4(%r15), %al
movb %al, 0x2(%r14)
movb 0x8(%r15), %al
movb %al, 0x3(%r14)
movb 0xc(%r15), %al
movb %al, 0x4(%r14)
movb 0x10(%r15), %al
movb %al, 0x5(%r14)
movb 0x14(%r15), %al
movb %al, 0x6(%r14)
leaq 0x8(%rbx), %rsi
leaq 0x6661(%rip), %rcx      # 0xf8c4
movq %rbx, %rdi
movl $0x7, %edx
movq %r14, %r8
callq 0x4237
testl %eax, %eax
jne 0x927f
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1030
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1130
testq %rax, %rax
je 0x9fd2
movq %rax, %rbx
xorl %eax, %eax
movl $0x8, (%rbx,%rax,4)
incq %rax
cmpq $0x90, %rax
jne 0x9f57
movl $0x90, %eax
movl $0x9, (%rbx,%rax,4)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x9f6e
movl $0x100, %eax            # imm = 0x100
movl $0x7, (%rbx,%rax,4)
incq %rax
cmpq $0x118, %rax            # imm = 0x118
jne 0x9f85
movl $0x118, %eax            # imm = 0x118
movl $0x8, (%rbx,%rax,4)
incq %rax
cmpq $0x120, %rax            # imm = 0x120
jne 0x9f9c
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0xa031
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_O1/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 0x1130
testq %rax, %rax
je 0xa029
movq %rax, %rbx
xorl %eax, %eax
movl $0x5, (%rbx,%rax,4)
incq %rax
cmpq $0x20, %rax
jne 0x9ff5
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0xa031
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_O1/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 0x1130
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xa08a
testq %r15, %r15
je 0xa072
xorl %ecx, %ecx
movl (%r12,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
movl %ecx, %edx
cmpq %r15, %rdx
jb 0xa061
movl %r15d, 0x1c(%r14)
movl %ebx, 0x18(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa09b
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xac79
movzbl (%rdi,%rdx), %eax
movzbl 0x1(%rdi,%rdx), %ecx
shll $0x4, %ecx
xorl %eax, %ecx
movzbl 0x2(%rdi,%rdx), %r8d
shll $0x8, %r8d
xorl %ecx, %r8d
jmp 0xaca9
xorl %eax, %eax
movl $0x0, %r8d
cmpq %rsi, %rdx
jae 0xaca4
xorl %ecx, %ecx
movq %rdx, %r9
xorl %r8d, %r8d
movzbl (%rdi,%r9), %r10d
shll %cl, %r10d
xorl %r10d, %r8d
incq %r9
addl $0x8, %ecx
cmpq %r9, %rsi
jne 0xac8e
cmpq %rsi, %rdx
jae 0xacad
movzwl %r8w, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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:
testl %r8d, %r8d
je 0xbc19
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rax
movq %rdx, %r9
subq %rcx, %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %ebx, %ebx
testq %rax, %rax
je 0xbbde
movq %rax, %r14
movq %r11, %r15
movq %r15, %rcx
shrq $0x3, %rcx
movl %r15d, %ebp
notb %bpl
movzbl (%rsi,%rcx), %r12d
movzbl %bpl, %r13d
andl $0x7, %r13d
movl %ebx, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %bpl
shlb %cl, %bpl
btl %r13d, %r12d
jae 0xbbc2
movq %rbx, %rcx
shrq $0x3, %rcx
orb %bpl, (%rdi,%rcx)
jmp 0xbbd0
notb %bpl
movq %rbx, %rcx
shrq $0x3, %rcx
andb %bpl, (%rdi,%rcx)
incq %rbx
incq %r15
decq %r14
jne 0xbb88
addq %rax, %r11
movq %r9, %r14
cmpq %rax, %rdx
je 0xbc03
movl %ebx, %ecx
notb %cl
movb $-0x2, %bpl
rolb %cl, %bpl
movq %rbx, %rcx
shrq $0x3, %rcx
andb %bpl, (%rdi,%rcx)
incq %rbx
decq %r14
jne 0xbbe6
incl %r10d
cmpl %r8d, %r10d
jne 0xbb7d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x310d(%rip), %rdi      # 0xf8f4
xorl %eax, %eax
callq 0x10c0
movl $0xa, %edi
callq 0x1040
leaq 0x324a(%rip), %rdi      # 0xfa49
callq 0x1060
leaq 0x3247(%rip), %rdi      # 0xfa52
callq 0x1060
leaq 0x326b(%rip), %rdi      # 0xfa82
callq 0x1060
leaq 0x3290(%rip), %rdi      # 0xfab3
callq 0x1060
leaq 0x32b8(%rip), %rdi      # 0xfae7
callq 0x1060
movl $0xa, %edi
popq %rax
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/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 0x1f36(%rip), %rsi      # 0xea58
callq 0x1160
testq %rax, %rax
jne 0xcb3d
leaq 0x2fdb(%rip), %rdi      # 0xfb0e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movl $0x18, %edi
callq 0x1130
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 0x77c6
testl %eax, %eax
je 0xcb8c
movl %eax, %ebx
movl %eax, %edi
callq 0x9e79
leaq 0x2fae(%rip), %rdi      # 0xfb2e
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_O1/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 0x1eb3(%rip), %rsi      # 0xea5b
movq %rbx, %rdi
callq 0x1160
testq %rax, %rax
jne 0xcbc6
leaq 0x2f80(%rip), %rdi      # 0xfb3c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movq (%r14), %rsi
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
movq %rbx, %rdi
callq 0x9e57
testl %eax, %eax
je 0xcc00
movl %eax, %ebx
movl %eax, %edi
callq 0x9e79
leaq 0x2f41(%rip), %rdi      # 0xfb2e
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_O1/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 0x1130
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       # 0xd0bd
leaq 0x43e(%rip), %rsi       # 0xd2ab
cmoveq %rdx, %rsi
cmpl $0x1, %ecx
leaq 0x44(%rip), %rcx        # 0xcebf
cmovneq %rsi, %rcx
movq %rcx, 0x10(%rax)
movl 0x4(%rbx), %edx
cmpq $0x3, %rdx
ja 0xcea4
leaq 0x5f1d(%rip), %rcx      # 0x12db0
movq (%rcx,%rdx,8), %rcx
leaq 0x5f32(%rip), %rsi      # 0x12dd0
movq (%rsi,%rdx,8), %rdx
jmp 0xceb2
leaq 0x59a(%rip), %rdx       # 0xd445
leaq 0x566(%rip), %rcx       # 0xd418
movq %rcx, 0x20(%rax)
movq %rdx, 0x18(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xcfee
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 0xcf49
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 0xcf3f
incq %rbx
addq $0x4, %r15
cmpq %rbx, %r12
jne 0xcf23
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 0xcfa5
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 0xcfa9
decq %rbx
addq $0x4, %r12
cmpq %rbx, %r15
jne 0xcf87
movl %r14d, %ebx
jmp 0xcfab
xorl %ebx, %ebx
jmp 0xcfb5
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 0xcefd
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xd1ec
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 0xd147
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 0xd13d
incq %rbx
addq $0x4, %r15
cmpq %rbx, %r12
jne 0xd121
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 0xd1a3
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 0xd1a7
decq %rbx
addq $0x4, %r12
cmpq %rbx, %r15
jne 0xd185
movl %r14d, %ebx
jmp 0xd1a9
xorl %ebx, %ebx
jmp 0xd1b3
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 0xd0fb
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pje[P]pixelsort/sorting.c
// Function: max_val
VAL_FN MAX_VAL(const pixel_t * a) {
    int max = -1;
    for(int c = 0, len = CHANNELS; c < len; ++c) {
        if(((unsigned char *)a)[c] > max) max = ((unsigned char *)a)[c];
    }
    return max;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %eax, %edx
movzbl (%rdi,%rcx), %eax
cmpl %eax, %edx
cmovgl %edx, %eax
incq %rcx
cmpq $0x3, %rcx
jne 0xd3ae
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xd403
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x1f3b7(%rip)     # 0x25c8c
je 0x68d9
popq %rcx
retq
movl $0x2, %esi
xorl %eax, %eax
callq 0x64f0
testl %eax, %eax
js 0x68fd
movl $0x1, 0x1f181(%rip)     # 0x25a74
movl %eax, %edi
movl %eax, %esi
popq %rax
jmp 0x6918
callq 0x6060
movl (%rax), %eax
movl %eax, 0x1f37e(%rip)     # 0x25c88
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x68d7
// File: /workspace/github_c_makefile_star2_O1/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 0x1ec0f(%rip), %rbx     # 0x25b70
movq %rbx, %rdi
callq 0x6160
leaq 0x1eca0(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8728
testl %eax, %eax
jne 0x6fa4
movq 0x1ec42(%rip), %rbx     # 0x25bc8
movq %rbx, %rdi
callq 0x6160
leaq 0x1ec7b(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8728
testl %eax, %eax
je 0x6fa6
popq %rbx
retq
movq 0x1ebdb(%rip), %rbx     # 0x25b88
movq %rbx, %rdi
callq 0x6160
leaq 0x1ec54(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
popq %rbx
jmp 0x8728
// File: /workspace/github_c_makefile_star2_O1/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 0x1eac8(%rip), %edi     # 0x25a98
movzwl 0x1eac3(%rip), %esi     # 0x25a9a
callq 0x786e
testl %eax, %eax
jne 0x703d
movq 0x1eba9(%rip), %rbx     # 0x25b90
movq %rbx, %rdi
callq 0x6160
leaq 0x1ec1a(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8728
testl %eax, %eax
jne 0x703d
movl 0x1ea7d(%rip), %edi     # 0x25a88
movl 0x1ea7b(%rip), %esi     # 0x25a8c
callq 0x7cf6
testl %eax, %eax
jne 0x703d
movl 0x1ea50(%rip), %edi     # 0x25a70
callq 0x7dbd
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x703d
movq $-0x1, 0x1ea55(%rip) # 0x25a90
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1ea1a(%rip), %edi     # 0x25a68
testl %edi, %edi
js 0x7167
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
xorl %ebx, %ebx
movl $0x5413, %esi           # imm = 0x5413
xorl %eax, %eax
callq 0x6240
testl %eax, %eax
je 0x716b
callq 0x6060
movq %rax, %rbx
movl (%rax), %ebp
movl 0x1e9e8(%rip), %edi     # 0x25a70
leaq 0x17666(%rip), %rsi     # 0x1e6f5
movl $0x10, %edx
callq 0x6120
cmpq $0x10, %rax
jne 0x718b
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 0x1e99c(%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 0x7183
movl 0x1e94f(%rip), %edi     # 0x25a6c
leaq 0x20(%rsp), %rsi
movl $0x3f, %edx
callq 0x62b0
testq %rax, %rax
jle 0x7183
movb $0x0, 0x20(%rsp,%rax)
leaq 0x175c9(%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 0x718b
movl 0x4(%rsp), %eax
movl %eax, 0x1e91e(%rip)     # 0x25a80
movl (%rsp), %eax
jmp 0x717b
xorl %ebx, %ebx
jmp 0x7196
movzwl 0xa(%rsp), %eax
movl %eax, 0x1e90a(%rip)     # 0x25a80
movzwl 0x8(%rsp), %eax
movl %eax, 0x1e903(%rip)     # 0x25a84
jmp 0x7196
movl (%rbx), %eax
movl %eax, 0x1eafd(%rip)     # 0x25c88
movl %ebp, 0x1eaf7(%rip)     # 0x25c88
movl $0xfffffff5, %ebx       # imm = 0xFFFFFFF5
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x1e8cc(%rip), %r13     # 0x25a80
movslq 0x1e8c9(%rip), %rbp     # 0x25a84
movq %r13, %r12
imulq %rbp, %r12
shlq $0x3, %r12
movq %r12, %rdi
callq 0x63e0
movq %rax, %rbx
movq %rax, 0x1ea58(%rip)     # 0x25c30
testq %rax, %rax
je 0x71fc
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x6230
movl %r13d, 0x1ea34(%rip)    # 0x25c28
movl %ebp, 0x1ea32(%rip)     # 0x25c2c
jmp 0x7202
movl $0xfffffffb, %r15d      # imm = 0xFFFFFFFB
testq %rbx, %rbx
je 0x72d3
movq %r12, %rdi
callq 0x63e0
movq %rax, %r14
movq %rax, 0x1ea23(%rip)     # 0x25c40
testq %rax, %rax
je 0x7241
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x6230
movl %r13d, 0x1e9ff(%rip)    # 0x25c38
movl %ebp, 0x1e9fd(%rip)     # 0x25c3c
jmp 0x7247
movl $0xfffffffb, %r15d      # imm = 0xFFFFFFFB
testq %r14, %r14
je 0x72d3
movl 0x1e9d6(%rip), %edx     # 0x25c2c
imull 0x1e9cb(%rip), %edx     # 0x25c28
testl %edx, %edx
jle 0x728c
movzwl 0x1e830(%rip), %eax     # 0x25a98
movzwl 0x1e82b(%rip), %ecx     # 0x25a9a
movl %edx, %edx
xorl %esi, %esi
movl $0x20, (%rbx,%rsi,8)
movw %ax, 0x4(%rbx,%rsi,8)
movw %cx, 0x6(%rbx,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x7273
movl 0x1e9aa(%rip), %edx     # 0x25c3c
imull 0x1e99f(%rip), %edx     # 0x25c38
testl %edx, %edx
jle 0x72d0
movzwl 0x1e7f4(%rip), %eax     # 0x25a98
movzwl 0x1e7ef(%rip), %ecx     # 0x25a9a
movl %edx, %edx
xorl %r15d, %r15d
xorl %esi, %esi
movl $0x20, (%r14,%rsi,8)
movw %ax, 0x4(%r14,%rsi,8)
movw %cx, 0x6(%r14,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x72b2
jmp 0x72d3
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7db2
movl %esi, %ebp
movl %edi, %ebx
leaq 0x1defd(%rip), %rdi     # 0x25c10
leaq 0x169fd(%rip), %rsi     # 0x1e717
movl $0x2, %edx
callq 0x8728
testl %eax, %eax
jne 0x7db4
incl %ebp
movq %rsp, %r14
movl %ebp, %edi
movq %r14, %rsi
callq 0x13f3d
movslq %eax, %rdx
leaq 0x1decb(%rip), %rdi     # 0x25c10
movq %r14, %rsi
callq 0x8728
testl %eax, %eax
jne 0x7db4
leaq 0x1deb8(%rip), %rdi     # 0x25c10
leaq 0x169bf(%rip), %rsi     # 0x1e71e
movl $0x1, %edx
callq 0x8728
testl %eax, %eax
jne 0x7db4
incl %ebx
movq %rsp, %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x13f3d
movslq %eax, %rdx
leaq 0x1de8a(%rip), %rdi     # 0x25c10
movq %r14, %rsi
callq 0x8728
testl %eax, %eax
jne 0x7db4
leaq 0x1de77(%rip), %rdi     # 0x25c10
leaq 0x16b1f(%rip), %rsi     # 0x1e8bf
movl $0x1, %edx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x8728
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1de53(%rip), %rdx     # 0x25c18
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x7e05
movq 0x1de3d(%rip), %rsi     # 0x25c10
callq 0x6120
testq %rax, %rax
js 0x7df3
cmpq 0x1de34(%rip), %rax     # 0x25c18
jne 0x7df3
movq $0x0, 0x1de27(%rip) # 0x25c18
jmp 0x7e05
callq 0x6060
movl (%rax), %eax
movl %eax, 0x1de88(%rip)     # 0x25c88
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1dc61(%rip), %esi     # 0x25a80
movl 0x1dc5f(%rip), %edx     # 0x25a84
leaq 0x1ddfc(%rip), %rdi     # 0x25c28
callq 0x13d6d
testl %eax, %eax
jne 0x7e51
movl 0x1dc45(%rip), %esi     # 0x25a80
movl 0x1dc43(%rip), %edx     # 0x25a84
leaq 0x1ddf0(%rip), %rdi     # 0x25c38
callq 0x13d6d
testl %eax, %eax
je 0x7e53
popq %rcx
retq
movl 0x1dde3(%rip), %esi     # 0x25c3c
imull 0x1ddd8(%rip), %esi     # 0x25c38
testl %esi, %esi
jle 0x7e96
movq 0x1ddd5(%rip), %rax     # 0x25c40
movzwl 0x1dc26(%rip), %ecx     # 0x25a98
movzwl 0x1dc21(%rip), %edx     # 0x25a9a
movl %esi, %esi
xorl %edi, %edi
movl $0x20, (%rax,%rdi,8)
movw %cx, 0x4(%rax,%rdi,8)
movw %dx, 0x6(%rax,%rdi,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x7e7d
popq %rax
jmp 0x6fc8
// File: /workspace/github_c_makefile_star2_O1/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, 0x1dde9(%rip)     # 0x25c8c
je 0x7edd
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, 0x1dbca(%rip)    # 0x25a88
je 0x7ee3
movl %ebx, %edi
movl %ebp, %esi
callq 0x7cf6
testl %eax, %eax
jne 0x7f08
movl %ebx, 0x1dbb5(%rip)     # 0x25a88
movl %ebp, 0x1dbb3(%rip)     # 0x25a8c
xorl %eax, %eax
jmp 0x7f08
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
retq
movq 0x1dc96(%rip), %r14     # 0x25b80
movq %r14, %rdi
callq 0x6160
leaq 0x1dd17(%rip), %rdi     # 0x25c10
movq %r14, %rsi
movq %rax, %rdx
callq 0x8728
testl %eax, %eax
je 0x7ec0
popq %rbx
popq %r14
popq %rbp
retq