// File: /workspace/github_c_makefile_star2_O1/mcaimi[P]st/x.c
// Function: xloadfonts
void
xloadfonts(char *fontstr, double fontsize)
{
  FcPattern *pattern;
  double fontval;

  if (fontstr[0] == '-')
    pattern = XftXlfdParse(fontstr, False, False);
  else
    pattern = FcNameParse((FcChar8 *)fontstr);

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

  if (fontsize > 1) {
    FcPatternDel(pattern, FC_PIXEL_SIZE);
    FcPatternDel(pattern, FC_SIZE);
    FcPatternAddDouble(pattern, FC_PIXEL_SIZE, (double)fontsize);
    usedfontsize = fontsize;
  } else {
    if (FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) ==
        FcResultMatch) {
      usedfontsize = fontval;
    } else if (FcPatternGetDouble(pattern, FC_SIZE, 0, &fontval) ==
        FcResultMatch) {
      usedfontsize = -1;
    } else {
      /*
       * Default font size is 12, if none given. This is to
       * have a known usedfontsize value.
       */
      FcPatternAddDouble(pattern, FC_PIXEL_SIZE, 12);
      usedfontsize = 12;
    }
    defaultfontsize = usedfontsize;
  }

  if (xloadfont(&dc.font, pattern)) {
    die("can't open font %s\n", fontstr);
  }

  if (usedfontsize < 0) {
    FcPatternGetDouble(dc.font.match->pattern,
                       FC_PIXEL_SIZE, 0, &fontval);
    usedfontsize = fontval;
    if (fontsize == 0)
      defaultfontsize = fontval;
  }

  /* Setting character width and height. */
  win.cw = ceilf(dc.font.width * cwscale);
  win.ch = ceilf(dc.font.height * chscale);
  win.cyo = ceilf(dc.font.height * (chscale - 1) / 2);

  borderpx = ceilf(((float)borderperc / 100) * win.cw);

  FcPatternDel(pattern, FC_SLANT);
  if (!disableitalic)
    FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);

  if (xloadfont(&dc.ifont, pattern))
    die("can't open font %s\n", fontstr);

  FcPatternDel(pattern, FC_WEIGHT);
  if (!disablebold)
    FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
  if (xloadfont(&dc.ibfont, pattern))
    die("can't open font %s\n", fontstr);

  FcPatternDel(pattern, FC_SLANT);
  if (!disableroman)
    FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
  if (xloadfont(&dc.bfont, pattern))
    die("can't open font %s\n", fontstr);

  FcPatternDestroy(pattern);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movsd %xmm0, (%rsp)
movq %rdi, %rbx
cmpb $0x2d, (%rdi)
jne 0xdc3a
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x67c0
jmp 0xdc42
movq %rbx, %rdi
callq 0x6a20
movq %rax, %r14
testq %rax, %rax
movsd (%rsp), %xmm0
jne 0xdc65
leaq 0x9495(%rip), %rdi      # 0x170eb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x714f
movsd (%rsp), %xmm0
ucomisd 0x8feb(%rip), %xmm0     # 0x16c58
jbe 0xdcaf
leaq 0x9489(%rip), %r15      # 0x170ff
movq %r14, %rdi
movq %r15, %rsi
callq 0x6160
leaq 0x947c(%rip), %rsi      # 0x17104
movq %r14, %rdi
callq 0x6160
movq %r14, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x6180
movsd (%rsp), %xmm0
movsd %xmm0, 0x1318b(%rip)    # 0x20e38
jmp 0xdd24
leaq 0x9449(%rip), %rsi      # 0x170ff
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x61c0
testl %eax, %eax
je 0xdd04
leaq 0x9434(%rip), %rsi      # 0x17104
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x61c0
testl %eax, %eax
je 0xdd0c
leaq 0x9415(%rip), %rsi      # 0x170ff
movsd 0x8f76(%rip), %xmm0     # 0x16c68
movq %r14, %rdi
callq 0x6180
movsd 0x8f66(%rip), %xmm0     # 0x16c68
jmp 0xdd14
movsd 0x10(%rsp), %xmm0
jmp 0xdd14
movsd 0x8f4c(%rip), %xmm0     # 0x16c60
movsd %xmm0, 0x1311c(%rip)    # 0x20e38
movsd %xmm0, 0x1311c(%rip)    # 0x20e40
leaq 0x12db5(%rip), %rdi     # 0x20ae0
movq %r14, %rsi
callq 0xf281
testl %eax, %eax
je 0xdd48
leaq 0x93ad(%rip), %rdi      # 0x170eb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x714f
xorpd %xmm0, %xmm0
ucomisd 0x130e4(%rip), %xmm0    # 0x20e38
jbe 0xdd9d
movq 0x12da3(%rip), %rax     # 0x20b00
movq 0x18(%rax), %rdi
leaq 0x9397(%rip), %rsi      # 0x170ff
leaq 0x10(%rsp), %r15
xorl %edx, %edx
movq %r15, %rcx
callq 0x61c0
movsd (%r15), %xmm0
movsd %xmm0, 0x130b4(%rip)    # 0x20e38
movsd (%rsp), %xmm1
ucomisd 0x8edf(%rip), %xmm1     # 0x16c70
jne 0xdd9d
jp 0xdd9d
movsd %xmm0, 0x130a3(%rip)    # 0x20e40
xorps %xmm0, %xmm0
cvtsi2ssl 0x12d3c(%rip), %xmm0 # 0x20ae4
mulss 0x1007c(%rip), %xmm0    # 0x1de2c
callq 0x6810
movaps %xmm0, (%rsp)
cvttss2si %xmm0, %eax
xorps %xmm1, %xmm1
cvtsi2ssl 0x12d18(%rip), %xmm1 # 0x20ae0
movss %xmm1, 0x1c(%rsp)
movl %eax, 0x12f58(%rip)     # 0x20d2c
movss 0x10054(%rip), %xmm0    # 0x1de30
movss %xmm0, 0x18(%rsp)
mulss %xmm1, %xmm0
callq 0x6810
cvttss2si %xmm0, %eax
movss 0x18(%rsp), %xmm0
addss 0x8ea3(%rip), %xmm0     # 0x16ca0
movl %eax, 0x12f25(%rip)     # 0x20d28
mulss 0x1c(%rsp), %xmm0
mulss 0x8e93(%rip), %xmm0     # 0x16ca4
callq 0x6810
xorps %xmm1, %xmm1
cvtsi2ssl 0xf73f(%rip), %xmm1 # 0x1d560
cvttss2si %xmm0, %eax
divss 0x8e7b(%rip), %xmm1     # 0x16ca8
movl %eax, 0x12efd(%rip)     # 0x20d30
cvttps2dq (%rsp), %xmm0
cvtdq2ps %xmm0, %xmm0
mulss %xmm1, %xmm0
callq 0x6810
cvttss2si %xmm0, %eax
movl %eax, 0x12f92(%rip)     # 0x20de0
leaq 0x92b4(%rip), %rsi      # 0x17109
movq %r14, %rdi
callq 0x6160
cmpl $0x0, 0x12c20(%rip)     # 0x20a84
jne 0xde7a
leaq 0x929c(%rip), %rsi      # 0x17109
movq %r14, %rdi
movl $0x64, %edx
callq 0x6920
leaq 0x12ccf(%rip), %rdi     # 0x20b50
movq %r14, %rsi
callq 0xf281
testl %eax, %eax
je 0xde9e
leaq 0x9257(%rip), %rdi      # 0x170eb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x714f
leaq 0x926a(%rip), %rsi      # 0x1710f
movq %r14, %rdi
callq 0x6160
cmpl $0x0, 0x12bcc(%rip)     # 0x20a80
jne 0xdeca
leaq 0x9252(%rip), %rsi      # 0x1710f
movq %r14, %rdi
movl $0xc8, %edx
callq 0x6920
leaq 0x12cb7(%rip), %rdi     # 0x20b88
movq %r14, %rsi
callq 0xf281
testl %eax, %eax
je 0xdeee
leaq 0x9207(%rip), %rdi      # 0x170eb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x714f
leaq 0x9214(%rip), %rsi      # 0x17109
movq %r14, %rdi
callq 0x6160
cmpl $0x0, 0x12b84(%rip)     # 0x20a88
jne 0xdf17
leaq 0x91fc(%rip), %rsi      # 0x17109
movq %r14, %rdi
xorl %edx, %edx
callq 0x6920
leaq 0x12bfa(%rip), %rdi     # 0x20b18
movq %r14, %rsi
callq 0xf281
testl %eax, %eax
je 0xdf3b
leaq 0x91ba(%rip), %rdi      # 0x170eb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x714f
movq %r14, %rdi
callq 0x6060
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq