LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/termbox[P]termbox/demo/paint.c
// Function: updateAndRedrawAll
void updateAndRedrawAll(int mx, int my) {
    tb_clear();
    if (mx != -1 && my != -1) {
        backbuf[bbw*my+mx].ch = runes[curRune];
        backbuf[bbw*my+mx].fg = colors[curCol];
    }
    memcpy(tb_cell_buffer(), backbuf, sizeof(struct tb_cell)*bbw*bbh);
    int h = tb_height();
    updateAndDrawButtons(&curRune, 0, 0, mx, my, len(runes), runeAttrFunc);
    updateAndDrawButtons(&curCol, 0, h-3, mx, my, len(colors), colorAttrFunc);
    tb_present();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movl %edi, %ebp
callq 0x498e
cmpl $-0x1, %ebp
sete %al
cmpl $-0x1, %ebx
sete %cl
orb %al, %cl
jne 0x3613
movslq 0x62c6(%rip), %rax      # 0x98a0
leaq 0x2a4f(%rip), %rcx      # 0x6030
movl (%rcx,%rax,4), %eax
movq 0x62bd(%rip), %rcx      # 0x98a8
movl 0x62bf(%rip), %edx      # 0x98b0
imull %ebx, %edx
addl %ebp, %edx
movslq %edx, %rdx
movl %eax, (%rcx,%rdx,8)
movslq 0x62b1(%rip), %rax      # 0x98b4
leaq 0x2a46(%rip), %rsi      # 0x6050
movzwl (%rsi,%rax,2), %eax
movw %ax, 0x4(%rcx,%rdx,8)
callq 0x474e
movq 0x6289(%rip), %rsi      # 0x98a8
movslq 0x628a(%rip), %rcx      # 0x98b0
movslq 0x628b(%rip), %rdx      # 0x98b8
imulq %rcx, %rdx
shlq $0x3, %rdx
movq %rax, %rdi
callq 0x3180
callq 0x4987
movl %eax, %r14d
leaq -0xce(%rip), %rax       # 0x357e
movq %rax, (%rsp)
leaq 0x6249(%rip), %rdi      # 0x98a0
pushq $0x5
popq %r9
xorl %esi, %esi
xorl %edx, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x337c
addl $-0x3, %r14d
leaq -0xde(%rip), %rax       # 0x3596
movq %rax, (%rsp)
leaq 0x6235(%rip), %rdi      # 0x98b4
pushq $0x8
popq %r9
xorl %esi, %esi
movl %r14d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x337c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4047
// File: /workspace/github_c_makefile_star2_O2/termbox[P]termbox/demo/paint.c
// Function: reallocBackBuffer
void reallocBackBuffer(int w, int h) {
    bbw = w;
    bbh = h;
    if (backbuf)
        free(backbuf);
    backbuf = calloc(sizeof(struct tb_cell), w*h);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl %edi, 0x6204(%rip)      # 0x98b0
movl %esi, 0x6206(%rip)      # 0x98b8
movq 0x61ef(%rip), %rdi      # 0x98a8
callq 0x3040
imull %ebp, %ebx
movslq %ebx, %rsi
pushq $0x8
popq %rdi
callq 0x3150
movq %rax, 0x61d5(%rip)      # 0x98a8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
callq 0x3ea6
testl %eax, %eax
js 0x3792
pushq $0x5
popq %rdi
callq 0x49b7
callq 0x4980
movl %eax, %ebx
callq 0x4987
movl %ebx, %edi
movl %eax, %esi
callq 0x369f
pushq $-0x1
popq %rbx
movl %ebx, %edi
movl %ebx, %esi
callq 0x35b2
leaq 0x8(%rsp), %r14
leaq 0x28eb(%rip), %r15      # 0x6010
movq %r14, %rdi
callq 0x4756
incl %eax
movl %ebx, %edi
movl %ebx, %esi
cmpl $0x4, %eax
ja 0x377a
movslq (%r15,%rax,4), %rax
addq %r15, %rax
movl %ebx, %edi
movl %ebx, %esi
jmpq *%rax
cmpw $0x1b, 0xa(%rsp)
movl %ebx, %edi
movl %ebx, %esi
jne 0x377a
jmp 0x3781
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
callq 0x369f
movl %ebx, %edi
movl %ebx, %esi
jmp 0x377a
cmpw $-0x17, 0xa(%rsp)
movl %ebx, %edi
movl %ebx, %esi
jne 0x377a
movl 0x18(%rsp), %edi
movl 0x1c(%rsp), %esi
callq 0x35b2
jmp 0x3725
callq 0x3eb2
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x5857(%rip), %rcx      # 0x8ff0
movq (%rcx), %rdi
leaq 0x28bd(%rip), %rsi      # 0x6060
movl %eax, %edx
xorl %eax, %eax
callq 0x3170
jmp 0x37cf
callq 0x3eb2
movq 0x5836(%rip), %rax      # 0x8ff0
movq (%rax), %rcx
leaq 0x28bb(%rip), %rdi      # 0x607f
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x3250
pushq $-0x1
popq %rax
jmp 0x3788
// File: /workspace/github_c_makefile_star2_O2/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
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x11a6
leaq 0xeb5(%rip), %rdi       # 0x2030
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
movq %rbx, %rdi
callq 0x11e5
leaq 0xe9f(%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_O2/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 %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
decl %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x11d8
callq 0x1040
cmpl $0xa, %eax
je 0x11cf
movb %al, (%rbx,%r15)
incq %r15
jmp 0x11b7
leal 0x1(%r15), %r14d
movb $0xa, (%rbx,%r15)
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
xorl %esi, %esi
movsbq (%rbx,%rsi), %rax
incq %rsi
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x11f3
xorl %edx, %edx
cmpb $0x2d, %al
sete %dl
xorl %edi, %edi
cmpb $0x2b, %al
sete %dil
cmpq %rdi, %rdx
cmovaq %rdx, %rdi
leal (%rdi,%rsi), %edx
addl %edi, %esi
decl %esi
addq %rbx, %rsi
xorpd %xmm0, %xmm0
movsd 0xdda(%rip), %xmm1      # 0x2008
movsbq (%rsi), %rdi
testb $0x8, 0x1(%rcx,%rdi,2)
je 0x124f
addl $-0x30, %edi
cvtsi2sd %edi, %xmm2
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
incl %edx
incq %rsi
jmp 0x122e
xorl %r8d, %r8d
cmpb $0x2e, %dil
sete %r8b
leal (%r8,%rdx), %edi
leal (%r8,%rdx), %esi
decl %esi
addl %edx, %r8d
incl %r8d
movsd 0xd9e(%rip), %xmm2      # 0x2010
movsbq (%rbx,%rsi), %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x129b
addl $-0x30, %edx
cvtsi2sd %edx, %xmm3
mulsd %xmm1, %xmm0
addsd %xmm3, %xmm0
mulsd %xmm1, %xmm2
incq %rsi
incl %r8d
incl %edi
jmp 0x1272
orb $0x20, %dl
cmpb $0x65, %dl
jne 0x12b5
movl %edi, %edx
cmpb $0x2d, (%rbx,%rdx)
sete %dl
cmovnel %edi, %r8d
movl %r8d, %esi
jmp 0x12b7
xorl %edx, %edx
movslq %esi, %rsi
addq %rsi, %rbx
xorl %esi, %esi
movsbq (%rbx), %rdi
testb $0x8, 0x1(%rcx,%rdi,2)
je 0x12e5
imull $0xa, %esi, %esi
addl %edi, %esi
addl $-0x30, %esi
incq %rbx
jmp 0x12bf
testb %dl, %dl
jne 0x12e1
divsd %xmm1, %xmm2
jmp 0x12e5
mulsd %xmm1, %xmm2
subl $0x1, %esi
jae 0x12d7
cmpb $0x2d, %al
jne 0x12f6
xorpd 0xd2a(%rip), %xmm0      # 0x2020
divsd %xmm2, %xmm0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_2/exercise_2_02/loop.c
// Function: main
int main(void)
{
  char s[MAXLINE];

  // int i;
  // int c;
  // for (i = 0; (i < MAXLINE - 1) * ((c = getchar()) != '\n') * (c != EOF); ++i)
  // {
  //   s[i] = c;
  // }

  int i = 0;
  int loop = 1;
  while (loop)
  {
    char c = getchar();

    if (i >= (MAXLINE - 1) || c == '\n' || c == EOF)
    {
      loop = 0;
    }

    s[i++] = c;
  }

  s[i] = '\0';

  printf("%s", s);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
xorl %ebx, %ebx
pushq $0x1
popq %rax
movl %ebx, %r14d
testl %eax, %eax
je 0x1192
callq 0x1040
cmpl $0x3e7, %ebx            # imm = 0x3E7
setb %cl
movb %al, (%rsp,%r14)
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
setne %dl
cmpl $0xa000000, %eax        # imm = 0xA000000
setne %al
andb %dl, %al
andb %cl, %al
incl %ebx
movzbl %al, %eax
jmp 0x115b
movb $0x0, (%rsp,%r14)
leaq 0xe66(%rip), %rdi       # 0x2004
movq %rsp, %rsi
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11a0
movq (%rax), %rcx
movl %ebx, %eax
testb $0x1, 0x1(%rcx,%rax,2)
je 0x1ab6
leaq 0x2771(%rip), %rcx      # 0x4210
movzbl (%rcx,%rax,4), %eax
leaq 0x2666(%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_O2/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 %rbp
pushq %rbx
subq $0x18, %rsp
movl %edi, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divl %ecx
leaq 0x8(%rsp), %rbx
movq %rax, (%rbx)
imull $0xf4240, %edx, %eax    # imm = 0xF4240
movq %rax, 0x8(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %edi
xorl %esi, %esi
movq %rbx, %rdx
movq %rbx, %rcx
callq 0x2110
testl %eax, %eax
je 0x225f
callq 0x2040
cmpl $0x4, (%rax)
je 0x2242
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
andq $0x0, (%rdi)
movq %rsi, %r14
andq $0x0, (%rsi)
leaq 0xa7b9(%rip), %rsi      # 0xba58
movq %rdx, %rdi
callq 0x1160
testq %rax, %rax
je 0x1321
movq %rax, %r15
xorl %r13d, %r13d
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x1140
movq %r15, %rdi
callq 0x1100
movq %rax, %r12
movq %r15, %rdi
callq 0x10d0
andq $0x0, (%r14)
movq %r12, %rdi
callq 0x1130
movq %rax, (%rbx)
testq %r12, %r12
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x1305
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1080
movq %rax, (%r14)
movq %r15, %rdi
callq 0x1090
cmpq $0x0, (%rbx)
pushq $0x53
popq %rax
cmovnel %r13d, %eax
testq %r12, %r12
cmovel %r13d, %eax
jmp 0x1324
pushq $0x4e
popq %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testq %rcx, %rcx
js 0x16c2
cvtsi2ss %rcx, %xmm0
jmp 0x16d7
movq %rcx, %rax
shrq %rax
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movl %edx, %r12d
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq %r15, %r12
je 0x171f
movl (%rbx,%r15,4), %eax
testl %eax, %eax
je 0x171a
movl %eax, %eax
cvtsi2ss %rax, %xmm0
divss 0xc(%rsp), %xmm0
movl %ebp, %eax
shlq $0x5, %rax
leaq (%r14,%rax), %rdi
movss %xmm0, 0x18(%r14,%rax)
movl %r15d, %esi
callq 0x7b26
incl %ebp
incq %r15
jmp 0x16e5
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq $-0x1
popq %rax
xorl %ecx, %ecx
leaq 0x81da(%rip), %rdx      # 0xb1c0
cmpq %rcx, %rsi
je 0x3002
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
jmp 0x2fe6
notl %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0x127c
movl %eax, %r14d
addl $0xc, %r14d
movq (%r15), %rbp
movq %rbp, %r13
addq %r14, %r13
jae 0x315f
pushq $0x4d
jmp 0x3191
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1150
testq %rax, %rax
je 0x318f
movq %rax, (%r12)
movq %r13, (%r15)
addq %rax, %rbp
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0x3192
movb (%rbx,%rcx), %dl
movb %dl, (%rbp,%rcx)
incq %rcx
jmp 0x317e
pushq $0x53
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pje[P]pixelsort/lodepng.c
// Function: lodepng_has_palette_alpha
unsigned lodepng_has_palette_alpha(const LodePNGColorMode* info)
{
  size_t i;
  for(i = 0; i < info->palettesize; i++)
  {
    if(info->palette[i * 4 + 3] < 255) return 1;
  }
  return 0;
}

// Assembly:
movq 0x10(%rdi), %rcx
xorl %eax, %eax
pushq $0x1
popq %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x33ec
movq 0x8(%rdi), %r8
cmpb $-0x1, 0x3(%r8,%rsi,4)
leaq 0x1(%rsi), %rsi
je 0x33d5
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x50(%rbx), %rdi
cmpq 0x48(%rbx), %r15
jae 0x3478
addq %r14, %rdi
callq 0x8879
movq 0x58(%rbx), %rdi
addq %r14, %rdi
callq 0x8879
incq %r15
addq $0x8, %r14
jmp 0x3451
callq 0x1030
movq 0x58(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/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
movq %rax, %rsi
callq 0x888b
testl %eax, %eax
je 0x35a5
xorl %eax, %eax
cmpq %rax, %r15
je 0x35a5
movb (%rbx,%rax), %cl
movq (%r14), %rdx
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x3592
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x68(%rbx), %rdi
cmpq 0x60(%rbx), %r15
jae 0x35fd
addq %r14, %rdi
callq 0x8879
movq 0x70(%rbx), %rdi
addq %r14, %rdi
callq 0x8879
movq 0x78(%rbx), %rdi
addq %r14, %rdi
callq 0x8879
movq 0x80(%rbx), %rdi
addq %r14, %rdi
callq 0x8879
incq %r15
addq $0x8, %r14
jmp 0x35bb
callq 0x1030
movq 0x70(%rbx), %rdi
callq 0x1030
movq 0x78(%rbx), %rdi
callq 0x1030
movq 0x80(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/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 0x3ef6
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x3ef6
movl 0x18(%rdi), %ecx
cmpl 0x18(%rsi), %ecx
jne 0x3ef6
testl %ecx, %ecx
je 0x3ec2
movl 0x1c(%rdi), %ecx
cmpl 0x1c(%rsi), %ecx
jne 0x3ef6
movl 0x20(%rdi), %ecx
cmpl 0x20(%rsi), %ecx
jne 0x3ef6
movl 0x24(%rdi), %ecx
cmpl 0x24(%rsi), %ecx
jne 0x3ef6
movq 0x10(%rdi), %rcx
cmpq 0x10(%rsi), %rcx
jne 0x3ef6
shlq $0x2, %rcx
xorl %r8d, %r8d
pushq $0x1
popq %rdx
cmpq %r8, %rcx
je 0x3ef7
movq 0x8(%rdi), %rax
movb (%rax,%r8), %r9b
movq 0x8(%rsi), %r10
leaq 0x1(%r8), %r11
xorl %eax, %eax
cmpb (%r10,%r8), %r9b
movq %r11, %r8
je 0x3ed6
retq
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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
cmpq $0x10, %r14
je 0x4805
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x4800
callq 0x47d9
movq (%rbx,%r14,8), %rdi
callq 0x1030
incq %r14
jmp 0x47e3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pje[P]pixelsort/lodepng.c
// Function: addChunk_tRNS
static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info)
{
  unsigned error = 0;
  size_t i;
  ucvector tRNS;
  ucvector_init(&tRNS);
  if(info->colortype == LCT_PALETTE)
  {
    size_t amount = info->palettesize;
    /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/
    for(i = info->palettesize; i > 0; i--)
    {
      if(info->palette[4 * (i - 1) + 3] == 255) amount--;
      else break;
    }
    /*add only alpha channel*/
    for(i = 0; i < amount; i++) ucvector_push_back(&tRNS, info->palette[4 * i + 3]);
  }
  else if(info->colortype == LCT_GREY)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256));
    }
  }
  else if(info->colortype == LCT_RGB)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g % 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b % 256));
    }
  }

  error = addChunk(out, "tRNS", tRNS.data, tRNS.size);
  ucvector_cleanup(&tRNS);

  return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movl (%rsi), %eax
testl %eax, %eax
je 0x78ea
cmpl $0x2, %eax
je 0x78a8
cmpl $0x3, %eax
jne 0x7913
movq 0x10(%r14), %rax
movq %rax, %r12
subq $0x1, %rax
jb 0x7882
movq 0x8(%r14), %rcx
cmpb $-0x1, 0x3(%rcx,%rax,4)
je 0x786e
xorl %r13d, %r13d
movq %rsp, %r15
cmpq %r13, %r12
je 0x7913
movq 0x8(%r14), %rax
movzbl 0x3(%rax,%r13,4), %esi
movq %r15, %rdi
callq 0x2f4e
incq %r13
jmp 0x7888
cmpl $0x0, 0x18(%r14)
je 0x7913
movzbl 0x1d(%r14), %esi
movq %rsp, %r15
movq %r15, %rdi
callq 0x2f4e
movzbl 0x1c(%r14), %esi
movq %r15, %rdi
callq 0x2f4e
movzbl 0x21(%r14), %esi
movq %r15, %rdi
callq 0x2f4e
movzbl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x2f4e
pushq $0x24
jmp 0x78f3
cmpl $0x0, 0x18(%r14)
je 0x7913
pushq $0x1c
popq %r12
movzbl 0x1(%r14,%r12), %esi
movq %rsp, %r15
movq %r15, %rdi
callq 0x2f4e
movzbl (%r14,%r12), %esi
movq %r15, %rdi
callq 0x2f4e
movq %rsp, %r14
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x4f87(%rip), %rsi      # 0xc8ab
movq %rbx, %rdi
callq 0x9920
movq %r14, %rdi
callq 0x89e8
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/pje[P]pixelsort/lodepng.c
// Function: readBitsFromStream
static unsigned readBitsFromStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits)
{
  unsigned result = 0, i;
  for(i = 0; i < nbits; i++)
  {
    result += ((unsigned)READBIT(*bitpointer, bitstream)) << i;
    (*bitpointer)++;
  }
  return result;
}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
movl %ecx, %r8d
cmpq %rdx, %r8
jae 0x7ccc
movq (%rdi), %r8
movq %r8, %r9
shrq $0x3, %r9
movzbl (%rsi,%r9), %r9d
movl %r8d, %r10d
andl $0x7, %r10d
xorl %r11d, %r11d
btl %r10d, %r9d
setb %r11b
shll %cl, %r11d
addl %r11d, %eax
incq %r8
movq %r8, (%rdi)
incl %ecx
jmp 0x7c93
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7d8c
movq %rax, %rbx
xorl %eax, %eax
cmpq $0x90, %rax
je 0x7d1f
movl $0x8, (%rbx,%rax,4)
incq %rax
jmp 0x7d0b
movl $0x90, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x7d38
movl $0x9, (%rbx,%rax,4)
incq %rax
jmp 0x7d24
movl $0x100, %eax            # imm = 0x100
cmpq $0x118, %rax            # imm = 0x118
je 0x7d51
movl $0x7, (%rbx,%rax,4)
incq %rax
jmp 0x7d3d
movl $0x118, %eax            # imm = 0x118
cmpq $0x120, %rax            # imm = 0x120
je 0x7d6a
movl $0x8, (%rbx,%rax,4)
incq %rax
jmp 0x7d56
pushq $0xf
popq %rcx
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7de9
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_O2/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 0x7de1
movq %rax, %rbx
xorl %eax, %eax
cmpq $0x20, %rax
je 0x7dc1
movl $0x5, (%rbx,%rax,4)
incq %rax
jmp 0x7daf
pushq $0x20
popq %rdx
pushq $0xf
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7de9
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_O2/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 0x7e3e
xorl %ecx, %ecx
movl %ecx, %ecx
cmpq %r15, %rcx
jae 0x7e26
movl (%r12,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incl %ecx
jmp 0x7e14
movl %r15d, 0x1c(%r14)
movl %ebx, 0x18(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7e4d
pushq $0x53
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x869a
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
movzwl %ax, %eax
jmp 0x86bd
xorl %eax, %eax
cmpq %rsi, %rdx
jae 0x86bd
xorl %ecx, %ecx
xorl %eax, %eax
cmpq %rdx, %rsi
je 0x8695
movzbl (%rdi,%rdx), %r8d
shll %cl, %r8d
xorl %r8d, %eax
incq %rdx
addl $0x8, %ecx
jmp 0x86a5
retq
// File: /workspace/github_c_makefile_star2_O2/pje[P]pixelsort/lodepng.c
// Function: searchCodeIndex
static size_t searchCodeIndex(const unsigned* array, size_t array_size, size_t value)
{
  /*linear search implementation*/
  /*for(size_t i = 1; i < array_size; i++) if(array[i] > value) return i - 1;
  return array_size - 1;*/

  /*binary search implementation (not that much faster) (precondition: array_size > 0)*/
  size_t left  = 1;
  size_t right = array_size - 1;
  while(left <= right)
  {
    size_t mid = (left + right) / 2;
    if(array[mid] <= value) left = mid + 1; /*the value to find is more to the right*/
    else if(array[mid - 1] > value) right = mid - 1; /*the value to find is more to the left*/
    else return mid - 1;
  }
  return array_size - 1;
}

// Assembly:
decq %rsi
pushq $0x1
popq %rcx
movq %rsi, %r8
cmpq %r8, %rcx
ja 0x876e
leaq (%r8,%rcx), %rax
shrq %rax
movl (%rdi,%rax,4), %r9d
cmpq %rdx, %r9
jbe 0x8766
movl -0x4(%rdi,%rax,4), %r9d
decq %rax
movq %rax, %r8
cmpq %rdx, %r9
ja 0x873f
jmp 0x8771
incq %rax
movq %rax, %rcx
jmp 0x873f
movq %rsi, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/pje[P]pixelsort/lodepng.c
// Function: readBitsFromReversedStream
static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits)
{
  unsigned result = 0;
  size_t i;
  for(i = nbits - 1; i < nbits; i--)
  {
    result += (unsigned)readBitFromReversedStream(bitpointer, bitstream) << i;
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
movq %rdx, %r12
decq %r12
cmpq %rbx, %r12
jae 0x88f4
movq %r15, %rdi
movq %r14, %rsi
callq 0x88ff
movzbl %al, %eax
movl %r12d, %ecx
shll %cl, %eax
addl %eax, %ebp
jmp 0x88d5
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x28, %rsp
movl %r8d, 0x4(%rsp)
movq %rsi, %r12
leaq 0x8(%rsp), %r13
andq $0x0, (%r13)
movq %rdi, %rbp
movq %rcx, 0x18(%rsp)
subq %rcx, %rdx
movq %rdx, 0x10(%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
cmpl 0x4(%rsp), %ebx
je 0x8f58
movq 0x18(%rsp), %r14
leaq (%r15,%r14), %rax
movq %rax, 0x20(%rsp)
subq $0x1, %r14
jb 0x8f1c
movq %r15, %rax
shrq $0x3, %rax
movl %r15d, %ecx
notb %cl
movzbl (%r12,%rax), %eax
movzbl %cl, %ecx
andl $0x7, %ecx
xorl %edx, %edx
btl %ecx, %eax
setb %dl
incq %r15
movq %r13, %rdi
movq %rbp, %rsi
callq 0x8e71
jmp 0x8ee7
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdx
subq $0x1, %rdx
jb 0x8f47
movl %eax, %ecx
notb %cl
movb $-0x2, %sil
rolb %cl, %sil
movq %rax, %rcx
shrq $0x3, %rcx
andb %sil, (%rbp,%rcx)
incq %rax
jmp 0x8f26
movq %rax, 0x8(%rsp)
incl %ebx
movq 0x20(%rsp), %r15
jmp 0x8ed3
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq (%rsi), %rsi
leaq 0x2fa1(%rip), %rdi      # 0xc8f4
xorl %eax, %eax
callq 0x10c0
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x1040
leaq 0x30de(%rip), %rdi      # 0xca49
callq 0x1060
leaq 0x30db(%rip), %rdi      # 0xca52
callq 0x1060
leaq 0x30ff(%rip), %rdi      # 0xca82
callq 0x1060
leaq 0x3124(%rip), %rdi      # 0xcab3
callq 0x1060
leaq 0x314c(%rip), %rdi      # 0xcae7
callq 0x1060
movl %ebx, %edi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/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 0x1e0e(%rip), %rsi      # 0xba58
callq 0x1160
testq %rax, %rax
jne 0x9c65
leaq 0x2eb3(%rip), %rdi      # 0xcb0e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
pushq $0x18
popq %rdi
callq 0x1130
movq %rax, %r14
leaq 0xc(%rax), %rdx
leaq 0x8(%rax), %rsi
andq $0x0, 0x8(%rax)
movl $0x4, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rcx
callq 0x6589
testl %eax, %eax
je 0x9caf
movl %eax, %ebx
movl %eax, %edi
callq 0x7b08
leaq 0x2e8b(%rip), %rdi      # 0xcb2e
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_O2/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 0x1d90(%rip), %rsi      # 0xba5b
movq %rbx, %rdi
callq 0x1160
testq %rax, %rax
jne 0x9ce9
leaq 0x2e5d(%rip), %rdi      # 0xcb3c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movq (%r14), %rsi
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
movq %rbx, %rdi
callq 0x7aee
testl %eax, %eax
je 0x9d23
movl %eax, %ebx
movl %eax, %edi
callq 0x7b08
leaq 0x2e1e(%rip), %rdi      # 0xcb2e
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
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x38
popq %rdi
callq 0x1130
andq $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 0x1ab(%rip), %rdx       # 0xa0fc
leaq 0x2e8(%rip), %rsi       # 0xa240
cmoveq %rdx, %rsi
cmpl $0x1, %ecx
leaq 0x44(%rip), %rcx        # 0x9faa
cmovneq %rsi, %rcx
movq %rcx, 0x10(%rax)
movl 0x4(%rbx), %edx
cmpq $0x3, %rdx
ja 0x9f8f
leaq 0x6e32(%rip), %rcx      # 0x10db0
movq (%rcx,%rdx,8), %rcx
leaq 0x6e47(%rip), %rsi      # 0x10dd0
movq (%rsi,%rdx,8), %rdx
jmp 0x9f9d
leaq 0x3bc(%rip), %rdx       # 0xa352
leaq 0x39c(%rip), %rcx       # 0xa339
movq %rcx, 0x20(%rax)
movq %rdx, 0x18(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x4(%rsi), %rbp
movq 0x28(%rsi), %rax
movslq 0x10(%rax), %r15
movq %rdi, %r12
movq %r12, %rax
subq %r14, %rax
sarq $0x2, %rax
cmpq %rbp, %rax
jge 0xa02b
movq 0x18(%rbx), %rsi
movl %ebp, %edx
subl %eax, %edx
movq %r12, %rdi
movq %r15, %rcx
callq 0xa03a
cltq
leaq (%r12,%rax,4), %r13
movq 0x18(%rbx), %rsi
movq %r13, %rax
subq %r14, %rax
shrq $0x2, %rax
movl %ebp, %edx
subl %eax, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0xa094
movslq %eax, %rsi
leaq (,%rsi,4), %r12
addq %r13, %r12
movq 0x20(%rbx), %rdx
movq %r13, %rdi
callq 0xa0ee
jmp 0x9fca
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x4(%rsi), %rbp
movq 0x28(%rsi), %rax
movslq 0x10(%rax), %r15
movq %rdi, %r12
movq %r12, %rax
subq %r14, %rax
sarq $0x2, %rax
cmpq %rbp, %rax
jge 0xa17d
movq 0x18(%rbx), %rsi
movl %ebp, %edx
subl %eax, %edx
movq %r12, %rdi
movq %r15, %rcx
callq 0xa18c
cltq
leaq (%r12,%rax,4), %r13
movq 0x18(%rbx), %rsi
movq %r13, %rax
subq %r14, %rax
shrq $0x2, %rax
movl %ebp, %edx
subl %eax, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0xa1e6
movslq %eax, %rsi
leaq (,%rsi,4), %r12
addq %r13, %r12
movq 0x20(%rbx), %rdx
movq %r13, %rdi
callq 0xa0ee
jmp 0xa11c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq $-0x1
popq %rax
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0xa2fc
movzbl (%rdi,%rcx), %edx
cmpl %edx, %eax
cmovlel %edx, %eax
incq %rcx
jmp 0xa2e8
retq
// File: /workspace/github_c_makefile_star2_O2/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
cmpq $0x3, %rcx
je 0xa338
movzbl (%rdi,%rcx), %edx
cmpl %edx, %eax
cmovgel %edx, %eax
incq %rcx
jmp 0xa324
retq
// File: /workspace/github_c_makefile_star2_O2/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
cmpl $0x0, 0x1f54c(%rip)     # 0x25c8c
je 0x6747
pushq $-0x3
popq %rax
popq %rcx
retq
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x64f0
testl %eax, %eax
js 0x6767
movl $0x1, 0x1f315(%rip)     # 0x25a74
movl %eax, %edi
popq %rax
jmp 0x6778
callq 0x6060
movl (%rax), %eax
movl %eax, 0x1f514(%rip)     # 0x25c88
pushq $-0x4
jmp 0x6744
// File: /workspace/github_c_makefile_star2_O2/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 %rax
movzwl 0x1ecf0(%rip), %edi     # 0x25a98
movzwl 0x1eceb(%rip), %esi     # 0x25a9a
callq 0x730a
testl %eax, %eax
jne 0x6dfb
movq 0x1edd1(%rip), %rdi     # 0x25b90
callq 0x78d9
testl %eax, %eax
jne 0x6dfb
movl 0x1ecba(%rip), %edi     # 0x25a88
movl 0x1ecb8(%rip), %esi     # 0x25a8c
callq 0x771c
testl %eax, %eax
jne 0x6dfb
movl 0x1ec8d(%rip), %edi     # 0x25a70
callq 0x77dd
testl %eax, %eax
je 0x6df1
pushq $-0x1
popq %rax
jmp 0x6dfb
orq $-0x1, 0x1ec97(%rip)    # 0x25a90
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1ec5c(%rip), %edi     # 0x25a68
testl %edi, %edi
js 0x6e64
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
xorl %ebx, %ebx
movl $0x5413, %esi           # imm = 0x5413
xorl %eax, %eax
callq 0x6240
testl %eax, %eax
je 0x6e6b
callq 0x6060
movl (%rax), %ebp
movl 0x1ec38(%rip), %edi     # 0x25a70
leaq 0x168b6(%rip), %rsi     # 0x1d6f5
pushq $0x10
popq %rdx
callq 0x6120
cmpq $0x10, %rax
jne 0x6f20
xorl %eax, %eax
cmpq $0x10, %rax
je 0x6e86
andq $0x0, 0x68(%rsp,%rax,8)
incq %rax
jmp 0x6e53
xorl %ebx, %ebx
jmp 0x6f29
movzwl 0xa(%rsp), %eax
movl %eax, 0x1ec0a(%rip)     # 0x25a80
movzwl 0x8(%rsp), %eax
movl %eax, 0x1ec03(%rip)     # 0x25a84
jmp 0x6f29
movl 0x1ebe0(%rip), %edi     # 0x25a6c
pushq $0x40
popq %rcx
movl %edi, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %edi, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, 0x68(%rsp,%rdx,8)
leaq 0x10(%rsp), %r8
andq $0x0, (%r8)
movq $0xf4240, 0x8(%r8)      # imm = 0xF4240
incl %edi
leaq 0x68(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6390
cmpl $0x1, %eax
jne 0x6f20
movl 0x1eb97(%rip), %edi     # 0x25a6c
leaq 0x20(%rsp), %rsi
pushq $0x3f
popq %rdx
callq 0x62b0
testq %rax, %rax
jle 0x6f20
movb $0x0, 0x20(%rsp,%rax)
leaq 0x16813(%rip), %rsi     # 0x1d706
xorl %ebx, %ebx
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
leaq 0x4(%rsp), %rcx
xorl %eax, %eax
callq 0x63f0
cmpl $0x2, %eax
jne 0x6f20
movl 0x4(%rsp), %eax
movl %eax, 0x1eb68(%rip)     # 0x25a80
movl (%rsp), %eax
jmp 0x6e7b
movl %ebp, 0x1ed62(%rip)     # 0x25c88
pushq $-0xb
popq %rbx
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %rbp
retq