// File: /workspace/github_c_makefile_star2_O0/smilingthax[P]libfontembed/test_cff.c
// Function: main
int main(int argc,char **argv)
{
  FILE *f;
  const char *fn="ee.cff";

  if (argc==2) {
    fn=argv[1];
  }

  if ((f=fopen(fn,"rb"))==NULL) {
    fprintf(stderr,"Could not open font: %m\n");
    return 1;
  }

  CFF_FILE *cff;
  if (is_sfnt_cff(f)) {
    OTF_FILE *otf=otf_load2(f,-1);
    assert(otf);

    int len;
    char *buf=otf_get_table(otf,OTF_TAG('C','F','F',' '),&len);
    otf_close(otf);
    assert(buf);

    cff=cff_load2(buf,len,1);
  } else {
    cff=cff_load_file(f);
    fclose(f);
  }
  assert(cff);

  dump_name_index(cff);
//  dump_string_index(cff);
// ...

  assert(cff->nameIndex.count>0);
  struct _CFF_DICT *dict=cff_read_dict(
    cff_index_get(&cff->topDictIndex,0),
    cff_index_length(&cff->topDictIndex,0));
  assert(dict);
  dump_dict(cff,dict);

  cff_close(cff);

//  test_ints();
//  test_real(100000000.);
//  test_real(-2.25);
//  test_real(1.140541e-05);

//  printf("%d",cff_find_stdstr("a"));

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x571e(%rip), %rax      # 0xa1cb
movq %rax, -0x20(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x4ac3
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x5704(%rip), %rsi      # 0xa1d2
callq 0x4140
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x4b01
movq 0xa4fc(%rip), %rax      # 0xefe0
movq (%rax), %rdi
leaq 0x56e7(%rip), %rsi      # 0xa1d5
movb $0x0, %al
callq 0x4190
movl $0x1, -0x4(%rbp)
jmp 0x4c97
movq -0x18(%rbp), %rdi
callq 0x49f0
cmpl $0x0, %eax
je 0x4bac
movq -0x18(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5030
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x4b2e
jmp 0x4b4d
leaq 0x56b9(%rip), %rdi      # 0xa1ee
leaq 0x557c(%rip), %rsi      # 0xa0b8
movl $0xdf, %edx
leaq 0x56aa(%rip), %rcx      # 0xa1f2
callq 0x40d0
movq -0x30(%rbp), %rdi
movl $0x43464620, %esi       # imm = 0x43464620
leaq -0x34(%rbp), %rdx
callq 0x5e10
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5280
cmpq $0x0, -0x40(%rbp)
je 0x4b75
jmp 0x4b94
leaq 0x568d(%rip), %rdi      # 0xa209
leaq 0x5535(%rip), %rsi      # 0xa0b8
movl $0xe4, %edx
leaq 0x5663(%rip), %rcx      # 0xa1f2
callq 0x40d0
movq -0x40(%rbp), %rdi
movslq -0x34(%rbp), %rsi
movl $0x1, %edx
callq 0x8580
movq %rax, -0x28(%rbp)
jmp 0x4bc2
movq -0x18(%rbp), %rdi
callq 0x8980
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4110
cmpq $0x0, -0x28(%rbp)
je 0x4bcb
jmp 0x4bea
leaq 0x55fc(%rip), %rdi      # 0xa1ce
leaq 0x54df(%rip), %rsi      # 0xa0b8
movl $0xeb, %edx
leaq 0x560d(%rip), %rcx      # 0xa1f2
callq 0x40d0
movq -0x28(%rbp), %rdi
callq 0x4450
movq -0x28(%rbp), %rax
movzwl 0x20(%rax), %eax
cmpl $0x0, %eax
jle 0x4c02
jmp 0x4c21
leaq 0x5604(%rip), %rdi      # 0xa20d
leaq 0x54a8(%rip), %rsi      # 0xa0b8
movl $0xf1, %edx
leaq 0x55d6(%rip), %rcx      # 0xa1f2
callq 0x40d0
movq -0x28(%rbp), %rdi
addq $0x38, %rdi
xorl %esi, %esi
callq 0x4550
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
addq $0x38, %rdi
xorl %esi, %esi
callq 0x44f0
movq -0x50(%rbp), %rdi
movl %eax, %esi
callq 0x8130
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x4c5b
jmp 0x4c7a
leaq 0x55c2(%rip), %rdi      # 0xa224
leaq 0x544f(%rip), %rsi      # 0xa0b8
movl $0xf5, %edx
leaq 0x557d(%rip), %rcx      # 0xa1f2
callq 0x40d0
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4950
movq -0x28(%rbp), %rdi
callq 0x88e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq