// File: /workspace/github_c_makefile_star2_O2/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, 0x18(%rsp)
movq %rsi, %r15
shrq $0x20, %r15
shrq $0x29, %rcx
andb $0x1, %cl
movq %rax, 0x20(%rsp)
shll %cl, %eax
movl %eax, 0x14(%rsp)
movl %ebp, %ebx
movl 0xc320(%rip), %eax      # 0x18e04
movl %eax, 0x10(%rsp)
movl 0x10125(%rip), %r14d    # 0x1cc14
movl 0x1011b(%rip), %ecx     # 0x1cc10
movl %r9d, (%rsp)
imull %r9d, %ecx
movl %r15d, %eax
notl %eax
testb $0x5, %al
movq %rcx, 0x28(%rsp)
jne 0xcb29
movl 0xffb3(%rip), %eax      # 0x1cac4
orl 0xffa9(%rip), %eax      # 0x1cac0
pushq $0xb
popq %rax
cmovel %ebx, %eax
movl %eax, %ebx
btl $0x18, %ebx
jb 0xcb5c
movl %ebx, %eax
jmp 0xcb4a
pushq $0xb
popq %rax
testb $0x4, %r15b
je 0xcb3b
cmpl $0x0, 0xff4f(%rip)      # 0x1ca88
jne 0xcb4a
testb $0x1, %r15b
je 0xcb1f
cmpl $0x0, 0xff0c(%rip)      # 0x1ca54
je 0xcb1f
movl %eax, %r12d
shlq $0x4, %r12
addq 0xfea0(%rip), %r12      # 0x1c9f8
movl %eax, %ebx
jmp 0xcba6
leaq 0x30(%rsp), %rcx
orw $-0x1, 0x6(%rcx)
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 0xff65(%rip), %rdi      # 0x1caf0
movq 0xffd6(%rip), %rsi      # 0x1cb68
movq 0xff5f(%rip), %rdx      # 0x1caf8
leaq 0x68(%rsp), %r12
movq %r12, %r8
callq 0x6720
movq %rbp, %r13
shrq $0x20, %r13
btq $0x38, %rbp
movq %r14, 0x8(%rsp)
jb 0xcbc9
movq 0xfe38(%rip), %rax      # 0x1c9f8
shlq $0x4, %r13
addq %rax, %r13
jmp 0xcc1c
leaq 0x38(%rsp), %rcx
orw $-0x1, 0x6(%rcx)
movl $0xff00, %eax           # imm = 0xFF00
movl %r13d, %edx
andl %eax, %edx
movw %dx, 0x2(%rcx)
shrq $0x28, %rbp
andl %eax, %ebp
movw %bp, (%rcx)
shll $0x8, %r13d
movw %r13w, 0x4(%rcx)
movq 0xfef6(%rip), %rdi      # 0x1caf0
movq 0xff67(%rip), %rsi      # 0x1cb68
movq 0xfef0(%rip), %rdx      # 0x1caf8
leaq 0x58(%rsp), %r13
movq %r13, %r8
callq 0x6720
movq 0xfddc(%rip), %rax      # 0x1c9f8
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 %r12, %rbp
cmovneq %rbx, %rbp
testb $0x20, 0xffcc(%rip)     # 0x1cc18
jne 0xcc58
movq 0x28(%rsp), %r12
jmp 0xcd46
movl 0xb932(%rip), %edx      # 0x18590
shlq $0x4, %rdx
addq %rax, %rdx
cmpq %rdx, %rbp
je 0xccd1
testb %cl, %cl
cmovneq %rbx, %r12
movl 0x8(%r12), %eax
notl %eax
leaq 0x30(%rsp), %rcx
movw %ax, (%rcx)
movzwl 0xa(%r12), %eax
notl %eax
movw %ax, 0x2(%rcx)
movl 0xc(%r12), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r12), %eax
movw %ax, 0x6(%rcx)
movq 0xfe49(%rip), %rdi      # 0x1caf0
movq 0xfeba(%rip), %rsi      # 0x1cb68
movq 0xfe43(%rip), %rdx      # 0x1caf8
leaq 0x40(%rsp), %rbp
movq %rbp, %r8
callq 0x6720
movq 0xfd2f(%rip), %rax      # 0x1c9f8
movl 0xb8c5(%rip), %ecx      # 0x18594
jmp 0xcce1
movl 0xb8bd(%rip), %ecx      # 0x18594
movq %rcx, %rbp
shlq $0x4, %rbp
addq %rax, %rbp
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
movq 0x28(%rsp), %r12
je 0xcd36
movl 0x8(%r13), %eax
notl %eax
leaq 0x38(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%r13), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r13), %eax
movw %ax, 0x6(%rcx)
movq 0xfdd7(%rip), %rdi      # 0x1caf0
movq 0xfe48(%rip), %rsi      # 0x1cb68
movq 0xfdd1(%rip), %rdx      # 0x1caf8
leaq 0x78(%rsp), %r13
movq %r13, %r8
callq 0x6720
jmp 0xcd46
movl 0xb854(%rip), %ecx      # 0x18590
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r13
movq 0x8(%rsp), %rbx
imull 0x4(%rsp), %ebx
cmpl $0x2, %r14d
jne 0xcd9d
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 0xfd6e(%rip), %rdi      # 0x1caf0
movq 0xfddf(%rip), %rsi      # 0x1cb68
movq 0xfd68(%rip), %rdx      # 0x1caf8
leaq 0x40(%rsp), %rbp
movq %rbp, %r8
callq 0x6720
movl 0x10(%rsp), %eax
addl %eax, %ebx
addl %eax, %r12d
movq 0x8(%rsp), %r14
imull 0x14(%rsp), %r14d
testb $0x20, %r15b
movq %r13, %rax
cmoveq %rbp, %rax
cmoveq %r13, %rbp
btl $0xb, 0xfe50(%rip)      # 0x1cc18
movq %rbp, %r13
cmovaeq %rax, %r13
testb $0x10, %r15b
cmoveq %rax, %r13
movq %r15, 0x8(%rsp)
testb $0x40, %r15b
cmovneq %rbp, %r13
movl 0xc01a(%rip), %ecx      # 0x18e04
cmpl $0x0, 0x4(%rsp)
movq %r12, %r15
jne 0xce32
movl (%rsp), %eax
testl %eax, %eax
movl %r12d, %esi
cmovel %eax, %esi
movl 0xfe0b(%rip), %edx      # 0x1cc10
addl %r12d, %edx
movl 0xfdf6(%rip), %edi      # 0x1cc04
addl %ecx, %edi
movl $0x0, %eax
cmpl %edi, %edx
jl 0xce1f
movl 0xfded(%rip), %eax      # 0x1cc0c
addl %edx, %eax
xorl %edi, %edi
movl %ecx, %edx
movl %eax, %ecx
callq 0xe255
movl 0xbfd2(%rip), %ecx      # 0x18e04
leal (%rbx,%r14), %r12d
movl 0xfdc4(%rip), %eax      # 0x1cc00
addl %ecx, %eax
cmpl %eax, %r12d
jl 0xce7e
movl (%rsp), %eax
testl %eax, %eax
movq %r15, %rdi
movl %edi, %esi
cmovel %eax, %esi
movl 0xfdb2(%rip), %edx      # 0x1cc08
movl 0xfdb4(%rip), %eax      # 0x1cc10
addl %edi, %eax
addl 0xfda0(%rip), %ecx      # 0x1cc04
cmpl %ecx, %eax
jl 0xce6e
movl 0xfd9e(%rip), %eax      # 0x1cc0c
movl %r12d, %edi
movl %eax, %ecx
callq 0xe255
movl 0xbf86(%rip), %ecx      # 0x18e04
cmpl $0x0, (%rsp)
jne 0xce96
movl %ebx, %edi
xorl %esi, %esi
movl %r12d, %edx
callq 0xe255
movl 0xbf6e(%rip), %ecx      # 0x18e04
movl 0xfd73(%rip), %r9d      # 0x1cc10
leal (%r9,%r15), %esi
addl 0xfd5d(%rip), %ecx      # 0x1cc04
cmpl %ecx, %esi
jl 0xcec2
movl 0xfd5b(%rip), %ecx      # 0x1cc0c
movl %ebx, %edi
movl %r12d, %edx
callq 0xe255
movl 0xfd4e(%rip), %r9d      # 0x1cc10
movq 0xfc97(%rip), %rdi      # 0x1cb60
movq %rbp, %rsi
movl %ebx, %edx
movq %r15, %r12
movl %r12d, %ecx
movl %r14d, %r8d
callq 0x63f0
leaq 0x50(%rsp), %rcx
andl $0x0, (%rcx)
movzwl 0xfd25(%rip), %eax      # 0x1cc10
movw %ax, 0x6(%rcx)
movw %r14w, 0x4(%rcx)
movq 0xfc65(%rip), %rdi      # 0x1cb60
pushq $0x1
popq %r8
movl %ebx, %esi
movl %r12d, %edx
callq 0x6650
movq 0x8(%rsp), %r15
btl $0xb, %r15d
jb 0xcf30
movq 0xfc44(%rip), %rdi      # 0x1cb60
movq %r13, %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x63a0
jmp 0xcf5c
movl %r14d, %eax
cltd
movq 0x20(%rsp), %r10
idivl %r10d
movl 0xfcce(%rip), %ecx      # 0x1cc10
movl %ebx, %edi
movl %r12d, %esi
movl %eax, %edx
movq %r13, %r8
movq %rbp, %r9
pushq %r10
pushq 0x20(%rsp)
callq 0xfc6a
popq %rax
popq %rcx
testb $0x8, %r15b
je 0xcf9f
cvtsi2ss %r12d, %xmm0
cvtsi2ssl 0xfaa1(%rip), %xmm1 # 0x1ca10
movq 0xfbea(%rip), %rdi      # 0x1cb60
mulss 0xbe8e(%rip), %xmm1     # 0x18e0c
addss %xmm0, %xmm1
addss 0x4c46(%rip), %xmm1     # 0x11bd0
cvttss2si %xmm1, %ecx
pushq $0x1
popq %r9
movq %r13, %rsi
movl %ebx, %edx
movl %r14d, %r8d
callq 0x63f0
testb %r15b, %r15b
jns 0xcfe5
cvtsi2ss %r12d, %xmm0
movl 0xfa61(%rip), %eax      # 0x1ca10
addl %eax, %eax
cvtsi2ss %eax, %xmm1
mulss 0xbe4f(%rip), %xmm1     # 0x18e0c
divss 0x4c0f(%rip), %xmm1     # 0x11bd4
movq 0xfb94(%rip), %rdi      # 0x1cb60
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
pushq $0x1
popq %r9
movq %r13, %rsi
movl %ebx, %edx
movl %r14d, %r8d
callq 0x63f0
movq 0xfb74(%rip), %rdi      # 0x1cb60
xorl %esi, %esi
callq 0x6610
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq