// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl 0xb2fc(%rip), %eax      # 0x19ffc
movl -0x18(%rbp), %ecx
imull 0x139c2(%rip), %ecx     # 0x226cc
addl %ecx, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x20(%rbp)
movl 0xb2e1(%rip), %eax      # 0x19ffc
movl -0x1c(%rbp), %ecx
imull 0x139a3(%rip), %ecx     # 0x226c8
addl %ecx, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x24(%rbp)
movw $0xffff, -0x30(%rbp)    # imm = 0xFFFF
leaq 0x1371b(%rip), %rax     # 0x22458
addq $0x10, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cvtsi2ssl 0x13978(%rip), %xmm0 # 0x226cc
movss %xmm0, -0x40(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x4c(%rbp)
movss -0x20(%rbp), %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x24(%rbp), %xmm0
movq -0x38(%rbp), %rax
cvtsi2ssl 0x8(%rax), %xmm1
addss %xmm1, %xmm0
cvtsi2ssl 0x13945(%rip), %xmm1 # 0x226d0
addss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xefcc
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movw 0x4(%rax), %ax
movw %ax, -0x2e(%rbp)
movzwl -0x2e(%rbp), %eax
cmpl $0x400, %eax            # imm = 0x400
jne 0xeddb
jmp 0xefbe
movzwl -0x30(%rbp), %eax
movzwl -0x2e(%rbp), %ecx
cmpl %ecx, %eax
je 0xeefc
movw -0x2e(%rbp), %ax
movw %ax, -0x30(%rbp)
leaq 0x1365e(%rip), %rax     # 0x22458
addq $0x10, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cvtsi2ssl 0x138bb(%rip), %xmm0 # 0x226cc
movss %xmm0, -0x60(%rbp)
movzwl -0x2e(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
movss 0x60e5(%rip), %xmm0     # 0x14f0c
movss 0x60e1(%rip), %xmm1     # 0x14f10
movss %xmm1, -0x5c(%rbp)
cmpl $0x0, %eax
movss %xmm0, -0x58(%rbp)
jne 0xee48
movss -0x5c(%rbp), %xmm0
movss %xmm0, -0x58(%rbp)
movss -0x60(%rbp), %xmm0
movss -0x58(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x40(%rbp)
movzwl -0x2e(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xee8d
movzwl -0x2e(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xee8d
leaq 0x135de(%rip), %rax     # 0x22458
addq $0xe8, %rax
movq %rax, -0x38(%rbp)
movl $0x3, -0x3c(%rbp)
jmp 0xeed9
movzwl -0x2e(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xeeb3
leaq 0x135b8(%rip), %rax     # 0x22458
addq $0xa0, %rax
movq %rax, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
jmp 0xeed7
movzwl -0x2e(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xeed5
leaq 0x13592(%rip), %rax     # 0x22458
addq $0x58, %rax
movq %rax, -0x38(%rbp)
movl $0x2, -0x3c(%rbp)
jmp 0xeed7
jmp 0xeed9
movss -0x24(%rbp), %xmm0
movq -0x38(%rbp), %rax
cvtsi2ssl 0x8(%rax), %xmm1
addss %xmm1, %xmm0
cvtsi2ssl 0x137dd(%rip), %xmm1 # 0x226d0
addss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movl -0x44(%rbp), %eax
movl %eax, %esi
callq 0x6890
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
jne 0xef36
movl -0x44(%rbp), %edi
movl -0x3c(%rbp), %esi
movq -0x8(%rbp), %rdx
movslq -0x54(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdx
callq 0xe1b0
movl %eax, -0x48(%rbp)
jmp 0xef50
movq -0x38(%rbp), %rcx
addq $0x20, %rcx
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
cmpl $0x0, -0x48(%rbp)
je 0xefa6
movl -0x48(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
movq %rdx, 0x8(%rax,%rcx)
cvttss2si -0x28(%rbp), %eax
cwtl
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
movsd %xmm0, 0x10(%rax,%rcx)
cvttss2si -0x2c(%rbp), %eax
cwtl
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movsd %xmm0, 0x18(%rax)
movss -0x40(%rbp), %xmm0
addss -0x28(%rbp), %xmm0
movss %xmm0, -0x28(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xed94
movl -0x54(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)