// File: /workspace/github_c_makefile_star2_O0/smilingthax[P]libfontembed/embed_pdf.c
// Function: emb_pdf_simple_cidfont
char *emb_pdf_simple_cidfont(EMB_PARAMS *emb,const char *fontname,int descendant_obj_ref) // {{{ - to be freed by user
{
  assert(emb);
  assert(fontname);

  char *ret=NULL,*pos;
  int len,size;

  size=250;
  pos=ret=malloc(size);
  if (!ret) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    return NULL;
  }
     // for CFF: one of:
     // UniGB-UCS2-H, UniCNS-UCS2-H, UniJIS-UCS2-H, UniKS-UCS2-H
  const char *encoding="Identity-H",*addenc="-";
  if (emb->outtype==EMB_FMT_TTF) { // !=CidType0
    addenc="";
  }

  len=snprintf(pos,size,
               "<</Type /Font\n"
               "  /Subtype /Type0\n"
               "  /BaseFont /%s%s%s\n"
               "  /Encoding /%s\n"
               "  /DescendantFonts [%d 0 R]\n",
//               "  /ToUnicode ?\n" // TODO
               emb_pdf_escape_name(fontname,-1),
               addenc,((addenc[0])?encoding:""),
               encoding,
               descendant_obj_ref);
  NEXT;

  len=snprintf(pos,size,">>\n");
  NEXT;

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x99ef
jmp 0x9a0e
leaq 0x48de(%rip), %rdi      # 0xe2d4
leaq 0x5673(%rip), %rsi      # 0xf070
movl $0x212, %edx            # imm = 0x212
leaq 0x5ade(%rip), %rcx      # 0xf4e7
callq 0x2100
cmpq $0x0, -0x18(%rbp)
je 0x9a17
jmp 0x9a36
leaq 0x5b07(%rip), %rdi      # 0xf525
leaq 0x564b(%rip), %rsi      # 0xf070
movl $0x213, %edx            # imm = 0x213
leaq 0x5ab6(%rip), %rcx      # 0xf4e7
callq 0x2100
movq $0x0, -0x28(%rbp)
movl $0xfa, -0x38(%rbp)
movslq -0x38(%rbp), %rdi
callq 0x21d0
movq %rax, -0x28(%rbp)
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x9a99
movq 0x957c(%rip), %rax      # 0x12fe0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x2040
movl (%rax), %edi
callq 0x2070
movq -0x50(%rbp), %rdi
movq %rax, %rdx
leaq 0x48d7(%rip), %rsi      # 0xe35c
movb $0x0, %al
callq 0x21e0
movq $0x0, -0x8(%rbp)
jmp 0x9bf8
leaq 0x5a8e(%rip), %rax      # 0xf52e
movq %rax, -0x40(%rbp)
leaq 0x5a8e(%rip), %rax      # 0xf539
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jne 0x9ac4
leaq 0x4a8a(%rip), %rax      # 0xe54a
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
movslq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x9450
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x9b04
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x9b11
leaq 0x4a3f(%rip), %rax      # 0xe54a
movq %rax, -0x78(%rbp)
jmp 0x9b11
movq -0x58(%rbp), %r8
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %r9
movq -0x40(%rbp), %r10
movl -0x1c(%rbp), %eax
leaq 0x5a08(%rip), %rdx      # 0xf53b
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x2220
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x9b53
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jl 0x9b72
leaq 0x51a6(%rip), %rdi      # 0xed00
leaq 0x550f(%rip), %rsi      # 0xf070
movl $0x230, %edx            # imm = 0x230
leaq 0x597a(%rip), %rcx      # 0xf4e7
callq 0x2100
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %ecx
movl -0x38(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x38(%rbp), %rsi
leaq 0x57d1(%rip), %rdx      # 0xf36e
movb $0x0, %al
callq 0x2220
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x9bb5
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jl 0x9bd4
leaq 0x5144(%rip), %rdi      # 0xed00
leaq 0x54ad(%rip), %rsi      # 0xf070
movl $0x233, %edx            # imm = 0x233
leaq 0x5918(%rip), %rcx      # 0xf4e7
callq 0x2100
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %ecx
movl -0x38(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)