LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/dynstring.c
// Function: dyn_init
int dyn_init(DYN_STRING *ds,int reserve_size) // {{{
{
  assert(ds);
  assert(reserve_size>0);

  ds->len=0;
  ds->alloc=reserve_size;
  ds->buf=malloc(ds->alloc+1);
  if (!ds->buf) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    assert(0);
    ds->len=-1;
    return -1;
  }
  return 0;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x720a
testl %esi, %esi
jle 0x7223
movq %rdi, %rbx
andl $0x0, (%rdi)
movl %esi, 0x4(%rdi)
incl %esi
movq %rsi, %rdi
callq 0x21d0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x723c
xorl %eax, %eax
popq %rbx
retq
leaq 0x4500(%rip), %rdi      # 0xb711
leaq 0x44fc(%rip), %rsi      # 0xb714
leaq 0x4501(%rip), %rcx      # 0xb720
pushq $0xb
jmp 0x727d
leaq 0x4516(%rip), %rdi      # 0xb740
leaq 0x44e3(%rip), %rsi      # 0xb714
leaq 0x44e8(%rip), %rcx      # 0xb720
pushq $0xc
jmp 0x727d
movq 0x7d9d(%rip), %rax      # 0xefe0
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x3100(%rip), %rsi      # 0xa359
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
leaq 0x3a53(%rip), %rdi      # 0xacc0
leaq 0x44a0(%rip), %rsi      # 0xb714
leaq 0x44a5(%rip), %rcx      # 0xb720
pushq $0x13
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/dynstring.c
// Function: dyn_free
void dyn_free(DYN_STRING *ds) // {{{
{
  assert(ds);

  ds->len=-1;
  ds->alloc=0;
  free(ds->buf);
  ds->buf=NULL;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x72a4
movq %rdi, %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
callq 0x21b0
andq $0x0, 0x8(%rbx)
popq %rbx
retq
leaq 0x4466(%rip), %rdi      # 0xb711
leaq 0x4462(%rip), %rsi      # 0xb714
leaq 0x4496(%rip), %rcx      # 0xb74f
pushq $0x1d
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/dynstring.c
// Function: dyn_ensure
int dyn_ensure(DYN_STRING *ds,int free_space) // {{{
{
  assert(ds);
  assert(free_space);

  if (ds->len<0) {
    return -1;
  }
  if (ds->alloc - ds->len >= free_space) {
    return 0; // done
  }
  ds->alloc+=free_space;
  char *tmp=realloc(ds->buf,ds->alloc+1);
  if (!tmp) {
    ds->len=-1;
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    assert(0);
    return -1;
  }
  ds->buf=tmp;
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7310
testl %esi, %esi
je 0x7329
movq %rdi, %rbx
movl (%rdi), %ecx
testl %ecx, %ecx
js 0x7304
movl 0x4(%rbx), %eax
movl %eax, %edx
subl %ecx, %edx
xorl %ebp, %ebp
cmpl %esi, %edx
jge 0x7307
leal (%rax,%rsi), %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
addl %esi, %eax
incl %eax
movslq %eax, %rsi
callq 0x2240
testq %rax, %rax
je 0x7342
movq %rax, 0x8(%rbx)
jmp 0x7307
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x43fa(%rip), %rdi      # 0xb711
leaq 0x43f6(%rip), %rsi      # 0xb714
leaq 0x4446(%rip), %rcx      # 0xb76b
pushq $0x28
jmp 0x7386
leaq 0x445d(%rip), %rdi      # 0xb78d
leaq 0x43dd(%rip), %rsi      # 0xb714
leaq 0x442d(%rip), %rcx      # 0xb76b
pushq $0x29
jmp 0x7386
orl $-0x1, (%rbx)
movq 0x7c94(%rip), %rax      # 0xefe0
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x2ff7(%rip), %rsi      # 0xa359
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
leaq 0x394a(%rip), %rdi      # 0xacc0
leaq 0x4397(%rip), %rsi      # 0xb714
leaq 0x43e7(%rip), %rcx      # 0xb76b
pushq $0x36
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/dynstring.c
// Function: dyn_vprintf
int dyn_vprintf(DYN_STRING *ds,const char *fmt,va_list ap) // {{{
{
  assert(ds);

  int need,len=strlen(fmt)+100;
  va_list va;

  if (dyn_ensure(ds,len)==-1) {
    return -1;
  }

  while (1) {
    va_copy(va,ap);
    need=vsnprintf(ds->buf+ds->len,ds->alloc-ds->len+1,fmt,va);
    va_end(va);
    if (need==-1) {
      len+=100;
    } else if (need>=len) {
      len=need;
    } else {
      ds->len+=need;
      break;
    }
    if (dyn_ensure(ds,len)==-1) {
      return -1;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x7440
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2090
movq %rax, %r13
addl $0x64, %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x72c1
pushq $-0x1
popq %rcx
cmpl $-0x1, %eax
je 0x742f
movq %rsp, %r12
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, (%rsp)
movslq (%r14), %rdi
movl 0x4(%r14), %eax
subl %edi, %eax
addq 0x8(%r14), %rdi
incl %eax
movslq %eax, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x20e0
cmpl $-0x1, %eax
je 0x740c
movl %eax, %ebp
cmpl %r13d, %eax
jge 0x7413
jmp 0x742a
addl $0x64, %r13d
movl %r13d, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x72c1
movl %ebp, %r13d
cmpl $-0x1, %eax
jne 0x73d1
pushq $-0x1
popq %rcx
jmp 0x742f
addl %ebp, (%r14)
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x42ca(%rip), %rdi      # 0xb711
leaq 0x42c6(%rip), %rsi      # 0xb714
leaq 0x4343(%rip), %rcx      # 0xb798
pushq $0x40
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/fontfile.c
// Function: fontfile_open_sfnt
FONTFILE *fontfile_open_sfnt(OTF_FILE *otf) // {{{
{
  if (!otf) {
    assert(0);
    return NULL;
  }
  FONTFILE *ret=calloc(1,sizeof(FONTFILE));

  ret->sfnt=otf;

  return ret;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x74fd
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x2100
movq %rbx, (%rax)
popq %rbx
retq
leaq 0x37bc(%rip), %rdi      # 0xacc0
leaq 0x42d1(%rip), %rsi      # 0xb7dc
leaq 0x42d5(%rip), %rcx      # 0xb7e7
pushq $0x13
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/fontfile.c
// Function: fontfile_open_std
FONTFILE *fontfile_open_std(const char *name) // {{{
{
  assert(name);
  FONTFILE *ret=calloc(1,sizeof(FONTFILE));

  ret->stdname=strdup(name);

  return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x754b
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x2100
movq %rax, %r14
movq %rbx, %rdi
callq 0x2250
movq %rax, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x403b(%rip), %rdi      # 0xb58d
leaq 0x4283(%rip), %rsi      # 0xb7dc
leaq 0x42b0(%rip), %rcx      # 0xb810
pushq $0x20
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/fontfile.c
// Function: fontfile_close
void fontfile_close(FONTFILE *ff) // {{{
{
  if (ff) {
    otf_close(ff->sfnt);
    // ??? cff_close(ff->cff);
    free(ff->stdname);
    free(ff);
  }
}

// Assembly:
testq %rdi, %rdi
je 0x758b
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x34be
movq 0x8(%rbx), %rdi
callq 0x21b0
movq %rbx, %rdi
popq %rbx
jmp 0x21b0
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/frequent.c
// Function: frequent_new
FREQUENT *frequent_new(int size) // {{{ - just free() it
{
  assert(size>0);
  FREQUENT *ret=malloc(sizeof(ret[0])+sizeof(ret->pair[0])*size);
  if (!ret) {
    return NULL;
  }
  ret->size=size;
  ret->czero=0;
  ret->sorted=1;
  int iA;
  for (iA=0;iA<size;iA++) {
    ret->pair[iA].key=INTPTR_MIN;
    ret->pair[iA].count=0;
    ret->pair[iA].zero=0;
  }

  return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testl %edi, %edi
jle 0x75e3
movl %edi, %ebx
movl %edi, %r14d
shlq $0x4, %r14
leaq 0x10(%r14), %rdi
callq 0x21d0
testq %rax, %rax
je 0x75db
movl %ebx, (%rax)
andl $0x0, 0x4(%rax)
movb $0x1, 0x8(%rax)
xorl %ecx, %ecx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
cmpq %rcx, %r14
je 0x75db
movq %rdx, 0x10(%rax,%rcx)
andq $0x0, 0x18(%rax,%rcx)
addq $0x10, %rcx
jmp 0x75c5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x415e(%rip), %rdi      # 0xb748
leaq 0x4249(%rip), %rsi      # 0xb83a
leaq 0x424d(%rip), %rcx      # 0xb845
pushq $0x11
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/frequent.c
// Function: frequent_add
void frequent_add(FREQUENT *freq,intptr_t key) // {{{
{
  assert(freq);
  int iA,zero=-1;
  for (iA=freq->size-1;iA>=0;iA--) {
    if (freq->pair[iA].key==key) {
      freq->pair[iA].count++;
      freq->sorted=0;
      return;
    } else if (freq->pair[iA].count==freq->czero) {
      zero=iA;
    }
  }
  if (zero>=0) { // insert into set
    freq->pair[zero].key=key;
    freq->pair[zero].count++; // i.e. czero+1
    freq->pair[zero].zero=freq->czero;
    // if it was sorted, the free entries are at the end. zero points to the first free entry, because of the loop direction
  } else { // out-of-set count
    freq->czero++;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x765d
movl (%rdi), %edx
leaq 0x10(%rdi), %rax
pushq $-0x1
popq %rcx
testl %edx, %edx
jle 0x7630
decq %rdx
movl %edx, %r8d
shlq $0x4, %r8
movl 0x8(%rax,%r8), %r9d
cmpq %rsi, (%rax,%r8)
je 0x764a
cmpl 0x4(%rdi), %r9d
cmovel %edx, %ecx
jmp 0x760e
testl %ecx, %ecx
js 0x7659
movl %ecx, %ecx
shlq $0x4, %rcx
movq %rsi, (%rax,%rcx)
incl 0x8(%rax,%rcx)
movl 0x4(%rdi), %edx
movl %edx, 0xc(%rax,%rcx)
retq
addq %r8, %rax
incl %r9d
movl %r9d, 0x8(%rax)
movb $0x0, 0x8(%rdi)
retq
incl 0x4(%rdi)
retq
pushq %rax
leaq 0x41fc(%rip), %rdi      # 0xb861
leaq 0x41ce(%rip), %rsi      # 0xb83a
leaq 0x41f3(%rip), %rcx      # 0xb866
pushq $0x26
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/frequent.c
// Function: frequent_get
intptr_t frequent_get(FREQUENT *freq,int pos) // {{{
{
  assert(freq);
  if (!freq->sorted) {
    // sort by (count-zero)
    qsort(freq->pair,freq->size,sizeof(freq->pair[0]),frequent_cmp);
    freq->sorted=1;
  }
  if ( (pos<0)||(pos>=freq->size) ) {
    return INTPTR_MIN;
  }
  return freq->pair[pos].key;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x76cc
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x0, 0x8(%rdi)
jne 0x76a8
leaq 0x10(%rbx), %rdi
movslq (%rbx), %rsi
leaq 0x4d(%rip), %rcx        # 0x76e9
pushq $0x10
popq %rdx
callq 0x2260
movb $0x1, 0x8(%rbx)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
testl %ebp, %ebp
js 0x76c5
cmpl %ebp, (%rbx)
jle 0x76c5
movl %ebp, %eax
shlq $0x4, %rax
movq 0x10(%rbx,%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x418e(%rip), %rdi      # 0xb861
leaq 0x4160(%rip), %rsi      # 0xb83a
leaq 0x41ad(%rip), %rcx      # 0xb88e
pushq $0x47
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_subset.c
// Function: otf_copy_sfnt
int otf_copy_sfnt(OTF_FILE *otf,struct _OTF_WRITE_WOFF *woff,OUTPUT_FN output,void *context) // {{{
{
  assert(otf);
  assert(output);
  int iA;

  struct _OTF_WRITE_INFO otw={
    .version=otf->version,
    .numTables=otf->numTables
  };
  otw.tables=malloc(sizeof(struct _OTF_WRITE_TABLE)*otf->numTables);
  if (!otw.tables) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    return -1;
  }

  // just copy everything
  for (iA=0;iA<otf->numTables;iA++) {
    otw.tables[iA].tag=otf->tables[iA].tag;
    otw.tables[iA].action=otf_action_copy;
    otw.tables[iA].copy.otf=otf;
    otw.tables[iA].copy.table_no=iA;
  }
  otw.order=otf_tagorder_offset_sort(otf);

  const int ret=otf_write_sfnt(&otw,woff,output,context);

  free(otw.order);
  free(otw.tables);
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
testq %rdi, %rdi
je 0x77f9
movq %rdx, %r14
testq %rdx, %rdx
je 0x7812
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r12
andq $0x0, 0x8(%rsp)
movl 0x14(%rdi), %eax
movl %eax, 0x8(%rsp)
movzwl 0x38(%rdi), %r13d
movw %r13w, 0xc(%rsp)
imulq $0x50, %r13, %rdi
callq 0x21d0
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x77ca
xorl %ecx, %ecx
leaq 0x1076(%rip), %rdx      # 0x87cd
xorl %esi, %esi
cmpq %r13, %rsi
jae 0x7781
movq 0x40(%r12), %rdi
movl (%rdi,%rcx), %edi
movq %rdi, (%rax,%rcx,4)
movq %rdx, 0x8(%rax,%rcx,4)
movq %r12, 0x10(%rax,%rcx,4)
movl %esi, 0x18(%rax,%rcx,4)
incq %rsi
addq $0x14, %rcx
jmp 0x7759
movq %r12, %rdi
callq 0x86ec
leaq 0x8(%rsp), %r12
movq %rax, 0x10(%r12)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x894c
movl %eax, %ebx
movq 0x10(%r12), %rdi
callq 0x21b0
movq 0x8(%r12), %rdi
callq 0x21b0
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x780f(%rip), %rax      # 0xefe0
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x2b72(%rip), %rsi      # 0xa359
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
pushq $-0x1
popq %rbx
jmp 0x77ba
leaq 0x2838(%rip), %rdi      # 0xa038
leaq 0x40ae(%rip), %rsi      # 0xb8b5
leaq 0x40b5(%rip), %rcx      # 0xb8c3
pushq $0xc
jmp 0x7829
leaq 0x3200(%rip), %rdi      # 0xaa19
leaq 0x4095(%rip), %rsi      # 0xb8b5
leaq 0x409c(%rip), %rcx      # 0xb8c3
pushq $0xd
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_subset.c
// Function: otf_intersect_tables
int otf_intersect_tables(OTF_FILE *otf,struct _OTF_WRITE_TABLE *tables) // {{{
{
  int iA,iB,numTables=0;
  for (iA=0,iB=0;(iA<otf->numTables)&&(tables[iB].tag);) {
    if (otf->tables[iA].tag==tables[iB].tag) {
      if (tables[iB].action) {
        if (tables[iB].action==otf_action_copy) {
          tables[iB].copy.table_no=iA; // original table location found.
        }
        if (iB!=numTables) { // >, actually
          memmove(tables+numTables,tables+iB,sizeof(struct _OTF_WRITE_TABLE));
        }
        numTables++;
      } // else skip
      iA++;
      iB++;
    } else if (otf->tables[iA].tag<tables[iB].tag) {
      iA++;
    } else { // not in otf->tables
      if ( (tables[iB].action)&&(tables[iB].action!=otf_action_copy) ) { // keep
        if (iB!=numTables) { // >, actually
          memmove(tables+numTables,tables+iB,sizeof(struct _OTF_WRITE_TABLE));
        }
        numTables++;
      } // else delete
      iB++;
    }
  }
  return numTables;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
xorl %r13d, %r13d
leaq 0xf52(%rip), %rdi       # 0x87cd
xorl %ebx, %ebx
xorl %ebp, %ebp
movq %rsi, 0x10(%rsp)
movslq %r13d, %rax
movslq %ebx, %rcx
imulq $0x50, %rcx, %r12
addq %rsi, %r12
imulq $0x14, %rax, %r8
movl %r13d, 0xc(%rsp)
movzwl 0x38(%r14), %eax
cmpl %eax, %r13d
jge 0x7960
movq (%r12), %rcx
testq %rcx, %rcx
je 0x7960
movq 0x40(%r14), %rax
movl (%rax,%r8), %edx
movslq %ebp, %rax
cmpq %rdx, %rcx
je 0x791f
ja 0x7958
movq 0x8(%r12), %rcx
testq %rcx, %rcx
sete %dl
cmpq %rdi, %rcx
sete %cl
orb %dl, %cl
jne 0x7914
cmpl %ebp, %ebx
je 0x7912
movq %rdi, %r13
imulq $0x50, %rax, %rdi
addq %rsi, %rdi
movq %r12, %rsi
pushq $0x50
popq %rdx
movq %r14, %r15
movq %r8, %r14
callq 0x2230
movq %r14, %r8
movq %r15, %r14
movq %r13, %rdi
movl 0xc(%rsp), %r13d
movq 0x10(%rsp), %rsi
incl %ebp
incl %ebx
addq $0x50, %r12
jmp 0x789a
movq 0x8(%r12), %rcx
testq %rcx, %rcx
je 0x7956
cmpq %rdi, %rcx
jne 0x7933
movl %r13d, 0x18(%r12)
cmpl %ebp, %ebx
je 0x7954
movq %rdi, %r15
imulq $0x50, %rax, %rdi
addq %rsi, %rdi
movq %r12, %rsi
pushq $0x50
popq %rdx
callq 0x2230
movq %r15, %rdi
movq 0x10(%rsp), %rsi
incl %ebp
incl %ebx
incl %r13d
jmp 0x7884
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_subset.c
// Function: otf_subset_glyf
static int otf_subset_glyf(OTF_FILE *otf,int curgid,int donegid,BITSET glyphs) // {{{
{
  int ret=0;
  if (get_SHORT(otf->gly)>=0) { // not composite
    return ret; // done
  }

  char *cur=otf->gly+10;

  unsigned short flags;
  do {
    flags=get_USHORT(cur);
    const unsigned short sub_gid=get_USHORT(cur+2);
    assert(sub_gid<otf->numGlyphs);
    if (!bit_check(glyphs,sub_gid)) {
      // bad: temporarily load sub glyph
      const int len=otf_get_glyph(otf,sub_gid);
      assert(len>0);
      bit_set(glyphs,sub_gid);
      if (sub_gid<donegid) {
        ret+=len;
        ret+=otf_subset_glyf(otf,sub_gid,donegid,glyphs); // composite of composites?, e.g. in DejaVu
      }
      const int res=otf_get_glyph(otf,curgid); // reload current glyph
      assert(res);
    }

    // skip parameters
    cur+=6;
    if (flags&0x01) {
      cur+=2;
    }
    if (flags&0x08) {
      cur+=2;
    } else if (flags&0x40) {
      cur+=4;
    } else if (flags&0x80) {
      cur+=8;
    }
  } while (flags&0x20); // more components

  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, 0x14(%rsp)
movq 0x80(%rdi), %rbp
movl $0x0, 0xc(%rsp)
cmpb $0x0, (%rbp)
jns 0x81a8
movq %rcx, %r8
addq $0xa, %rbp
movl $0x0, 0xc(%rsp)
pushq $0x1
popq %rdx
movzwl %si, %eax
movl %eax, 0x10(%rsp)
pushq $0x2
popq %rsi
movq %rcx, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movzwl 0x2(%rbp), %eax
rolw $0x8, %ax
cmpw 0x4c(%rdi), %ax
jae 0x81bb
movzbl 0x1(%rbp), %r15d
movzwl %ax, %r13d
movl %r13d, %ebx
shrl $0x5, %ebx
movl (%r8,%rbx,4), %eax
movl %edx, %r14d
movl %r13d, %ecx
shll %cl, %r14d
btl %r13d, %eax
jb 0x8173
movl %r13d, %esi
callq 0x4137
testl %eax, %eax
jle 0x81ed
movq 0x20(%rsp), %rcx
orl %r14d, (%rcx,%rbx,4)
movl 0x14(%rsp), %edx
cmpl %edx, %r13d
jge 0x8150
movl %eax, %r12d
addl 0xc(%rsp), %r12d
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %esi
callq 0x8088
addl %r12d, %eax
movl %eax, 0xc(%rsp)
jmp 0x8155
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl 0x10(%rsp), %esi
callq 0x4137
testl %eax, %eax
movq 0x20(%rsp), %r8
movq %rbx, %rdi
pushq $0x1
popq %rdx
pushq $0x2
popq %rsi
je 0x81d4
movq %rsi, %rax
testb $0x8, %r15b
jne 0x8190
pushq $0x4
popq %rax
testb $0x40, %r15b
jne 0x8190
movl %r15d, %eax
shrb $0x4, %al
andb $0x8, %al
movzbl %al, %eax
movl %r15d, %ecx
andl $0x1, %ecx
leaq 0x6(%rbp,%rcx,2), %rbp
addq %rax, %rbp
testb $0x20, %r15b
jne 0x80d9
movl 0xc(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38b7(%rip), %rdi      # 0xba79
leaq 0x36ec(%rip), %rsi      # 0xb8b5
leaq 0x38c0(%rip), %rcx      # 0xba90
pushq $0x65
jmp 0x8204
leaq 0x1f55(%rip), %rdi      # 0xa130
leaq 0x36d3(%rip), %rsi      # 0xb8b5
leaq 0x38a7(%rip), %rcx      # 0xba90
pushq $0x70
jmp 0x8204
leaq 0x38ce(%rip), %rdi      # 0xbac2
leaq 0x36ba(%rip), %rsi      # 0xb8b5
leaq 0x388e(%rip), %rcx      # 0xba90
pushq $0x69
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_subset.c
// Function: otf_cff_extract
int otf_cff_extract(OTF_FILE *otf,OUTPUT_FN output,void *context) // {{{ - returns number of bytes written
{
  assert(otf);
  assert(output);

  if (otf->flags&OTF_F_WOFF) {
    int len;
    char *data=otf_get_table(otf,OTF_TAG('C','F','F',' '),&len);
    if (!data) {
      return -1;
    }
    (*output)(data,len,context);
    return len;
  }

  int idx=otf_find_table(otf,OTF_TAG('C','F','F',' '));
  if (idx==-1) {
    return -1;
  }
  const OTF_DIRENT *table=otf->tables+idx;

  return copy_block(otf->f,table->offset,table->length,output,context);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rdx, 0x8(%rsp)
testq %rdi, %rdi
je 0x8588
movq %rsi, %rbx
testq %rsi, %rsi
je 0x85a7
movq %rdi, %r12
testb $-0x80, 0x9(%rdi)
jne 0x84e9
movq %r12, %rdi
movl $0x43464620, %esi       # imm = 0x43464620
callq 0x36be
cmpl $-0x1, %eax
je 0x8573
movq (%r12), %r15
testq %r15, %r15
je 0x85c6
movq 0x40(%r12), %rcx
cltq
imulq $0x14, %rax, %rax
movl 0x8(%rcx,%rax), %esi
movl 0xc(%rcx,%rax), %r14d
xorl %r13d, %r13d
movq %r15, %rdi
xorl %edx, %edx
callq 0x2170
cmpl $-0x1, %eax
je 0x8549
leaq 0x10(%rsp), %r12
cmpl $0x1001, %r14d          # imm = 0x1001
jl 0x8514
movl $0x1000, %edx           # imm = 0x1000
movq %r12, %rdi
pushq $0x1
popq %rsi
movq %r15, %rcx
callq 0x21f0
movq %rax, %rbp
cmpl $0x1000, %ebp           # imm = 0x1000
jl 0x8573
movq %r12, %rdi
movl %ebp, %esi
movq 0x8(%rsp), %rdx
callq *%rbx
addl %ebp, %r13d
subl %ebp, %r14d
jmp 0x84aa
leaq 0x10(%rsp), %rdx
movq %r12, %rdi
movl $0x43464620, %esi       # imm = 0x43464620
callq 0x371c
testq %rax, %rax
je 0x8573
movl 0x10(%rsp), %esi
movq %rax, %rdi
movq 0x8(%rsp), %rdx
callq *%rbx
movl 0x10(%rsp), %eax
jmp 0x8576
movslq %r14d, %rdx
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
movq %r15, %rcx
callq 0x21f0
movq %rax, %r15
cmpl %r15d, %r14d
pushq $-0x1
popq %rax
jg 0x8576
leaq 0x10(%rsp), %rdi
movl %r15d, %esi
movq 0x8(%rsp), %rdx
callq *%rbx
addl %r15d, %r13d
movl %r13d, %eax
jmp 0x8576
movq 0x6a90(%rip), %rax      # 0xefe0
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x21dc(%rip), %rsi      # 0xa742
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
pushq $-0x1
popq %rax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1aa9(%rip), %rdi      # 0xa038
leaq 0x331f(%rip), %rsi      # 0xb8b5
leaq 0x34a9(%rip), %rcx      # 0xba46
movl $0x166, %edx            # imm = 0x166
callq 0x20f0
leaq 0x246b(%rip), %rdi      # 0xaa19
leaq 0x3300(%rip), %rsi      # 0xb8b5
leaq 0x348a(%rip), %rcx      # 0xba46
movl $0x167, %edx            # imm = 0x167
callq 0x20f0
leaq 0x1a98(%rip), %rdi      # 0xa065
leaq 0x32e1(%rip), %rsi      # 0xb8b5
leaq 0x34ed(%rip), %rcx      # 0xbac8
movl $0x144, %edx            # imm = 0x144
callq 0x20f0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_write.c
// Function: otf_tagorder_win_sort
int *otf_tagorder_win_sort(const struct _OTF_WRITE_TABLE *tables,int numTables) // {{{
{
  int *order=malloc(sizeof(int)*numTables);
  if (!order) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    return NULL;
  }

  // reverse intersection of both sorted arrays
  int priolist[NUM_PRIO]={0,};
  int iA=numTables-1,iB=sizeof(otf_tagorder_win)/sizeof(otf_tagorder_win[0])-1;
  int ret=numTables-1;
  while ( (iA>=0)&&(iB>=0) ) {
    if (tables[iA].tag==otf_tagorder_win[iB].tag) {
      priolist[otf_tagorder_win[iB--].prio]=1+iA--;
    } else if (tables[iA].tag>otf_tagorder_win[iB].tag) { // no order known: put unchanged at end of result
      order[ret--]=iA--;
    } else { // <
      iB--;
    }
  }
  while (iA>=0) {
    order[ret--]=iA--;
  }
  for (iA=NUM_PRIO-1;iA>=0;iA--) { // pick the matched tables up in sorted order (bucketsort principle)
    if (priolist[iA]) {
      order[ret--]=priolist[iA]-1;
    }
  }
  return order;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %esi, %r14d
movq %rdi, %r15
movslq %esi, %rdi
shlq $0x2, %rdi
callq 0x21d0
movq %rax, %rbx
testq %rax, %rax
je 0x86b5
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
decl %r14d
pushq $0x13
popq %rax
leaq 0x36f9(%rip), %rcx      # 0xbd30
movl %r14d, %edx
movl %r14d, %esi
imulq $0x50, %rsi, %rsi
addq %r15, %rsi
testl %r14d, %r14d
js 0x8683
testl %eax, %eax
js 0x8683
movl %eax, %edi
movl 0x4(%rcx,%rdi,8), %r8d
cmpq %r8, (%rsi)
je 0x865f
ja 0x8675
decl %eax
jmp 0x8644
leal -0x1(%r14), %esi
incl %r14d
decl %eax
movslq (%rcx,%rdi,8), %rdi
movl %r14d, (%rsp,%rdi,4)
movl %esi, %r14d
jmp 0x863a
movslq %edx, %rsi
decl %edx
movl %r14d, (%rbx,%rsi,4)
decl %r14d
jmp 0x863a
movslq %edx, %rax
testl %r14d, %r14d
js 0x8697
movl %r14d, (%rbx,%rax,4)
decq %rax
decl %r14d
jmp 0x8686
pushq $0x13
popq %rcx
testl %ecx, %ecx
js 0x86df
movl %ecx, %edx
movl (%rsp,%rdx,4), %edx
testl %edx, %edx
je 0x86b1
decl %edx
movslq %eax, %rsi
decl %eax
movl %edx, (%rbx,%rsi,4)
decl %ecx
jmp 0x869a
movq 0x6924(%rip), %rax      # 0xefe0
movq (%rax), %r14
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x1c87(%rip), %rsi      # 0xa359
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_write.c
// Function: otf_tagorder_offset_sort
int *otf_tagorder_offset_sort(const OTF_FILE *otf) // {{{
{
  int *order=malloc(sizeof(int)*otf->numTables);
  if (!order) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    return NULL;
  }

  int iA;
  struct _OTF_KV tmp[otf->numTables]; // or tmp=malloc(sizeof(struct _OTF_KV)*otf->numTables); assert(tmp);
  for (iA=0;iA<otf->numTables;iA++) {
    tmp[iA].key=otf->tables[iA].offset;
    tmp[iA].value=iA;
  }
  qsort(tmp,otf->numTables,sizeof(struct _OTF_KV),otf_kv_compare); // qsort_r / qsort_s makes portability hard ...
  for (iA=0;iA<otf->numTables;iA++) {
    order[iA]=tmp[iA].value;
  }
  return order;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movzwl 0x38(%rdi), %r15d
leal (,%r15,4), %edi
callq 0x21d0
movq %rax, %rbx
testq %rax, %rax
je 0x8791
movq %rsp, %r12
leal 0xf(,%r15,8), %eax
andl $-0x10, %eax
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
movzwl 0x38(%r14), %esi
pushq $0x8
popq %rax
xorl %ecx, %ecx
cmpq %rcx, %rsi
je 0x8753
movq 0x40(%r14), %rdx
movl (%rdx,%rax), %edx
movl %edx, (%r15,%rcx,8)
movl %ecx, 0x4(%r15,%rcx,8)
incq %rcx
addq $0x14, %rax
jmp 0x8735
leaq 0x63(%rip), %rcx        # 0x87bd
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x2260
movzwl 0x38(%r14), %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x877e
movl 0x4(%r15,%rcx,8), %edx
movl %edx, (%rbx,%rcx,4)
incq %rcx
jmp 0x876c
movq %r12, %rsp
movq %rbx, %rax
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x6848(%rip), %rax      # 0xefe0
movq (%rax), %r14
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x1bab(%rip), %rsi      # 0xa359
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x8781
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_write.c
// Function: otf_action_copy
void otf_action_copy(struct _OTF_WRITE_TABLE *self) // {{{
{
  OTF_FILE *otf=self->copy.otf;
  const OTF_DIRENT *table=otf->tables+self->copy.table_no;

  // get checksum and unpadded length
  self->info.table.tag=self->tag;
  self->info.table.checkSum=table->checkSum;
  self->info.table.offset=0; // later
  self->info.table.length=table->length; // unpadded
  self->info.table.compLength=table->length; // uncompressed

  self->info.data=NULL;
  self->info.load=action_copy_load;
  self->info.free=action_free;
}

// Assembly:
movq 0x10(%rdi), %rax
movq 0x40(%rax), %rax
movslq 0x18(%rdi), %rcx
imulq $0x14, %rcx, %rcx
movl (%rdi), %edx
movl %edx, 0x28(%rdi)
movl 0x4(%rax,%rcx), %edx
movl %edx, 0x2c(%rdi)
andl $0x0, 0x30(%rdi)
movl 0xc(%rax,%rcx), %eax
movl %eax, 0x34(%rdi)
movl %eax, 0x38(%rdi)
andq $0x0, 0x20(%rdi)
leaq 0x10(%rip), %rax        # 0x8813
movq %rax, 0x40(%rdi)
leaq 0x58(%rip), %rax        # 0x8866
movq %rax, 0x48(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_write.c
// Function: action_copy_load
static int action_copy_load(struct _OTF_WRITE_TABLE *self) // {{{
{
  OTF_FILE *otf=self->copy.otf;
  const OTF_DIRENT *table=otf->tables+self->copy.table_no;

  char *data=otf_read_table(otf,NULL,table);
  if (!data) {
    return -1;
  }

  assert(!self->info.data);
  self->info.data=data;
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movslq 0x18(%rbx), %rax
imulq $0x14, %rax, %rdx
addq 0x40(%rdi), %rdx
xorl %esi, %esi
callq 0x2b30
testq %rax, %rax
je 0x8842
cmpq $0x0, 0x20(%rbx)
jne 0x8847
movq %rax, 0x20(%rbx)
xorl %eax, %eax
jmp 0x8845
pushq $-0x1
popq %rax
popq %rbx
retq
leaq 0x3388(%rip), %rdi      # 0xbbd6
leaq 0x32a8(%rip), %rsi      # 0xbafd
leaq 0x338b(%rip), %rcx      # 0xbbe7
movl $0xbc, %edx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_write.c
// Function: otf_action_replace
void otf_action_replace(struct _OTF_WRITE_TABLE *self) // {{{
{
  char *data=self->replace.data;
  int length=self->replace.length;

  // get checksum and unpadded length
  self->info.table.tag=self->tag;
  self->info.table.checkSum=otf_checksum(data,otf_padded(length));
  self->info.table.offset=0; // later
  self->info.table.length=length; // unpadded
  self->info.table.compLength=length; // uncompressed

  assert(data);
  if (otf_padded(length)>length) { // clear padding bytes
    memset(data+length,0,otf_padded(length)-length);
  }
  self->info.data=data;
  self->info.load=NULL;
  self->info.free=action_nop;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
movslq 0x18(%rdi), %r15
movl (%rdi), %eax
movl %eax, 0x28(%rdi)
leal 0x3(%r15), %ebp
andl $-0x4, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x8930
movl %eax, 0x2c(%rbx)
andl $0x0, 0x30(%rbx)
movl %r15d, 0x34(%rbx)
movl %r15d, 0x38(%rbx)
testq %r14, %r14
je 0x8911
cmpl %r15d, %ebp
jle 0x88f2
movq %r15, %rdi
addq %r14, %rdi
subl %r15d, %ebp
movslq %ebp, %rdx
xorl %esi, %esi
callq 0x20d0
movq %r14, 0x20(%rbx)
andq $0x0, 0x40(%rbx)
leaq 0x49(%rip), %rax        # 0x894b
movq %rax, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x32ca(%rip), %rdi      # 0xbbe2
leaq 0x31de(%rip), %rsi      # 0xbafd
leaq 0x31e4(%rip), %rcx      # 0xbb0a
movl $0x104, %edx            # imm = 0x104
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_write.c
// Function: action_load_data
static int action_load_data(struct _OTF_WRITE_TABLE *self) // {{{
{
  if (!self->info.data) {
    assert(self->info.load);
    if (!self->info.load) {
      return -1;
    }
    const int res=(*self->info.load)(self);
    if (res<0) {
      return -1;
    }
  }
  return 0;
}

// Assembly:
pushq %rax
cmpq $0x0, 0x20(%rdi)
jne 0x908b
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x9094
callq *%rax
testl %eax, %eax
js 0x908f
xorl %eax, %eax
popq %rcx
retq
pushq $-0x1
popq %rax
jmp 0x908d
leaq 0x2bea(%rip), %rdi      # 0xbc85
leaq 0x2a5b(%rip), %rsi      # 0xbafd
leaq 0x2bec(%rip), %rcx      # 0xbc95
movl $0xd9, %edx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/sfnt_write.c
// Function: otf_write_compressed_raw
static char *otf_write_compressed_raw(const char *in,unsigned int length,unsigned long *compLength) // {{{
{
  assert(compLength);
#ifdef WOFF_SUPPORT
  *compLength=compressBound(length); // known to be > otf_padded(length)
  char *tmp=malloc(sizeof(char)*(*compLength));
  if (!tmp) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    *compLength=-1;
    return NULL;
  }
  if (compress2((unsigned char *)tmp,compLength,(const unsigned char *)in,length,9)!=Z_OK) {
    fprintf(stderr,"Compression failed\n");
    free(tmp);
    *compLength=-1;
    return NULL;
  }
  if (*compLength<length) {
    return tmp; // compressed
  }
  free(tmp);
#endif
  *compLength=length; // uncompressed
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x9179
movq %rdx, %rbx
movq %rdi, %r12
movl %esi, %r14d
movq %r14, %rdi
callq 0x2210
movq %rax, (%rbx)
movq %rax, %rdi
callq 0x21d0
testq %rax, %rax
je 0x9110
movq %rax, %r15
pushq $0x9
popq %r8
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x20c0
testl %eax, %eax
jne 0x913c
cmpq %r14, (%rbx)
jb 0x916a
movq %r15, %rdi
callq 0x21b0
jmp 0x9164
movq 0x5ec9(%rip), %rax      # 0xefe0
movq (%rax), %r14
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x122c(%rip), %rsi      # 0xa359
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x9160
movq 0x5e9d(%rip), %rax      # 0xefe0
movq (%rax), %rcx
leaq 0x2bcf(%rip), %rdi      # 0xbd1c
pushq $0x13
popq %rsi
pushq $0x1
popq %rdx
callq 0x2280
movq %r15, %rdi
callq 0x21b0
pushq $-0x1
popq %r14
movq %r14, (%rbx)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x2b45(%rip), %rdi      # 0xbcc5
leaq 0x2976(%rip), %rsi      # 0xbafd
leaq 0x2b42(%rip), %rcx      # 0xbcd0
pushq $0x22
popq %rdx
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O2/ioerror[P]csidh-reference-implementation/rng.c
// Function: randombytes
void randombytes(void *x, size_t l)
{
    static int fd = -1;
    ssize_t n;
    if (fd < 0 && 0 > (fd = open("/dev/urandom", O_RDONLY)))
        exit(1);
    for (size_t i = 0; i < l; i += n)
        if (0 >= (n = read(fd, (char *) x + i, l - i)))
            exit(2);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x4eaa(%rip)      # 0x6068
jns 0x11da
leaq 0x3011(%rip), %rdi      # 0x41d8
xorl %esi, %esi
xorl %eax, %eax
callq 0x1090
movl %eax, 0x4e92(%rip)      # 0x6068
testl %eax, %eax
js 0x120a
xorl %r15d, %r15d
movq %rbx, %rdx
subq %r15, %rdx
jbe 0x1204
movl 0x4e7d(%rip), %edi      # 0x6068
leaq (%r14,%r15), %rsi
callq 0x1060
addq %rax, %r15
testq %rax, %rax
jg 0x11dd
pushq $0x2
popq %rdi
callq 0x10a0
popq %rbx
popq %r14
popq %r15
retq
pushq $0x1
jmp 0x11fe
nop
// File: /workspace/github_c_makefile_star2_O2/ioerror[P]csidh-reference-implementation/csidh.c
// Function: csidh_private
__attribute__((visibility("default"))) void csidh_private(private_key *priv)
{
    memset(&priv->e, 0, sizeof(priv->e));
    for (size_t i = 0; i < NUM_PRIMES; ) {
        int8_t buf[64];
        randombytes(buf, sizeof(buf));
        for (size_t j = 0; j < sizeof(buf); ++j) {
            if (buf[j] <= MAX_EXPONENT && buf[j] >= -MAX_EXPONENT) {
                priv->e[i / 2] |= (buf[j] & 0xf) << i % 2 * 4;
                if (++i >= NUM_PRIMES)
                    break;
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, (%rdi)
andq $0x0, 0x1d(%rdi)
xorl %r12d, %r12d
movq %rsp, %r14
pushq $0x40
popq %r15
cmpq $0x4a, %r12
jae 0x30d3
movq %r14, %rdi
movq %r15, %rsi
vzeroupper
callq 0x11ac
xorl %eax, %eax
cmpq $0x40, %rax
je 0x3085
movb (%rsp,%rax), %dl
leal 0x5(%rdx), %ecx
cmpb $0xa, %cl
ja 0x30ce
andb $0xf, %dl
leal (,%r12,4), %ecx
andb $0x4, %cl
shlb %cl, %dl
movq %r12, %rcx
shrq %rcx
orb %dl, (%rbx,%rcx)
incq %r12
cmpq $0x49, %r12
ja 0x3085
incq %rax
jmp 0x309b
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O2/ioerror[P]csidh-reference-implementation/csidh.c
// Function: validate
bool validate(public_key const *in)
{
    /* make sure the curve is nonsingular: A^2-4 != 0 */
    {
        ui dummy;
        if (!ui_sub3(&dummy, (ui *) &in->A, &p)) /* returns borrow */
            /* A >= p */
            return false;

        fp fp_pm2;
        fp_set(&fp_pm2, 2);
        if (!memcmp(&in->A, &fp_pm2, sizeof(fp)))
            /* A = 2 */
            return false;

        fp_sub3(&fp_pm2, &fp_0, &fp_pm2);
        if (!memcmp(&in->A, &fp_pm2, sizeof(fp)))
            /* A = -2 */
            return false;
    }

    const proj A = {in->A, fp_1};

    do {
        proj P;
        fp_random(&P.x);
        P.z = fp_1;

        /* maximal 2-power in p+1 */
        xDBL(&P, &A, &P);
        xDBL(&P, &A, &P);

        bool is_supersingular;
        ui order = ui_1;

        if (validate_rec(&P, &A, 0, NUM_PRIMES, &order, &is_supersingular))
            return is_supersingular;

    /* P didn't have big enough order to prove supersingularity. */
    } while (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, %rbx
leaq 0xf13(%rip), %rdx       # 0x4010
leaq 0x150(%rsp), %rdi
movq %rbx, %rsi
callq 0x12a0
testb %al, %al
je 0x326c
leaq 0xd0(%rsp), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x1388
pushq $0x40
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1080
testl %eax, %eax
je 0x326c
leaq 0xf0b(%rip), %rsi       # 0x4050
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %r14, %rdx
callq 0x1567
pushq $0x40
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1080
testl %eax, %eax
je 0x326c
vmovups (%rbx), %ymm0
vmovups 0x20(%rbx), %ymm1
leaq 0x150(%rsp), %rbx
vmovups %ymm1, 0x20(%rbx)
vmovups %ymm0, (%rbx)
leaq 0xf01(%rip), %rax       # 0x4090
vmovups (%rax), %ymm0
vmovups 0x20(%rax), %ymm1
vmovups %ymm0, 0x70(%rsp)
vmovups %ymm0, 0x40(%rbx)
vmovups %ymm1, 0x50(%rsp)
vmovups %ymm1, 0x60(%rbx)
leaq 0x110(%rsp), %rbp
leaq 0x1028(%rip), %rax      # 0x41e5
vmovups (%rax), %ymm0
vmovups %ymm0, 0x30(%rsp)
leaq 0xd0(%rsp), %r14
vmovups 0x20(%rax), %ymm0
vmovups %ymm0, 0x10(%rsp)
pushq $0x4a
popq %r15
leaq 0x90(%rsp), %r12
leaq 0xf(%rsp), %r13
movq %r14, %rdi
vzeroupper
callq 0x2463
vmovups 0x50(%rsp), %ymm0
vmovups %ymm0, 0x20(%rbp)
vmovups 0x70(%rsp), %ymm0
vmovups %ymm0, (%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
vzeroupper
callq 0x26c4
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x26c4
vmovups 0x10(%rsp), %ymm0
vmovups %ymm0, 0xb0(%rsp)
vmovups 0x30(%rsp), %ymm0
vmovups %ymm0, 0x90(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
vzeroupper
callq 0x3282
testb %al, %al
je 0x31eb
movb 0xf(%rsp), %al
jmp 0x326e
xorl %eax, %eax
andb $0x1, %al
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ioerror[P]csidh-reference-implementation/csidh.c
// Function: csidh
__attribute__((visibility("default"))) bool csidh(public_key *out, public_key const *in, private_key const *priv)
{
    if (!validate(in)) {
        fp_random(&out->A);
        return false;
    }
    action(out, in, priv);
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
callq 0x30e2
movl %eax, %ebx
movq %r15, %rdi
testb %al, %al
je 0x397b
movq %r12, %rsi
movq %r14, %rdx
callq 0x34cf
jmp 0x3980
callq 0x2463
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ssse3/encrypt.c
// Function: crypto_aead_encrypt
int crypto_aead_encrypt(
    unsigned char *c, unsigned long long *clen,         // Ciphertext out
    const unsigned char *m, unsigned long long mlen,    // Plaintext in
    const unsigned char *ad, unsigned long long adlen,  // AAD in
    const unsigned char *nsec,                          // Secret Nonce in
    const unsigned char *npub,                          // Public Nonce in
    const unsigned char *k)                             // Secret Key in
{
    sbob_t  cb;                         // Local state

    sbob_clr(&cb);                      // Clear state

#if (CRYPTO_KEYBYTES > 0)
    // Secret Key
    sbob_put(&cb, BLNK_KEY, k, CRYPTO_KEYBYTES);
    sbob_fin(&cb, BLNK_KEY);
#endif

#if (CRYPTO_NPUBBYTES > 0)
    // Mix the public seq. number
    sbob_put(&cb, BLNK_NPUB, npub, CRYPTO_NPUBBYTES);
    sbob_fin(&cb, BLNK_NPUB);
#endif

#if (CRYPTO_NSECBYTES > 0)
    // Secret Sequence Number, store at start of c
    sbob_enc(&cb, BLNK_NSEC, c, nsec, CRYPTO_NSECBYTES);
    sbob_fin(&cb, BLNK_NSEC);
    c += CRYPTO_NSEC_BYTES:
#endif

    // Associated Data
    sbob_put(&cb, BLNK_AAD, ad, (size_t) adlen);
    sbob_fin(&cb, BLNK_AAD);

    // Encrypt Message
    sbob_enc(&cb, BLNK_MSG, c, m, (size_t) mlen);
    sbob_fin(&cb, BLNK_MSG);
    c += mlen;

#if (SBOB_MACSIZE > 0)
    sbob_get(&cb, BLNK_MAC, c, SBOB_MACSIZE);
    //sbob_fin(&cb, BLNK_MAC);          // Required if MAC-and-Continue
#endif
    sbob_clr(&cb);                      // Clear sensitive data

    *clen = mlen + CRYPTO_ABYTES;       // store length

    return 0;                           // Success.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %rbp
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, (%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x1050
pushq $0x10
popq %r13
pushq $0x18
popq %rcx
movq %r15, %rdi
movl %r13d, %esi
movq 0xa0(%rsp), %rdx
callq 0x10d0
movq %r15, %rdi
movl %r13d, %esi
callq 0x10b0
pushq $0x20
popq %r13
pushq $0x10
popq %rcx
movq %r15, %rdi
movl %r13d, %esi
movq 0x98(%rsp), %rdx
callq 0x10d0
movq %r15, %rdi
movl %r13d, %esi
callq 0x10b0
pushq $0x40
popq %r13
movq %r15, %rdi
movl %r13d, %esi
movq %r14, %rdx
movq %rbp, %rcx
callq 0x10d0
movq %r15, %rdi
movl %r13d, %esi
callq 0x10b0
pushq $0x50
popq %rbp
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq (%rsp), %rcx
movq %rbx, %r8
callq 0x1070
movq %r15, %rdi
movl %ebp, %esi
callq 0x10b0
addq %rbx, %r12
pushq $0x60
popq %rsi
movq %r15, %rdi
movq %r12, %rdx
pushq $0x10
popq %rcx
callq 0x1030
movq %r15, %rdi
callq 0x1050
addq $0x10, %rbx
movq 0x8(%rsp), %rax
movq %rbx, (%rax)
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ssse3/encrypt.c
// Function: crypto_aead_decrypt
int crypto_aead_decrypt(
    unsigned char *m, unsigned long long *outputmlen,   // Plaintext out
    unsigned char *nsec,                                // Secret Nonce out
    const unsigned char *c, unsigned long long clen,    // Ciphertext in
    const unsigned char *ad, unsigned long long adlen,  // AAD in
    const unsigned char *npub,                          // Public Nonce in
    const unsigned char *k)                             // Secret Key in
{
    sbob_t  cb;                         // Local state

    if (clen < CRYPTO_ABYTES)
        return -1;
    clen -= CRYPTO_ABYTES;

    sbob_clr(&cb);                      // Clear state

#if (CRYPTO_KEYBYTES > 0)
    // Secret Key
    sbob_put(&cb, BLNK_KEY, k, CRYPTO_KEYBYTES);
    sbob_fin(&cb, BLNK_KEY);
#endif

#if (CRYPTO_NPUBBYTES > 0)
    // Mix the public seq. number
    sbob_put(&cb, BLNK_NPUB, npub, CRYPTO_NPUBBYTES);
    sbob_fin(&cb, BLNK_NPUB);
#endif

#if (CRYPTO_NSECBYTES > 0)
    // Decrypt Secret Sequence Number, store at start of c
    sbob_dec(&cb, BLNK_NSEC, nsec, c, CRYPTO_NSECBYTES);
    sbob_fin(&cb, BLNK_NSEC);
    c += CRYPTO_NSEC_BYTES:
#endif

    // Associated Data
    sbob_put(&cb, BLNK_AAD, ad, (size_t) adlen);
    sbob_fin(&cb, BLNK_AAD);

    // Decrypt Message
    sbob_dec(&cb, BLNK_MSG, m, c, (size_t) clen);
    sbob_fin(&cb, BLNK_MSG);
    c += clen;

#if (SBOB_MACSIZE > 0)
    if (sbob_cmp(&cb, BLNK_MAC, c, SBOB_MACSIZE) != 0)
        return -1;                      // Authentication Failure
    //sbob_fin(&cb, BLNK_MAC);          // Required if MAC-and-Continue
#endif

    sbob_clr(&cb);                      // Clear sensitive data
    *outputmlen = clen;

    return 0;       // Success.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
pushq $-0x1
popq %rbp
cmpq $0x10, %r8
jb 0x13af
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rsi, 0x8(%rsp)
leaq -0x10(%r8), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %r13
movq %rdi, 0x18(%rsp)
movq %r13, %rdi
callq 0x1050
pushq $0x10
popq %rbx
pushq $0x18
popq %rcx
movq %r13, %rdi
movl %ebx, %esi
movq 0xb0(%rsp), %rdx
callq 0x10d0
movq %r13, %rdi
movl %ebx, %esi
callq 0x10b0
pushq $0x20
popq %rbx
pushq $0x10
popq %rcx
movq %r13, %rdi
movl %ebx, %esi
movq 0xa8(%rsp), %rdx
callq 0x10d0
movq %r13, %rdi
movl %ebx, %esi
callq 0x10b0
pushq $0x40
popq %rbx
movq %r13, %rdi
movl %ebx, %esi
movq %r14, %rdx
movq 0x10(%rsp), %r14
movq 0xa0(%rsp), %rcx
callq 0x10d0
movq %r13, %rdi
movl %ebx, %esi
callq 0x10b0
pushq $0x50
popq %rbx
movq %r13, %rdi
movl %ebx, %esi
movq 0x18(%rsp), %rdx
movq %r12, %rcx
movq %r14, %r8
callq 0x1040
movq %r13, %rdi
movl %ebx, %esi
callq 0x10b0
leaq (%r12,%r15), %rdx
addq $-0x10, %rdx
pushq $0x60
popq %rsi
movq %r13, %rdi
pushq $0x10
popq %rcx
callq 0x10c0
testl %eax, %eax
jne 0x13af
leaq 0x20(%rsp), %rdi
callq 0x1050
movq 0x8(%rsp), %rax
movq %r14, (%rax)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ssse3/stribob.c
// Function: sbob_clr
void sbob_clr(sbob_t *sb)
{
    int i;

    for (i = 0; i < 8; i++)
        sb->s.q[i] = 0;
    sb->l = 0;
}

// Assembly:
xorl %eax, %eax
cmpq $0x8, %rax
je 0x13d2
andq $0x0, (%rdi,%rax,8)
incq %rax
jmp 0x13c2
andl $0x0, 0x40(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ssse3/stribob.c
// Function: sbob_fin
void sbob_fin(sbob_t *sb, sbob_pad_t pad)
{
    // pad
    sb->s.b[sb->l] ^= BLNK_END;
    sb->s.b[SBOB_RATE] ^= pad | BLNK_FIN;

    // compress and zero the buffer
    SBOB_PI(&sb->s);
    sb->l = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0x40(%rdi), %rax
xorb $0x1, (%rdi,%rax)
orb $0x2, %sil
xorb %sil, 0x20(%rdi)
callq 0x1080
andl $0x0, 0x40(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ssse3/stribob.c
// Function: sbob_put
void sbob_put(sbob_t *sb, sbob_pad_t pad, const void *in, size_t len)
{
    int j;
    size_t i;

    j = sb->l;
    for (i = 0; i < len; i++) {
        if (j == SBOB_RATE) {
            sb->s.b[SBOB_RATE] ^= pad;
            SBOB_PI(&sb->s);
            j = 0;
        }
        sb->s.b[j++] ^= ((const uint8_t *) in)[i];
    }
    sb->l = j;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movl 0x40(%rdi), %eax
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x1439
cmpl $0x20, %eax
jne 0x1427
xorb %bpl, 0x20(%r15)
movq %r15, %rdi
callq 0x1080
xorl %eax, %eax
movb (%r14,%r12), %cl
movslq %eax, %rdx
incl %eax
xorb %cl, (%r15,%rdx)
incq %r12
jmp 0x140f
movl %eax, 0x40(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ssse3/stribob.c
// Function: sbob_get
void sbob_get(sbob_t *sb, sbob_pad_t pad, void *out, size_t len)
{
    int j;
    size_t i;

    j = sb->l;
    for (i = 0; i < len; i++) {
        if (j == SBOB_RATE) {
            sb->s.b[SBOB_RATE] ^= pad;
            SBOB_PI(&sb->s);
            j = 0;
        }
        ((uint8_t *) out)[i] = sb->s.b[j++];
    }
    sb->l = j;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movl 0x40(%rdi), %eax
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x1489
cmpl $0x20, %eax
jne 0x1477
xorb %bpl, 0x20(%r15)
movq %r15, %rdi
callq 0x1080
xorl %eax, %eax
movslq %eax, %rcx
incl %eax
movb (%r15,%rcx), %cl
movb %cl, (%r14,%r12)
incq %r12
jmp 0x145f
movl %eax, 0x40(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ssse3/stribob.c
// Function: sbob_cmp
int sbob_cmp(sbob_t *sb, sbob_pad_t pad, const void *in, size_t len)
{
    int j, d;
    size_t i;

    j = sb->l;
    d = 0;
    for (i = 0; i < len; i++) {
        if (j == SBOB_RATE) {
            sb->s.b[SBOB_RATE] ^= pad;
            SBOB_PI(&sb->s);
            j = 0;
        }
        if (d == 0)
            d = ((int) ((const uint8_t *) in)[i]) - ((int) sb->s.b[j]);
        j++;
    }
    sb->l = j;

    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movl 0x40(%rdi), %eax
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x14e9
cmpl $0x20, %eax
jne 0x14cd
xorb %bpl, 0x20(%r15)
movq %r15, %rdi
callq 0x1080
xorl %eax, %eax
testl %r12d, %r12d
jne 0x14e2
movzbl (%r14,%r13), %r12d
movslq %eax, %rcx
movzbl (%r15,%rcx), %ecx
subl %ecx, %r12d
incl %eax
incq %r13
jmp 0x14b5
movl %eax, 0x40(%r15)
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq