// File: /workspace/github_c_makefile_star2_O3/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 0xc18b
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x56e0
jmp 0xc193
movq %rbx, %rdi
callq 0x58b0
movq %rax, %r14
testq %rax, %rax
movsd (%rsp), %xmm0
jne 0xc1b6
leaq 0x2cb0(%rip), %rdi      # 0xee57
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e56
movsd (%rsp), %xmm0
ucomisd 0x2902(%rip), %xmm0     # 0xeac0
jbe 0xc200
leaq 0x2ca4(%rip), %r15      # 0xee6b
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
leaq 0x2c97(%rip), %rsi      # 0xee70
movq %r14, %rdi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x5160
movsd (%rsp), %xmm0
movsd %xmm0, 0xbc52(%rip)     # 0x17e50
jmp 0xc275
leaq 0x2c64(%rip), %rsi      # 0xee6b
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5190
testl %eax, %eax
je 0xc255
leaq 0x2c4f(%rip), %rsi      # 0xee70
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5190
testl %eax, %eax
je 0xc25d
leaq 0x2c30(%rip), %rsi      # 0xee6b
movsd 0x2885(%rip), %xmm0     # 0xeac8
movq %r14, %rdi
callq 0x5160
movsd 0x2875(%rip), %xmm0     # 0xeac8
jmp 0xc265
movsd 0x8(%rsp), %xmm0
jmp 0xc265
movsd 0x2813(%rip), %xmm0     # 0xea78
movsd %xmm0, 0xbbe3(%rip)     # 0x17e50
movsd %xmm0, 0xbbe3(%rip)     # 0x17e58
leaq 0xb92c(%rip), %rdi      # 0x17ba8
movq %r14, %rsi
callq 0xc643
testl %eax, %eax
je 0xc299
leaq 0x2bc8(%rip), %rdi      # 0xee57
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e56
xorpd %xmm0, %xmm0
ucomisd 0xbbab(%rip), %xmm0     # 0x17e50
jbe 0xc2ee
movq 0xb91a(%rip), %rax      # 0x17bc8
movq 0x18(%rax), %rdi
leaq 0x2bb2(%rip), %rsi      # 0xee6b
leaq 0x8(%rsp), %r15
xorl %edx, %edx
movq %r15, %rcx
callq 0x5190
movsd (%r15), %xmm0
movsd %xmm0, 0xbb7b(%rip)     # 0x17e50
movsd (%rsp), %xmm1
ucomisd 0x27d6(%rip), %xmm1     # 0xeab8
jne 0xc2ee
jp 0xc2ee
movsd %xmm0, 0xbb6a(%rip)     # 0x17e58
xorps %xmm0, %xmm0
cvtsi2ssl 0xb8b3(%rip), %xmm0 # 0x17bac
cvttss2si %xmm0, %eax
xorps %xmm0, %xmm0
cvtsi2ssl 0xb8a0(%rip), %xmm0 # 0x17ba8
movl %eax, 0xba96(%rip)      # 0x17da4
cvttss2si %xmm0, %eax
movl %eax, 0xba88(%rip)      # 0x17da0
leaq 0x2b56(%rip), %r15      # 0xee75
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movl $0x64, %edx
callq 0x57f0
leaq 0xb8d7(%rip), %rdi      # 0x17c18
movq %r14, %rsi
callq 0xc643
testl %eax, %eax
je 0xc35e
leaq 0x2b03(%rip), %rdi      # 0xee57
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e56
leaq 0x2b16(%rip), %r15      # 0xee7b
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movl $0xc8, %edx
callq 0x57f0
leaq 0xb8c9(%rip), %rdi      # 0x17c50
movq %r14, %rsi
callq 0xc643
testl %eax, %eax
je 0xc3a4
leaq 0x2abd(%rip), %rdi      # 0xee57
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e56
leaq 0x2aca(%rip), %r15      # 0xee75
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x57f0
leaq 0xb816(%rip), %rdi      # 0x17be0
movq %r14, %rsi
callq 0xc643
testl %eax, %eax
je 0xc3e7
leaq 0x2a7a(%rip), %rdi      # 0xee57
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5e56
movq %r14, %rdi
callq 0x5050
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq