// File: /workspace/github_c_makefile_star2_O2/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 0xb660
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x56e0
jmp 0xb668
movq %rbx, %rdi
callq 0x58b0
movq %rax, %r14
testq %rax, %rax
movsd (%rsp), %xmm0
jne 0xb68b
leaq 0x27ab(%rip), %rdi      # 0xde27
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5a26
movsd (%rsp), %xmm0
ucomisd 0x23fd(%rip), %xmm0     # 0xda90
jbe 0xb6d5
leaq 0x279f(%rip), %r15      # 0xde3b
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
leaq 0x2792(%rip), %rsi      # 0xde40
movq %r14, %rdi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x5160
movsd (%rsp), %xmm0
movsd %xmm0, 0xb77d(%rip)     # 0x16e50
jmp 0xb74a
leaq 0x275f(%rip), %rsi      # 0xde3b
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5190
testl %eax, %eax
je 0xb72a
leaq 0x274a(%rip), %rsi      # 0xde40
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5190
testl %eax, %eax
je 0xb732
leaq 0x272b(%rip), %rsi      # 0xde3b
movsd 0x2380(%rip), %xmm0     # 0xda98
movq %r14, %rdi
callq 0x5160
movsd 0x2370(%rip), %xmm0     # 0xda98
jmp 0xb73a
movsd 0x8(%rsp), %xmm0
jmp 0xb73a
movsd 0x230e(%rip), %xmm0     # 0xda48
movsd %xmm0, 0xb70e(%rip)     # 0x16e50
movsd %xmm0, 0xb70e(%rip)     # 0x16e58
leaq 0xb457(%rip), %rdi      # 0x16ba8
movq %r14, %rsi
callq 0xbb41
testl %eax, %eax
je 0xb76e
leaq 0x26c3(%rip), %rdi      # 0xde27
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5a26
xorpd %xmm0, %xmm0
ucomisd 0xb6d6(%rip), %xmm0     # 0x16e50
jbe 0xb7c3
movq 0xb445(%rip), %rax      # 0x16bc8
movq 0x18(%rax), %rdi
leaq 0x26ad(%rip), %rsi      # 0xde3b
leaq 0x8(%rsp), %r15
xorl %edx, %edx
movq %r15, %rcx
callq 0x5190
movsd (%r15), %xmm0
movsd %xmm0, 0xb6a6(%rip)     # 0x16e50
movsd (%rsp), %xmm1
ucomisd 0x22d1(%rip), %xmm1     # 0xda88
jne 0xb7c3
jp 0xb7c3
movsd %xmm0, 0xb695(%rip)     # 0x16e58
cvtsi2ssl 0xb3e1(%rip), %xmm0 # 0x16bac
cvttss2si %xmm0, %eax
cvtsi2ssl 0xb3d1(%rip), %xmm0 # 0x16ba8
movl %eax, 0xb5c7(%rip)      # 0x16da4
cvttss2si %xmm0, %eax
movl %eax, 0xb5b9(%rip)      # 0x16da0
leaq 0x2657(%rip), %r15      # 0xde45
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
pushq $0x64
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x57f0
leaq 0xb40a(%rip), %rdi      # 0x16c18
movq %r14, %rsi
callq 0xbb41
testl %eax, %eax
je 0xb82b
leaq 0x2606(%rip), %rdi      # 0xde27
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5a26
leaq 0x2619(%rip), %r15      # 0xde4b
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movl $0xc8, %edx
callq 0x57f0
leaq 0xb3fc(%rip), %rdi      # 0x16c50
movq %r14, %rsi
callq 0xbb41
testl %eax, %eax
je 0xb871
leaq 0x25c0(%rip), %rdi      # 0xde27
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5a26
leaq 0x25cd(%rip), %r15      # 0xde45
movq %r14, %rdi
movq %r15, %rsi
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x57f0
leaq 0xb349(%rip), %rdi      # 0x16be0
movq %r14, %rsi
callq 0xbb41
testl %eax, %eax
je 0xb8b4
leaq 0x257d(%rip), %rdi      # 0xde27
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5a26
movq %r14, %rdi
callq 0x5050
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq