// File: /workspace/github_c_makefile_star2_O2/odknt[P]st/x.c
// Function: xmakeglyphfontspecs
int
xmakeglyphfontspecs(GlyphFontSpec *specs, const Glyph *glyphs, int len, int x, int y)
{
	float winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, xp, yp;
	ushort mode, prevmode = USHRT_MAX;
	Font *font = &dc.font;
	int frcflags = FRC_NORMAL;
	float runewidth = win.cw;
	Rune rune;
	FT_UInt glyphidx;
	int i, f, numspecs = 0;

	for (i = 0, xp = winx, yp = winy + font->ascent + win.cyo; i < len; ++i) {
		/* Fetch rune and mode for current glyph. */
		rune = glyphs[i].u;
		mode = glyphs[i].mode;

		/* Skip dummy wide-character spacing. */
		if (mode == ATTR_WDUMMY)
			continue;

		/* Determine font for glyph if different from previous glyph. */
		if (prevmode != mode) {
			prevmode = mode;
			font = &dc.font;
			frcflags = FRC_NORMAL;
			runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
			if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {
				font = &dc.ibfont;
				frcflags = FRC_ITALICBOLD;
			} else if (mode & ATTR_ITALIC) {
				font = &dc.ifont;
				frcflags = FRC_ITALIC;
			} else if (mode & ATTR_BOLD) {
				font = &dc.bfont;
				frcflags = FRC_BOLD;
			}
			yp = winy + font->ascent + win.cyo;
		}

		/* select font */
		glyphidx = FT_Get_Char_Index(font->match.face, rune);
		if (!glyphidx)
			glyphidx = xselectfont(rune, frcflags, &specs[numspecs].font);
		else
			specs[numspecs].font = &font->match;
		if (glyphidx) {
			specs[numspecs].glyph.index = glyphidx;
			specs[numspecs].glyph.x = (short)xp;
			specs[numspecs].glyph.y = (short)yp;
		}

		xp += runewidth;
		numspecs++;
	}

	return numspecs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl 0xbf23(%rip), %eax      # 0x17e0c
movl 0x12a4c(%rip), %r9d     # 0x1e93c
imull %r9d, %ecx
addl %eax, %ecx
cvtsi2ss %ecx, %xmm1
imull 0x12a36(%rip), %r8d     # 0x1e938
addl %eax, %r8d
cvtsi2ss %r8d, %xmm2
cvtsi2ss %r9d, %xmm0
movss %xmm0, 0x8(%rsp)
movq %rsi, %r14
cvtsi2ssl 0x127c0(%rip), %xmm0 # 0x1e6e0
movq %rdi, 0x10(%rsp)
cvtsi2ssl 0x12a13(%rip), %xmm3 # 0x1e940
movss %xmm2, 0xc(%rsp)
addss %xmm2, %xmm0
addss %xmm0, %xmm3
movaps %xmm3, 0x20(%rsp)
xorl %ebx, %ebx
testl %edx, %edx
cmovlel %ebx, %edx
shlq $0x4, %rdx
leaq 0x12786(%rip), %r12     # 0x1e6d8
movw $0xffff, 0x2(%rsp)      # imm = 0xFFFF
movl $0x0, 0x4(%rsp)
xorl %ebp, %ebp
movq %rdx, 0x18(%rsp)
cmpq %rbx, %rdx
je 0xc0a4
movzwl 0x4(%r14,%rbx), %eax
cmpl $0x400, %eax            # imm = 0x400
je 0xc09b
movaps %xmm1, 0x30(%rsp)
cmpw %ax, 0x2(%rsp)
je 0xc023
cvtsi2ssl 0x129a2(%rip), %xmm0 # 0x1e93c
xorl %ecx, %ecx
btl $0x9, %eax
setae %cl
leaq 0x4c86(%rip), %rdx      # 0x10c30
mulss (%rdx,%rcx,4), %xmm0
movss %xmm0, 0x8(%rsp)
movl %eax, %ecx
andl $0x1, %ecx
movl %eax, %edx
notl %edx
xorl %esi, %esi
testb $0x5, %dl
sete %sil
leaq 0x1279a(%rip), %rdx     # 0x1e768
leaq 0x127db(%rip), %rdi     # 0x1e7b0
cmoveq %rdi, %rdx
testl %ecx, %ecx
leaq 0x1273e(%rip), %r12     # 0x1e720
leaq 0x126ef(%rip), %rdi     # 0x1e6d8
cmoveq %rdi, %r12
addl %ecx, %ecx
testb $0x4, %al
leal 0x1(%rsi,%rsi), %esi
cmovneq %rdx, %r12
cmovel %ecx, %esi
movl %esi, 0x4(%rsp)
cvtsi2ssl 0x8(%r12), %xmm0
cvtsi2ssl 0x12931(%rip), %xmm1 # 0x1e940
addss 0xc(%rsp), %xmm0
addss %xmm0, %xmm1
movaps %xmm1, 0x20(%rsp)
movw %ax, 0x2(%rsp)
movl (%r14,%rbx), %r13d
movq 0x20(%r12), %rdi
movq %r13, %rsi
callq 0x6880
movslq %ebp, %r15
shlq $0x5, %r15
movq 0x10(%rsp), %rcx
leaq (%rcx,%r15), %rdx
testl %eax, %eax
je 0xc057
leaq 0x20(%r12), %rcx
movq %rcx, (%rdx)
movaps 0x30(%rsp), %xmm1
jmp 0xc06c
movl %r13d, %edi
movl 0x4(%rsp), %esi
callq 0xb5de
testl %eax, %eax
movaps 0x30(%rsp), %xmm1
je 0xc08e
movl %eax, %eax
movq 0x10(%rsp), %rcx
movq %rax, 0x8(%rcx,%r15)
movaps %xmm1, %xmm0
unpcklps 0x20(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
cvttps2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movups %xmm0, 0x10(%rcx,%r15)
addss 0x8(%rsp), %xmm1
incl %ebp
movq 0x18(%rsp), %rdx
addq $0x10, %rbx
jmp 0xbf68
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq