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

  char *cmap=otf_get_table(otf,OTF_TAG('c','m','a','p'),&len);
  if (!cmap) {
    assert(len==-1);
    printf("No cmap table\n");
    return;
  }
  printf("cmap:\n");
  assert(get_USHORT(cmap)==0x0000); // version
  const int numTables=get_USHORT(cmap+2);
  printf("  numTables: %d\n",numTables);
  for (iA=0;iA<numTables;iA++) {
    const char *nrec=cmap+4+8*iA;
    const char *ndata=cmap+get_ULONG(nrec+4);
    assert(ndata>=cmap+4+8*numTables);
    printf("  platformID/encodingID: %d/%d\n"
           "  offset: %d  data (format: %d, length: %d, language: %d);\n",
           get_USHORT(nrec),get_USHORT(nrec+2),
           get_ULONG(nrec+4),
           get_USHORT(ndata),get_USHORT(ndata+2),get_USHORT(ndata+4));

    if (full) {
      int iB;
      const int format=get_USHORT(ndata);
      if (format==4) {
        const int segCountX2=get_USHORT(ndata+6);
        for (iB=0;iB<segCountX2;iB+=2) {
          const int start=get_USHORT(ndata+16+segCountX2+iB);
          const int delta=get_USHORT(ndata+16+2*segCountX2+iB);
          const int offset=get_USHORT(ndata+16+3*segCountX2+iB);
          printf("    [%x, %x]: delta: %d, offset: %d  ",
                 start,
                 get_USHORT(ndata+14+iB), // end
                 delta,offset);
          if (offset) {
            printf("(glyphIndex offset: ndata + %d + 2*(c - start))",
                   16+3*segCountX2+iB+offset);
          } else {
            printf("(gid of start: %d)",
                   (start+delta)%65536);
          }
          putchar('\n');
          // either  offset!=0: *( ndata+16+3*segCountX2+iB + offset + 2*(X-start) )
          // or: just add delta to X (mod 65536)
        }
        // ... glyphIndexArray from  ndata+16+4*segCountX2  up to  get_USHORT(ndata+2))
      } else if (format==6) {
        const int len=get_USHORT(ndata+8);
        printf("    subrange start char: %x, length: %d, glyph indices:\n",
               get_USHORT(ndata+6),len);
        for (iB=0;iB<len;iB++) {
          printf("%d ",get_USHORT(ndata+10+2*iB));
        }
        putchar('\n');
      }
    }
  }
  free(cmap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x187b
jmp 0x189a
leaq 0xa782(%rip), %rdi      # 0xc004
leaq 0xa77f(%rip), %rsi      # 0xc008
movl $0x67, %edx
leaq 0xa902(%rip), %rcx      # 0xc197
callq 0x1100
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl $0x636d6170, %esi       # imm = 0x636D6170
leaq -0x14(%rbp), %rdx
callq 0x3340
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x18f8
cmpl $-0x1, -0x14(%rbp)
jne 0x18c6
jmp 0x18e5
leaq 0xa765(%rip), %rdi      # 0xc032
leaq 0xa734(%rip), %rsi      # 0xc008
movl $0x6c, %edx
leaq 0xa8b7(%rip), %rcx      # 0xc197
callq 0x1100
leaq 0xa8cb(%rip), %rdi      # 0xc1b7
movb $0x0, %al
callq 0x1040
jmp 0x1c5a
leaq 0xa8c7(%rip), %rdi      # 0xc1c6
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
callq 0x1840
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0x1919
jmp 0x1938
leaq 0xa8ad(%rip), %rdi      # 0xc1cd
leaq 0xa6e1(%rip), %rsi      # 0xc008
movl $0x71, %edx
leaq 0xa864(%rip), %rcx      # 0xc197
callq 0x1100
movq -0x20(%rbp), %rdi
addq $0x2, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
leaq 0xa891(%rip), %rdi      # 0xc1e6
movb $0x0, %al
callq 0x1040
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1c51
movq -0x20(%rbp), %rax
addq $0x4, %rax
movl -0x10(%rbp), %ecx
shll $0x3, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
addq $0x4, %rdi
callq 0x14f0
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
addq $0x4, %rcx
movl -0x24(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jb 0x19ca
jmp 0x19e9
leaq 0xa826(%rip), %rdi      # 0xc1f7
leaq 0xa630(%rip), %rsi      # 0xc008
movl $0x77, %edx
leaq 0xa7b3(%rip), %rcx      # 0xc197
callq 0x1100
movq -0x30(%rbp), %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x74(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x70(%rbp)
movq -0x30(%rbp), %rdi
addq $0x4, %rdi
callq 0x14f0
movl %eax, -0x6c(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x68(%rbp)
movq -0x38(%rbp), %rdi
addq $0x2, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x64(%rbp)
movq -0x38(%rbp), %rdi
addq $0x4, %rdi
callq 0x1840
movl -0x74(%rbp), %esi
movl -0x70(%rbp), %edx
movl -0x6c(%rbp), %ecx
movl -0x68(%rbp), %r8d
movl -0x64(%rbp), %r9d
movzwl %ax, %eax
leaq 0xa7ac(%rip), %rdi      # 0xc211
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1040
cmpl $0x0, -0xc(%rbp)
je 0x1c41
movq -0x38(%rbp), %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x40(%rbp)
cmpl $0x4, -0x40(%rbp)
jne 0x1bb3
movq -0x38(%rbp), %rdi
addq $0x6, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x1bae
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
movslq -0x44(%rbp), %rax
addq %rax, %rdi
movslq -0x3c(%rbp), %rax
addq %rax, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
movl -0x44(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
movslq -0x3c(%rbp), %rax
addq %rax, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x4c(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
imull $0x3, -0x44(%rbp), %eax
cltq
addq %rax, %rdi
movslq -0x3c(%rbp), %rax
addq %rax, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x50(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x38(%rbp), %rdi
addq $0xe, %rdi
movslq -0x3c(%rbp), %rax
addq %rax, %rdi
callq 0x1840
movl -0x78(%rbp), %esi
movzwl %ax, %edx
movl -0x4c(%rbp), %ecx
movl -0x50(%rbp), %r8d
leaq 0xa71e(%rip), %rdi      # 0xc26c
movb $0x0, %al
callq 0x1040
cmpl $0x0, -0x50(%rbp)
je 0x1b78
imull $0x3, -0x44(%rbp), %esi
addl $0x10, %esi
addl -0x3c(%rbp), %esi
addl -0x50(%rbp), %esi
leaq 0xa723(%rip), %rdi      # 0xc292
movb $0x0, %al
callq 0x1040
jmp 0x1b96
movl -0x48(%rbp), %eax
addl -0x4c(%rbp), %eax
movl $0x10000, %ecx          # imm = 0x10000
cltd
idivl %ecx
movl %edx, %esi
leaq 0xa733(%rip), %rdi      # 0xc2c2
movb $0x0, %al
callq 0x1040
movl $0xa, %edi
callq 0x11d0
movl -0x3c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1aac
jmp 0x1c3f
cmpl $0x6, -0x40(%rbp)
jne 0x1c3d
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x1840
movzwl %ax, %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rdi
addq $0x6, %rdi
callq 0x1840
movzwl %ax, %esi
movl -0x54(%rbp), %edx
leaq 0xa6eb(%rip), %rdi      # 0xc2d5
movb $0x0, %al
callq 0x1040
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x1c33
movq -0x38(%rbp), %rdi
addq $0xa, %rdi
movl -0x3c(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x1840
movzwl %ax, %esi
leaq 0xa6ed(%rip), %rdi      # 0xc30e
movb $0x0, %al
callq 0x1040
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1bf8
movl $0xa, %edi
callq 0x11d0
jmp 0x1c3f
jmp 0x1c41
jmp 0x1c43
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1963
movq -0x20(%rbp), %rdi
callq 0x11a0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)