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

	if (fontstr[0] == '-')
		pattern = XftXlfdParse(fontstr, False, False);
	else
		pattern = FcNameParse((const 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);

	FcPatternDel(pattern, FC_SLANT);
	FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
	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 0xee7d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6750
jmp 0xee85
movq %rbx, %rdi
callq 0x6980
movq %rax, %r14
testq %rax, %rax
movsd (%rsp), %xmm0
jne 0xeea8
leaq 0x4335(%rip), %rdi      # 0x131ce
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6faf
movsd (%rsp), %xmm0
ucomisd 0x3df0(%rip), %xmm0     # 0x12ca0
jbe 0xeef2
leaq 0x4329(%rip), %r15      # 0x131e2
movq %r14, %rdi
movq %r15, %rsi
callq 0x6140
leaq 0x431c(%rip), %rsi      # 0x131e7
movq %r14, %rdi
callq 0x6140
movq %r14, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x6160
movsd (%rsp), %xmm0
movsd %xmm0, 0xede0(%rip)     # 0x1dcd0
jmp 0xef67
leaq 0x42e9(%rip), %rsi      # 0x131e2
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x61a0
testl %eax, %eax
je 0xef47
leaq 0x42d4(%rip), %rsi      # 0x131e7
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x61a0
testl %eax, %eax
je 0xef4f
leaq 0x42b5(%rip), %rsi      # 0x131e2
movsd 0x3d73(%rip), %xmm0     # 0x12ca8
movq %r14, %rdi
callq 0x6160
movsd 0x3d63(%rip), %xmm0     # 0x12ca8
jmp 0xef57
movsd 0x8(%rsp), %xmm0
jmp 0xef57
movsd 0x3d29(%rip), %xmm0     # 0x12c80
movsd %xmm0, 0xed71(%rip)     # 0x1dcd0
movsd %xmm0, 0xed71(%rip)     # 0x1dcd8
leaq 0xeaaa(%rip), %rdi      # 0x1da18
movq %r14, %rsi
callq 0xf5c6
testl %eax, %eax
je 0xef8b
leaq 0x424d(%rip), %rdi      # 0x131ce
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6faf
xorpd %xmm0, %xmm0
ucomisd 0xed39(%rip), %xmm0     # 0x1dcd0
jbe 0xefe0
movq 0xea98(%rip), %rax      # 0x1da38
movq 0x18(%rax), %rdi
leaq 0x4237(%rip), %rsi      # 0x131e2
leaq 0x8(%rsp), %r15
xorl %edx, %edx
movq %r15, %rcx
callq 0x61a0
movsd (%r15), %xmm0
movsd %xmm0, 0xed09(%rip)     # 0x1dcd0
movsd (%rsp), %xmm1
ucomisd 0x3cc4(%rip), %xmm1     # 0x12c98
jne 0xefe0
jp 0xefe0
movsd %xmm0, 0xecf8(%rip)     # 0x1dcd8
xorps %xmm0, %xmm0
cvtsi2ssl 0xea31(%rip), %xmm0 # 0x1da1c
mulss 0xae25(%rip), %xmm0     # 0x19e18
callq 0x67b0
cvttss2si %xmm0, %eax
xorps %xmm0, %xmm0
cvtsi2ssl 0xea11(%rip), %xmm0 # 0x1da18
movl %eax, 0xec17(%rip)      # 0x1dc24
mulss 0xae07(%rip), %xmm0     # 0x19e1c
callq 0x67b0
cvttss2si %xmm0, %eax
movl %eax, 0xebfc(%rip)      # 0x1dc20
leaq 0x41c1(%rip), %r15      # 0x131ec
movq %r14, %rdi
movq %r15, %rsi
callq 0x6140
movq %r14, %rdi
movq %r15, %rsi
movl $0x64, %edx
callq 0x6890
leaq 0xea3b(%rip), %rdi      # 0x1da88
movq %r14, %rsi
callq 0xf5c6
testl %eax, %eax
je 0xf06a
leaq 0x416e(%rip), %rdi      # 0x131ce
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6faf
leaq 0x4181(%rip), %r15      # 0x131f2
movq %r14, %rdi
movq %r15, %rsi
callq 0x6140
movq %r14, %rdi
movq %r15, %rsi
movl $0xc8, %edx
callq 0x6890
leaq 0xea2d(%rip), %rdi      # 0x1dac0
movq %r14, %rsi
callq 0xf5c6
testl %eax, %eax
je 0xf0b0
leaq 0x4128(%rip), %rdi      # 0x131ce
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6faf
leaq 0x4135(%rip), %r15      # 0x131ec
movq %r14, %rdi
movq %r15, %rsi
callq 0x6140
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x6890
leaq 0xe97a(%rip), %rdi      # 0x1da50
movq %r14, %rsi
callq 0xf5c6
testl %eax, %eax
je 0xf0f3
leaq 0x40e5(%rip), %rdi      # 0x131ce
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6faf
movq %r14, %rdi
callq 0x6050
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq