// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x85f5
jmp 0x8614
leaq 0x6f29(%rip), %rdi      # 0xf525
leaq 0x6a6d(%rip), %rsi      # 0xf070
movl $0x61, %edx
leaq 0x7062(%rip), %rcx      # 0xf671
callq 0x2100
movl $0x58, -0x34(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x865b
movq -0x10(%rbp), %rdi
callq 0x20a0
cmpq $0x6, %rax
jne 0x8633
jmp 0x8652
leaq 0x7096(%rip), %rdi      # 0xf6d0
leaq 0x6a2f(%rip), %rsi      # 0xf070
movl $0x66, %edx
leaq 0x7024(%rip), %rcx      # 0xf671
callq 0x2100
movl -0x34(%rbp), %eax
addl $0x7, %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
addq $0x1, %rcx
movslq -0x34(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x870c
movl -0x34(%rbp), %eax
addl $0xc, %eax
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x8691
jmp 0x86b0
leaq 0x704e(%rip), %rdi      # 0xf6e6
leaq 0x69d1(%rip), %rsi      # 0xf070
movl $0x6c, %edx
leaq 0x6fc6(%rip), %rcx      # 0xf671
callq 0x2100
cmpq $0x0, -0x20(%rbp)
je 0x86b9
jmp 0x86d8
leaq 0x7033(%rip), %rdi      # 0xf6f3
leaq 0x69a9(%rip), %rsi      # 0xf070
movl $0x6d, %edx
leaq 0x6f9e(%rip), %rcx      # 0xf671
callq 0x2100
movq -0x18(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
addq $0x1, %rcx
movslq -0x34(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
addq $0x1, %rcx
movslq -0x34(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rsi
movl $0x1, %edi
callq 0x2110
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x8773
movq 0xa8b4(%rip), %rax      # 0x12fe0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x2040
movl (%rax), %edi
callq 0x2070
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x5c0f(%rip), %rsi      # 0xe35c
movb $0x0, %al
callq 0x21e0
leaq 0x65a5(%rip), %rdi      # 0xed00
leaq 0x690e(%rip), %rsi      # 0xf070
movl $0x74, %edx
leaq 0x6f03(%rip), %rcx      # 0xf671
callq 0x2100
movl $0x0, -0x34(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x8789
movl -0x34(%rbp), %eax
addl $0xc, %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rcx
addq $0x54, %rcx
movslq -0x34(%rbp), %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
addq $0x1, %rcx
movslq -0x34(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x87ff
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movl $0x6, %edx
callq 0x20c0
movq -0x30(%rbp), %rax
movq (%rax), %rax
movb $0x2b, 0x6(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x7, %rdi
movq -0x8(%rbp), %rsi
callq 0x2140
movl -0x34(%rbp), %eax
addl $0x7, %eax
movl %eax, -0x34(%rbp)
jmp 0x880f
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x2140
movq -0x30(%rbp), %rax
movl $0x5a, 0x1c(%rax)
cmpl $0x0, -0x24(%rbp)
jl 0x88a8
movq -0x30(%rbp), %rcx
addq $0x54, %rcx
movslq -0x34(%rbp), %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x2140
movq -0x18(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
addq $0x1, %rcx
movslq -0x34(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rcx
addq $0x54, %rcx
movslq -0x34(%rbp), %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x2140
movq -0x18(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
addq $0x1, %rcx
movslq -0x34(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)