// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xa4b7(%rip), %rax      # 0xc3e4
movq %rax, -0x18(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x1f43
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x30d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1f59
jmp 0x1f78
leaq 0xa0a4(%rip), %rdi      # 0xc004
leaq 0xa0a1(%rip), %rsi      # 0xc008
movl $0xe5, %edx
leaq 0xa4a5(%rip), %rcx      # 0xc418
callq 0x1100
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x1f9e
movq -0x20(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0xa498(%rip), %rdi      # 0xc42f
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rax
cmpl $0x10000, 0x14(%rax)    # imm = 0x10000
jne 0x1fbb
leaq 0xa499(%rip), %rdi      # 0xc44b
movb $0x0, %al
callq 0x1040
jmp 0x2016
movq -0x20(%rbp), %rax
cmpl $0x4f54544f, 0x14(%rax) # imm = 0x4F54544F
jne 0x1fd8
leaq 0xa489(%rip), %rdi      # 0xc458
movb $0x0, %al
callq 0x1040
jmp 0x2014
movq -0x20(%rbp), %rax
cmpl $0x74727565, 0x14(%rax) # imm = 0x74727565
jne 0x1ff5
leaq 0xa47a(%rip), %rdi      # 0xc466
movb $0x0, %al
callq 0x1040
jmp 0x2012
movq -0x20(%rbp), %rax
cmpl $0x74797031, 0x14(%rax) # imm = 0x74797031
jne 0x2010
leaq 0xa46d(%rip), %rdi      # 0xc476
movb $0x0, %al
callq 0x1040
jmp 0x2012
jmp 0x2014
jmp 0x2016
movq -0x20(%rbp), %rax
movzwl 0x38(%rax), %esi
leaq 0xa462(%rip), %rdi      # 0xc487
movb $0x0, %al
callq 0x1040
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
movzwl 0x38(%rcx), %ecx
cmpl %ecx, %eax
jge 0x2109
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %esi
shrl $0x18, %esi
andl $0xff, %esi
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
shrl $0x10, %edx
andl $0xff, %edx
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rdi
imulq $0x14, %rdi, %rdi
addq %rdi, %rax
movl (%rax), %r8d
andl $0xff, %r8d
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rdi
imulq $0x14, %rdi, %rdi
addq %rdi, %rax
movl 0xc(%rax), %r9d
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rdi
imulq $0x14, %rdi, %rdi
addq %rdi, %rax
movl 0x8(%rax), %eax
leaq 0xa3a5(%rip), %rdi      # 0xc496
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1040
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2033
movq -0x20(%rbp), %rax
movzwl 0x48(%rax), %esi
movq -0x20(%rbp), %rax
movzwl 0x4a(%rax), %edx
leaq 0xa387(%rip), %rdi      # 0xc4a7
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rax
movzwl 0x4c(%rax), %esi
leaq 0xa397(%rip), %rdi      # 0xc4cd
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x4010
movq -0x20(%rbp), %rax
movzwl 0x58(%rax), %esi
leaq 0xa386(%rip), %rdi      # 0xc4dd
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
callq 0x4c50
movl %eax, %esi
leaq 0xa383(%rip), %rdi      # 0xc4f3
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
callq 0x1350
movq -0x20(%rbp), %rdi
callq 0x1590
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x1860
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
jne 0x21b6
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x1c70
movq -0x20(%rbp), %rdi
callq 0x1e00
movq -0x20(%rbp), %rdi
callq 0x27b0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq