// File: /workspace/github_c_makefile_star2_O0/smilingthax[P]libfontembed/test_analyze.c
// Function: show_name
void show_name(OTF_FILE *otf) // {{{
{
  assert(otf);
  int iA,len=0;
  char *buf;

  buf=otf_get_table(otf,OTF_TAG('n','a','m','e'),&len);
  if (!buf) {
    assert(len==-1);
    printf("No name table\n");
    return;
  }
  printf("NAME:\n");
  int name_count=get_USHORT(buf+2);
  const char *nstore=buf+get_USHORT(buf+4);
  for (iA=0;iA<name_count;iA++) {
    const char *nrec=buf+6+12*iA;
    printf("  { platformID/encodingID/languageID/nameID: %d/%d/%d/%d\n"
           "    length: %d, offset: %d, data                       :",
           get_USHORT(nrec),
           get_USHORT(nrec+2),
           get_USHORT(nrec+4),
           get_USHORT(nrec+6),
           get_USHORT(nrec+8),
           get_USHORT(nrec+10));
    if (  (get_USHORT(nrec)==0)||
          ( (get_USHORT(nrec)==3) )  ) { // WCHAR
      int nlen=get_USHORT(nrec+8);
      int npos=get_USHORT(nrec+10);
      for (;nlen>0;nlen-=2,npos+=2) {
        if (nstore[npos]!=0x00) {
          printf("?");
        } else {
          printf("%c",nstore[npos+1]);
        }
      }
      printf(" }\n");
    } else {
      printf("%.*s }\n",
             get_USHORT(nrec+8),nstore+get_USHORT(nrec+10));
    }
  }
  free(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x15a5
jmp 0x15c4
leaq 0xaa58(%rip), %rdi      # 0xc004
leaq 0xaa55(%rip), %rsi      # 0xc008
movl $0x39, %edx
leaq 0xab28(%rip), %rcx      # 0xc0e7
callq 0x1100
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x6e616d65, %esi       # imm = 0x6E616D65
leaq -0x10(%rbp), %rdx
callq 0x3340
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1622
cmpl $-0x1, -0x10(%rbp)
jne 0x15f0
jmp 0x160f
leaq 0xaa3b(%rip), %rdi      # 0xc032
leaq 0xaa0a(%rip), %rsi      # 0xc008
movl $0x3f, %edx
leaq 0xaadd(%rip), %rcx      # 0xc0e7
callq 0x1100
leaq 0xaaec(%rip), %rdi      # 0xc102
movb $0x0, %al
callq 0x1040
jmp 0x1838
leaq 0xaae8(%rip), %rdi      # 0xc111
movb $0x0, %al
callq 0x1040
movq -0x18(%rbp), %rdi
addq $0x2, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
addq $0x4, %rdi
callq 0x1840
movw %ax, %cx
movq -0x40(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x182f
movq -0x18(%rbp), %rax
addq $0x6, %rax
imull $0xc, -0xc(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
addq $0x4, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rdi
addq $0x6, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
addq $0xa, %rdi
callq 0x1840
movl -0x54(%rbp), %esi
movl -0x50(%rbp), %edx
movl -0x4c(%rbp), %ecx
movl -0x48(%rbp), %r8d
movl -0x44(%rbp), %r9d
movzwl %ax, %eax
leaq 0xaa00(%rip), %rdi      # 0xc118
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1040
movq -0x30(%rbp), %rdi
callq 0x1840
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x1748
movq -0x30(%rbp), %rdi
callq 0x1840
movzwl %ax, %eax
cmpl $0x3, %eax
jne 0x17da
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
addq $0xa, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x34(%rbp)
jle 0x17ca
movq -0x28(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1795
leaq 0xa9fe(%rip), %rdi      # 0xc18a
movb $0x0, %al
callq 0x1040
jmp 0x17b4
movq -0x28(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %esi
leaq 0xa9df(%rip), %rdi      # 0xc18c
movb $0x0, %al
callq 0x1040
jmp 0x17b6
movl -0x34(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x38(%rbp)
jmp 0x176e
leaq 0xa9c2(%rip), %rdi      # 0xc193
movb $0x0, %al
callq 0x1040
jmp 0x181f
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
addq $0xa, %rdi
callq 0x1840
movq -0x60(%rbp), %rdx
movl -0x58(%rbp), %esi
movzwl %ax, %eax
cltq
addq %rax, %rdx
leaq 0xa977(%rip), %rdi      # 0xc18f
movb $0x0, %al
callq 0x1040
jmp 0x1821
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1673
movq -0x18(%rbp), %rdi
callq 0x11a0
addq $0x70, %rsp
popq %rbp
retq
nop