// File: /workspace/github_c_makefile_star2_O1/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, 0xeb96(%rip)      # 0x1dcb0
je 0xf12a
leaq 0x410d(%rip), %rdi      # 0x13230
xorl %eax, %eax
callq 0x6faf
cmpl $0xb, 0xeb8f(%rip)      # 0x1dcc0
jg 0xf155
movl $0xc, 0xeb83(%rip)      # 0x1dcc0
movq 0xeb74(%rip), %rdi      # 0x1dcb8
movl $0xc0, %esi
callq 0x7049
movq %rax, 0xeb63(%rip)      # 0x1dcb8
leaq 0xa464(%rip), %r14      # 0x195c0
leaq 0x40f8(%rip), %rbx      # 0x1325b
leaq 0x4082(%rip), %rbp      # 0x131ec
xorl %r13d, %r13d
movq (%r13,%r14), %rdi
cmpb $0x2d, (%rdi)
jne 0xf182
xorl %esi, %esi
xorl %edx, %edx
callq 0x6750
jmp 0xf187
callq 0x6980
movq %rax, %r15
testq %rax, %rax
jne 0xf19e
movq (%r13,%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6faf
movsd 0xeb32(%rip), %xmm0     # 0x1dcd8
ucomisd 0x3aea(%rip), %xmm0     # 0x12c98
jbe 0xf237
movsd 0xeb14(%rip), %xmm1     # 0x1dcd0
subsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
ucomisd 0x3aca(%rip), %xmm1     # 0x12c98
jne 0xf1d2
jnp 0xf237
movq %r15, %rdi
leaq 0x4006(%rip), %rsi      # 0x131e2
xorl %edx, %edx
leaq 0x8(%rsp), %rcx
callq 0x61a0
testl %eax, %eax
jne 0xf237
movsd 0x10(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
leaq 0x3fda(%rip), %r12      # 0x131e2
movq %r12, %rsi
callq 0x6140
movq %r15, %rdi
leaq 0x3fcd(%rip), %rsi      # 0x131e7
callq 0x6140
movsd 0x8(%rsp), %xmm0
movq %r15, %rdi
movq %r12, %rsi
leaq 0x4029(%rip), %rbx      # 0x1325b
callq 0x6160
movq %r15, %rdi
leaq 0x3dc4(%rip), %rsi      # 0x13005
movl $0x1, %edx
callq 0x6620
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x6800
movq 0xe8a2(%rip), %rdi      # 0x1db00
movl 0xe98c(%rip), %esi      # 0x1dbf0
movq %r15, %rdx
callq 0x66a0
movq %r15, %rdi
xorl %esi, %esi
callq 0xf7a0
testl %eax, %eax
je 0xf289
movq (%r13,%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6faf
movq %r15, %rdi
movq %rbp, %rsi
callq 0x6140
movq %r15, %rdi
movq %rbp, %rsi
movl $0x64, %edx
callq 0x6890
movq %r15, %rdi
movl $0x1, %esi
callq 0xf7a0
testl %eax, %eax
je 0xf2c4
movq (%r13,%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6faf
movq %r15, %rdi
leaq 0x3f24(%rip), %r12      # 0x131f2
movq %r12, %rsi
callq 0x6140
movq %r15, %rdi
movq %r12, %rsi
movl $0xc8, %edx
callq 0x6890
movq %r15, %rdi
movl $0x3, %esi
callq 0xf7a0
testl %eax, %eax
je 0xf306
movq (%r13,%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6faf
movq %r15, %rdi
movq %rbp, %rsi
callq 0x6140
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x6890
movq %r15, %rdi
movl $0x2, %esi
callq 0xf7a0
testl %eax, %eax
je 0xf33e
movq (%r13,%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6faf
movq %r15, %rdi
callq 0x6050
addq $0x8, %r13
cmpq $0x11, %r13
jl 0xf16d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq