LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_write_real
void cff_write_real(char **buf,double value) // {{{
{
  char tmp[20];
  int res=snprintf(tmp,250,"%G",value);
  assert(res<15);
  int iA,pos=0;
  for (iA=0;iA<res;iA++) {
    char t=tmp[iA];
    if ( (t>='0')&&(t<='9') ) {
      t-='0';
    } else if (t=='-') {
      t=0xe;
    } else if (t=='.') {
      t=0xa;
    } else if (t=='E') {
      if (tmp[iA+1]=='-') {
        iA++;
        t=0xc;
      } else if (tmp[iA+1]=='+') {
        iA++;
        t=0xb;
      } else { // snprintf does not produce this...
        assert(0);
        t=0xb;
      }
      if (tmp[iA+1]=='0') {
        iA++;
      }
    } else {
      assert(0);
      break;
    }
    if (pos==0) {
      (**buf)=t<<4;
    } else {
      *((*buf)++)|=t;
    }
    pos^=1;
  }
  // end marker
  if (pos==0) {
    *((*buf)++)=0xff;
  } else {
    *((*buf)++)|=0xf;
  }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x236c(%rip), %rdx      # 0x87f9
movq %rsp, %rdi
movl $0xfa, %esi
movb $0x1, %al
callq 0x41d0
cmpl $0xe, %eax
jg 0x6576
xorl %edx, %edx
xorl %ecx, %ecx
cmpl %eax, %edx
jge 0x6525
movslq %edx, %rdi
movzbl (%rsp,%rdi), %r8d
leal -0x30(%r8), %esi
cmpb $0xa, %sil
jb 0x6501
cmpl $0x2d, %r8d
je 0x64fe
cmpl $0x45, %r8d
je 0x64d6
cmpl $0x2e, %r8d
jne 0x6544
movb $0xa, %sil
jmp 0x6501
movzbl 0x1(%rsp,%rdi), %edx
movb $0xc, %sil
cmpl $0x2d, %edx
je 0x64eb
cmpl $0x2b, %edx
jne 0x655d
movb $0xb, %sil
leaq 0x1(%rdi), %r8
leaq 0x2(%rdi), %rdx
cmpb $0x30, 0x2(%rsp,%rdi)
cmovnel %r8d, %edx
jmp 0x6501
movb $0xe, %sil
testl %ecx, %ecx
je 0x6514
movq (%rbx), %rdi
leaq 0x1(%rdi), %r8
movq %r8, (%rbx)
orb %sil, (%rdi)
jmp 0x651e
shlb $0x4, %sil
movq (%rbx), %rdi
movb %sil, (%rdi)
xorl $0x1, %ecx
incl %edx
jmp 0x64a9
movq (%rbx), %rax
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
testl %ecx, %ecx
je 0x653a
movb (%rax), %cl
orb $0xf, %cl
jmp 0x653c
movb $-0x1, %cl
movb %cl, (%rax)
addq $0x20, %rsp
popq %rbx
retq
leaq 0x34cb(%rip), %rdi      # 0x9a16
leaq 0x1b6b(%rip), %rsi      # 0x80bd
leaq 0x22aa(%rip), %rcx      # 0x8803
pushq $0x6b
jmp 0x658d
leaq 0x34b2(%rip), %rdi      # 0x9a16
leaq 0x1b52(%rip), %rsi      # 0x80bd
leaq 0x2291(%rip), %rcx      # 0x8803
pushq $0x64
jmp 0x658d
leaq 0x227f(%rip), %rdi      # 0x87fc
leaq 0x1b39(%rip), %rsi      # 0x80bd
leaq 0x2278(%rip), %rcx      # 0x8803
pushq $0x52
popq %rdx
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_read_integer
int32_t cff_read_integer(const char **buf) // {{{
{
  const char *b=*buf;
  const unsigned char b0=*b;
  if (b0==28) { // size 3
    (*buf)+=3;
    return (b[1]<<8)|
           (unsigned char)b[2];
  } else if (b0==29) { // size 5
    (*buf)+=5;
    return (b[1]<<24)|
           ((unsigned char)b[2]<<16)|
           ((unsigned char)b[3]<<8)|
           (unsigned char)b[4];
  } else if (b0<32) {
    // 30 real number, 31 reserved, <28 opval/reserved
  } else if (b0<247) { // size 1
    (*buf)++;
    return (int)b0-139;
  } else if (b0<251) { // size 2
    (*buf)+=2;
    return (b0-247)*256+(unsigned char)b[1]+108;
  } else if (b0<255) { // size 2
    (*buf)+=2;
    return -(b0-251)*256-(unsigned char)b[1]-108;
  } // else: 255 reserved
  assert(0);
  return 0;
}

// Assembly:
movq (%rdi), %rcx
movzbl (%rcx), %eax
cmpl $0x1d, %eax
je 0x65b8
cmpl $0x1c, %eax
jne 0x65c5
leaq 0x3(%rcx), %rax
movq %rax, (%rdi)
movsbl 0x1(%rcx), %edx
shll $0x8, %edx
movzbl 0x2(%rcx), %eax
orl %edx, %eax
retq
leaq 0x5(%rcx), %rax
movq %rax, (%rdi)
movl 0x1(%rcx), %eax
bswapl %eax
retq
cmpb $0x20, %al
jb 0x6612
cmpb $-0xa, %al
ja 0x65d9
incq %rcx
movq %rcx, (%rdi)
addl $0xffffff75, %eax       # imm = 0xFFFFFF75
retq
cmpb $-0x6, %al
ja 0x65f3
leaq 0x2(%rcx), %rdx
movq %rdx, (%rdi)
shll $0x8, %eax
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
addl $0xffff096c, %eax       # imm = 0xFFFF096C
retq
cmpl $0xff, %eax
je 0x6612
leaq 0x2(%rcx), %rdx
movq %rdx, (%rdi)
shll $0x8, %eax
movzbl 0x1(%rcx), %ecx
orl %eax, %ecx
movl $0xfa94, %eax           # imm = 0xFA94
subl %ecx, %eax
retq
pushq %rax
leaq 0x33fc(%rip), %rdi      # 0x9a16
leaq 0x1a9c(%rip), %rsi      # 0x80bd
leaq 0x2200(%rip), %rcx      # 0x8828
movl $0x98, %edx
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_read_dict_token
struct _CFF_VALUE cff_read_dict_token(const char **buf) // {{{
{
  struct _CFF_VALUE ret;
  const char *b=*buf;
  const unsigned char b0=*b;
  if (b0<22) { // operator, size 1 or size 2
    int opvalue=b0;
    (*buf)++;
    if (opvalue==12) {
      opvalue=(opvalue<<8)|((unsigned char)b[1]);
      (*buf)++;
    }
    ret.op=cffop_get_by_value(opvalue);
    if (!ret.op) {
      ret.type=CFF_VAL_ERROR;
    } else {
      ret.type=CFF_VAL_OP;
    }
  } else if (b0==30) { // real, varsize
    (*buf)++;
    ret.real=cff_read_real(buf);
    if (isnan(ret.real)) {
      ret.type=CFF_VAL_ERROR;
    } else {
      ret.type=CFF_VAL_REAL;
    }
  } else if ( (b0>=28)&&(b0!=31)&&(b0<=254) ) {
    ret.type=CFF_VAL_INT;
    ret.number=cff_read_integer(buf);
  } else { // 22-27,31,255 reserved
    assert(0);
    ret.type=CFF_VAL_ERROR;
  }
  return ret;
}

// Assembly:
pushq %rax
movq (%rdi), %rcx
movzbl (%rcx), %eax
cmpl $0x15, %eax
ja 0x666e
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
cmpl $0xc, %eax
jne 0x665a
movzbl 0x1(%rcx), %eax
orl $0xc00, %eax            # imm = 0xC00
addq $0x2, %rcx
movq %rcx, (%rdi)
movl %eax, %edi
callq 0x70b8
movq %rax, %rdx
xorl %eax, %eax
testq %rdx, %rdx
setne %al
jmp 0x66a6
cmpl $0x1e, %eax
jne 0x6691
incq %rcx
movq %rcx, (%rdi)
callq 0x6354
xorl %eax, %eax
ucomisd %xmm0, %xmm0
setnp %al
leal (%rax,%rax,2), %eax
movq %xmm0, %rdx
jmp 0x66a6
cmpl $0x1f, %eax
je 0x66a8
addb $-0x1c, %al
cmpb $-0x1e, %al
ja 0x66a8
callq 0x6593
movl %eax, %edx
pushq $0x2
popq %rax
popq %rcx
retq
leaq 0x3367(%rip), %rdi      # 0x9a16
leaq 0x1a07(%rip), %rsi      # 0x80bd
leaq 0x2193(%rip), %rcx      # 0x8850
movl $0xbe, %edx
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_write_integer
void cff_write_integer(char **buf,int32_t value) // {{{
{
  char *b=*buf;
  if ( (value>=-107)&&(value<=107) ) { // size 1
    b[0]=value+139;
    (*buf)++;
  } else if ( (value>=108)&&(value<=1131) ) { // size 2
    value-=108;
    b[0]=(value>>8)+247;
    b[1]=value&0xff;
    (*buf)+=2;
  } else if ( (value>=-1131)&&(value<=-108) ) { // size 2
    value=-value-108;
    b[0]=(value>>8)+251;
    b[1]=value&0xff;
    (*buf)+=2;
  } else if ( (value>=-32768)&&(value<=32767) ) { // size 3
    b[0]=28;
    b[1]=(value>>8)&0xff;
    b[2]=value&0xff;
    (*buf)+=3;
  } else { // size 5
    b[0]=29;
    b[1]=(value>>24)&0xff;
    b[2]=(value>>16)&0xff;
    b[3]=(value>>8)&0xff;
    b[4]=value&0xff;
    (*buf)+=5;
  }
}

// Assembly:
movl %esi, %ecx
movq (%rdi), %rax
leal 0x6b(%rcx), %edx
cmpl $0xd6, %edx
ja 0x66e0
addb $-0x75, %cl
movb %cl, (%rax)
pushq $0x1
jmp 0x6717
leal -0x6c(%rcx), %edx
cmpl $0x3ff, %edx            # imm = 0x3FF
ja 0x66f5
movl %edx, %ecx
shrl $0x8, %ecx
addb $-0x9, %cl
jmp 0x6710
leal 0x46b(%rcx), %edx
cmpl $0x3ff, %edx            # imm = 0x3FF
ja 0x671c
pushq $-0x6c
popq %rdx
subl %ecx, %edx
movl %edx, %ecx
shrl $0x8, %ecx
addb $-0x5, %cl
movb %cl, (%rax)
movb %dl, 0x1(%rax)
pushq $0x2
popq %rax
addq %rax, (%rdi)
retq
movswl %cx, %edx
cmpl %ecx, %edx
jne 0x6730
movb $0x1c, (%rax)
movb %ch, 0x1(%rax)
movb %cl, 0x2(%rax)
pushq $0x3
jmp 0x6717
movb $0x1d, (%rax)
movl %ecx, %edx
shrl $0x18, %edx
movb %dl, 0x1(%rax)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0x2(%rax)
movb %ch, 0x3(%rax)
movb %cl, 0x4(%rax)
pushq $0x5
jmp 0x6717
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_write_dict_token
void cff_write_dict_token(char **buf,const struct _CFF_VALUE *value) // {{{
{
  assert(value);
  switch (value->type) {
  case CFF_VAL_ERROR:
  default:
    assert(0);
    return;
  case CFF_VAL_OP:
    if (value->op->value>=0x0c00) {
      *((*buf)++)=12;
      *((*buf)++)=(value->op->value)&0xff;
    } else {
      *((*buf)++)=value->op->value;
    }
    break;
  case CFF_VAL_INT:
    cff_write_integer(buf,value->number);
    break;
  case CFF_VAL_REAL:
    *((*buf)++)=30;
    cff_write_real(buf,value->real);
    break;
  }
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0x67c3
movl (%rsi), %eax
cmpl $0x1, %eax
je 0x6785
cmpl $0x2, %eax
je 0x677c
cmpl $0x3, %eax
jne 0x67e2
movq (%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%rdi)
movb $0x1e, (%rax)
movsd 0x8(%rsi), %xmm0
popq %rax
jmp 0x647e
movl 0x8(%rsi), %esi
popq %rax
jmp 0x66c7
movq 0x8(%rsi), %rax
movl 0x8(%rax), %eax
cmpl $0xc00, %eax            # imm = 0xC00
jl 0x67b5
movq (%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%rdi)
movb $0xc, (%rax)
movq 0x8(%rsi), %rax
movb 0x8(%rax), %al
movq (%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
movb %al, (%rcx)
jmp 0x67c1
movq (%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
movb %al, (%rcx)
popq %rax
retq
leaq 0x20bb(%rip), %rdi      # 0x8885
leaq 0x18ec(%rip), %rsi      # 0x80bd
leaq 0x20b3(%rip), %rcx      # 0x888b
movl $0xe7, %edx
callq 0x40d0
leaq 0x322d(%rip), %rdi      # 0x9a16
leaq 0x18cd(%rip), %rsi      # 0x80bd
leaq 0x2094(%rip), %rcx      # 0x888b
movl $0xeb, %edx
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_read_dict
struct _CFF_DICT *cff_read_dict(const char *start,int length) // {{ {
{
  assert(start);
  const char *end=start+length;

  struct _CFF_DICT *ret=malloc(sizeof(struct _CFF_DICT)+20*sizeof(struct _CFF_VALUE));
  if (!ret) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    return NULL;
  }
  ret->alloc=20;
  ret->len=0;
  while (start<end) {
    if (ret->len>=ret->alloc) {
      ret->alloc+=20;
      struct _CFF_DICT *tmp=realloc(ret,sizeof(struct _CFF_DICT)+ret->alloc*sizeof(struct _CFF_VALUE));
      if (!tmp) {
        fprintf(stderr,"Bad realloc: %s\n", strerror(errno));
        free(ret);
        return NULL;
      }
      ret=tmp;
    }
// FIXME:  length check
    ret->data[ret->len]=cff_read_dict_token(&start);
    if (ret->data[ret->len].type==CFF_VAL_ERROR) {
      fprintf(stderr,"Bad DICT token\n");
      free(ret);
      return NULL;
    }
    ret->len++;
  }
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
je 0x694b
movl %esi, %ebp
movq %rdi, %r15
movl $0x148, %edi            # imm = 0x148
callq 0x4160
testq %rax, %rax
je 0x68bb
movq %rax, %rbx
movslq %ebp, %r12
addq %r15, %r12
movabsq $0x1400000000, %rax     # imm = 0x1400000000
movq %rax, (%rbx)
xorl %ecx, %ecx
leaq 0x8(%rsp), %r14
cmpq %r12, %r15
jae 0x693b
movslq 0x4(%rbx), %rsi
cmpl %esi, %ecx
jl 0x6886
addq $0x14, %rsi
movl %esi, 0x4(%rbx)
shlq $0x4, %rsi
orq $0x8, %rsi
movq %rbx, %rdi
callq 0x41e0
testq %rax, %rax
je 0x6907
movl (%rax), %ecx
movq %rax, %rbx
movslq %ecx, %r15
shlq $0x4, %r15
movq %r14, %rdi
callq 0x6632
movl %eax, 0x8(%rbx,%r15)
movq %rdx, 0x10(%rbx,%r15)
movslq (%rbx), %rcx
movq %rcx, %rax
shlq $0x4, %rax
cmpl $0x0, 0x8(%rbx,%rax)
je 0x68e9
incl %ecx
movl %ecx, (%rbx)
movq 0x8(%rsp), %r15
jmp 0x6850
movq 0x671e(%rip), %rax      # 0xcfe0
movq (%rax), %r14
callq 0x4030
movl (%rax), %edi
callq 0x4070
leaq 0x1993(%rip), %rsi      # 0x826b
xorl %ebx, %ebx
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4190
jmp 0x693b
movq 0x66f0(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x2019(%rip), %rdi      # 0x8913
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x4200
jmp 0x6931
movq 0x66d2(%rip), %rax      # 0xcfe0
movq (%rax), %r14
callq 0x4030
movl (%rax), %edi
callq 0x4070
leaq 0x1fde(%rip), %rsi      # 0x8902
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4190
movq %rbx, %rdi
callq 0x4140
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f77(%rip), %rdi      # 0x88c9
leaq 0x1764(%rip), %rsi      # 0x80bd
leaq 0x1f6f(%rip), %rcx      # 0x88cf
movl $0x106, %edx            # imm = 0x106
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_get_string
const char *cff_get_string(CFF_FILE *cff,int sid,int *retlen) // {{{  or NULL
{
  assert(cff);
  assert( (sid>=0)&&(sid<=65000) );
  if (sid<=390) {
    const char *ret=cff_get_stdstr(sid);
    if (retlen) {
      *retlen=strlen(ret);
    }
    return ret;
  }
  sid-=391;
  if (cff->stringIndex.count==0) {
    return NULL;
  }
  assert(cff->stringIndex.offSize!=OFFERR);
  if (retlen) {
    *retlen=cff_index_length(&cff->stringIndex,sid);
  }
  return cff_index_get(&cff->stringIndex,sid);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6a3a
cmpl $0xfde9, %esi           # imm = 0xFDE9
jae 0x6a59
movq %rdx, %rbx
cmpl $0x186, %esi            # imm = 0x186
ja 0x69dd
movl %esi, %edi
callq 0x7140
movq %rax, %r14
testq %rbx, %rbx
je 0x6a2f
movq %r14, %rdi
callq 0x4090
movl %eax, (%rbx)
jmp 0x6a2f
movzwl 0x50(%rdi), %eax
testl %eax, %eax
je 0x6a2c
cmpl $0x0, 0x54(%rdi)
je 0x6a78
addl $0xfffffe79, %esi       # imm = 0xFFFFFE79
movl %esi, %ecx
testq %rbx, %rbx
je 0x6a14
cmpl %eax, %esi
jae 0x6a0f
movq 0x58(%rdi), %r8
movl 0x4(%r8,%rcx,4), %edx
subl (%r8,%rcx,4), %edx
jmp 0x6a12
pushq $-0x1
popq %rdx
movl %edx, (%rbx)
cmpl %eax, %esi
jae 0x6a2c
movq 0x58(%rdi), %rax
movq 0x60(%rdi), %rdx
movl (%rax,%rcx,4), %eax
leaq (%rdx,%rax), %r14
decq %r14
jmp 0x6a2f
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1787(%rip), %rdi      # 0x81c8
leaq 0x1675(%rip), %rsi      # 0x80bd
leaq 0x1efe(%rip), %rcx      # 0x894d
movl $0x16c, %edx            # imm = 0x16C
callq 0x40d0
leaq 0x1f20(%rip), %rdi      # 0x8980
leaq 0x1656(%rip), %rsi      # 0x80bd
leaq 0x1edf(%rip), %rcx      # 0x894d
movl $0x16d, %edx            # imm = 0x16D
callq 0x40d0
leaq 0x1f18(%rip), %rdi      # 0x8997
leaq 0x1637(%rip), %rsi      # 0x80bd
leaq 0x1ec0(%rip), %rcx      # 0x894d
movl $0x179, %edx            # imm = 0x179
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_load2
CFF_FILE *cff_load2(const char *buf,size_t len,int take) // {{{
{
  assert(buf);
  CFF_FILE *ret=cff_new();
  if (ret) {
    if (take) {
      ret->flags|=CFF_F_FREE_DATA;
    }
    ret->font=buf;
    ret->length=len;

    int pos=cff_read_header(ret);
    if (pos>=0) {
      pos=cff_do_load(ret,pos);
    }
    if (pos<0) {
      cff_close(ret);
      return NULL;
    }
  } else if (take) {
    free((char *)buf);
  }
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6c6b
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %rdi
movl $0x80, %esi
callq 0x40e0
testq %rax, %rax
je 0x6b8f
movq %rax, %rbx
testl %ebp, %ebp
je 0x6ad3
movl $0x1, 0x10(%rbx)
movq %r14, (%rbx)
movq %r15, 0x8(%rbx)
cmpq $0x2, %r15
jbe 0x6bd0
movb (%r14), %al
movb %al, 0x14(%rbx)
movb 0x1(%r14), %cl
movb %cl, 0x15(%rbx)
movzbl 0x3(%r14), %ecx
leal -0x5(%rcx), %edx
xorl %edi, %edi
cmpb $-0x4, %dl
cmovael %ecx, %edi
movzbl 0x2(%r14), %esi
movzbl %dil, %ecx
movl %ecx, 0x18(%rbx)
cmpl $0x3, %esi
jbe 0x6be5
cmpb $0x1, %al
jne 0x6bf8
leaq 0x20(%rbx), %rdx
movq %rbx, %rdi
callq 0x6e7d
testl %eax, %eax
js 0x6c0d
leaq 0x38(%rbx), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x6e7d
testl %eax, %eax
js 0x6c22
leaq 0x50(%rbx), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x6e7d
testl %eax, %eax
js 0x6c37
movq %rbx, %rdx
addq $0x68, %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x6e7d
testl %eax, %eax
jns 0x6c5d
movq 0x6462(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x1f3b(%rip), %rdi      # 0x8ac3
pushq $0x21
jmp 0x6c4a
movq 0x644a(%rip), %rax      # 0xcfe0
movq (%rax), %r15
callq 0x4030
movl (%rax), %edi
callq 0x4070
leaq 0x16bf(%rip), %rsi      # 0x826b
xorl %ebx, %ebx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4190
testl %ebp, %ebp
je 0x6c5d
movq %r14, %rdi
callq 0x4140
jmp 0x6c5b
movq 0x6409(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x1e36(%rip), %rdi      # 0x8a17
pushq $0x1b
jmp 0x6c4a
movq 0x63f4(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x1e3d(%rip), %rdi      # 0x8a33
jmp 0x6c1e
movq 0x63e1(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x1e45(%rip), %rdi      # 0x8a4e
pushq $0x1d
jmp 0x6c4a
movq 0x63cc(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x1e4e(%rip), %rdi      # 0x8a6c
pushq $0x1a
jmp 0x6c4a
movq 0x63b7(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x1e54(%rip), %rdi      # 0x8a87
pushq $0x1e
jmp 0x6c4a
movq 0x63a2(%rip), %rax      # 0xcfe0
movq (%rax), %rcx
leaq 0x1e5e(%rip), %rdi      # 0x8aa6
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
callq 0x4200
movq %rbx, %rdi
callq 0x6c8a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1591(%rip), %rdi      # 0x8203
leaq 0x1444(%rip), %rsi      # 0x80bd
leaq 0x1d38(%rip), %rcx      # 0x89b8
movl $0x211, %edx            # imm = 0x211
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_close
void cff_close(CFF_FILE *cff) // {{{
{
  assert(cff);
  if (cff) {
    cff_index_free_data(&cff->globalSubrIndex);
    cff_index_free_data(&cff->stringIndex);
    cff_index_free_data(&cff->topDictIndex);
    cff_index_free_data(&cff->nameIndex);
    if (cff->flags&CFF_F_FREE_DATA) {
      free((char *)cff->font);
    }
    free(cff);
  }
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x6cce
movq %rdi, %rbx
addq $0x68, %rdi
callq 0x6e4f
leaq 0x50(%rbx), %rdi
callq 0x6e4f
leaq 0x38(%rbx), %rdi
callq 0x6e4f
leaq 0x20(%rbx), %rdi
callq 0x6e4f
testb $0x1, 0x10(%rbx)
je 0x6cc5
movq (%rbx), %rdi
callq 0x4140
movq %rbx, %rdi
popq %rbx
jmp 0x4140
leaq 0x14f3(%rip), %rdi      # 0x81c8
leaq 0x13e1(%rip), %rsi      # 0x80bd
leaq 0x1d19(%rip), %rcx      # 0x89fc
movl $0x25b, %edx            # imm = 0x25B
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_load_file
CFF_FILE *cff_load_file(FILE *f) // {{{
{
#define BLOCKSIZE 1024
  char *buf=NULL;
  int pos=0,len=0;
  while (1) {
    if (pos>=len) {
      len+=BLOCKSIZE;
      char *tmp=realloc(buf,len);
      if (!tmp) {
        fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
        free(buf);
        return NULL;
      }
      buf=tmp;
    }
    size_t res=fread(buf+pos,1,len-pos,f);
    if (res==0) {
      if (!feof(f)) {
        fprintf(stderr,"File read error: %s\n", strerror(errno));
        free(buf);
        return NULL;
      }
      break;
    }
    pos+=res;
  }
  return cff_load2(buf,pos,1);
#undef BLOCKSIZE
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpl %r15d, %ebp
jge 0x6d0d
movq %r12, %rbx
jmp 0x6d27
addl $0x400, %r15d           # imm = 0x400
movslq %r15d, %rsi
movq %r12, %rdi
callq 0x41e0
movq %rax, %rbx
testq %rax, %rax
je 0x6da2
movslq %ebp, %r13
leaq (%rbx,%r13), %rdi
movl %r15d, %eax
subl %ebp, %eax
movslq %eax, %rdx
pushq $0x1
popq %rsi
movq %r14, %rcx
callq 0x41a0
addl %eax, %ebp
movq %rbx, %r12
testq %rax, %rax
jne 0x6d03
movq %r14, %rdi
callq 0x41c0
testl %eax, %eax
je 0x6d73
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6a97
movq 0x6266(%rip), %rax      # 0xcfe0
movq (%rax), %r14
callq 0x4030
movl (%rax), %edi
callq 0x4070
leaq 0x1c57(%rip), %rsi      # 0x89e7
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4190
movq %rbx, %rdi
jmp 0x6dcf
movq 0x6237(%rip), %rax      # 0xcfe0
movq (%rax), %rbx
callq 0x4030
movl (%rax), %edi
callq 0x4070
leaq 0x14ac(%rip), %rsi      # 0x826b
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4190
movq %r12, %rdi
callq 0x4140
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_load_filename
CFF_FILE *cff_load_filename(const char *filename) // {{{
{
  FILE *f=fopen(filename,"rb");
  if (!f) {
    fprintf(stderr,"Could not open \"%s\": %s\n", filename, strerror(errno));
    return NULL;
  }
  CFF_FILE *ret=cff_load_file(f);
  fclose(f);
  return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x13d9(%rip), %rsi      # 0x81cc
callq 0x4130
testq %rax, %rax
je 0x6e1e
movq %rax, %r14
movq %rax, %rdi
callq 0x6ced
movq %rax, %rbx
movq %r14, %rdi
callq 0x4100
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x61bb(%rip), %rax      # 0xcfe0
movq (%rax), %r14
callq 0x4030
movl (%rax), %edi
callq 0x4070
leaq 0x1467(%rip), %rsi      # 0x82a2
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4190
xorl %eax, %eax
jmp 0x6e16
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff_tables.c
// Function: cffop_get_by_value
const struct CFF_OPS *cffop_get_by_value(int value) // {{{
{
  if ( (value>=0)&&(value<sizeof(cff_ops1)/sizeof(*cff_ops1)) ) {
    return &cff_ops1[value];
  }
  value-=0x0c00;
  if ( (value>=0)&&(value<sizeof(cff_ops2)/sizeof(*cff_ops2)) ) {
    return &cff_ops2[value];
  }
  return NULL;
}

// Assembly:
cmpl $0x15, %edi
ja 0x70cc
movl %edi, %ecx
shlq $0x5, %rcx
leaq 0x5546(%rip), %rax      # 0xc610
jmp 0x70e4
addl $0xfffff400, %edi       # imm = 0xFFFFF400
cmpl $0x26, %edi
ja 0x70e8
movl %edi, %ecx
shlq $0x5, %rcx
leaq 0x57ec(%rip), %rax      # 0xc8d0
addq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff_tables.c
// Function: cff_find_stdstr
int cff_find_stdstr(const char *str) // {{{
{
  // assert(str);
  init_rev_stdstr();
  const char **key=&str;
  const char ***res=bsearch(&key,cff_rev_stdstr,sizeof(cff_rev_stdstr)/sizeof(*cff_rev_stdstr),sizeof(*cff_rev_stdstr),cff_pstrcmp);
  if (!res) {
    return -1;
  }
  return *res-cff_stdstr;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, (%rsp)
cmpq $0x0, 0x6da6(%rip)      # 0xdf10
leaq 0x614f(%rip), %rbx      # 0xd2c0
jne 0x71ae
leaq 0x6d96(%rip), %rax      # 0xdf10
xorl %ecx, %ecx
cmpq $0xc38, %rcx            # imm = 0xC38
je 0x7193
leaq (%rbx,%rcx), %rdx
movq %rdx, (%rcx,%rax)
addq $0x8, %rcx
jmp 0x717c
leaq 0x6d76(%rip), %rdi      # 0xdf10
leaq -0x72(%rip), %rcx       # 0x712f
pushq $0x8
popq %rdx
movl $0x187, %esi            # imm = 0x187
callq 0x41f0
movq %rsp, %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x6d50(%rip), %rsi      # 0xdf10
leaq -0x98(%rip), %r8        # 0x712f
pushq $0x8
popq %rcx
movl $0x187, %edx            # imm = 0x187
callq 0x4150
testq %rax, %rax
je 0x71e5
movq (%rax), %rax
subq %rbx, %rax
shrq $0x3, %rax
jmp 0x71e8
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/lib/libyaml/tests/run-emitter.c
// Function: print_output
int print_output(char *name, unsigned char *buffer, size_t size, int count)
{
    FILE *file;
    char data[BUFFER_SIZE];
    size_t data_size = 1;
    size_t total_size = 0;
    if (count >= 0) {
        printf("FAILED (at the event #%d)\nSOURCE:\n", count+1);
    }
    file = fopen(name, "rb");
    assert(file);
    while (data_size > 0) {
        data_size = fread(data, 1, BUFFER_SIZE, file);
        assert(!ferror(file));
        if (!data_size) break;
        assert(fwrite(data, 1, data_size, stdout) == data_size);
        total_size += data_size;
        if (feof(file)) break;
    }
    fclose(file);
    printf("#### (length: %d)\n", total_size);
    printf("OUTPUT:\n%s#### (length: %d)\n", buffer, size);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10018, %rsp          # imm = 0x10018
movq %rdx, 0x8(%rsp)
movq %rsi, (%rsp)
movq %rdi, %rbx
testl %ecx, %ecx
js 0x1683
incl %ecx
leaq 0x9ce(%rip), %rdi       # 0x2048
movl %ecx, %esi
xorl %eax, %eax
callq 0x10f0
leaq 0x9e1(%rip), %rsi       # 0x206b
movq %rbx, %rdi
callq 0x1200
testq %rax, %rax
je 0x177e
movq %rax, %r12
xorl %r15d, %r15d
leaq 0x10(%rsp), %r13
pushq $0x1
popq %rbp
movq 0x2930(%rip), %r14      # 0x3fe0
movl $0x10000, %edx          # imm = 0x10000
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rcx
callq 0x1090
movq %rax, %rbx
movq %r12, %rdi
callq 0x1080
testl %eax, %eax
jne 0x1740
testq %rbx, %rbx
je 0x16fc
movq (%r14), %rcx
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1230
cmpq %rbx, %rax
jne 0x175f
addq %rbx, %r15
movq %r12, %rdi
callq 0x1150
testl %eax, %eax
je 0x16b0
movq %r12, %rdi
callq 0x10c0
leaq 0x9f5(%rip), %rdi       # 0x2100
movq %r15, %rsi
xorl %eax, %eax
callq 0x10f0
leaq 0x9da(%rip), %rdi       # 0x20f6
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x10f0
xorl %eax, %eax
addq $0x10018, %rsp          # imm = 0x10018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x971(%rip), %rdi       # 0x20b8
leaq 0x925(%rip), %rsi       # 0x2073
leaq 0x92c(%rip), %rcx       # 0x2081
movl $0xc9, %edx
callq 0x1110
leaq 0x960(%rip), %rdi       # 0x20c6
leaq 0x906(%rip), %rsi       # 0x2073
leaq 0x90d(%rip), %rcx       # 0x2081
movl $0xcb, %edx
callq 0x1110
leaq 0x8e9(%rip), %rdi       # 0x206e
leaq 0x8e7(%rip), %rsi       # 0x2073
leaq 0x8ee(%rip), %rcx       # 0x2081
movl $0xc6, %edx
callq 0x1110
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/sha256/main.c
// Function: perftest
static void
print_hardware(const char * str)
{

	/* Inform the user of the general topic... */
	printf("%s", str);

	/* ... and whether we're using hardware acceleration or not. */
#if defined(CPUSUPPORT_CONFIG_FILE)
#if defined(CPUSUPPORT_X86_SHANI) && defined(CPUSUPPORT_X86_SSSE3)
	if (cpusupport_x86_shani() && cpusupport_x86_ssse3())
		printf(" using hardware SHANI.\n");
	else
#endif
#if defined(CPUSUPPORT_X86_SSE2)
	if (cpusupport_x86_sse2())
		printf(" using hardware SSE2.\n");
	else
#endif
#if defined(CPUSUPPORT_ARM_SHA256)
	if (cpusupport_arm_sha256())
		printf(" using hardware ARM SHA256.\n");
	else
#endif
		printf(" using software SHA.\n");
#else
	printf(" with unknown hardware acceleration status.\n");
#endif /* CPUSUPPORT_CONFIG_FILE */
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x4765(%rip), %rdi      # 0x5ba2
leaq 0x3bc6(%rip), %rsi      # 0x500a
xorl %eax, %eax
callq 0x10e0
leaq 0x6d2a(%rip), %rbx      # 0x817c
cmpl $0x0, (%rbx)
je 0x1491
leaq 0x6d2e(%rip), %r14      # 0x818c
leaq 0x406c(%rip), %rbx      # 0x54d1
cmpl $0x0, (%r14)
jne 0x14f3
leaq 0x6d1a(%rip), %r15      # 0x8190
cmpl $0x0, (%r15)
jne 0x149e
callq 0x3a1c
movl %eax, (%r14)
movl $0x1, (%r15)
testl %eax, %eax
jne 0x14f3
jmp 0x149e
leaq 0x6ce8(%rip), %r14      # 0x8180
cmpl $0x0, (%r14)
je 0x14c8
leaq 0x6cdf(%rip), %r14      # 0x8184
leaq 0x400f(%rip), %rbx      # 0x54bb
cmpl $0x0, (%r14)
jne 0x14f3
leaq 0x6ccf(%rip), %r15      # 0x8188
cmpl $0x0, (%r15)
je 0x14e0
leaq 0x3fe0(%rip), %rbx      # 0x54a6
jmp 0x14f3
callq 0x39cc
movl %eax, (%rbx)
movl $0x1, (%r14)
testl %eax, %eax
jne 0x1457
jmp 0x149e
callq 0x39f4
movl %eax, (%r14)
movl $0x1, (%r15)
testl %eax, %eax
je 0x14bf
movq %rbx, %rdi
callq 0x1090
movq 0x6ace(%rip), %rax      # 0x7fd0
movq (%rax), %rdi
callq 0x1180
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
leaq 0x1a7(%rip), %rax       # 0x16c0
movq %rax, (%rsp)
leaq 0x3fcc(%rip), %rsi      # 0x54f0
leaq 0x183(%rip), %r9        # 0x16ae
pushq $0x3
popq %rdx
pushq $0x1
popq %rbx
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x989680, %ecx         # imm = 0x989680
movl %ebx, %r8d
callq 0x43e4
testl %eax, %eax
je 0x155f
leaq 0x3ace(%rip), %rdi      # 0x501c
xorl %eax, %eax
callq 0x49bc
callq 0x1070
andl $0x0, (%rax)
jmp 0x1561
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/sha256/main.c
// Function: selftest
static int
selftest(void)
{
	SHA256_CTX ctx;
	uint8_t hbuf[32];
	char hbuf_hex[65];
	size_t i;
	size_t failures = 0;

	for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
		printf("Computing SHA256 of \"%s\"...", tests[i].s);
		SHA256_Init(&ctx);
		SHA256_Update(&ctx, (const uint8_t *)tests[i].s,
		    strlen(tests[i].s));
		SHA256_Final(hbuf, &ctx);
		hexify(hbuf, hbuf_hex, 32);
		if (strcmp(hbuf_hex, tests[i].o)) {
			printf(" FAILED!\n");
			printf("Computed SHA256: %s\n", hbuf_hex);
			printf("Correct SHA256:  %s\n", tests[i].o);
			failures++;
		} else {
			printf(" PASSED!\n");
		}
	}

	if (failures)
		return (1);
	else
		return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
pushq $0x8
popq %r13
leaq 0x70(%rsp), %r14
leaq 0x20(%rsp), %r12
xorl %r15d, %r15d
cmpq $0x98, %r13
je 0x164f
leaq 0x67ad(%rip), %rax      # 0x7d50
movq -0x8(%r13,%rax), %rbx
movq (%r13,%rax), %rbp
leaq 0x3a79(%rip), %rdi      # 0x502d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10e0
movq %r14, %rdi
callq 0x1718
movq %rbx, %rdi
callq 0x10c0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1882
movq %rsp, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1974
movq %rbx, %rdi
movq %r12, %rsi
pushq $0x20
popq %rdx
callq 0x42f0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1140
testl %eax, %eax
je 0x163a
leaq 0x3e8f(%rip), %rdi      # 0x549d
callq 0x1090
leaq 0x3a2f(%rip), %rdi      # 0x5049
movq %r12, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x3a33(%rip), %rdi      # 0x505e
movq %rbp, %rsi
xorl %eax, %eax
callq 0x10e0
incq %r15
jmp 0x1646
leaq 0x3e53(%rip), %rdi      # 0x5494
callq 0x1090
addq $0x10, %r13
jmp 0x158f
xorl %eax, %eax
testq %r15, %r15
setne %al
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/sha256/main.c
// Function: perftest_func
static int
perftest_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	SHA256_CTX ctx;
	uint8_t hbuf[32];
	size_t i;

	(void)cookie; /* UNUSED */

	/* Do the hashing. */
	SHA256_Init(&ctx);
	for (i = 0; i < nreps; i++)
		SHA256_Update(&ctx, buf, buflen);
	SHA256_Final(hbuf, &ctx);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x1718
subq $0x1, %rbx
jb 0x16fa
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1882
jmp 0x16e4
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x1974
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/tylerneylon[P]APIsWithLua/ch6/limit_cpu.c
// Function: hook
void hook(lua_State *L, lua_Debug *ar) {

  instruction_count += instructions_per_hook;

  if (!do_limit_instructions) return;

  if (instruction_count > instruction_count_limit) {
    lua_pushstring(L, "exceeded allowed cpu time");
    lua_error(L);
  }
}

// Assembly:
movq 0x29cbd(%rip), %rax     # 0x2e2d0
addq 0x29c86(%rip), %rax     # 0x2e2a0
movq %rax, 0x29caf(%rip)     # 0x2e2d0
cmpl $0x0, 0x29c70(%rip)     # 0x2e298
je 0x4656
cmpq 0x29c77(%rip), %rax     # 0x2e2a8
jle 0x4656
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x199c1(%rip), %rsi     # 0x1e004
callq 0x4e90
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5bda
retq
// File: /workspace/github_c_makefile_star2_O2/tylerneylon[P]APIsWithLua/ch6/limit_cpu.c
// Function: main
int main() {
  lua_State *L = luaL_newstate();
  luaL_openlibs(L);
  lua_sethook(L, hook, LUA_MASKCOUNT, instructions_per_hook);

  print_status();
  while (accept_and_run_a_line(L)) print_status();

  lua_close(L);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x12baa
movq %rax, %rbx
movq %rax, %rdi
callq 0x12dd0
movl 0x29c13(%rip), %ecx     # 0x2e2a0
leaq -0x88(%rip), %rsi       # 0x460c
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x5fa0
callq 0x4657
movq %rbx, %rdi
callq 0x1d608
testl %eax, %eax
jne 0x469f
movq %rbx, %rdi
callq 0xd0f2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/chip8.c
// Function: chip8_init
int
chip8_init(struct chip8* chip8)
{
    assert(chip8 != NULL);

    memset(chip8, 0, sizeof(*chip8));
    srand(time(NULL));

    memmove(chip8->mem, CHIP8_FONT, sizeof(CHIP8_FONT));

    return CHIP8_OK;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x26a1
movq %rdi, %rbx
movl $0x1848, %edx           # imm = 0x1848
xorl %esi, %esi
callq 0x20c0
xorl %edi, %edi
callq 0x2120
movl %eax, %edi
callq 0x2140
leaq 0xb5e(%rip), %rsi       # 0x31f0
pushq $0x50
popq %rdx
movq %rbx, %rdi
callq 0x2100
xorl %eax, %eax
popq %rbx
retq
leaq 0xa73(%rip), %rdi       # 0x311b
leaq 0xa7a(%rip), %rsi       # 0x3129
leaq 0xa7f(%rip), %rcx       # 0x3135
pushq $0x29
popq %rdx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/chip8.c
// Function: chip8_load
int
chip8_load(struct chip8* chip8, const uint8_t* rom, long size)
{
    assert(rom != NULL);

    if (CHIP8_ROM_ADDR + size >= CHIP8_MEM_SIZE) {
        return CHIP8_ERROR_OVERSIZED_ROM;
    }

    memmove(chip8->mem + CHIP8_ROM_ADDR, rom, size);
    chip8->pc = CHIP8_ROM_ADDR;

    return CHIP8_OK;
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x26ee
cmpq $0xdff, %rdx            # imm = 0xDFF
jle 0x26d2
pushq $0x1
popq %rax
jmp 0x26ec
movq %rdi, %rbx
addq $0x200, %rdi            # imm = 0x200
callq 0x21d0
movw $0x200, 0x1012(%rbx)    # imm = 0x200
xorl %eax, %eax
popq %rbx
retq
leaq 0xa5f(%rip), %rdi       # 0x3154
leaq 0xa2d(%rip), %rsi       # 0x3129
leaq 0xa5d(%rip), %rcx       # 0x3160
pushq $0x36
popq %rdx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/chip8.c
// Function: chip8_step
int
chip8_step(struct chip8* chip8)
{
    uint16_t code = chip8->mem[chip8->pc] << 8 | chip8->mem[chip8->pc + 1];

    struct instruction inst = { 0 };
    int rc = instruction_decode(&inst, code);
    if (rc != INSTRUCTION_OK) {
        fprintf(stderr, "attempted to decode a bad instruction\n");
        return CHIP8_ERROR_BAD_INSTRUCTION;
    }

    rc = operation_apply(chip8, &inst);
    if (rc != OPERATION_OK) {
        fprintf(stderr, "attempted to execute a bad operation: %s\n", operation_error_message(rc));
        return CHIP8_ERROR_BAD_OPERATION;
    }

    if (chip8->timer_delay > 0) chip8->timer_delay -= 1;
    if (chip8->timer_sound > 0) chip8->timer_sound -= 1;

    return CHIP8_OK;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movzwl 0x1012(%rdi), %eax
movzwl (%rdi,%rax), %eax
rolw $0x8, %ax
movq %rsp, %rdi
andl $0x0, 0x8(%rdi)
andq $0x0, (%rdi)
movzwl %ax, %esi
callq 0x27e4
testl %eax, %eax
jne 0x2774
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x2860
testl %eax, %eax
jne 0x2794
movb 0x1846(%rbx), %al
testb %al, %al
je 0x275a
decb %al
movb %al, 0x1846(%rbx)
movb 0x1847(%rbx), %cl
xorl %eax, %eax
testb %cl, %cl
je 0x276e
decb %cl
movb %cl, 0x1847(%rbx)
addq $0x10, %rsp
popq %rbx
retq
movq 0x3865(%rip), %rax      # 0x5fe0
movq (%rax), %rcx
leaq 0xa11(%rip), %rdi       # 0x3196
pushq $0x26
popq %rsi
pushq $0x1
popq %rdx
callq 0x21e0
pushq $0x2
jmp 0x27bb
movq 0x3845(%rip), %rcx      # 0x5fe0
movq (%rcx), %rbx
movl %eax, %edi
callq 0x28b7
leaq 0xa11(%rip), %rsi       # 0x31bd
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21b0
pushq $0x3
popq %rax
jmp 0x276e
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/inst.c
// Function: instruction_decode
int
instruction_decode(struct instruction* inst, uint16_t code)
{
    // params can be set now since their position is consistent
    inst->opcode = OPCODE_UNDEFINED;
    inst->nnn = code & 0x0fff;
    inst->n = code & 0x000f;
    inst->x = (code & 0x0f00) >> 8;
    inst->y = (code & 0x00f0) >> 4;
    inst->kk = code & 0x00ff;

    // loop through each opcode and try to find a match
    for (int op = OPCODE_UNDEFINED + 1; op < OPCODE_COUNT; op++) {
        // check for a match by masking the code and comparing the values
        if ((code & INSTRUCTION_MASKS[op].mask) == INSTRUCTION_MASKS[op].value) {
            inst->opcode = op;
            return INSTRUCTION_OK;
        }
    }

    // if nothing matched from the above loop then the code is invalid
    return INSTRUCTION_ERROR;
}

// Assembly:
andl $0x0, (%rdi)
movl %esi, %eax
andl $0xfff, %eax            # imm = 0xFFF
movw %ax, 0x4(%rdi)
movl %esi, %eax
andb $0xf, %al
movb %al, 0x6(%rdi)
movl %esi, %eax
shrl $0x8, %eax
andb $0xf, %al
movb %al, 0x7(%rdi)
movl %esi, %eax
shrb $0x4, %al
movb %al, 0x8(%rdi)
movb %sil, 0x9(%rdi)
pushq $0x1
popq %rcx
leaq 0xa27(%rip), %rax       # 0x3240
cmpq $0x24, %rcx
je 0x2834
movzwl (%rax,%rcx,4), %edx
andw %si, %dx
cmpw 0x2(%rax,%rcx,4), %dx
je 0x2832
incq %rcx
jmp 0x2819
movl %ecx, (%rdi)
xorl %eax, %eax
cmpq $0x24, %rcx
setae %al
retq
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op.c
// Function: operation_apply
int
operation_apply(struct chip8* chip8, const struct instruction* inst)
{
    assert(chip8 != NULL);
    assert(inst != NULL);

    operation_func operation = OPERATIONS[inst->opcode];
    return operation(chip8, inst);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x2879
testq %rsi, %rsi
je 0x2898
movslq (%rsi), %rax
leaq 0x344b(%rip), %rcx      # 0x5cc0
popq %rdx
jmpq *(%rcx,%rax,8)
leaq 0x89b(%rip), %rdi       # 0x311b
leaq 0xd29(%rip), %rsi       # 0x35b0
leaq 0xd2b(%rip), %rcx       # 0x35b9
movl $0x17d, %edx            # imm = 0x17D
callq 0x20e0
leaq 0xd5a(%rip), %rdi       # 0x35f9
leaq 0xd0a(%rip), %rsi       # 0x35b0
leaq 0xd0c(%rip), %rcx       # 0x35b9
movl $0x17e, %edx            # imm = 0x17E
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op.c
// Function: operation_RET_00EE
static int
operation_RET_00EE(struct chip8* chip8, const struct instruction* inst)
{
    if (chip8->sp <= 0) return OPERATION_ERROR_STACK_UNDERFLOW;

    chip8->sp -= 1;
    chip8->pc = chip8->stack[chip8->sp];
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
movzwl 0x1034(%rdi), %eax
testw %ax, %ax
je 0x2929
decl %eax
movw %ax, 0x1034(%rdi)
movzwl %ax, %eax
movzwl 0x1014(%rdi,%rax,2), %eax
addl $0x2, %eax
movw %ax, 0x1012(%rdi)
xorl %eax, %eax
retq
pushq $0x4
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op.c
// Function: operation_CALL_2nnn
static int
operation_CALL_2nnn(struct chip8* chip8, const struct instruction* inst)
{
    if (chip8->sp >= CHIP8_STACK_SIZE - 1) return OPERATION_ERROR_STACK_OVERFLOW;

    chip8->stack[chip8->sp] = chip8->pc;
    chip8->sp += 1;
    chip8->pc = inst->nnn;
    return OPERATION_OK;
}

// Assembly:
movzwl 0x1034(%rdi), %eax
cmpq $0xe, %rax
jbe 0x295a
pushq $0x3
popq %rax
retq
movzwl 0x1012(%rdi), %ecx
movw %cx, 0x1014(%rdi,%rax,2)
incw 0x1034(%rdi)
movzwl 0x4(%rsi), %eax
movw %ax, 0x1012(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op.c
// Function: operation_DRW_Dxyn
static int
operation_DRW_Dxyn(struct chip8* chip8, const struct instruction* inst)
{
    chip8->reg[CHIP8_REG_VF] = 0;
    for (long dy = 0; dy < inst->n; dy++) {
        uint8_t sprite = chip8->mem[chip8->index + dy];
        for (long dx = 0; dx < CHIP8_SPRITE_WIDTH; dx++) {
            // account for pixels wrapping around edges of the display
            long x = (chip8->reg[inst->x] + dx) % CHIP8_DISPLAY_WIDTH;
            long y = (chip8->reg[inst->y] + dy) % CHIP8_DISPLAY_HEIGHT;

            // chip8->display is stored as a row-major matrix
            long pixel_index = (y * CHIP8_DISPLAY_WIDTH) + x;

            // determine what the resulting pixel value will be
            bool new_pixel = sprite & (0x80 >> dx);
            bool old_pixel = chip8->display[pixel_index];
            bool resulting_pixel = new_pixel ^ old_pixel;

            // set VF register to 1 if a pixel gets turned off
            if (old_pixel && !resulting_pixel) chip8->reg[CHIP8_REG_VF] = 1;

            chip8->display[pixel_index] = resulting_pixel;
        }
    }
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
movb $0x0, 0x100f(%rdi)
xorl %eax, %eax
movzbl 0x6(%rsi), %ecx
cmpq %rcx, %rax
jae 0x2cfd
movzwl 0x1010(%rdi), %ecx
addq %rax, %rcx
movzbl (%rdi,%rcx), %edx
xorl %ecx, %ecx
cmpq $0x8, %rcx
je 0x2cf5
movzbl 0x7(%rsi), %r8d
movzbl 0x1000(%rdi,%r8), %r9d
addl %ecx, %r9d
andl $0x3f, %r9d
movzbl 0x8(%rsi), %r8d
movzbl 0x1000(%rdi,%r8), %r8d
addl %eax, %r8d
andl $0x1f, %r8d
shll $0x6, %r8d
orl %r9d, %r8d
movl %edx, %r9d
shll %cl, %r9d
movb 0x1046(%rdi,%r8), %r11b
shrb $0x7, %r9b
cmpb %r9b, %r11b
setne %r10b
cmpb $0x1, %r11b
jne 0x2ce8
cmpb %r9b, %r11b
jne 0x2ce8
movb $0x1, 0x100f(%rdi)
movb %r10b, 0x1046(%rdi,%r8)
incq %rcx
jmp 0x2c86
incq %rax
jmp 0x2c69
addw $0x2, 0x1012(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op.c
// Function: operation_LD_Fx33
static int
operation_LD_Fx33(struct chip8* chip8, const struct instruction* inst)
{
    chip8->mem[chip8->index + 0] = (chip8->reg[inst->x] / 100);
    chip8->mem[chip8->index + 1] = (chip8->reg[inst->x] / 10)  % 10;
    chip8->mem[chip8->index + 2] = (chip8->reg[inst->x] / 100) % 10;
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
movzbl 0x7(%rsi), %eax
movzbl 0x1000(%rdi,%rax), %eax
movb $0x64, %cl
divb %cl
movzwl 0x1010(%rdi), %edx
movb %al, (%rdi,%rdx)
movzbl 0x7(%rsi), %eax
movzbl 0x1000(%rdi,%rax), %eax
movb $0xa, %dl
divb %dl
movzbl %al, %eax
divb %dl
movzbl %ah, %eax
movzwl 0x1010(%rdi), %edx
movb %al, 0x1(%rdx,%rdi)
movzbl 0x7(%rsi), %eax
movzbl 0x1000(%rdi,%rax), %eax
divb %cl
movzwl 0x1010(%rdi), %ecx
movb %al, 0x2(%rcx,%rdi)
addw $0x2, 0x1012(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op.c
// Function: operation_LD_Fx55
static int
operation_LD_Fx55(struct chip8* chip8, const struct instruction* inst)
{
    for (long i = 0; i < inst->x; i++) {
        chip8->mem[chip8->index + i] = chip8->reg[i];
    }
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
xorl %eax, %eax
movzbl 0x7(%rsi), %ecx
cmpq %rcx, %rax
jae 0x2ebe
leaq (%rdi,%rax), %rcx
movb 0x1000(%rdi,%rax), %dl
movzwl 0x1010(%rdi), %r8d
movb %dl, (%r8,%rcx)
incq %rax
jmp 0x2e99
addw $0x2, 0x1012(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op.c
// Function: operation_LD_Fx65
static int
operation_LD_Fx65(struct chip8* chip8, const struct instruction* inst)
{
    for (long i = 0; i < inst->x; i++) {
        chip8->reg[i] = chip8->mem[chip8->index + i];
    }
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
xorl %eax, %eax
movzbl 0x7(%rsi), %ecx
cmpq %rcx, %rax
jae 0x2eee
movzwl 0x1010(%rdi), %ecx
leaq (%rdi,%rax), %rdx
movb (%rcx,%rdx), %cl
movb %cl, 0x1000(%rdi,%rax)
incq %rax
jmp 0x2ecb
addw $0x2, 0x1012(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/albinoloverats[P]hide/src/tiff.c
// Function: init
extern image_type_t *init(void)
{
	static image_type_t tiff;
	tiff.type = "TIFF";
	tiff.is_type = is_tiff;
	tiff.read = read_tiff;
	tiff.write = write_tiff;
	tiff.info = info_tiff;
	tiff.free = free_tiff;
	return &tiff;
}

// Assembly:
leaq 0xe3d(%rip), %rax       # 0x2000
movq %rax, 0x2ebe(%rip)      # 0x4088
leaq 0x2eb7(%rip), %rax      # 0x4088
leaq 0x40(%rip), %rcx        # 0x1218
movq %rcx, 0x2eb1(%rip)      # 0x4090
leaq 0x6b(%rip), %rcx        # 0x1251
movq %rcx, 0x2eab(%rip)      # 0x4098
leaq 0x152(%rip), %rcx       # 0x1346
movq %rcx, 0x2ea5(%rip)      # 0x40a0
leaq 0x2be(%rip), %rcx       # 0x14c0
movq %rcx, 0x2e9f(%rip)      # 0x40a8
leaq 0x2ca(%rip), %rcx       # 0x14da
movq %rcx, 0x2e99(%rip)      # 0x40b0
retq
// File: /workspace/github_c_makefile_star2_O2/albinoloverats[P]hide/src/tiff.c
// Function: read_tiff
static int read_tiff(image_info_t *image_info, void (*progress_update)(uint64_t, uint64_t))
{
	errno = EXIT_SUCCESS;

	TIFF *tif = TIFFOpen(image_info->file, "r");
	if (!tif)
		return errno;

	TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &image_info->width);
	TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &image_info->height);
	TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &image_info->bpp);

	image_info->buffer = malloc(sizeof (uint8_t *) * image_info->height);
	for (uint64_t y = 0; y < image_info->height; y++)
	{
		image_info->buffer[y] = malloc(image_info->width * image_info->bpp);
		TIFFReadScanline(tif, image_info->buffer[y], y, 0);
		if (progress_update)
			progress_update(y, image_info->height);
	}

	TIFFClose(tif);

	return errno;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x1040
movq %rax, %rbx
andl $0x0, (%rax)
movq (%r15), %rdi
leaq 0xd8e(%rip), %rsi       # 0x2005
callq 0x1050
testq %rax, %rax
je 0x1335
movq %rax, %r12
movq %rbx, (%rsp)
leaq 0x30(%r15), %rdx
xorl %r13d, %r13d
movq %rax, %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x1070
leaq 0x28(%r15), %rbp
movq %r12, %rdi
movl $0x101, %esi            # imm = 0x101
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1070
leaq 0x38(%r15), %rdx
movq %r12, %rdi
movl $0x115, %esi            # imm = 0x115
xorl %eax, %eax
callq 0x1070
movq 0x28(%r15), %rbx
leaq (,%rbx,8), %rdi
callq 0x10a0
movq %rax, 0x40(%r15)
cmpq %rbx, %r13
jae 0x1329
movzwl 0x38(%r15), %edi
imulq 0x30(%r15), %rdi
callq 0x10a0
movq 0x40(%r15), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x40(%r15), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x10b0
testq %r14, %r14
je 0x1320
movq (%rbp), %rsi
movq %r13, %rdi
callq *%r14
incq %r13
movq (%rbp), %rbx
jmp 0x12e0
movq %r12, %rdi
callq 0x10d0
movq (%rsp), %rbx
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_log_init
bool ce_log_init(const char* filename){
     g_ce_log = fopen(filename, "wa");
     if(!g_ce_log){
          fprintf(stderr, "error: unable to create ce log: fopen(\"%s\", \"wa\") failed: '%s'\n", filename, strerror(errno));
          return false;
     }

     static const char* greetings [] = {
          "Thank you for flying ce",
          "There's nothing like a fresh cup of ce in the morning",
          "Why do kids love the taste of C Editor?\n\nIt's the taste you can ce",
          "ce is for C Editor, that's good enough for me",
          "I missed you.",
          "Hope you're having a great day! -ce",
          "You're a special person -- or robot. I don't judge.",
          "I missed you... in a creepy way.",
          "I'm a potato",
          "At least this isn't emacs? Am I right!",
          "TACOCAT is the best palindrome",
          "Found a bug? It's a feature.",
          "Yo.",
          "Slurp'n up whitespace since 2016",
          "Welcome to GNU Emacs, one component of the GNU/Linux operating system.",
          "ce, the world's only editor with a Michelin star.",
          "Oy! ce's a beaut!",
          "The default config has a great vimplementation!",
          "They see me slurpin' They hatin'",
          "'Days of pain are worth the years of upcoming prosperity' -confucius, probably",
          "ce, aka, 'the cache miss king'",
          "All the terminal you want with none of the illness",
          "I used ce before it was cool",
          "'Where has this been all my life' -emacs enthusiast",
     };

     srand(time(NULL));
     ce_log("%s\n", greetings[rand() % (sizeof(greetings) / sizeof(greetings[0]))]);
     return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x1c8a9(%rip), %rsi     # 0x2a104
callq 0xd5b0
movq %rax, %rbx
movq %rax, 0x2c286(%rip)     # 0x39af0
testq %rax, %rax
je 0xd8b6
xorl %edi, %edi
callq 0xd450
movl %eax, %edi
callq 0xd370
callq 0xd710
cltq
pushq $0x18
popq %rcx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
leaq 0x1c80f(%rip), %rcx     # 0x2a0a4
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x2004e(%rip), %rdi     # 0x2d8f1
xorl %eax, %eax
callq 0xd8e5
testq %rbx, %rbx
setne %al
popq %rbx
popq %r14
popq %r15
retq
movq 0x2b73b(%rip), %rax     # 0x38ff8
movq (%rax), %r15
callq 0xd0a0
movl (%rax), %edi
callq 0xd650
leaq 0x1c834(%rip), %rsi     # 0x2a107
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xd3c0
jmp 0xd8aa