// File: /workspace/github_c_makefile_star2_O0/mcaimi[P]st/x.c
// Function: xloadsparefonts
void
xloadsparefonts(void)
{
  FcPattern *pattern;
  double sizeshift, fontval;
  spareFontList *spl = NULL;
  struct _spareFontInfo *fontItem = NULL;
  char *fp = NULL;

  if (frclen != 0)
    die("can't embed spare fonts. cache isn't empty");

  // bail out if no spare font is specified in Xresources
  spl = loadSpareFontList(spareFonts);
  if (spl == NULL) return;

  // allocate space for font cache
  if (frccap < 4 * spl->fontCount) {
    frccap += 4 * spl->fontCount - frccap;
    frc = xrealloc(frc, frccap * sizeof(Fontcache));
  }

  fontItem = spl->fonts;
  while (fontItem != NULL) {
    fp = fontItem->fontString;
    printf("Loading extra font %s, spec %d bytes wide, frccap %d\n", fp, strlen(fp), frccap);
    if (*fp == '-')
      pattern = XftXlfdParse(fp, False, False);
    else
      pattern = FcNameParse((FcChar8 *)fp);

    if (!pattern)
      die("can't open spare font %s\n", fp);

    if (defaultfontsize > 0) {
      sizeshift = usedfontsize - defaultfontsize;
      if (sizeshift != 0 && FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == FcResultMatch) {
        fontval += sizeshift;
        FcPatternDel(pattern, FC_PIXEL_SIZE);
        FcPatternDel(pattern, FC_SIZE);
        FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval);
      }
    }

    FcPatternAddBool(pattern, FC_SCALABLE, 1);

    FcConfigSubstitute(NULL, pattern, FcMatchPattern);
    XftDefaultSubstitute(xw.dpy, xw.scr, pattern);

    if (xloadsparefont(pattern, FRC_NORMAL))
      die("can't open spare font %s\n", fp);

    FcPatternDel(pattern, FC_SLANT);
    FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
    if (xloadsparefont(pattern, FRC_ITALIC))
      die("can't open spare font %s\n", fp);

    FcPatternDel(pattern, FC_WEIGHT);
    FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
    if (xloadsparefont(pattern, FRC_ITALICBOLD))
      die("can't open spare font %s\n", fp);

    FcPatternDel(pattern, FC_SLANT);
    FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
    if (xloadsparefont(pattern, FRC_BOLD))
      die("can't open spare font %s\n", fp);

    FcPatternDestroy(pattern);

    // next
    fontItem = fontItem->next;
  }

  fp = NULL;
  if (spl != NULL) {
    unloadSpareFontList(spl);
    spl = NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpl $0x0, 0x11d81(%rip)     # 0x24bc8
je 0x12e57
leaq 0x873e(%rip), %rdi      # 0x1b58e
movb $0x0, %al
callq 0x6c50
movq 0x11a22(%rip), %rdi     # 0x24880
callq 0xe8a0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x12e73
jmp 0x13160
movl 0x11d5f(%rip), %eax     # 0x24bd8
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
shll $0x2, %ecx
cmpl %ecx, %eax
jae 0x12ebf
movq -0x20(%rbp), %rax
movl (%rax), %eax
shll $0x2, %eax
subl 0x11d43(%rip), %eax     # 0x24bd8
addl 0x11d3d(%rip), %eax     # 0x24bd8
movl %eax, 0x11d37(%rip)     # 0x24bd8
movq 0x11d28(%rip), %rdi     # 0x24bd0
movslq 0x11d29(%rip), %rsi     # 0x24bd8
shlq $0x4, %rsi
callq 0x6d00
movq %rax, 0x11d11(%rip)     # 0x24bd0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x13140
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x63b0
movq -0x38(%rbp), %rsi
movq %rax, %rdx
movl 0x11cd9(%rip), %ecx     # 0x24bd8
leaq 0x86b3(%rip), %rdi      # 0x1b5b9
movb $0x0, %al
callq 0x60b0
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x12f2c
movq -0x30(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x67d0
movq %rax, -0x8(%rbp)
jmp 0x12f39
movq -0x30(%rbp), %rdi
callq 0x6a20
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x12f52
movq -0x30(%rbp), %rsi
leaq 0x86a4(%rip), %rdi      # 0x1b5ef
movb $0x0, %al
callq 0x6c50
movsd 0x11c8e(%rip), %xmm0    # 0x24be8
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x12fef
movsd 0x11c71(%rip), %xmm0    # 0x24be0
subsd 0x11c71(%rip), %xmm0    # 0x24be8
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x12f8e
jp 0x12f8e
jmp 0x12fed
movq -0x8(%rbp), %rdi
leaq 0x83d6(%rip), %rsi      # 0x1b36f
xorl %edx, %edx
leaq -0x18(%rbp), %rcx
callq 0x61c0
cmpl $0x0, %eax
jne 0x12fed
movsd -0x10(%rbp), %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x83ac(%rip), %rsi      # 0x1b36f
callq 0x6160
movq -0x8(%rbp), %rdi
leaq 0x83a1(%rip), %rsi      # 0x1b374
callq 0x6160
movq -0x8(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
leaq 0x8387(%rip), %rsi      # 0x1b36f
callq 0x6180
jmp 0x12fef
movq -0x8(%rbp), %rdi
leaq 0x8323(%rip), %rsi      # 0x1b31d
movl $0x1, %edx
callq 0x6690
movq -0x8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
xorl %edx, %edx
callq 0x68a0
movq 0x1196e(%rip), %rdi     # 0x24988
movl 0x11a88(%rip), %esi     # 0x24aa8
movq -0x8(%rbp), %rdx
callq 0x6710
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x135e0
cmpl $0x0, %eax
je 0x1304b
movq -0x30(%rbp), %rsi
leaq 0x85ab(%rip), %rdi      # 0x1b5ef
movb $0x0, %al
callq 0x6c50
movq -0x8(%rbp), %rdi
leaq 0x8323(%rip), %rsi      # 0x1b379
callq 0x6160
movq -0x8(%rbp), %rdi
leaq 0x8313(%rip), %rsi      # 0x1b379
movl $0x64, %edx
callq 0x6920
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x135e0
cmpl $0x0, %eax
je 0x13095
movq -0x30(%rbp), %rsi
leaq 0x8561(%rip), %rdi      # 0x1b5ef
movb $0x0, %al
callq 0x6c50
movq -0x8(%rbp), %rdi
leaq 0x82df(%rip), %rsi      # 0x1b37f
callq 0x6160
movq -0x8(%rbp), %rdi
leaq 0x82cf(%rip), %rsi      # 0x1b37f
movl $0xc8, %edx
callq 0x6920
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x135e0
cmpl $0x0, %eax
je 0x130df
movq -0x30(%rbp), %rsi
leaq 0x8517(%rip), %rdi      # 0x1b5ef
movb $0x0, %al
callq 0x6c50
movq -0x8(%rbp), %rdi
leaq 0x828f(%rip), %rsi      # 0x1b379
callq 0x6160
movq -0x8(%rbp), %rdi
leaq 0x827f(%rip), %rsi      # 0x1b379
xorl %edx, %edx
callq 0x6920
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x135e0
cmpl $0x0, %eax
je 0x13126
movq -0x30(%rbp), %rsi
leaq 0x84d0(%rip), %rdi      # 0x1b5ef
movb $0x0, %al
callq 0x6c50
movq -0x8(%rbp), %rdi
callq 0x6060
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x12ecb
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x13160
movq -0x20(%rbp), %rdi
callq 0xe860
movq $0x0, -0x20(%rbp)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)