// File: /workspace/github_c_makefile_star2_O3/smilingthax[P]libfontembed/test_analyze.c
// Function: main
int main(int argc,char **argv)
{
  const char *fn=TESTFONT;
  if (argc==2) {
    fn=argv[1];
  }
  OTF_FILE *otf=otf_load(fn);
  assert(otf);
  if (otf->numTTC) {
    printf("TTC has %d fonts, using %d\n",otf->numTTC,otf->useTTC);
  }
  if (otf->version==0x00010000) {
    printf("Got TTF 1.0\n");
  } else if (otf->version==OTF_TAG('O','T','T','O')) {
    printf("Got OTF(CFF)\n");
  } else if (otf->version==OTF_TAG('t','r','u','e')) {
    printf("Got TTF (true)\n");
  } else if (otf->version==OTF_TAG('t','y','p','1')) {
    printf("Got SFNT(Type1)\n");
  }

  printf("Has %d tables\n",otf->numTables);

  int iA;
  for (iA=0;iA<otf->numTables;iA++) {
    printf("%c%c%c%c %d @%d\n",OTF_UNTAG(otf->tables[iA].tag),otf->tables[iA].length,otf->tables[iA].offset);
  }
  printf("unitsPerEm: %d, indexToLocFormat: %d\n",
         otf->unitsPerEm,otf->indexToLocFormat);
  printf("num glyphs: %d\n",otf->numGlyphs);
  otf_get_width(otf,0); // load table.
  printf("numberOfHMetrics: %d\n",otf->numberOfHMetrics);

  printf("Embedding rights: %x\n",emb_otf_get_rights(otf));

  show_post(otf);

  show_name(otf);

  show_cmap(otf,1);
  // printf("%d %d\n",otf_from_unicode(otf,'A'),0);

  if (!(otf->flags&OTF_F_FMT_CFF)) {
    show_glyf(otf,1);
  }

  show_hmtx(otf);

  otf_close(otf);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0x2, %edi
jne 0x2771
movq 0x8(%rsi), %rdi
jmp 0x2778
leaq 0x6c16(%rip), %rdi      # 0x938e
callq 0x31de
testq %rax, %rax
je 0x290f
movq %rax, %rbx
movl 0xc(%rax), %esi
testl %esi, %esi
je 0x27a1
movl 0x10(%rbx), %edx
leaq 0x6c3f(%rip), %rdi      # 0x93d9
xorl %eax, %eax
callq 0x1040
movl 0x14(%rbx), %eax
cmpl $0x74727564, %eax       # imm = 0x74727564
jg 0x27c2
cmpl $0x10000, %eax          # imm = 0x10000
je 0x27d9
cmpl $0x4f54544f, %eax       # imm = 0x4F54544F
jne 0x27ee
leaq 0x6d24(%rip), %rdi      # 0x94e4
jmp 0x27e9
cmpl $0x74727565, %eax       # imm = 0x74727565
je 0x27e2
cmpl $0x74797031, %eax       # imm = 0x74797031
jne 0x27ee
leaq 0x6cee(%rip), %rdi      # 0x94c5
jmp 0x27e9
leaq 0x6d11(%rip), %rdi      # 0x94f1
jmp 0x27e9
leaq 0x6cec(%rip), %rdi      # 0x94d5
callq 0x11f0
movzwl 0x38(%rbx), %esi
leaq 0x6bfc(%rip), %rdi      # 0x93f5
xorl %eax, %eax
callq 0x1040
cmpw $0x0, 0x38(%rbx)
je 0x2864
movl $0xc, %r15d
movl $0xff, %ebp
leaq 0x6beb(%rip), %r14      # 0x9404
xorl %r12d, %r12d
movq 0x40(%rbx), %rax
movl -0xc(%rax,%r15), %r8d
movl -0x4(%rax,%r15), %edi
movl %r8d, %esi
shrl $0x18, %esi
movl %r8d, %edx
shrl $0x10, %edx
andl %ebp, %edx
movl %r8d, %ecx
shrl $0x8, %ecx
andl %ebp, %ecx
andl %ebp, %r8d
movl (%rax,%r15), %r9d
movl %edi, (%rsp)
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
incq %r12
movzwl 0x38(%rbx), %eax
addq $0x14, %r15
cmpq %rax, %r12
jb 0x281c
movzwl 0x48(%rbx), %esi
movzwl 0x4a(%rbx), %edx
leaq 0x6ba2(%rip), %rdi      # 0x9415
xorl %eax, %eax
callq 0x1040
movzwl 0x4c(%rbx), %esi
leaq 0x6bb6(%rip), %rdi      # 0x943b
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
xorl %esi, %esi
callq 0x39a6
movzwl 0x58(%rbx), %esi
leaq 0x6baa(%rip), %rdi      # 0x944b
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
callq 0x3ec0
leaq 0x6baa(%rip), %rdi      # 0x9461
movl %eax, %esi
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
callq 0x1e8c
movq %rbx, %rdi
callq 0x1fb9
movq %rbx, %rdi
movl $0x1, %esi
callq 0x21c8
testb $0x1, 0xa(%rbx)
jne 0x28f0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2524
movq %rbx, %rdi
callq 0x2681
movq %rbx, %rdi
callq 0x310c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x66ee(%rip), %rdi      # 0x9004
leaq 0x66eb(%rip), %rsi      # 0x9008
leaq 0x6a9e(%rip), %rcx      # 0x93c2
movl $0xe5, %edx
callq 0x10e0
nop