// File: /workspace/github_c_makefile_star2_O2/mrdotx[P]st/x.c
// Function: xloadsparefonts
void
xloadsparefonts(void)
{
	FcPattern *pattern;
	double sizeshift, fontval;
	int fc;
	char **fp;

	if (frclen != 0)
		die("can't embed spare fonts. cache isn't empty");

	/* Calculate count of spare fonts */
	fc = sizeof(font2) / sizeof(*font2);
	if (fc == 0)
		return;

	/* Allocate memory for cache entries. */
	if (frccap < 4 * fc) {
		frccap += 4 * fc - frccap;
		frc = xrealloc(frc, frccap * sizeof(Fontcache));
	}

	for (fp = font2; fp - font2 < fc; ++fp) {
	
		if (**fp == '-')
			pattern = XftXlfdParse(*fp, False, False);
		else
			pattern = FcNameParse((FcChar8 *)*fp);
	
		if (!pattern)
			die("can't open spare font %s\n", *fp);
	   		
		if (defaultfontsize > 0) {
			sizeshift = usedfontsize - defaultfontsize;
			if (sizeshift != 0 &&
					FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) ==
					FcResultMatch) {	
				fontval += sizeshift;
				FcPatternDel(pattern, FC_PIXEL_SIZE);
				FcPatternDel(pattern, FC_SIZE);
				FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval);
			}
		}
	
		FcPatternAddBool(pattern, FC_SCALABLE, 1);
	
		FcConfigSubstitute(NULL, pattern, FcMatchPattern);
		XftDefaultSubstitute(xw.dpy, xw.scr, pattern);
	
		if (xloadsparefont(pattern, FRC_NORMAL))
			die("can't open spare font %s\n", *fp);
	
		FcPatternDel(pattern, FC_SLANT);
		FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
		if (xloadsparefont(pattern, FRC_ITALIC))
			die("can't open spare font %s\n", *fp);
			
		FcPatternDel(pattern, FC_WEIGHT);
		FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
		if (xloadsparefont(pattern, FRC_ITALICBOLD))
			die("can't open spare font %s\n", *fp);
	
		FcPatternDel(pattern, FC_SLANT);
		FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
		if (xloadsparefont(pattern, FRC_BOLD))
			die("can't open spare font %s\n", *fp);
	
		FcPatternDestroy(pattern);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x0, 0xe750(%rip)      # 0x1cca0
je 0xe560
leaq 0x3cc7(%rip), %rdi      # 0x12220
xorl %eax, %eax
callq 0x6b5a
cmpl $0xb, 0xe749(%rip)      # 0x1ccb0
jg 0xe58b
movl $0xc, 0xe73d(%rip)      # 0x1ccb0
movq 0xe72e(%rip), %rdi      # 0x1cca8
movl $0xc0, %esi
callq 0x6bf2
movq %rax, 0xe71d(%rip)      # 0x1cca8
leaq 0xa01e(%rip), %r15      # 0x185b0
leaq 0x3cb2(%rip), %rbx      # 0x1224b
leaq 0x3c3c(%rip), %r12      # 0x121dc
xorl %ebp, %ebp
cmpq $0x10, %rbp
jg 0xe784
movq (%rbp,%r15), %rdi
cmpb $0x2d, (%rdi)
jne 0xe5c1
xorl %esi, %esi
xorl %edx, %edx
callq 0x6740
jmp 0xe5c6
callq 0x6970
movq %rax, %r13
testq %rax, %rax
jne 0xe5dd
movq (%rbp,%r15), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6b5a
movsd 0xe6e3(%rip), %xmm0     # 0x1ccc8
ucomisd 0x3693(%rip), %xmm0     # 0x11c80
jbe 0xe676
movsd 0xe6c5(%rip), %xmm1     # 0x1ccc0
subsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
ucomisd 0x3673(%rip), %xmm1     # 0x11c80
jne 0xe611
jnp 0xe676
movq %r13, %rdi
leaq 0x3bb7(%rip), %rsi      # 0x121d2
xorl %edx, %edx
leaq 0x8(%rsp), %rcx
callq 0x61a0
testl %eax, %eax
jne 0xe676
movsd 0x10(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
leaq 0x3b8b(%rip), %r14      # 0x121d2
movq %r14, %rsi
callq 0x6140
movq %r13, %rdi
leaq 0x3b7e(%rip), %rsi      # 0x121d7
callq 0x6140
movsd 0x8(%rsp), %xmm0
movq %r13, %rdi
movq %r14, %rsi
leaq 0x3bda(%rip), %rbx      # 0x1224b
callq 0x6160
movq %r13, %rdi
leaq 0x3975(%rip), %rsi      # 0x11ff5
pushq $0x1
popq %rdx
callq 0x6620
xorl %edi, %edi
movq %r13, %rsi
xorl %edx, %edx
callq 0x67f0
movq 0xe455(%rip), %rdi      # 0x1caf0
movl 0xe53f(%rip), %esi      # 0x1cbe0
movq %r13, %rdx
callq 0x6690
movq %r13, %rdi
xorl %esi, %esi
callq 0xec17
testl %eax, %eax
je 0xe6c6
movq (%rbp,%r15), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6b5a
movq %r13, %rdi
movq %r12, %rsi
callq 0x6140
movq %r13, %rdi
movq %r12, %rsi
pushq $0x64
popq %rdx
callq 0x6880
movq %r13, %rdi
pushq $0x1
popq %rsi
callq 0xec17
testl %eax, %eax
je 0xe6fd
movq (%rbp,%r15), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6b5a
movq %r13, %rdi
leaq 0x3adb(%rip), %r14      # 0x121e2
movq %r14, %rsi
callq 0x6140
movq %r13, %rdi
movq %r14, %rsi
movl $0xc8, %edx
callq 0x6880
movq %r13, %rdi
pushq $0x3
popq %rsi
callq 0xec17
testl %eax, %eax
je 0xe73d
movq (%rbp,%r15), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6b5a
movq %r13, %rdi
movq %r12, %rsi
callq 0x6140
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x6880
movq %r13, %rdi
pushq $0x2
popq %rsi
callq 0xec17
testl %eax, %eax
je 0xe773
movq (%rbp,%r15), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6b5a
movq %r13, %rdi
callq 0x6050
addq $0x8, %rbp
jmp 0xe5a2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq