// File: /workspace/github_c_makefile_star2_O1/jaimecgomezz[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);
  // >>>>>>>>>>>>>>>>>>>> vertcenter
  // ==================== vertcenter
  // ==================== vertcenter
  // <<<<<<<<<<<<<<<<<<<< vertcenter

  // >>>>>>>>>>>>>>>>>>>> relative-border
  // ==================== relative-border
  // ==================== relative-border
  // <<<<<<<<<<<<<<<<<<<< relative-border

  FcPatternDel(pattern, FC_SLANT);
  // >>>>>>>>>>>>>>>>>>>> disable-bold-italic-fonts
  // ==================== disable-bold-italic-fonts
  FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
  // ==================== disable-bold-italic-fonts
  // <<<<<<<<<<<<<<<<<<<< disable-bold-italic-fonts
  if (xloadfont(&dc.ifont, pattern))
    die("can't open font %s\n", fontstr);

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

  FcPatternDel(pattern, FC_SLANT);
  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 $0x10, %rsp
movsd %xmm0, (%rsp)
movq %rdi, %rbx
cmpb $0x2d, (%rdi)
jne 0xbe6a
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x56f0
jmp 0xbe72
movq %rbx, %rdi
callq 0x58c0
movq %rax, %r14
testq %rax, %rax
movsd (%rsp), %xmm0
jne 0xbe95
leaq 0x2fb5(%rip), %rdi      # 0xee3b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e66
movsd (%rsp), %xmm0
ucomisd 0x2bfb(%rip), %xmm0     # 0xea98
jbe 0xbedf
leaq 0x2fa9(%rip), %r15      # 0xee4f
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
leaq 0x2f9c(%rip), %rsi      # 0xee54
movq %r14, %rdi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x5160
movsd (%rsp), %xmm0
movsd %xmm0, 0xbf83(%rip)     # 0x17e60
jmp 0xbf54
leaq 0x2f69(%rip), %rsi      # 0xee4f
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5190
testl %eax, %eax
je 0xbf34
leaq 0x2f54(%rip), %rsi      # 0xee54
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5190
testl %eax, %eax
je 0xbf3c
leaq 0x2f35(%rip), %rsi      # 0xee4f
movsd 0x2b7e(%rip), %xmm0     # 0xeaa0
movq %r14, %rdi
callq 0x5160
movsd 0x2b6e(%rip), %xmm0     # 0xeaa0
jmp 0xbf44
movsd 0x8(%rsp), %xmm0
jmp 0xbf44
movsd 0x2b0c(%rip), %xmm0     # 0xea50
movsd %xmm0, 0xbf14(%rip)     # 0x17e60
movsd %xmm0, 0xbf14(%rip)     # 0x17e68
leaq 0xbc5d(%rip), %rdi      # 0x17bb8
movq %r14, %rsi
callq 0xc330
testl %eax, %eax
je 0xbf78
leaq 0x2ecd(%rip), %rdi      # 0xee3b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e66
xorpd %xmm0, %xmm0
ucomisd 0xbedc(%rip), %xmm0     # 0x17e60
jbe 0xbfcd
movq 0xbc4b(%rip), %rax      # 0x17bd8
movq 0x18(%rax), %rdi
leaq 0x2eb7(%rip), %rsi      # 0xee4f
leaq 0x8(%rsp), %r15
xorl %edx, %edx
movq %r15, %rcx
callq 0x5190
movsd (%r15), %xmm0
movsd %xmm0, 0xbeac(%rip)     # 0x17e60
movsd (%rsp), %xmm1
ucomisd 0x2acf(%rip), %xmm1     # 0xea90
jne 0xbfcd
jp 0xbfcd
movsd %xmm0, 0xbe9b(%rip)     # 0x17e68
xorps %xmm0, %xmm0
cvtsi2ssl 0xbbe4(%rip), %xmm0 # 0x17bbc
cvttss2si %xmm0, %eax
xorps %xmm0, %xmm0
cvtsi2ssl 0xbbd1(%rip), %xmm0 # 0x17bb8
movl %eax, 0xbdc7(%rip)      # 0x17db4
cvttss2si %xmm0, %eax
movl %eax, 0xbdb9(%rip)      # 0x17db0
leaq 0x2e5b(%rip), %r15      # 0xee59
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movl $0x64, %edx
callq 0x5800
leaq 0xbc08(%rip), %rdi      # 0x17c28
movq %r14, %rsi
callq 0xc330
testl %eax, %eax
je 0xc03d
leaq 0x2e08(%rip), %rdi      # 0xee3b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e66
leaq 0x2e1b(%rip), %r15      # 0xee5f
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movl $0xc8, %edx
callq 0x5800
leaq 0xbbfa(%rip), %rdi      # 0x17c60
movq %r14, %rsi
callq 0xc330
testl %eax, %eax
je 0xc083
leaq 0x2dc2(%rip), %rdi      # 0xee3b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e66
leaq 0x2dcf(%rip), %r15      # 0xee59
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5800
leaq 0xbb47(%rip), %rdi      # 0x17bf0
movq %r14, %rsi
callq 0xc330
testl %eax, %eax
je 0xc0c6
leaq 0x2d7f(%rip), %rdi      # 0xee3b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e66
movq %r14, %rdi
callq 0x5050
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq