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

	if (!(pattern = FcNameParse((const FcChar8 *)fontstr)))
		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);

	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);
	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), %rdi
callq 0x6a80
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x11406
movq -0x8(%rbp), %rsi
leaq 0x3fd3(%rip), %rdi      # 0x153d2
movb $0x0, %al
callq 0x6c20
movsd -0x10(%rbp), %xmm0
movsd 0x3b2d(%rip), %xmm1     # 0x14f40
ucomisd %xmm1, %xmm0
jbe 0x11460
movq -0x18(%rbp), %rdi
leaq 0x3fc2(%rip), %rsi      # 0x153e6
callq 0x6150
movq -0x18(%rbp), %rdi
leaq 0x3fb7(%rip), %rsi      # 0x153eb
callq 0x6150
movq -0x18(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
leaq 0x3f9d(%rip), %rsi      # 0x153e6
callq 0x6180
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0x11325(%rip)    # 0x22780
jmp 0x114f1
movq -0x18(%rbp), %rdi
leaq 0x3f7b(%rip), %rsi      # 0x153e6
xorl %edx, %edx
leaq -0x20(%rbp), %rcx
callq 0x61c0
cmpl $0x0, %eax
jne 0x1148a
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x112f8(%rip)    # 0x22780
jmp 0x114e1
movq -0x18(%rbp), %rdi
leaq 0x3f56(%rip), %rsi      # 0x153eb
xorl %edx, %edx
leaq -0x20(%rbp), %rcx
callq 0x61c0
cmpl $0x0, %eax
jne 0x114b7
movsd 0x3a6b(%rip), %xmm0     # 0x14f18
movsd %xmm0, 0x112cb(%rip)    # 0x22780
jmp 0x114df
movq -0x18(%rbp), %rdi
leaq 0x3f24(%rip), %rsi      # 0x153e6
movsd 0x3a7e(%rip), %xmm0     # 0x14f48
callq 0x6180
movsd 0x3a71(%rip), %xmm0     # 0x14f48
movsd %xmm0, 0x112a1(%rip)    # 0x22780
jmp 0x114e1
movsd 0x11297(%rip), %xmm0    # 0x22780
movsd %xmm0, 0x1126f(%rip)    # 0x22760
movq -0x18(%rbp), %rsi
leaq 0x10f5c(%rip), %rdi     # 0x22458
addq $0x10, %rdi
callq 0x11b60
cmpl $0x0, %eax
je 0x1151c
movq -0x8(%rbp), %rsi
leaq 0x3ebd(%rip), %rdi      # 0x153d2
movb $0x0, %al
callq 0x6c20
xorps %xmm0, %xmm0
ucomisd 0x11259(%rip), %xmm0    # 0x22780
jbe 0x1156e
movq 0x10f68(%rip), %rdi     # 0x22498
leaq 0x3eaf(%rip), %rsi      # 0x153e6
xorl %edx, %edx
leaq -0x20(%rbp), %rcx
callq 0x61c0
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x11231(%rip)    # 0x22780
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1156c
jp 0x1156c
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x111f4(%rip)    # 0x22760
jmp 0x1156e
cvtsi2ssl 0x10ef6(%rip), %xmm0 # 0x2246c
mulss 0x8a82(%rip), %xmm0     # 0x1a000
callq 0x6880
cvttss2si %xmm0, %eax
movl %eax, 0x1113f(%rip)     # 0x226cc
cvtsi2ssl 0x10ed3(%rip), %xmm0 # 0x22468
mulss 0x8a67(%rip), %xmm0     # 0x1a004
callq 0x6880
cvttss2si %xmm0, %eax
movl %eax, 0x1111c(%rip)     # 0x226c8
cvtsi2ssl 0x10eb4(%rip), %xmm0 # 0x22468
movss 0x8a48(%rip), %xmm1     # 0x1a004
movss 0x394c(%rip), %xmm2     # 0x14f10
subss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss 0x3938(%rip), %xmm1     # 0x14f0c
divss %xmm1, %xmm0
callq 0x6880
cvttss2si %xmm0, %eax
movl %eax, 0x110e9(%rip)     # 0x226d0
movq -0x18(%rbp), %rdi
leaq 0x3dfe(%rip), %rsi      # 0x153f0
callq 0x6150
movq -0x18(%rbp), %rdi
leaq 0x3dee(%rip), %rsi      # 0x153f0
movl $0x64, %edx
callq 0x6980
movq -0x18(%rbp), %rsi
leaq 0x10e41(%rip), %rdi     # 0x22458
addq $0xa0, %rdi
callq 0x11b60
cmpl $0x0, %eax
je 0x1163a
movq -0x8(%rbp), %rsi
leaq 0x3d9f(%rip), %rdi      # 0x153d2
movb $0x0, %al
callq 0x6c20
movq -0x18(%rbp), %rdi
leaq 0x3db1(%rip), %rsi      # 0x153f6
callq 0x6150
movq -0x18(%rbp), %rdi
leaq 0x3da1(%rip), %rsi      # 0x153f6
movl $0xc8, %edx
callq 0x6980
movq -0x18(%rbp), %rsi
leaq 0x10dee(%rip), %rdi     # 0x22458
addq $0xe8, %rdi
callq 0x11b60
cmpl $0x0, %eax
je 0x1168d
movq -0x8(%rbp), %rsi
leaq 0x3d4c(%rip), %rdi      # 0x153d2
movb $0x0, %al
callq 0x6c20
movq -0x18(%rbp), %rdi
leaq 0x3d58(%rip), %rsi      # 0x153f0
callq 0x6150
movq -0x18(%rbp), %rsi
leaq 0x10db0(%rip), %rdi     # 0x22458
addq $0x58, %rdi
callq 0x11b60
cmpl $0x0, %eax
je 0x116c8
movq -0x8(%rbp), %rsi
leaq 0x3d11(%rip), %rdi      # 0x153d2
movb $0x0, %al
callq 0x6c20
movq -0x18(%rbp), %rdi
callq 0x6050
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)