// File: /workspace/github_c_makefile_star2_O1/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 0x274d
movq 0x8(%rsi), %rdi
jmp 0x2754
leaq 0x6c3a(%rip), %rdi      # 0x938e
callq 0x31a7
testq %rax, %rax
je 0x28eb
movq %rax, %rbx
movl 0xc(%rax), %esi
testl %esi, %esi
je 0x277d
movl 0x10(%rbx), %edx
leaq 0x6c63(%rip), %rdi      # 0x93d9
xorl %eax, %eax
callq 0x1040
movl 0x14(%rbx), %eax
cmpl $0x74727564, %eax       # imm = 0x74727564
jg 0x279e
cmpl $0x10000, %eax          # imm = 0x10000
je 0x27b5
cmpl $0x4f54544f, %eax       # imm = 0x4F54544F
jne 0x27ca
leaq 0x6d48(%rip), %rdi      # 0x94e4
jmp 0x27c5
cmpl $0x74727565, %eax       # imm = 0x74727565
je 0x27be
cmpl $0x74797031, %eax       # imm = 0x74797031
jne 0x27ca
leaq 0x6d12(%rip), %rdi      # 0x94c5
jmp 0x27c5
leaq 0x6d35(%rip), %rdi      # 0x94f1
jmp 0x27c5
leaq 0x6d10(%rip), %rdi      # 0x94d5
callq 0x11f0
movzwl 0x38(%rbx), %esi
leaq 0x6c20(%rip), %rdi      # 0x93f5
xorl %eax, %eax
callq 0x1040
cmpw $0x0, 0x38(%rbx)
je 0x2840
movl $0xc, %r15d
movl $0xff, %ebp
leaq 0x6c0f(%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 0x27f8
movzwl 0x48(%rbx), %esi
movzwl 0x4a(%rbx), %edx
leaq 0x6bc6(%rip), %rdi      # 0x9415
xorl %eax, %eax
callq 0x1040
movzwl 0x4c(%rbx), %esi
leaq 0x6bda(%rip), %rdi      # 0x943b
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
xorl %esi, %esi
callq 0x39b0
movzwl 0x58(%rbx), %esi
leaq 0x6bce(%rip), %rdi      # 0x944b
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
callq 0x3ecc
leaq 0x6bce(%rip), %rdi      # 0x9461
movl %eax, %esi
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
callq 0x1e7c
movq %rbx, %rdi
callq 0x1fa9
movq %rbx, %rdi
movl $0x1, %esi
callq 0x21b8
testb $0x1, 0xa(%rbx)
jne 0x28cc
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2514
movq %rbx, %rdi
callq 0x266c
movq %rbx, %rdi
callq 0x30d8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6712(%rip), %rdi      # 0x9004
leaq 0x670f(%rip), %rsi      # 0x9008
leaq 0x6ac2(%rip), %rcx      # 0x93c2
movl $0xe5, %edx
callq 0x10e0
nop