// File: /workspace/github_c_makefile_star2_O3/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
testq %rdi, %rdi
je 0x6bfa
movl %r8d, %ebx
movq %rsi, %rbp
movq %rdi, %r12
movq %rdx, 0x10(%rsp)
testq %rsi, %rsi
movq %rcx, 0x8(%rsp)
je 0x6acd
movq %rbp, %rdi
callq 0x2090
movl $0x5f, %r14d
cmpq $0x6, %rax
je 0x6ad3
leaq 0x4bd3(%rip), %rdi      # 0xb688
leaq 0x456c(%rip), %rsi      # 0xb028
leaq 0x4b66(%rip), %rcx      # 0xb629
movl $0x66, %edx
callq 0x20e0
movl $0x58, %r14d
movq %r12, %rdi
callq 0x2090
movq %rax, %r13
leaq (%rax,%r14), %r15
incq %r15
testl %ebx, %ebx
js 0x6b27
movl %ebx, 0x4(%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6c1e
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
je 0x6c3d
callq 0x2090
movq %rax, %r14
movq %rbx, %rdi
callq 0x2090
addq %r14, %r15
addq %rax, %r15
addq $0xe, %r15
movl 0x4(%rsp), %ebx
movslq %r15d, %rsi
movl $0x1, %edi
callq 0x20f0
testq %rax, %rax
je 0x6c19
movq %rax, %r14
incq %r13
xorl %eax, %eax
testl %ebx, %ebx
movl $0xc, %ecx
cmovsq %rax, %rcx
addq %rcx, %r13
leaq (%r14,%rcx), %r15
addq $0x54, %r15
movq %r15, (%r14)
testq %rbp, %rbp
je 0x6b8d
movl $0x6, %edx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x20a0
movb $0x2b, 0x6(%r15)
addq $0x7, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x2120
addq $0x7, %r13
jmp 0x6b98
movq %r15, %rdi
movq %r12, %rsi
callq 0x2120
movl $0x5a, 0x1c(%r14)
testl %ebx, %ebx
js 0x6be4
movq %r14, %r15
addq $0x54, %r15
movslq %r13d, %r12
leaq (%r15,%r12), %rdi
movq %rdi, 0x40(%r14)
movq 0x10(%rsp), %r13
movq %r13, %rsi
callq 0x2120
movq %r13, %rdi
callq 0x2090
addl %r12d, %eax
incl %eax
movslq %eax, %rdi
addq %r15, %rdi
movq %rdi, 0x48(%r14)
movq 0x8(%rsp), %rsi
callq 0x2120
movl %ebx, 0x50(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x48dc(%rip), %rdi      # 0xb4dd
leaq 0x4420(%rip), %rsi      # 0xb028
leaq 0x4a1a(%rip), %rcx      # 0xb629
movl $0x61, %edx
callq 0x20e0
callq 0x2c09
leaq 0x4a79(%rip), %rdi      # 0xb69e
leaq 0x43fc(%rip), %rsi      # 0xb028
leaq 0x49f6(%rip), %rcx      # 0xb629
movl $0x6c, %edx
callq 0x20e0
leaq 0x4a67(%rip), %rdi      # 0xb6ab
leaq 0x43dd(%rip), %rsi      # 0xb028
leaq 0x49d7(%rip), %rcx      # 0xb629
movl $0x6d, %edx
callq 0x20e0