// File: /workspace/github_c_makefile_star2_O2/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 0x2c37
movq 0x8(%rsi), %rdi
jmp 0x2c3e
leaq 0x6750(%rip), %rdi      # 0x938e
callq 0x3859
testq %rax, %rax
je 0x2dc3
movq %rax, %rbx
movl 0xc(%rax), %esi
testl %esi, %esi
je 0x2c67
movl 0x10(%rbx), %edx
leaq 0x6779(%rip), %rdi      # 0x93d9
xorl %eax, %eax
callq 0x2040
movl 0x14(%rbx), %eax
cmpl $0x10000, %eax          # imm = 0x10000
je 0x2ca1
cmpl $0x74797031, %eax       # imm = 0x74797031
je 0x2c8f
cmpl $0x74727565, %eax       # imm = 0x74727565
je 0x2c98
cmpl $0x4f54544f, %eax       # imm = 0x4F54544F
jne 0x2cad
leaq 0x6857(%rip), %rdi      # 0x94e4
jmp 0x2ca8
leaq 0x682f(%rip), %rdi      # 0x94c5
jmp 0x2ca8
leaq 0x6836(%rip), %rdi      # 0x94d5
jmp 0x2ca8
leaq 0x6849(%rip), %rdi      # 0x94f1
callq 0x2200
movzwl 0x38(%rbx), %esi
leaq 0x673d(%rip), %rdi      # 0x93f5
xorl %eax, %eax
callq 0x2040
pushq $0xc
popq %r15
movl $0xff, %ebp
leaq 0x6735(%rip), %r14      # 0x9404
xorl %r12d, %r12d
movzwl 0x38(%rbx), %eax
cmpq %rax, %r12
jae 0x2d1c
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 0x2040
incq %r12
addq $0x14, %r15
jmp 0x2cd2
movzwl 0x48(%rbx), %esi
movzwl 0x4a(%rbx), %edx
leaq 0x66ea(%rip), %rdi      # 0x9415
xorl %eax, %eax
callq 0x2040
movzwl 0x4c(%rbx), %esi
leaq 0x66fe(%rip), %rdi      # 0x943b
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4201
movzwl 0x58(%rbx), %esi
leaq 0x66f2(%rip), %rdi      # 0x944b
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
callq 0x4744
leaq 0x66f2(%rip), %rdi      # 0x9461
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
callq 0x237c
movq %rbx, %rdi
callq 0x24ee
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x26ce
testb $0x1, 0xa(%rbx)
jne 0x2da4
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a17
movq %rbx, %rdi
callq 0x2b60
movq %rbx, %rdi
callq 0x3772
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x623a(%rip), %rdi      # 0x9004
leaq 0x6237(%rip), %rsi      # 0x9008
leaq 0x65ea(%rip), %rcx      # 0x93c2
movl $0xe5, %edx
callq 0x20f0
nop