// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/embed_pdf.c
// Function: emb_pdf_fd_new
static EMB_PDF_FONTDESCR *emb_pdf_fd_new(const char *fontname,
                                  const char *subset_tag,
                                  const char *cid_registry, // or supplement==-1
                                  const char *cid_ordering, // or supplement==-1
                                  int cid_supplement) // -1 for non-cid
{
  assert(fontname);
  EMB_PDF_FONTDESCR *ret;

  int len=sizeof(EMB_PDF_FONTDESCR);
  if (subset_tag) {
    assert(strlen(subset_tag)==6);
    len+=7;
  }
  len+=strlen(fontname)+1;
  if (cid_supplement>=0) { // cid font
    len+=12; // space for panose
    assert(cid_registry);
    assert(cid_ordering);
    len+=strlen(cid_registry)+1;
    len+=strlen(cid_ordering)+1;
  }
  ret=calloc(1,len);
  if (!ret) {
    fprintf(stderr,"Bad alloc: %s\n", strerror(errno));
    assert(0);
    return NULL;
  }

  // now fill the struct
  len=0;
  if (cid_supplement>=0) { // free space for panose is at beginning
    len+=12;
  }
  ret->fontname=ret->data+len;
  len+=strlen(fontname)+1;
  if (subset_tag) {
    strncpy(ret->fontname,subset_tag,6);
    ret->fontname[6]='+';
    strcpy(ret->fontname+7,fontname);
    len+=7;
  } else {
    strcpy(ret->fontname,fontname);
  }
  ret->italicAngle=90;
  if (cid_supplement>=0) {
    ret->registry=ret->data+len;
    strcpy(ret->registry,cid_registry);
    len+=strlen(cid_registry)+1;

    ret->ordering=ret->data+len;
    strcpy(ret->ordering,cid_ordering);
    len+=strlen(cid_registry)+1;
  }
  ret->supplement=cid_supplement;

  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, (%rsp)
testq %rdi, %rdi
je 0x62f7
movl %r8d, %ebx
movq %rsi, %rbp
movq %rdi, %r12
testq %rsi, %rsi
movq %rcx, 0x10(%rsp)
je 0x61d2
movq %rbp, %rdi
callq 0x2090
cmpq $0x6, %rax
jne 0x6356
pushq $0x5f
jmp 0x61d4
pushq $0x58
popq %r14
movq %r12, %rdi
callq 0x2090
movq %rax, %r13
leaq (%rax,%r14), %r15
incq %r15
testl %ebx, %ebx
js 0x622b
movl %ebx, 0xc(%rsp)
cmpq $0x0, (%rsp)
je 0x636f
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x6388
movq (%rsp), %rdi
callq 0x2090
movq %rax, %r14
movq %rbx, %rdi
callq 0x2090
addq %r14, %r15
addq %rax, %r15
addq $0xe, %r15
movl 0xc(%rsp), %ebx
movslq %r15d, %rsi
pushq $0x1
popq %rdi
callq 0x2100
testq %rax, %rax
je 0x6313
movq %rax, %r14
incq %r13
xorl %eax, %eax
testl %ebx, %ebx
pushq $0xc
popq %rcx
cmovsq %rax, %rcx
addq %rcx, %r13
leaq (%r14,%rcx), %r15
addq $0x54, %r15
movq %r15, (%r14)
testq %rbp, %rbp
je 0x628b
pushq $0x6
popq %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x20b0
movb $0x2b, 0x6(%r15)
addq $0x7, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x2130
addq $0x7, %r13
jmp 0x6296
movq %r15, %rdi
movq %r12, %rsi
callq 0x2130
movl $0x5a, 0x1c(%r14)
testl %ebx, %ebx
js 0x62e1
movq %r14, %r15
addq $0x54, %r15
movslq %r13d, %r12
leaq (%r15,%r12), %rdi
movq %rdi, 0x40(%r14)
movq (%rsp), %r13
movq %r13, %rsi
callq 0x2130
movq %r13, %rdi
callq 0x2090
addl %r12d, %eax
incl %eax
movslq %eax, %rdi
addq %r15, %rdi
movq %rdi, 0x48(%r14)
movq 0x10(%rsp), %rsi
callq 0x2130
movl %ebx, 0x50(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x51df(%rip), %rdi      # 0xb4dd
leaq 0x4d23(%rip), %rsi      # 0xb028
leaq 0x531d(%rip), %rcx      # 0xb629
pushq $0x61
jmp 0x639f
movq 0x8cc6(%rip), %rax      # 0xefe0
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x2070
leaq 0x4029(%rip), %rsi      # 0xa359
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21e0
leaq 0x497c(%rip), %rdi      # 0xacc0
leaq 0x4cdd(%rip), %rsi      # 0xb028
leaq 0x52d7(%rip), %rcx      # 0xb629
pushq $0x74
jmp 0x639f
leaq 0x532b(%rip), %rdi      # 0xb688
leaq 0x4cc4(%rip), %rsi      # 0xb028
leaq 0x52be(%rip), %rcx      # 0xb629
pushq $0x66
jmp 0x639f
leaq 0x5328(%rip), %rdi      # 0xb69e
leaq 0x4cab(%rip), %rsi      # 0xb028
leaq 0x52a5(%rip), %rcx      # 0xb629
pushq $0x6c
jmp 0x639f
leaq 0x531c(%rip), %rdi      # 0xb6ab
leaq 0x4c92(%rip), %rsi      # 0xb028
leaq 0x528c(%rip), %rcx      # 0xb629
pushq $0x6d
popq %rdx
callq 0x20f0