LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ffoissey[P]push_swap_42/libft/srcs/sort/ft_insertsort_integer.c
// Function: ft_insertsort_long
void		ft_insertsort_long(long *tab, size_t size)
{
	size_t	i;
	size_t	j;

	if (!tab)
		return ;
	i = 0;
	while (++i < size)
	{
		j = 0;
		while (j < i)
		{
			if (tab[i] < tab[j++])
				ft_insert_elem_long(tab, i, j);
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0x329c
pushq %r15
pushq %r14
pushq %rbx
movabsq $0x1, %rax
xorl %ecx, %ecx
movq %rdi, %rdx
movq %rax, %r8
xorl %r9d, %r9d
incq %r9
cmpq %rsi, %r9
jae 0x3297
movq %rcx, %r10
xorl %r11d, %r11d
cmpq %r8, %r11
je 0x328b
movq (%rdi,%r9,8), %rbx
cmpq (%rdi,%r11,8), %rbx
jge 0x3283
movq %rax, %r14
cmpq %r14, %r10
je 0x327c
movq -0x8(%rdx,%r14,8), %r15
movq %r15, (%rdx,%r14,8)
decq %r14
jmp 0x3269
movslq %ebx, %rbx
movq %rbx, (%rdi,%r11,8)
incq %r11
incq %r10
jmp 0x3257
incq %r8
addq $0x8, %rdx
decq %rcx
jmp 0x3249
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_2/exercise_2_08/rightrot.c
// Function: printbin
void printbin(unsigned int x)
{
  unsigned int n = sizeof(unsigned int);

  printf("0b");

  int i;
  for (i = n * 8 - 1; i >= 0; --i)
  {
    (x & (unsigned int)pow(2, i)) ? putchar('1') : putchar('0');
  }

  putchar('\n');
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0xe78(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1050
pushq $0x1f
popq %rbp
pushq $0x31
popq %r14
testl %ebp, %ebp
js 0x11c0
cvtsi2sd %ebp, %xmm0
callq 0x1030
cvttsd2si %xmm0, %rax
andl %ebx, %eax
cmpl $0x1, %eax
movl %r14d, %edi
sbbl $0x0, %edi
callq 0x1040
decl %ebp
jmp 0x119a
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/elasticarray/main.c
// Function: main
int
main(int argc, char * argv[])
{
	const char * ch;

	WARNP_INIT;

	/* Process arguments. */
	while ((ch = GETOPT(argc, argv)) != NULL) {
		GETOPT_SWITCH(ch) {
		GETOPT_OPT("-x"):
			exit(selftest());
		GETOPT_OPT("-t"):
			exit(elasticarray_perftest());
		GETOPT_DEFAULT:
			usage();
		}
	}

	usage();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x131c
callq 0x27e4
leaq 0x4e1d(%rip), %r13      # 0x6140
leaq 0x1cda(%rip), %r14      # 0x3004
leaq 0x1cd6(%rip), %r15      # 0x3007
movl %ebp, %edi
movq %rbx, %rsi
callq 0x1d3c
testq %rax, %rax
je 0x1405
movq %rax, %r12
movq $0x101, (%rsp)          # imm = 0x101
movq (%rsp), %rax
decq %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x0, (%r13)
je 0x1378
movq %r12, %rdi
callq 0x2151
addq (%rsp), %rax
jmp 0x1386
movq 0x10(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
cmpq $0x102, %rax            # imm = 0x102
je 0x13d9
cmpq $0x104, %rax            # imm = 0x104
je 0x13c4
cmpq $0x106, %rax            # imm = 0x106
je 0x13f8
cmpl $0x0, (%r13)
jne 0x1405
cmpl $0x0, 0xc(%rsp)
jne 0x1363
movl $0x106, %edi            # imm = 0x106
subq (%rsp), %rdi
callq 0x24be
movl $0x1, 0xc(%rsp)
jmp 0x1363
cmpl $0x0, (%r13)
jne 0x140a
movl $0x104, %esi            # imm = 0x104
subq (%rsp), %rsi
movq %r15, %rdi
jmp 0x13ec
cmpl $0x0, (%r13)
jne 0x1411
movl $0x102, %esi            # imm = 0x102
subq (%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x2269
jmp 0x1363
movl $0x1, (%r13)
jmp 0x1331
callq 0x1732
callq 0x17b4
jmp 0x1416
callq 0x141d
movl %eax, %edi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/elasticarray/elasticarray_perftest.c
// Function: elasticarray_perftest
int
elasticarray_perftest(void)
{

	/* Benchmark elasticarray_append() and elasticarray_shrink(). */
	if (check_append_shrink())
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
pushq $0x4
popq %rsi
xorl %edi, %edi
callq 0x1a00
testq %rax, %rax
je 0x183d
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x25e8
testl %eax, %eax
je 0x17fe
callq 0x1070
cmpl $0x0, (%rax)
je 0x1827
movq %rax, %r14
leaq 0x188f(%rip), %rdi      # 0x3080
xorl %eax, %eax
callq 0x2861
andl $0x0, (%r14)
jmp 0x1835
xorl %eax, %eax
leaq 0x4(%rsp), %r14
movl %eax, 0x4(%rsp)
cmpl $0xf423f, %eax          # imm = 0xF423F
jg 0x184a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19e7
testl %eax, %eax
jne 0x1835
movl 0x4(%rsp), %eax
incl %eax
jmp 0x1805
leaq 0x1852(%rip), %rdi      # 0x3080
xorl %eax, %eax
callq 0x29f0
movq %rbx, %rdi
callq 0x1a97
pushq $-0x1
popq %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8(%rsp), %rdi
callq 0x25e8
testl %eax, %eax
jne 0x17dd
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %r15
leaq 0x18(%rsp), %rdi
subq (%rdi), %r14
subq 0x8(%rdi), %r15
callq 0x25e8
testl %eax, %eax
jne 0x17dd
cvtsi2sd %r14, %xmm0
cvtsi2sd %r15, %xmm1
mulsd 0x17db(%rip), %xmm1     # 0x3068
addsd %xmm0, %xmm1
mulsd 0x17d7(%rip), %xmm1     # 0x3070
divsd 0x17d7(%rip), %xmm1     # 0x3078
movsd %xmm1, 0x38(%rsp)
xorl %eax, %eax
movl %eax, 0x4(%rsp)
cmpl $0xf423f, %eax          # imm = 0xF423F
jg 0x18c4
movq %rbx, %rdi
callq 0x19f2
movl 0x4(%rsp), %eax
incl %eax
jmp 0x18a9
leaq 0x8(%rsp), %rdi
callq 0x25e8
testl %eax, %eax
jne 0x17dd
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %r15
leaq 0x18(%rsp), %rdi
subq (%rdi), %r14
subq 0x8(%rdi), %r15
callq 0x25e8
testl %eax, %eax
jne 0x17dd
cvtsi2sd %r14, %xmm0
cvtsi2sd %r15, %xmm1
mulsd 0x175d(%rip), %xmm1     # 0x3068
addsd %xmm0, %xmm1
mulsd 0x1759(%rip), %xmm1     # 0x3070
divsd 0x1759(%rip), %xmm1     # 0x3078
movsd %xmm1, 0x30(%rsp)
xorl %eax, %eax
leaq 0x4(%rsp), %r14
movl %eax, 0x4(%rsp)
cmpl $0xf423f, %eax          # imm = 0xF423F
jg 0x195a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19e7
testl %eax, %eax
jne 0x1835
movq %rbx, %rdi
callq 0x19f2
movl 0x4(%rsp), %eax
incl %eax
jmp 0x192c
leaq 0x8(%rsp), %rdi
callq 0x25e8
testl %eax, %eax
jne 0x17dd
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq 0x18(%rsp), %rax
cvtsi2sd %rax, %xmm0
subq 0x20(%rsp), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0x16d6(%rip), %xmm1     # 0x3068
addsd %xmm0, %xmm1
mulsd 0x16d2(%rip), %xmm1     # 0x3070
divsd 0x16d2(%rip), %xmm1     # 0x3078
movsd %xmm1, 0x28(%rsp)
movq %rbx, %rdi
callq 0x1a97
leaq 0x16df(%rip), %rdi      # 0x309a
callq 0x1090
leaq 0x16c3(%rip), %rdi      # 0x308a
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
movb $0x3, %al
callq 0x10d0
xorl %eax, %eax
jmp 0x1840
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_04/stack.c
// Function: main
int main(void)
{
  int type;
  double op2;
  char s[MAXOP];

  while ((type = getop(s)) != EOF)
  {
    switch (type)
    {
    case NUMBER:
      push(atof(s));
      break;

    case '+':
      push(pop() + pop());
      break;

    case '-':
      op2 = pop();
      push(pop() - op2);
      break;

    case '*':
      push(pop() * pop());
      break;

    case '/':
      op2 = pop();

      if (op2 != 0.0)
      {
        push(pop() / op2);
      }
      else
      {
        printf("Error: zero divisor.\n");
      }

      break;

    case '%':
      op2 = pop();

      if (op2 != 0.0)
      {
        push((int)pop() % (int)op2);
      }
      else
      {
        printf("Error: zero divisor.\n");
      }
      break;

    case 'h':
      view_head();
      break;

    case 'd':
      duplicate();
      break;

    case 's':
      swap();
      break;

    case 'c':
      clear();
      break;

    case '\n':
      printf("result: %.8g\n", pop());
      break;

    default:
      printf("Error: unknown command %s.\n", s);
      break;
    }
  }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
leaq 0x10(%rsp), %rbx
leaq 0xea8(%rip), %r14       # 0x2040
leaq 0xeaf(%rip), %r15       # 0x204e
leaq 0xe6a(%rip), %r13       # 0x2010
leaq 0xecd(%rip), %r12       # 0x207a
movq %rbx, %rdi
callq 0x1345
leal -0x25(%rax), %ecx
cmpl $0xb, %ecx
ja 0x11ff
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
callq 0x1495
ucomisd 0xe34(%rip), %xmm0      # 0x2008
jne 0x11dc
jnp 0x1325
movsd %xmm0, 0x8(%rsp)
callq 0x1495
cvttsd2si %xmm0, %eax
cvttsd2si 0x8(%rsp), %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm0
callq 0x1466
jmp 0x11ad
cmpl $0xa, %eax
je 0x12f3
cmpl $0x63, %eax
je 0x131b
cmpl $0x64, %eax
je 0x12e9
cmpl $0x68, %eax
je 0x1307
cmpl $0x73, %eax
je 0x1311
cmpl $-0x1, %eax
je 0x1332
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x11ad
callq 0x1495
movsd %xmm0, 0x8(%rsp)
callq 0x1495
mulsd 0x8(%rsp), %xmm0
callq 0x1466
jmp 0x11ad
callq 0x1495
ucomisd 0xd94(%rip), %xmm0      # 0x2008
jne 0x127c
jnp 0x1325
movsd %xmm0, 0x8(%rsp)
callq 0x1495
divsd 0x8(%rsp), %xmm0
callq 0x1466
jmp 0x11ad
callq 0x1495
movsd %xmm0, 0x8(%rsp)
callq 0x1495
addsd 0x8(%rsp), %xmm0
callq 0x1466
jmp 0x11ad
callq 0x1495
movsd %xmm0, 0x8(%rsp)
callq 0x1495
subsd 0x8(%rsp), %xmm0
callq 0x1466
jmp 0x11ad
movq %rbx, %rdi
callq 0x1040
callq 0x1466
jmp 0x11ad
callq 0x14fc
jmp 0x11ad
callq 0x1495
movq %r14, %rdi
movb $0x1, %al
callq 0x1050
jmp 0x11ad
callq 0x14c9
jmp 0x11ad
callq 0x1517
jmp 0x11ad
callq 0x154b
jmp 0x11ad
movq %r12, %rdi
callq 0x1030
jmp 0x11ad
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
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_04/stack.c
// Function: getop
int getop(char s[])
{
  int i = 0, c;

  while ((s[0] = c = getch()) == ' ' || c == '\t')
    ;

  s[1] = '\0';

  if (!isdigit(c) && c != '.' && c != '-')
  {
    return c;
  }

  if (c == '-')
  {
    int next = getch();
    if (next == '\n' || next == ' ' || next == '\t')
    {
      ungetch(next);
      return c; // return '-' as operator
    }
    else if (!isdigit(next) && next != '.')
    {
      return next; // not a number
    }
    else // number like "-5", "-.6" etc, next is digit or '.'
    {
      s[++i] = c = next;
    }
  }

  if (isdigit(c))
  {
    while (isdigit(s[++i] = c = getch()))
      ;
  }

  if (c == '.')
  {
    while (isdigit(s[++i] = c = getch()))
      ;
  }

  if (c != EOF)
  {
    ungetch(c);
  }

  return NUMBER;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x156f
movl %eax, %ebx
movb %bl, (%r14)
cmpb $0x20, %bl
sete %al
cmpl $0x9, %ebx
sete %cl
orb %al, %cl
jne 0x1353
movb $0x0, 0x1(%r14)
callq 0x1070
movq %rax, %r15
movq (%rax), %rax
movslq %ebx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
leal -0x2f(%rbx), %ecx
cmpl $-0x3, %ecx
ja 0x139d
testw %ax, %ax
jne 0x139d
movl %ebx, %ebp
jmp 0x1455
xorl %r12d, %r12d
cmpl $0x2d, %ebx
jne 0x13f6
callq 0x156f
movl %eax, %ebx
cmpl $0x20, %eax
ja 0x13cb
movl %ebx, %eax
movabsq $0x100000600, %rcx      # imm = 0x100000600
btq %rax, %rcx
jae 0x13cb
pushq $0x2d
popq %rbp
jmp 0x144e
movslq %ebx, %rax
cmpl $0x2e, %ebx
je 0x13e2
movq (%r15), %rcx
movzwl (%rcx,%rax,2), %ecx
andl $0x800, %ecx            # imm = 0x800
je 0x1396
movb %bl, 0x1(%r14)
movq (%r15), %rcx
movzwl (%rcx,%rax,2), %eax
andl $0x800, %eax            # imm = 0x800
pushq $0x1
popq %r12
testw %ax, %ax
je 0x141c
movl %r12d, %r12d
movq (%r15), %r13
callq 0x156f
movl %eax, %ebx
movb %bl, 0x1(%r14,%r12)
incq %r12
movsbq %bl, %rax
testb $0x8, 0x1(%r13,%rax,2)
jne 0x13fe
cmpl $0x2e, %ebx
jne 0x1446
movslq %r12d, %rax
addq %rax, %r14
incq %r14
movq (%r15), %r12
callq 0x156f
movl %eax, %ebx
movb %bl, (%r14)
movsbq %bl, %rax
incq %r14
testb $0x8, 0x1(%r12,%rax,2)
jne 0x142a
pushq $0x30
popq %rbp
cmpl $-0x1, %ebx
je 0x1455
movl %ebx, %edi
callq 0x1591
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_04/stack.c
// Function: swap
void swap(void)
{
  double temp1 = pop();
  double temp2 = pop();

  push(temp1);
  push(temp2);
}

// Assembly:
subq $0x18, %rsp
callq 0x1495
movsd %xmm0, 0x10(%rsp)
callq 0x1495
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x1466
movsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
jmp 0x1466
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/base64.c
// Function: handle_error
void handle_error(int e, struct base64_args *args){
    fprintf(stderr, "Error: %s\n", strerror(e));
    free(args->file);
    free(args);
    exit(e);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movq 0x2db5(%rip), %rax      # 0x3ff8
movq (%rax), %r15
callq 0x1120
leaq 0xdb2(%rip), %rsi       # 0x2004
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10d0
movq 0x18(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movl %r14d, %edi
callq 0x1100
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/base64.c
// Function: tripletoquad
char *tripletoquad(char *x, char *r){

    r[0] = lookup(x[0] >> 2);
    r[1] = lookup(((x[0] & 0b00000011) << 4) | ((x[1] & 0b11110000) >> 4));
    r[2] = lookup(((x[1] & 0b00001111) << 2) | ((x[2] & 0b11000000) >> 6));
    r[3] = lookup(x[2] & 0b00111111);

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb (%rdi), %al
sarb $0x2, %al
movsbl %al, %edi
callq 0x1490
movb %al, (%rbx)
movb (%r14), %al
movb 0x1(%r14), %cl
shrb $0x4, %cl
shlb $0x4, %al
orb %cl, %al
andb $0x3f, %al
movzbl %al, %edi
callq 0x1490
movb %al, 0x1(%rbx)
movb 0x1(%r14), %al
movb 0x2(%r14), %cl
shrb $0x6, %cl
shlb $0x2, %al
orb %cl, %al
andb $0x3f, %al
movzbl %al, %edi
callq 0x1490
movb %al, 0x2(%rbx)
movzbl 0x2(%r14), %edi
andl $0x3f, %edi
callq 0x1490
movb %al, 0x3(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/base64.c
// Function: wrap_quad
void wrap_quad(char *quad, struct base64_args *args){
    static int printed = 0;
    for(int i = 0; i < 4; i++){
        if(printed++ == args->wrap && args->wrap != 0){
            putchar('\n');
            printed = 1;
        }
        putchar(quad[i]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
pushq $0xa
popq %r15
cmpq $0x4, %r12
je 0x1596
movslq 0x2b5c(%rip), %rax      # 0x40b4
leal 0x1(%rax), %ecx
movl %ecx, 0x2b53(%rip)      # 0x40b4
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
setne %al
testq %rcx, %rcx
sete %cl
orb %al, %cl
jne 0x1587
movl %r15d, %edi
callq 0x1040
movl $0x1, 0x2b2d(%rip)      # 0x40b4
movsbl (%r14,%r12), %edi
callq 0x1040
incq %r12
jmp 0x154b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/base64.c
// Function: encode_buffer
void encode_buffer(ssize_t size, char *buf, struct base64_args *args){
    //assert(buf[2] == '\n');
    size_t last_triplet = size - size % 3;
    size_t i = 0;
    char *quad = calloc(4, sizeof(char));
    for(; i < last_triplet; i += 3){
        tripletoquad(&buf[i], quad);
        wrap_quad(quad, args);
        memset(quad, 0, 4);
    }
    if(i < size){
        char *triplet = calloc(3, sizeof(char));
        size_t diff = size - i;
        triplet[0] = buf[i];
        if(diff == 2){
            triplet[1] = buf[i+1];
            tripletoquad(triplet, quad);
            quad[3] = '=';
        }
        else if(diff == 3 || diff == 1){
            tripletoquad(triplet, quad);
            quad[2] = '=';
            quad[3] = '=';
        }
        wrap_quad(quad, args);
        if(args->wrap != 0){
            putchar('\n');
        }
    }
    free(quad);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
pushq $0x3
popq %rcx
movq %rdi, %rax
cqto
idivq %rcx
movq %rdi, -0x30(%rbp)
subq %rdx, %r12
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x10b0
movq %rax, %r14
xorl %r13d, %r13d
cmpq %r12, %r13
jae 0x15ff
leaq (%r15,%r13), %rdi
movq %r14, %rsi
callq 0x14c6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1533
andl $0x0, (%r14)
addq $0x3, %r13
jmp 0x15d9
movq -0x30(%rbp), %r12
subq %r13, %r12
jbe 0x1674
pushq $0x3
popq %rdi
pushq $0x1
popq %rsi
callq 0x10b0
movq -0x30(%rbp), %rdx
addq $-0x2, %rdx
movb (%r15,%r13), %cl
movb %cl, (%rax)
cmpq %r13, %rdx
jne 0x163b
movb 0x1(%r15,%r13), %cl
movb %cl, 0x1(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x14c6
jmp 0x1655
andq $-0x3, %r12
cmpq $0x1, %r12
jne 0x165a
movq %rax, %rdi
movq %r14, %rsi
callq 0x14c6
movb $0x3d, 0x2(%r14)
movb $0x3d, 0x3(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1533
cmpq $0x0, 0x8(%rbx)
je 0x1674
pushq $0xa
popq %rdi
callq 0x1040
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/base64.c
// Function: encode_file
void encode_file(struct base64_args *args){
    char *buf = calloc(4096, sizeof(char));
    int fd = open(args->file, O_RDONLY);
    if(fd == -1){
        handle_error(errno, args);
    }

    ssize_t r = 0;
    for(r = read(fd, buf, 4095); r > 0; r = read(fd, buf, 4095)){
        encode_buffer(r, buf, args);
    }

    free(buf);
    close(fd);

    if(r == -1){
        handle_error(errno, args);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
movl $0x1000, %edi           # imm = 0x1000
callq 0x10b0
movq %rax, %r14
movq 0x18(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10f0
cmpl $-0x1, %eax
je 0x1704
movl %eax, %r15d
movl $0xfff, %edx            # imm = 0xFFF
movl %r15d, %edi
movq %r14, %rsi
callq 0x10a0
movq %rax, %r12
testq %rax, %rax
jle 0x16e5
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x159f
jmp 0x16bd
movq %r14, %rdi
callq 0x1030
movl %r15d, %edi
callq 0x1090
cmpq $-0x1, %r12
je 0x1704
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x1050
movl (%rax), %edi
movq %rbx, %rsi
callq 0x122c
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/base64.c
// Function: main
int main(int argc, char **argv){
    struct base64_args *args = calloc(1, sizeof(struct base64_args));
    parse_args(args, argc, argv);

    /*printf("decode: %d\n", args->decode);
    printf("ignore garbage: %d\n", args->ignore_garbage);
    printf("wrap: %d\n", args->wrap);
    printf("help: %d\n", args->help);
    printf("version: %d\n", args->version);
    printf("file: %s\n", args->file);*/

    if(args->file != NULL && strcmp(args->file, "-") && args->decode == false){
        encode_file(args);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %r15d
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x10b0
movq %rax, %rbx
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x1278
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x1760
cmpb $0x2d, (%rax)
jne 0x1753
cmpb $0x0, 0x1(%rax)
je 0x1760
cmpb $0x0, (%rbx)
jne 0x1760
movq %rbx, %rdi
callq 0x168a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_03/calculator.c
// Function: main
int main(void)
{
  int type;
  double op2;
  char s[MAXOP];

  while ((type = getop(s)) != EOF)
  {
    switch (type)
    {
    case NUMBER:
      push(atof(s));
      break;

    case '+':
      push(pop() + pop());
      break;

    case '-':
      op2 = pop();
      push(pop() - op2);
      break;

    case '*':
      push(pop() * pop());
      break;

    case '/':
      op2 = pop();

      if (op2 != 0.0)
      {
        push(pop() / op2);
      }
      else
      {
        printf("Error: zero divisor.\n");
      }

      break;

    case '%':
      op2 = pop();

      if (op2 != 0.0)
      {
        push((int)pop() % (int)op2);
      }
      else
      {
        printf("Error: zero divisor.\n");
      }
      break;

    case '\n':
      printf("result: %.8g\n", pop());
      break;

    default:
      printf("Error: unknown command %s.\n", s);
      break;
    }
  }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
leaq 0x10(%rsp), %rbx
leaq 0xea8(%rip), %r14       # 0x2040
leaq 0xeaf(%rip), %r15       # 0x204e
leaq 0xe6a(%rip), %r13       # 0x2010
leaq 0xee0(%rip), %r12       # 0x208d
movq %rbx, %rdi
callq 0x12f2
leal -0x25(%rax), %ecx
cmpl $0xb, %ecx
ja 0x11ff
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
callq 0x143e
ucomisd 0xe34(%rip), %xmm0      # 0x2008
jne 0x11dc
jnp 0x12be
movsd %xmm0, 0x8(%rsp)
callq 0x143e
cvttsd2si %xmm0, %eax
cvttsd2si 0x8(%rsp), %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm0
callq 0x140d
jmp 0x11ad
cmpl $0xa, %eax
je 0x12cb
cmpl $-0x1, %eax
je 0x12df
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x11ad
callq 0x143e
movsd %xmm0, 0x8(%rsp)
callq 0x143e
addsd 0x8(%rsp), %xmm0
callq 0x140d
jmp 0x11ad
callq 0x143e
movsd %xmm0, 0x8(%rsp)
callq 0x143e
subsd 0x8(%rsp), %xmm0
callq 0x140d
jmp 0x11ad
callq 0x143e
movsd %xmm0, 0x8(%rsp)
callq 0x143e
mulsd 0x8(%rsp), %xmm0
callq 0x140d
jmp 0x11ad
callq 0x143e
ucomisd 0xd7b(%rip), %xmm0      # 0x2008
jne 0x1291
jnp 0x12be
movsd %xmm0, 0x8(%rsp)
callq 0x143e
divsd 0x8(%rsp), %xmm0
callq 0x140d
jmp 0x11ad
movq %rbx, %rdi
callq 0x1040
callq 0x140d
jmp 0x11ad
movq %r12, %rdi
callq 0x1030
jmp 0x11ad
callq 0x143e
movq %r14, %rdi
movb $0x1, %al
callq 0x1050
jmp 0x11ad
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/phoboslab[P]pl_mpeg/pl_mpeg_extract_frames.c
// Function: write_bmp
int write_bmp(const char *path, int width, int height, uint8_t *pixels) {
	FILE *fh = fopen(path, "wb");
	if (!fh) {
		return 0;
	}

	int padded_width = (width * 3 + 3) & (~3);
	int padding = padded_width - (width * 3);
	int data_size = padded_width * height;
	int file_size = 54 + data_size;

	fwrite("BM", 1, 2, fh);
	fwrite(&file_size, 1, 4, fh);
	fwrite("\x00\x00\x00\x00\x36\x00\x00\x00\x28\x00\x00\x00", 1, 12, fh);
	fwrite(&width, 1, 4, fh);
	fwrite(&height, 1, 4, fh);
	fwrite("\x01\x00\x18\x00\x00\x00\x00\x00", 1, 8, fh); // planes, bpp, compression
	fwrite(&data_size, 1, 4, fh);
	fwrite("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 16, fh);

	for (int y = height - 1; y >= 0; y--) {
		fwrite(pixels + y * width * 3, 3, width, fh);
		fwrite("\x00\x00\x00\x00", 1, padding, fh);
	}
	fclose(fh);
	return file_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movl %edx, %ebp
movl %esi, %r15d
movl %esi, 0xc(%rsp)
movl %edx, 0x8(%rsp)
leaq 0x1d58(%rip), %rsi      # 0x86ab
callq 0x1100
testq %rax, %rax
je 0x6a94
movq %rax, %r14
leal (%r15,%r15,2), %eax
leal (%r15,%r15,2), %ecx
addl $0x3, %ecx
andl $-0x4, %ecx
movl %ecx, %r13d
subl %eax, %r13d
imull %ebp, %ecx
leaq 0x4(%rsp), %rax
movl %ecx, (%rax)
addl $0x36, %ecx
movq %rsp, %r15
movl %ecx, (%r15)
leaq 0x1d1c(%rip), %rdi      # 0x86ae
pushq $0x1
popq %rbx
pushq $0x2
popq %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x1120
pushq $0x4
popq %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1120
leaq 0x1a71(%rip), %rdi      # 0x8430
pushq $0xc
popq %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x1120
leaq 0xc(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1120
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1120
leaq 0x1a3d(%rip), %rdi      # 0x843d
pushq $0x8
popq %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x1120
leaq 0x4(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1120
leaq 0x1a1e(%rip), %rdi      # 0x8446
pushq $0x10
popq %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x1120
movslq (%r15), %rbx
movslq (%rbp), %r12
movslq %r13d, %r13
leal -0x1(%rbx), %ebp
leal (%r12,%r12,2), %r15d
imull %r15d, %ebp
testq %rbx, %rbx
jle 0x6a87
decq %rbx
movslq %ebp, %rbp
movq 0x10(%rsp), %rax
leaq (%rax,%rbp), %rdi
pushq $0x3
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1120
leaq 0x19e3(%rip), %rdi      # 0x8457
pushq $0x1
popq %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1120
subl %r15d, %ebp
jmp 0x6a4b
movq %r14, %rdi
callq 0x1060
movl (%rsp), %eax
jmp 0x6a96
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/phoboslab[P]pl_mpeg/pl_mpeg_extract_frames.c
// Function: main
int main(int argc, char *argv[]) {
	if (argc < 2) {
		printf("Usage: pl_mpeg_extract_frames <file.mpg>\n");
		return 1;
	}

	plm_t *plm = plm_create_with_filename(argv[1]);
	if (!plm) {
		printf("Couldn't open file %s\n", argv[1]);
		return 1;
	}

	plm_set_audio_enabled(plm, FALSE);
	
	int w = plm_get_width(plm);
	int h = plm_get_height(plm);
	uint8_t *pixels = (uint8_t *)malloc(w * h * 3);
	
	char bmp_name[16];
	plm_frame_t *frame = NULL;

	for (int i = 1; frame = plm_decode_video(plm); i++) {
		plm_frame_to_bgr(frame, pixels, w * 3); // BMP expects BGR ordering

		sprintf(bmp_name, "%06d.bmp", i);
		printf("Writing %s\n", bmp_name);
		write_bmp(bmp_name, w, h, pixels);
	}
	
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x1, %edi
jg 0x6ac9
leaq 0x1c1e(%rip), %rdi      # 0x86dd
callq 0x1040
jmp 0x6b8c
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x122c
testq %rax, %rax
je 0x6b7a
movq %rax, %rbx
andl $0x0, 0x38(%rax)
andl $0x0, 0x40(%rax)
movq %rax, %rdi
callq 0x19fb
movl %eax, %r14d
movq %rbx, %rdi
callq 0x1a31
movl %eax, %ebp
movq %r14, 0x8(%rsp)
leal (%r14,%r14,2), %r15d
imull %r15d, %eax
movslq %eax, %rdi
callq 0x10c0
movq %rax, %r12
pushq $0x1
popq %r13
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
callq 0x2030
testq %rax, %rax
je 0x6b76
movq %rax, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x4677
movq %r14, %rdi
leaq 0x1b84(%rip), %rsi      # 0x86c8
movl %r13d, %edx
xorl %eax, %eax
callq 0x1110
leaq 0x1b7c(%rip), %rdi      # 0x86d1
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
movq %r12, %rcx
callq 0x692c
incl %r13d
jmp 0x6b1f
xorl %eax, %eax
jmp 0x6b8f
movq 0x8(%r14), %rsi
leaq 0x1b2c(%rip), %rdi      # 0x86b1
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pajlada[P]st/st.c
// Function: tlinelen
int
tlinelen(int y)
{
	int i = term.col;

	if (term.line[y][i - 1].mode & ATTR_WRAP)
		return i;

	while (i > 0 && term.line[y][i - 1].u == ' ')
		--i;

	return i;
}

// Assembly:
movslq 0xe6bb(%rip), %rax      # 0x14754
movq 0xe6b8(%rip), %rcx      # 0x14758
movslq %edi, %rdx
movq (%rcx,%rdx,8), %rcx
movq %rax, %rdx
shlq $0x4, %rdx
testb $0x1, -0xb(%rcx,%rdx)
jne 0x60d6
addq $-0x10, %rcx
movl %eax, %edx
sarl $0x1f, %edx
andl %eax, %edx
testl %eax, %eax
jle 0x60d4
movl %eax, %esi
shlq $0x4, %rsi
cmpl $0x20, (%rcx,%rsi)
jne 0x60d6
decl %eax
jmp 0x60c0
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/pajlada[P]st/st.c
// Function: ttywrite
void
ttywrite(const char *s, size_t n, int may_echo)
{
	const char *next;

	if (may_echo && IS_SET(MODE_ECHO))
		twrite(s, n, 1);

	if (!IS_SET(MODE_CRLF)) {
		ttywriteraw(s, n);
		return;
	}

	/* This is similar to how the kernel handles ONLCR for ttys */
	while (n > 0) {
		if (*s == '\r') {
			next = s + 1;
			ttywriteraw("\r\n", 2);
		} else {
			next = memchr(s, '\r', n);
			DEFAULT(next, s + n);
			ttywriteraw(s, next - s);
		}
		n -= next - s;
		s = next;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testl %edx, %edx
sete %cl
movl 0xe04f(%rip), %eax      # 0x1479c
testb $0x10, %al
sete %dl
orb %cl, %dl
jne 0x6769
pushq $0x1
popq %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x664e
movl 0xe033(%rip), %eax      # 0x1479c
testb $0x8, %al
jne 0x6783
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x67eb
leaq 0x6eca(%rip), %r15      # 0xd654
pushq $0x2
popq %r12
pushq $0xd
popq %rbp
testq %rbx, %rbx
je 0x67dc
cmpb $0xd, (%r14)
jne 0x67a8
leaq 0x1(%r14), %r13
movq %r15, %rdi
movq %r12, %rsi
jmp 0x67c9
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x5120
leaq (%r14,%rbx), %r13
testq %rax, %rax
cmovneq %rax, %r13
movq %r13, %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x67eb
movq %r14, %rax
movq %r13, %r14
addq %rax, %rbx
subq %r13, %rbx
jmp 0x6791
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pajlada[P]st/st.c
// Function: tscrollup
void
tscrollup(int orig, int n)
{
	int i;
	Line temp;

	LIMIT(n, 0, term.bot-orig+1);

	tclearregion(0, orig, term.col-1, orig+n-1);
	tsetdirt(orig+n, term.bot);

	for (i = orig; i <= term.bot-n; i++) {
		temp = term.line[i];
		term.line[i] = term.line[i+n];
		term.line[i+n] = temp;
	}

	selscroll(orig, -n);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
testl %esi, %esi
js 0x9380
movl 0xb427(%rip), %r14d     # 0x14798
subl %ebx, %r14d
incl %r14d
cmpl %esi, %r14d
cmovgel %esi, %r14d
jmp 0x9383
xorl %r14d, %r14d
movl 0xb3cb(%rip), %edx      # 0x14754
decl %edx
leal (%r14,%rbx), %ebp
leal (%r14,%rbx), %ecx
decl %ecx
xorl %edi, %edi
movl %ebx, %esi
callq 0x70af
movl 0xb3f4(%rip), %esi      # 0x14798
movl %ebp, %edi
callq 0x5d97
movslq 0xb3e6(%rip), %rax      # 0x14798
movslq %r14d, %rsi
subq %rsi, %rax
movslq %ebx, %rcx
movq 0xb396(%rip), %rdi      # 0x14758
leaq (%rdi,%rcx,8), %rdx
leaq (%rdi,%rsi,8), %rsi
cmpq %rax, %rcx
jg 0x93e6
movq (%rdx), %rdi
movq (%rsi,%rcx,8), %r8
movq %r8, (%rdx)
movq %rdi, (%rsi,%rcx,8)
incq %rcx
addq $0x8, %rdx
jmp 0x93ca
negl %r14d
movl %ebx, %edi
movl %r14d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x9788
// File: /workspace/github_c_makefile_star2_O2/pajlada[P]st/st.c
// Function: tscrolldown
void
tscrolldown(int orig, int n)
{
	int i;
	Line temp;

	LIMIT(n, 0, term.bot-orig+1);

	tsetdirt(orig, term.bot-n);
	tclearregion(0, term.bot-n+1, term.col-1, term.bot);

	for (i = term.bot; i >= orig+n; i--) {
		temp = term.line[i];
		term.line[i] = term.line[i-n];
		term.line[i-n] = temp;
	}

	selscroll(orig, n);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %eax
movl %edi, %ebx
movl 0xb393(%rip), %esi      # 0x14798
testl %eax, %eax
js 0x941b
movl %esi, %r14d
subl %ebx, %r14d
incl %r14d
cmpl %eax, %r14d
cmovgel %eax, %r14d
jmp 0x941e
xorl %r14d, %r14d
subl %r14d, %esi
movl %ebx, %edi
callq 0x5d97
movl 0xb36a(%rip), %ecx      # 0x14798
movl %ecx, %esi
subl %r14d, %esi
incl %esi
movl 0xb319(%rip), %edx      # 0x14754
decl %edx
xorl %edi, %edi
callq 0x70af
movslq 0xb34d(%rip), %rax      # 0x14798
leal (%r14,%rbx), %ecx
movslq %ecx, %rcx
movslq %r14d, %rdi
movq 0xb2fc(%rip), %rdx      # 0x14758
shlq $0x3, %rdi
movq %rdx, %rsi
subq %rdi, %rsi
cmpq %rcx, %rax
jl 0x9480
movq (%rdx,%rax,8), %rdi
movq (%rsi,%rax,8), %r8
movq %r8, (%rdx,%rax,8)
movq %rdi, (%rsi,%rax,8)
decq %rax
jmp 0x9466
movl %ebx, %edi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9788
// File: /workspace/github_c_makefile_star2_O2/pajlada[P]st/x.c
// Function: xloadcols
void
xloadcols(void)
{
	int i;
	static int loaded;
	Color *cp;

	if (loaded) {
		for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp)
			XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);
	} else {
		dc.collen = MAX(LEN(colorname), 256);
		dc.col = xmalloc(dc.collen * sizeof(Color));
	}

	for (i = 0; i < dc.collen; i++)
		if (!xloadcolor(i, NULL, &dc.col[i])) {
			if (colorname[i])
				die("could not allocate color '%s'\n", colorname[i]);
			else
				die("could not allocate color %d\n", i);
		}
	loaded = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpb $0x1, 0xd145(%rip)      # 0x16b2c
jne 0x9a30
movq 0xd140(%rip), %rax      # 0x16b30
movq %rax, %rbx
movq 0xd13e(%rip), %rcx      # 0x16b38
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %rbx
jae 0x9a4c
movq 0xd21b(%rip), %rdi      # 0x16c28
movq 0xd28c(%rip), %rsi      # 0x16ca0
movq 0xd215(%rip), %rdx      # 0x16c30
movq %rbx, %rcx
callq 0x55c0
addq $0x10, %rbx
movq 0xd102(%rip), %rax      # 0x16b30
jmp 0x99f3
movq $0x104, 0xd0fd(%rip) # imm = 0x104
movl $0x1040, %edi           # imm = 0x1040
callq 0x5a0c
movq %rax, 0xd0e4(%rip)      # 0x16b30
leaq 0x7fcd(%rip), %r12      # 0x11a20
leaq 0x424d(%rip), %rbx      # 0xdca7
leaq 0x4227(%rip), %r14      # 0xdc88
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq %r15, 0xd0ca(%rip)      # 0x16b38
jbe 0x9abe
movq 0xd0b9(%rip), %rdx      # 0x16b30
addq %r13, %rdx
movl %r15d, %edi
xorl %esi, %esi
callq 0x9acf
testl %eax, %eax
jne 0x9ab1
leaq -0x10(%r15), %rax
cmpq $0xf0, %rax
jae 0x9aa3
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x5a36
jmp 0x9ab1
movq (%r12), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x5a36
incq %r15
addq $0x10, %r13
addq $0x8, %r12
jmp 0x9a67
movb $0x1, 0xd067(%rip)      # 0x16b2c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/pajlada[P]st/x.c
// Function: xgetcolor
int
xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
{
	if (!BETWEEN(x, 0, dc.collen))
		return 1;

	*r = dc.col[x].color.red >> 8;
	*g = dc.col[x].color.green >> 8;
	*b = dc.col[x].color.blue >> 8;

	return 0;
}

// Assembly:
pushq $0x1
popq %rax
testl %edi, %edi
js 0x9bf9
movl %edi, %edi
cmpq %rdi, 0xcf6e(%rip)      # 0x16b38
jb 0x9bf9
movq 0xcf5d(%rip), %rax      # 0x16b30
shlq $0x4, %rdi
movb 0x9(%rax,%rdi), %al
movb %al, (%rsi)
movq 0xcf4c(%rip), %rax      # 0x16b30
movb 0xb(%rax,%rdi), %al
movb %al, (%rdx)
movq 0xcf3f(%rip), %rax      # 0x16b30
movb 0xd(%rax,%rdi), %al
movb %al, (%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/bench/bulk_extract/main.c
// Function: callback_range
static int
callback_range(void * cookie,
    const struct kvldskey * key, const struct kvldskey * value)
{
	struct bulkextract_state * C = cookie;

	(void)key; /* UNUSED */
	(void)value; /* UNUSED */

	/* Notify the benchmarking code, and check if we should quit. */
	if (bench_tick(C->B, &C->done)) {
		warnp("bench_tick");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbx
movq 0x18(%rdi), %rax
leaq 0x14(%rdi), %rsi
movq %rax, %rdi
callq 0x4dc1
testl %eax, %eax
je 0x2688
callq 0x2090
cmpl $0x0, (%rax)
je 0x268c
movq %rax, %rbx
leaq 0x6a2f(%rip), %rdi      # 0x90ab
xorl %eax, %eax
callq 0x4931
andl $0x0, (%rbx)
jmp 0x269a
xorl %eax, %eax
jmp 0x269d
leaq 0x6a18(%rip), %rdi      # 0x90ab
xorl %eax, %eax
callq 0x4ac0
pushq $-0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: strlcpy2
int strlcpy2(char *dst, const char *src, int size) {
    char *orig = dst;
    if (size) {
	while (--size && (*dst = *src)) {
	    src++; dst++;
	}
	*dst = 0;
    }
    return dst - orig;
}

// Assembly:
movq %rdi, %rax
testl %edx, %edx
je 0x2961
decl %edx
xorl %ecx, %ecx
cmpl %ecx, %edx
je 0x2959
movb (%rsi,%rcx), %al
movb %al, (%rdi,%rcx)
testb %al, %al
je 0x2959
incq %rcx
jmp 0x2946
leaq (%rdi,%rcx), %rax
movb $0x0, (%rdi,%rcx)
subl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: Alert
void Alert(char *fmt, ...) {
    va_list argp;
    struct timeval tv;
    struct tm *tm;

    if (!(global.mode & MODE_QUIET) || (global.mode & (MODE_VERBOSE | MODE_STARTING))) {
	va_start(argp, fmt);

	gettimeofday(&tv, NULL);
	tm=localtime(&tv.tv_sec);
	fprintf(stderr, "[ALERT] %03d/%02d%02d%02d (%d) : ",
		tm->tm_yday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)getpid());
	vfprintf(stderr, fmt, argp);
	fflush(stderr);
	va_end(argp);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x68(%rsp)
testb %al, %al
je 0x2a15
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movl $0xd0, %eax
andl 0xb9a8(%rip), %eax      # 0xe3c8
cmpl $0x10, %eax
jne 0x2a37
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
leaq 0x40(%rsp), %rax
leaq 0x10(%rsp), %rcx
movq %rax, 0x10(%rcx)
leaq 0x130(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
leaq 0x30(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2190
movq %r15, %rdi
callq 0x2070
movq 0xb579(%rip), %rcx      # 0xdff8
movq (%rcx), %r15
movl 0x1c(%rax), %ebp
movl 0x8(%rax), %r12d
movl (%rax), %r13d
movl 0x4(%rax), %r14d
callq 0x2100
movl %eax, (%rsp)
leaq 0x76b2(%rip), %rsi      # 0xa151
movq %r15, %rdi
movl %ebp, %edx
movl %r12d, %ecx
movl %r14d, %r8d
movl %r13d, %r9d
xorl %eax, %eax
callq 0x2230
movq 0xb53d(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq %rbx, %rsi
leaq 0x10(%rsp), %rdx
callq 0x2350
movq 0xb526(%rip), %rax      # 0xdff8
movq (%rax), %rdi
callq 0x22b0
jmp 0x2a25
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: qfprintf
void qfprintf(FILE *out, char *fmt, ...) {
    va_list argp;

    if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) {
	va_start(argp, fmt);
	vfprintf(out, fmt, argp);
	fflush(out);
	va_end(argp);
    }
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2c6b
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movl 0xb757(%rip), %eax      # 0xe3c8
andl $0x50, %eax
cmpl $0x10, %eax
je 0x2cae
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x2350
movq %rbx, %rdi
callq 0x22b0
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: str2sa
struct sockaddr_in *str2sa(char *str) {
    static struct sockaddr_in sa;
    char *c;
    int port;

    memset(&sa, 0, sizeof(sa));
    str=strdup(str);

    if ((c=strrchr(str,':')) != NULL) {
	*c++=0;
	port=atol(c);
    }
    else
	port=0;

    if (*str == '*' || *str == '\0') { /* INADDR_ANY */
	sa.sin_addr.s_addr = INADDR_ANY;
    }
    else if (!inet_pton(AF_INET, str, &sa.sin_addr)) {
	struct hostent *he;

	if ((he = gethostbyname(str)) == NULL) {
	    Alert("Invalid server name: '%s'\n", str);
	}
	else
	    sa.sin_addr = *(struct in_addr *) *(he->h_addr_list);
    }
    sa.sin_port=htons(port);
    sa.sin_family=AF_INET;

    free(str);
    return &sa;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xb71f(%rip)     # 0xe3e4
callq 0x23e0
movq %rax, %rbx
pushq $0x3a
popq %rsi
movq %rax, %rdi
callq 0x2180
testq %rax, %rax
je 0x2cf0
movq %rax, %rdi
incq %rdi
movb $0x0, (%rax)
callq 0x2320
movq %rax, %r14
jmp 0x2cf3
xorl %r14d, %r14d
movzbl (%rbx), %eax
cmpl $0x2a, %eax
je 0x2cff
testl %eax, %eax
jne 0x2d08
andl $0x0, 0xb6e2(%rip)      # 0xe3e8
jmp 0x2d4d
leaq 0xb6d9(%rip), %rdx      # 0xe3e8
pushq $0x2
popq %rdi
movq %rbx, %rsi
callq 0x2260
testl %eax, %eax
jne 0x2d4d
movq %rbx, %rdi
callq 0x2220
testq %rax, %rax
je 0x2d3c
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0xb6ae(%rip)      # 0xe3e8
jmp 0x2d4d
leaq 0x7454(%rip), %rdi      # 0xa197
movq %rbx, %rsi
xorl %eax, %eax
callq 0x29aa
rolw $0x8, %r14w
movw %r14w, 0xb68c(%rip)     # 0xe3e6
leaq 0xb683(%rip), %r14      # 0xe3e4
movw $0x2, 0xb67a(%rip)      # 0xe3e4
movq %rbx, %rdi
callq 0x2050
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: str2net
int str2net(char *str, struct in_addr *addr, struct in_addr *mask) {
    char *c;
    unsigned long len;

    memset(mask, 0, sizeof(*mask));
    memset(addr, 0, sizeof(*addr));
    str=strdup(str);

    if ((c = strrchr(str, '/')) != NULL) {
	*c++ = 0;
        /* c points to the mask */
	if (strchr(c, '.') != NULL) {	    /* dotted notation */
	    if (!inet_pton(AF_INET, c, mask))
		return 0;
	}
	else { /* mask length */
	    char *err;
	    len = strtol(c, &err, 10);
	    if (!*c || (err && *err) || (unsigned)len > 32)
		return 0;
	    if (len)
		mask->s_addr = htonl(0xFFFFFFFFUL << (32 - len));
	    else
		mask->s_addr = 0;
	}
    }
    else {
	mask->s_addr = 0xFFFFFFFF;
    }
    if (!inet_pton(AF_INET, str, addr)) {
	struct hostent *he;

	if ((he = gethostbyname(str)) == NULL) {
	    return 0;
	}
	else
	    *addr = *(struct in_addr *) *(he->h_addr_list);
    }
    free(str);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
andl $0x0, (%rdx)
andl $0x0, (%rsi)
callq 0x23e0
movq %rax, %r14
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0x2180
testq %rax, %rax
je 0x2dd9
movq %rax, %r12
incq %r12
movb $0x0, (%rax)
pushq $0x2e
popq %rsi
movq %r12, %rdi
callq 0x2160
testq %rax, %rax
je 0x2e14
pushq $0x2
popq %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2260
testl %eax, %eax
jne 0x2ddd
jmp 0x2e5a
orl $-0x1, (%r15)
pushq $0x2
popq %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2260
testl %eax, %eax
jne 0x2e07
movq %r14, %rdi
callq 0x2220
testq %rax, %rax
je 0x2e5a
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x2050
pushq $0x1
popq %rax
jmp 0x2e5c
movq %rsp, %rsi
pushq $0xa
popq %rdx
movq %r12, %rdi
callq 0x2240
cmpb $0x0, (%r12)
je 0x2e5a
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x2e37
cmpb $0x0, (%rcx)
jne 0x2e5a
cmpl $0x20, %eax
ja 0x2e5a
leaq 0x20(%rax), %rcx
negq %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shlq %cl, %rdx
xorl %ecx, %ecx
testq %rax, %rax
bswapl %edx
cmovel %ecx, %edx
movl %edx, (%r15)
jmp 0x2ddd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: tv_delta
unsigned long tv_delta(struct timeval *tv1, struct timeval *tv2) {
    int cmp;
    unsigned long ret;
  

    cmp = tv_cmp(tv1, tv2);
    if (!cmp)
	return 0; /* same dates, null diff */
    else if (cmp < 0) {
	struct timeval *tmp = tv1;
	tv1 = tv2;
	tv2 = tmp;
    }
    ret = (tv1->tv_sec - tv2->tv_sec) * 1000;
    if (tv1->tv_usec > tv2->tv_usec)
	ret += (tv1->tv_usec - tv2->tv_usec) / 1000;
    else
	ret -= (tv2->tv_usec - tv1->tv_usec) / 1000;
    return (unsigned long) ret;
}

// Assembly:
movq (%rsi), %rax
cmpq %rax, (%rdi)
jge 0x30c7
movq %rdi, %rax
movq %rsi, %rdi
jmp 0x30cc
jle 0x310b
movq %rsi, %rax
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq (%rax), %rcx
imulq $0x3e8, %rcx, %rsi      # imm = 0x3E8
movq 0x8(%rax), %rax
movq %rdx, %rcx
subq %rax, %rcx
jle 0x30f8
movl $0x3e8, %edi            # imm = 0x3E8
movq %rcx, %rax
cqto
idivq %rdi
jmp 0x3107
subq %rdx, %rax
movq $-0x3e8, %rcx           # imm = 0xFC18
cqto
idivq %rcx
addq %rsi, %rax
retq
movq 0x8(%rdi), %rax
movq 0x8(%rsi), %rcx
cmpq %rcx, %rax
jl 0x30bf
movq %rsi, %rax
jg 0x30cc
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: tv_cmp2
static int tv_cmp2(struct timeval *tv1, struct timeval *tv2) {
    if (tv_iseternity(tv1))
	if (tv_iseternity(tv2))
	    return 0; /* same */
	else
	    return 1; /* tv1 later than tv2 */
    else if (tv_iseternity(tv2))
	return -1; /* tv2 later than tv1 */
    
    if (tv1->tv_sec > tv2->tv_sec)
	return 1;
    else if (tv1->tv_sec < tv2->tv_sec)
	return -1;
    else if (tv1->tv_usec > tv2->tv_usec)
	return 1;
    else if (tv1->tv_usec < tv2->tv_usec)
	return -1;
    else
	return 0;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
jne 0x3277
cmpq $0x0, 0x8(%rdi)
je 0x32ab
movq (%rsi), %r8
pushq $-0x1
popq %rax
testq %r8, %r8
jne 0x3289
cmpq $0x0, 0x8(%rsi)
je 0x32aa
pushq $0x1
popq %rdx
cmpq %r8, %rcx
jle 0x3294
movl %edx, %eax
retq
jl 0x32aa
movq 0x8(%rsi), %rcx
movl %edx, %eax
cmpq %rcx, 0x8(%rdi)
jg 0x32aa
setl %al
movzbl %al, %eax
negl %eax
retq
cmpq $0x0, (%rsi)
jne 0x32b8
cmpq $0x0, 0x8(%rsi)
je 0x32bc
pushq $0x1
popq %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: tv_delayfrom
static struct timeval *tv_delayfrom(struct timeval *tv, struct timeval *from, int ms) {
    if (!tv || !from)
	return NULL;
    tv->tv_usec = from->tv_usec + (ms%1000)*1000;
    tv->tv_sec  = from->tv_sec  + (ms/1000);
    while (tv->tv_usec >= 1000000) {
	tv->tv_usec -= 1000000;
	tv->tv_sec++;
    }
    return tv;
}

// Assembly:
testq %rdi, %rdi
je 0x34f3
movl $0x3e8, %ecx            # imm = 0x3E8
movl %esi, %eax
cltd
idivl %ecx
imull $0x3e8, %edx, %ecx      # imm = 0x3E8
movslq %ecx, %rcx
addq 0xaf3e(%rip), %rcx      # 0xe408
movq %rcx, 0x8(%rdi)
cltq
addq 0xaf29(%rip), %rax      # 0xe400
cmpq $0xf4240, %rcx          # imm = 0xF4240
jl 0x34f0
addq $-0xf4240, %rcx         # imm = 0xFFF0BDC0
movq %rcx, 0x8(%rdi)
incq %rax
jmp 0x34d7
movq %rax, (%rdi)
movq %rdi, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: client_retnclose
void client_retnclose(struct session *s, int len, const char *msg) {
    my_fd_clr(s->cli_fd, StaticReadEvent);
    my_fd_set(s->cli_fd, StaticWriteEvent);
    tv_eternity(&s->crexpire);
    tv_delayfrom(&s->cwexpire, &now, s->proxy->clitimeout);
    shutdown(s->cli_fd, SHUT_RD);
    s->cli_state = CL_STDATA;
    strcpy(s->rep->data, msg);
    s->rep->l = len;
    s->rep->r = s->rep->h = s->rep->lr = s->rep->w = s->rep->data;
    s->rep->r += len;
    s->req->l = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x48(%rdi), %ecx
pushq $-0x2
popq %rax
roll %cl, %eax
movq 0xab7b(%rip), %rdi      # 0xe3f8
sarl $0x5, %ecx
movslq %ecx, %rcx
andl %eax, (%rdi,%rcx,4)
movq %rdx, %r14
movl 0x48(%rbx), %ecx
pushq $0x1
popq %rax
shll %cl, %eax
movl %esi, %ebp
movq 0x2ab86(%rip), %rdx     # 0x2e420
sarl $0x5, %ecx
movslq %ecx, %rcx
orl %eax, (%rdx,%rcx,4)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
leaq 0x18(%rbx), %rdi
movq 0x40(%rbx), %rax
movl 0x30(%rax), %esi
callq 0x34ab
movl 0x48(%rbx), %edi
xorl %esi, %esi
callq 0x2120
movl $0x3, 0x4c(%rbx)
movq 0x60(%rbx), %rax
movq 0x30(%rax), %rdi
movq %r14, %rsi
callq 0x20a0
movq 0x60(%rbx), %rax
movl %ebp, (%rax)
movq 0x30(%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, 0x18(%rax)
movslq %ebp, %rdx
addq %rcx, %rdx
movq %rdx, 0x8(%rax)
movq 0x58(%rbx), %rax
andl $0x0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: client_return
void client_return(struct session *s, int len, const char *msg) {
    my_fd_set(s->cli_fd, StaticWriteEvent);
    tv_delayfrom(&s->cwexpire, &now, s->proxy->clitimeout);
    strcpy(s->rep->data, msg);
    s->rep->l = len;
    s->rep->r = s->rep->h = s->rep->lr = s->rep->w = s->rep->data;
    s->rep->r += len;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x48(%rdi), %ecx
pushq $0x1
popq %rax
shll %cl, %eax
movq %rdx, %r14
movq 0x2ab00(%rip), %rdx     # 0x2e420
sarl $0x5, %ecx
movslq %ecx, %rcx
orl %eax, (%rdx,%rcx,4)
movl %esi, %ebp
addq $0x18, %rdi
movq 0x40(%rbx), %rax
movl 0x30(%rax), %esi
callq 0x34ab
movq 0x60(%rbx), %rax
movq 0x30(%rax), %rdi
movq %r14, %rsi
callq 0x20a0
movq 0x60(%rbx), %rax
movl %ebp, (%rax)
movq 0x30(%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, 0x18(%rax)
movslq %ebp, %rdx
addq %rcx, %rdx
movq %rdx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq