// File: /workspace/github_c_makefile_star2_O3/mrdotx[P]st/x.c
// Function: xdrawglyphfontspecs
void
xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y)
{
	int charlen = len * ((base.mode & ATTR_WIDE) ? 2 : 1);
	int winx = borderpx + x * win.cw, winy = borderpx + y * win.ch,
	    width = charlen * win.cw;
	Color *fg, *bg, *temp, revfg, revbg, truefg, truebg;
	XRenderColor colfg, colbg;
	XRectangle r;

	/* Fallback on color display for attributes not supported by the font */
	if (base.mode & ATTR_ITALIC && base.mode & ATTR_BOLD) {
		if (dc.ibfont.badslant || dc.ibfont.badweight)
			base.fg = defaultattr;
	} else if ((base.mode & ATTR_ITALIC && dc.ifont.badslant) ||
	    (base.mode & ATTR_BOLD && dc.bfont.badweight)) {
		base.fg = defaultattr;
	}

	if (IS_TRUECOL(base.fg)) {
		colfg.alpha = 0xffff;
		colfg.red = TRUERED(base.fg);
		colfg.green = TRUEGREEN(base.fg);
		colfg.blue = TRUEBLUE(base.fg);
		XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &truefg);
		fg = &truefg;
	} else {
		fg = &dc.col[base.fg];
	}

	if (IS_TRUECOL(base.bg)) {
		colbg.alpha = 0xffff;
		colbg.green = TRUEGREEN(base.bg);
		colbg.red = TRUERED(base.bg);
		colbg.blue = TRUEBLUE(base.bg);
		XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &truebg);
		bg = &truebg;
	} else {
		bg = &dc.col[base.bg];
	}

	/* Change basic system colors [0-7] to bright system colors [8-15] */
	if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7))
		fg = &dc.col[base.fg + 8];

	if (IS_SET(MODE_REVERSE)) {
		if (fg == &dc.col[defaultfg]) {
			fg = &dc.col[defaultbg];
		} else {
			colfg.red = ~fg->color.red;
			colfg.green = ~fg->color.green;
			colfg.blue = ~fg->color.blue;
			colfg.alpha = fg->color.alpha;
			XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg,
					&revfg);
			fg = &revfg;
		}

		if (bg == &dc.col[defaultbg]) {
			bg = &dc.col[defaultfg];
		} else {
			colbg.red = ~bg->color.red;
			colbg.green = ~bg->color.green;
			colbg.blue = ~bg->color.blue;
			colbg.alpha = bg->color.alpha;
			XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg,
					&revbg);
			bg = &revbg;
		}
	}

	if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) {
		colfg.red = fg->color.red / 2;
		colfg.green = fg->color.green / 2;
		colfg.blue = fg->color.blue / 2;
		colfg.alpha = fg->color.alpha;
		XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg);
		fg = &revfg;
	}

	if (base.mode & ATTR_REVERSE) {
		temp = fg;
		fg = bg;
		bg = temp;
	}

	if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK)
		fg = bg;

	if (base.mode & ATTR_INVISIBLE)
		fg = bg;

	/* Intelligent cleaning up of the borders. */
	if (x == 0) {
		xclear(0, (y == 0)? 0 : winy, borderpx,
			winy + win.ch +
			((winy + win.ch >= borderpx + win.th)? win.h : 0));
	}
	if (winx + width >= borderpx + win.tw) {
		xclear(winx + width, (y == 0)? 0 : winy, win.w,
			((winy + win.ch >= borderpx + win.th)? win.h : (winy + win.ch)));
	}
	if (y == 0)
		xclear(winx, 0, winx + width, borderpx);
	if (winy + win.ch >= borderpx + win.th)
		xclear(winx, winy + win.ch, winx + width, win.h);

	/* Clean up the region we want to draw to. */
	XftDrawRect(xw.draw, bg, winx, winy, width, win.ch);

	/* Set the clip region because Xft is sometimes dirty. */
	r.x = 0;
	r.y = 0;
	r.height = win.ch;
	r.width = width;
	XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);

	if (base.mode & ATTR_BOXDRAW) {
		drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len);
	} else {
		/* Render the glyphs. */
		XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
	}

	/* Render underline and strikethrough. */
	if (base.mode & ATTR_UNDERLINE) {
		XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent * chscale + 1,
				width, 1);
	}

	if (base.mode & ATTR_STRUCK) {
		XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent * chscale / 3,
				width, 1);
	}

	/* Reset clip to none. */
	XftDrawSetClip(xw.draw, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r8d, 0x4(%rsp)
movl %ecx, %eax
movq %rdx, %rbp
movq %rsi, %rcx
movq %rdi, 0x10(%rsp)
movq %rsi, %r15
shrq $0x20, %r15
shrq $0x29, %rcx
andb $0x1, %cl
movq %rax, 0x18(%rsp)
shll %cl, %eax
movl %eax, 0xc(%rsp)
movl %ebp, %ebx
movl 0xc025(%rip), %eax      # 0x19e04
movl %eax, 0x8(%rsp)
movl 0xfe2b(%rip), %ecx      # 0x1dc14
movl 0xfe20(%rip), %r14d     # 0x1dc10
movl %r9d, (%rsp)
imull %r9d, %r14d
movl %r15d, %eax
notl %eax
testb $0x5, %al
movq %rcx, 0x28(%rsp)
jne 0xde26
movl 0xfcb8(%rip), %eax      # 0x1dac4
orl 0xfcae(%rip), %eax      # 0x1dac0
movl $0xb, %eax
cmovel %ebx, %eax
movl %eax, %ebx
btl $0x18, %ebx
jb 0xde5b
movl %ebx, %eax
jmp 0xde49
movl $0xb, %eax
testb $0x4, %r15b
je 0xde3a
cmpl $0x0, 0xfc50(%rip)      # 0x1da88
jne 0xde49
testb $0x1, %r15b
je 0xde1c
cmpl $0x0, 0xfc0d(%rip)      # 0x1da54
je 0xde1c
movl %eax, %r13d
shlq $0x4, %r13
addq 0xfba1(%rip), %r13      # 0x1d9f8
movl %eax, %ebx
jmp 0xdea6
leaq 0x30(%rsp), %rcx
movw $0xffff, 0x6(%rcx)      # imm = 0xFFFF
movl %ebx, %eax
shrl $0x8, %eax
movl $0xff00, %edx           # imm = 0xFF00
andl %edx, %eax
movw %ax, (%rcx)
andl %ebx, %edx
movw %dx, 0x2(%rcx)
movl %ebx, %eax
shll $0x8, %eax
movw %ax, 0x4(%rcx)
movq 0xfc65(%rip), %rdi      # 0x1daf0
movq 0xfcd6(%rip), %rsi      # 0x1db68
movq 0xfc5f(%rip), %rdx      # 0x1daf8
leaq 0x68(%rsp), %r13
movq %r13, %r8
callq 0x6720
movq %rbp, %r12
shrq $0x20, %r12
btq $0x38, %rbp
movq %r14, 0x20(%rsp)
jb 0xdec9
movq 0xfb38(%rip), %rax      # 0x1d9f8
shlq $0x4, %r12
addq %rax, %r12
jmp 0xdf1d
leaq 0x38(%rsp), %rcx
movw $0xffff, 0x6(%rcx)      # imm = 0xFFFF
movl $0xff00, %eax           # imm = 0xFF00
movl %r12d, %edx
andl %eax, %edx
movw %dx, 0x2(%rcx)
shrq $0x28, %rbp
andl %eax, %ebp
movw %bp, (%rcx)
shll $0x8, %r12d
movw %r12w, 0x4(%rcx)
movq 0xfbf5(%rip), %rdi      # 0x1daf0
movq 0xfc66(%rip), %rsi      # 0x1db68
movq 0xfbef(%rip), %rdx      # 0x1daf8
leaq 0x58(%rsp), %r12
movq %r12, %r8
callq 0x6720
movq 0xfadb(%rip), %rax      # 0x1d9f8
movl %r15d, %r14d
andl $0x3, %r14d
cmpl $0x1, %r14d
sete %dl
cmpl $0x8, %ebx
setb %cl
andb %dl, %cl
orl $0x8, %ebx
shlq $0x4, %rbx
addq %rax, %rbx
testb %cl, %cl
movq %r13, %rbp
cmovneq %rbx, %rbp
testb $0x20, 0xfccb(%rip)     # 0x1dc18
jne 0xdf59
movq 0x28(%rsp), %r13
jmp 0xe046
movl 0xb631(%rip), %edx      # 0x19590
shlq $0x4, %rdx
addq %rax, %rdx
cmpq %rdx, %rbp
je 0xdfce
testb %cl, %cl
cmovneq %rbx, %r13
movl 0x8(%r13), %eax
notl %eax
leaq 0x30(%rsp), %rcx
movw %ax, (%rcx)
movzwl 0xa(%r13), %eax
notl %eax
movw %ax, 0x2(%rcx)
movl 0xc(%r13), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r13), %eax
movw %ax, 0x6(%rcx)
movq 0xfb4c(%rip), %rdi      # 0x1daf0
movq 0xfbbd(%rip), %rsi      # 0x1db68
movq 0xfb46(%rip), %rdx      # 0x1daf8
leaq 0x40(%rsp), %rbp
movq %rbp, %r8
callq 0x6720
movq 0xfa32(%rip), %rax      # 0x1d9f8
movl 0xb5c8(%rip), %ecx      # 0x19594
jmp 0xdfde
movl 0xb5c0(%rip), %ecx      # 0x19594
movq %rcx, %rbp
shlq $0x4, %rbp
addq %rax, %rbp
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r12
movq 0x28(%rsp), %r13
je 0xe036
movl 0x8(%r12), %eax
notl %eax
leaq 0x38(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%r12), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r12), %eax
movw %ax, 0x6(%rcx)
movq 0xfad7(%rip), %rdi      # 0x1daf0
movq 0xfb48(%rip), %rsi      # 0x1db68
movq 0xfad1(%rip), %rdx      # 0x1daf8
leaq 0x78(%rsp), %r12
movq %r12, %r8
callq 0x6720
jmp 0xe046
movl 0xb554(%rip), %ecx      # 0x19590
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r12
movl %r13d, %ebx
imull 0x4(%rsp), %ebx
cmpl $0x2, %r14d
jne 0xe09b
movq 0x8(%rbp), %xmm0
psrlw $0x1, %xmm0
leaq 0x30(%rsp), %rcx
movd %xmm0, (%rcx)
movzwl 0xc(%rbp), %eax
shrl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%rbp), %eax
movw %ax, 0x6(%rcx)
movq 0xfa70(%rip), %rdi      # 0x1daf0
movq 0xfae1(%rip), %rsi      # 0x1db68
movq 0xfa6a(%rip), %rdx      # 0x1daf8
leaq 0x40(%rsp), %rbp
movq %rbp, %r8
callq 0x6720
movq 0x20(%rsp), %r14
movl 0x8(%rsp), %eax
addl %eax, %ebx
addl %eax, %r14d
imull 0xc(%rsp), %r13d
testb $0x20, %r15b
movq %r12, %rax
cmoveq %rbp, %rax
cmoveq %r12, %rbp
movl 0xfb54(%rip), %edx      # 0x1dc18
btl $0xb, %edx
movq %rbp, %r12
cmovaeq %rax, %r12
testb $0x10, %r15b
cmoveq %rax, %r12
testb $0x40, %r15b
cmovneq %rbp, %r12
movl 0xbd1f(%rip), %eax      # 0x19e04
cmpl $0x0, 0x4(%rsp)
jne 0xe15a
movl (%rsp), %esi
testl %esi, %esi
movl %r14d, %ecx
cmovel %esi, %ecx
movl 0xfb12(%rip), %r9d      # 0x1dc10
addl %r14d, %r9d
movl 0xfafd(%rip), %esi      # 0x1dc04
addl %eax, %esi
movl $0x0, %r8d
cmpl %esi, %r9d
jl 0xe11b
movl 0xfaf1(%rip), %r8d      # 0x1dc0c
movq 0xfa3e(%rip), %rdi      # 0x1db60
testb $0x20, %dl
leaq 0xb464(%rip), %rdx      # 0x19590
leaq 0xb461(%rip), %rsi      # 0x19594
cmovneq %rdx, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0xf8b4(%rip), %rsi      # 0x1d9f8
subl %ecx, %r9d
addl %r8d, %r9d
xorl %edx, %edx
movl %eax, %r8d
callq 0x63f0
movl 0xbcaa(%rip), %eax      # 0x19e04
leal (%rbx,%r13), %edx
movl 0xfa9c(%rip), %ecx      # 0x1dc00
addl %eax, %ecx
cmpl %ecx, %edx
jl 0xe1d6
movl (%rsp), %esi
testl %esi, %esi
movl %r14d, %ecx
cmovel %esi, %ecx
movl 0xfa8c(%rip), %r8d      # 0x1dc08
movl 0xfa8d(%rip), %r9d      # 0x1dc10
addl %r14d, %r9d
addl 0xfa78(%rip), %eax      # 0x1dc04
cmpl %eax, %r9d
jl 0xe198
movl 0xfa74(%rip), %r9d      # 0x1dc0c
movq 0xf9c1(%rip), %rdi      # 0x1db60
testb $0x20, 0xfa72(%rip)     # 0x1dc18
leaq 0xb3e3(%rip), %rax      # 0x19590
leaq 0xb3e0(%rip), %rsi      # 0x19594
cmovneq %rax, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0xf833(%rip), %rsi      # 0x1d9f8
subl %edx, %r8d
subl %ecx, %r9d
callq 0x63f0
movl 0xbc2e(%rip), %eax      # 0x19e04
cmpl $0x0, (%rsp)
jne 0xe21e
movq 0xf97d(%rip), %rdi      # 0x1db60
testb $0x20, 0xfa2e(%rip)     # 0x1dc18
leaq 0xb39f(%rip), %rcx      # 0x19590
leaq 0xb39c(%rip), %rdx      # 0x19594
cmovneq %rcx, %rdx
movl (%rdx), %esi
shlq $0x4, %rsi
addq 0xf7ef(%rip), %rsi      # 0x1d9f8
movl %ebx, %edx
xorl %ecx, %ecx
movl %r13d, %r8d
movl %eax, %r9d
callq 0x63f0
movl 0xbbe6(%rip), %eax      # 0x19e04
movl 0xf9eb(%rip), %r9d      # 0x1dc10
leal (%r9,%r14), %ecx
addl 0xf9d5(%rip), %eax      # 0x1dc04
cmpl %eax, %ecx
jl 0xe27b
movl 0xf9d2(%rip), %r9d      # 0x1dc0c
movq 0xf91f(%rip), %rdi      # 0x1db60
testb $0x20, 0xf9d0(%rip)     # 0x1dc18
leaq 0xb341(%rip), %rax      # 0x19590
leaq 0xb33e(%rip), %rdx      # 0x19594
cmovneq %rax, %rdx
movl (%rdx), %esi
shlq $0x4, %rsi
addq 0xf791(%rip), %rsi      # 0x1d9f8
subl %ecx, %r9d
movl %ebx, %edx
movl %r13d, %r8d
callq 0x63f0
movl 0xf995(%rip), %r9d      # 0x1dc10
movq 0xf8de(%rip), %rdi      # 0x1db60
movq %rbp, %rsi
movl %ebx, %edx
movl %r14d, %ecx
movl %r13d, %r8d
callq 0x63f0
leaq 0x50(%rsp), %rcx
movl $0x0, (%rcx)
movzwl 0xf96c(%rip), %eax      # 0x1dc10
movw %ax, 0x6(%rcx)
movw %r13w, 0x4(%rcx)
movq 0xf8ac(%rip), %rdi      # 0x1db60
movl %ebx, %esi
movl %r14d, %edx
movl $0x1, %r8d
callq 0x6650
btl $0xb, %r15d
jb 0xe2e6
movq 0xf88e(%rip), %rdi      # 0x1db60
movq %r12, %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x63a0
jmp 0xe314
movl %r13d, %eax
cltd
movq 0x18(%rsp), %r10
idivl %r10d
movl 0xf918(%rip), %ecx      # 0x1dc10
movl %ebx, %edi
movl %r14d, %esi
movl %eax, %edx
movq %r12, %r8
movq %rbp, %r9
pushq %r10
pushq 0x18(%rsp)
callq 0x1110b
addq $0x10, %rsp
testb $0x8, %r15b
je 0xe359
cvtsi2ss %r14d, %xmm0
cvtsi2ssl 0xf6e9(%rip), %xmm1 # 0x1da10
movq 0xf832(%rip), %rdi      # 0x1db60
mulss 0xbad6(%rip), %xmm1     # 0x19e0c
addss %xmm0, %xmm1
addss 0x48be(%rip), %xmm1     # 0x12c00
cvttss2si %xmm1, %ecx
movq %r12, %rsi
movl %ebx, %edx
movl %r13d, %r8d
movl $0x1, %r9d
callq 0x63f0
testb %r15b, %r15b
jns 0xe3a7
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
movl 0xf6a4(%rip), %eax      # 0x1da10
addl %eax, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0xba8f(%rip), %xmm1     # 0x19e0c
divss 0x487f(%rip), %xmm1     # 0x12c04
movq 0xf7d4(%rip), %rdi      # 0x1db60
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movq %r12, %rsi
movl %ebx, %edx
movl %r13d, %r8d
movl $0x1, %r9d
callq 0x63f0
movq 0xf7b2(%rip), %rdi      # 0x1db60
xorl %esi, %esi
callq 0x6610
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq