// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x10b00
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x67d0
movq %rax, -0x18(%rbp)
jmp 0x10b0d
movq -0x8(%rbp), %rdi
callq 0x6a20
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x10b26
movq -0x8(%rbp), %rsi
leaq 0xa83c(%rip), %rdi      # 0x1b35b
movb $0x0, %al
callq 0x6c50
movsd -0x10(%rbp), %xmm0
movsd 0xa3d5(%rip), %xmm1     # 0x1af08
ucomisd %xmm1, %xmm0
jbe 0x10b80
movq -0x18(%rbp), %rdi
leaq 0xa82b(%rip), %rsi      # 0x1b36f
callq 0x6160
movq -0x18(%rbp), %rdi
leaq 0xa820(%rip), %rsi      # 0x1b374
callq 0x6160
movq -0x18(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
leaq 0xa806(%rip), %rsi      # 0x1b36f
callq 0x6180
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0x14065(%rip)    # 0x24be0
jmp 0x10c11
movq -0x18(%rbp), %rdi
leaq 0xa7e4(%rip), %rsi      # 0x1b36f
xorl %edx, %edx
leaq -0x20(%rbp), %rcx
callq 0x61c0
cmpl $0x0, %eax
jne 0x10baa
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x14038(%rip)    # 0x24be0
jmp 0x10c01
movq -0x18(%rbp), %rdi
leaq 0xa7bf(%rip), %rsi      # 0x1b374
xorl %edx, %edx
leaq -0x20(%rbp), %rcx
callq 0x61c0
cmpl $0x0, %eax
jne 0x10bd7
movsd 0xa34b(%rip), %xmm0     # 0x1af18
movsd %xmm0, 0x1400b(%rip)    # 0x24be0
jmp 0x10bff
movq -0x18(%rbp), %rdi
leaq 0xa78d(%rip), %rsi      # 0x1b36f
movsd 0xa326(%rip), %xmm0     # 0x1af10
callq 0x6180
movsd 0xa319(%rip), %xmm0     # 0x1af10
movsd %xmm0, 0x13fe1(%rip)    # 0x24be0
jmp 0x10c01
movsd 0x13fd7(%rip), %xmm0    # 0x24be0
movsd %xmm0, 0x13fd7(%rip)    # 0x24be8
movq -0x18(%rbp), %rsi
leaq 0x13c74(%rip), %rdi     # 0x24890
addq $0x10, %rdi
callq 0x12ac0
cmpl $0x0, %eax
je 0x10c3c
movq -0x8(%rbp), %rsi
leaq 0xa726(%rip), %rdi      # 0x1b35b
movb $0x0, %al
callq 0x6c50
xorps %xmm0, %xmm0
ucomisd 0x13f99(%rip), %xmm0    # 0x24be0
jbe 0x10c92
movq 0x13c70(%rip), %rax     # 0x248c0
movq 0x18(%rax), %rdi
leaq 0xa714(%rip), %rsi      # 0x1b36f
xorl %edx, %edx
leaq -0x20(%rbp), %rcx
callq 0x61c0
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x13f6d(%rip)    # 0x24be0
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10c90
jp 0x10c90
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x13f58(%rip)    # 0x24be8
jmp 0x10c92
cvtsi2ssl 0x13c0a(%rip), %xmm0 # 0x248a4
mulss 0xf3ba(%rip), %xmm0     # 0x2005c
callq 0x6820
cvttss2si %xmm0, %eax
movl %eax, 0x13e37(%rip)     # 0x24ae8
cvtsi2ssl 0x13be7(%rip), %xmm0 # 0x248a0
mulss 0xf39f(%rip), %xmm0     # 0x20060
callq 0x6820
cvttss2si %xmm0, %eax
movl %eax, 0x13e14(%rip)     # 0x24ae4
cvtsi2ssl 0x13bc8(%rip), %xmm0 # 0x248a0
movss 0xf380(%rip), %xmm1     # 0x20060
movss 0xa214(%rip), %xmm2     # 0x1aefc
subss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss 0xa200(%rip), %xmm1     # 0x1aef8
divss %xmm1, %xmm0
callq 0x6820
cvttss2si %xmm0, %eax
movl %eax, 0x13de1(%rip)     # 0x24aec
cvtsi2ssl 0xea7d(%rip), %xmm0 # 0x1f790
movss 0xa1e9(%rip), %xmm1     # 0x1af04
divss %xmm1, %xmm0
cvtsi2ssl 0x13dc1(%rip), %xmm1 # 0x24ae8
mulss %xmm1, %xmm0
callq 0x6820
cvttss2si %xmm0, %eax
movl %eax, 0x13e4e(%rip)     # 0x24b88
movq -0x18(%rbp), %rdi
leaq 0xa634(%rip), %rsi      # 0x1b379
callq 0x6160
cmpl $0x0, 0x13af3(%rip)     # 0x24844
jne 0x10d68
movq -0x18(%rbp), %rdi
leaq 0xa61b(%rip), %rsi      # 0x1b379
movl $0x64, %edx
callq 0x6920
movq -0x18(%rbp), %rsi
leaq 0x13b1d(%rip), %rdi     # 0x24890
addq $0x80, %rdi
callq 0x12ac0
cmpl $0x0, %eax
je 0x10d96
movq -0x8(%rbp), %rsi
leaq 0xa5cc(%rip), %rdi      # 0x1b35b
movb $0x0, %al
callq 0x6c50
movq -0x18(%rbp), %rdi
leaq 0xa5de(%rip), %rsi      # 0x1b37f
callq 0x6160
cmpl $0x0, 0x13a93(%rip)     # 0x24840
jne 0x10dc4
movq -0x18(%rbp), %rdi
leaq 0xa5c5(%rip), %rsi      # 0x1b37f
movl $0xc8, %edx
callq 0x6920
movq -0x18(%rbp), %rsi
leaq 0x13ac1(%rip), %rdi     # 0x24890
addq $0xb8, %rdi
callq 0x12ac0
cmpl $0x0, %eax
je 0x10df2
movq -0x8(%rbp), %rsi
leaq 0xa570(%rip), %rdi      # 0x1b35b
movb $0x0, %al
callq 0x6c50
movq -0x18(%rbp), %rdi
leaq 0xa57c(%rip), %rsi      # 0x1b379
callq 0x6160
cmpl $0x0, 0x13a3f(%rip)     # 0x24848
jne 0x10e1d
movq -0x18(%rbp), %rdi
leaq 0xa563(%rip), %rsi      # 0x1b379
xorl %edx, %edx
callq 0x6920
movq -0x18(%rbp), %rsi
leaq 0x13a68(%rip), %rdi     # 0x24890
addq $0x48, %rdi
callq 0x12ac0
cmpl $0x0, %eax
je 0x10e48
movq -0x8(%rbp), %rsi
leaq 0xa51a(%rip), %rdi      # 0x1b35b
movb $0x0, %al
callq 0x6c50
movq -0x18(%rbp), %rdi
callq 0x6060
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)