// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rsi, %rcx
movq %rdi, 0x10(%rsp)
movq %rsi, %r14
shrq $0x20, %r14
shrq $0x29, %rcx
andb $0x1, %cl
movq %rax, 0x18(%rsp)
shll %cl, %eax
movl %eax, 0xc(%rsp)
movl %r12d, %ebx
movl %r14d, %eax
notl %eax
testb $0x5, %al
jne 0xd5d0
movl 0x10516(%rip), %eax     # 0x1dad4
orl 0x1050c(%rip), %eax     # 0x1dad0
movl $0xb, %eax
cmovel %ebx, %eax
movl %eax, %ebx
jmp 0xd5f3
testb $0x4, %r14b
je 0xd5df
cmpl $0x0, 0x104bb(%rip)     # 0x1da98
jne 0xd5ee
testb $0x1, %r14b
je 0xd5f3
cmpl $0x0, 0x10478(%rip)     # 0x1da64
je 0xd5f3
movl $0xb, %ebx
movl 0x1062b(%rip), %eax     # 0x1dc24
movq %rax, 0x20(%rsp)
movl 0xc810(%rip), %eax      # 0x19e14
movl %eax, 0x8(%rsp)
movl 0x10612(%rip), %ebp     # 0x1dc20
imull %r9d, %ebp
btl $0x18, %ebx
movl %r9d, (%rsp)
jb 0xd62c
movl %ebx, %r15d
shlq $0x4, %r15
addq 0x103de(%rip), %r15     # 0x1da08
jmp 0xd677
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 0x104a4(%rip), %rdi     # 0x1db00
movq 0x10515(%rip), %rsi     # 0x1db78
movq 0x1049e(%rip), %rdx     # 0x1db08
leaq 0x68(%rsp), %r15
movq %r15, %r8
callq 0x6730
movq %r12, %r13
shrq $0x20, %r13
btq $0x38, %r12
jb 0xd692
shlq $0x4, %r13
addq 0x10378(%rip), %r13     # 0x1da08
jmp 0xd6e1
leaq 0x38(%rsp), %rcx
movw $0xffff, 0x6(%rcx)      # imm = 0xFFFF
movl $0xff00, %eax           # imm = 0xFF00
movl %r13d, %edx
andl %eax, %edx
movw %dx, 0x2(%rcx)
shrq $0x28, %r12
andl %eax, %r12d
movw %r12w, (%rcx)
shll $0x8, %r13d
movw %r13w, 0x4(%rcx)
movq 0x1043a(%rip), %rdi     # 0x1db00
movq 0x104ab(%rip), %rsi     # 0x1db78
movq 0x10434(%rip), %rdx     # 0x1db08
leaq 0x58(%rsp), %r13
movq %r13, %r8
callq 0x6730
movq %r14, 0x28(%rsp)
andl $0x3, %r14d
cmpl $0x1, %r14d
sete %al
cmpl $0x8, %ebx
setb %cl
andb %al, %cl
movq 0x10308(%rip), %rax     # 0x1da08
orl $0x8, %ebx
shlq $0x4, %rbx
addq %rax, %rbx
testb %cl, %cl
movq %r15, %r12
cmovneq %rbx, %r12
testb $0x20, 0x1050e(%rip)    # 0x1dc28
jne 0xd726
movq 0x20(%rsp), %r15
jmp 0xd81c
movl 0xbe74(%rip), %edx      # 0x195a0
shlq $0x4, %rdx
addq %rax, %rdx
cmpq %rdx, %r12
je 0xd78e
testb %cl, %cl
cmovneq %rbx, %r15
movl 0x8(%r15), %eax
notl %eax
leaq 0x30(%rsp), %rcx
movw %ax, (%rcx)
movzwl 0xa(%r15), %eax
notl %eax
movw %ax, 0x2(%rcx)
movl 0xc(%r15), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r15), %eax
movw %ax, 0x6(%rcx)
movq 0x1038f(%rip), %rdi     # 0x1db00
movq 0x10400(%rip), %rsi     # 0x1db78
movq 0x10389(%rip), %rdx     # 0x1db08
leaq 0x40(%rsp), %r12
movq %r12, %r8
callq 0x6730
jmp 0xd79e
movl 0xbe10(%rip), %ecx      # 0x195a4
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r12
movq 0x10263(%rip), %rax     # 0x1da08
movl 0xbdf9(%rip), %ecx      # 0x195a4
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
movq 0x20(%rsp), %r15
je 0xd80c
movl 0x8(%r13), %eax
notl %eax
leaq 0x38(%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 0x10311(%rip), %rdi     # 0x1db00
movq 0x10382(%rip), %rsi     # 0x1db78
movq 0x1030b(%rip), %rdx     # 0x1db08
leaq 0x78(%rsp), %r13
movq %r13, %r8
callq 0x6730
jmp 0xd81c
movl 0xbd8e(%rip), %ecx      # 0x195a0
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r13
movl %r15d, %ebx
imull 0x4(%rsp), %ebx
cmpl $0x2, %r14d
jne 0xd87e
movzwl 0x8(%r12), %eax
shrl %eax
leaq 0x30(%rsp), %rcx
movw %ax, (%rcx)
movzwl 0xa(%r12), %eax
shrl %eax
movw %ax, 0x2(%rcx)
movzwl 0xc(%r12), %eax
shrl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r12), %eax
movw %ax, 0x6(%rcx)
movq 0x1029d(%rip), %rdi     # 0x1db00
movq 0x1030e(%rip), %rsi     # 0x1db78
movq 0x10297(%rip), %rdx     # 0x1db08
leaq 0x40(%rsp), %r12
movq %r12, %r8
callq 0x6730
movq 0x28(%rsp), %r14
movl (%rsp), %esi
movl 0x8(%rsp), %eax
addl %eax, %ebx
addl %eax, %ebp
imull 0xc(%rsp), %r15d
testb $0x20, %r14b
movq %r13, %rcx
cmoveq %r12, %rcx
cmoveq %r13, %r12
movl 0x1037f(%rip), %eax     # 0x1dc28
btl $0xb, %eax
movq %r12, %r13
cmovaeq %rcx, %r13
testb $0x10, %r14b
cmoveq %rcx, %r13
testb $0x40, %r14b
cmovneq %r12, %r13
cmpl $0x0, 0x4(%rsp)
jne 0xd934
testl %esi, %esi
movl %ebp, %ecx
cmovel %esi, %ecx
movl 0xc53b(%rip), %r8d      # 0x19e14
movl 0x10340(%rip), %r9d     # 0x1dc20
addl %ebp, %r9d
movl 0x1032b(%rip), %esi     # 0x1dc14
addl %r8d, %esi
movl $0x0, %edx
cmpl %esi, %r9d
jl 0xd8fc
movl 0x10320(%rip), %edx     # 0x1dc1c
movq 0x1026d(%rip), %rdi     # 0x1db70
testb $0x20, %al
leaq 0xbc94(%rip), %rax      # 0x195a0
leaq 0xbc91(%rip), %rsi      # 0x195a4
cmovneq %rax, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0x100e4(%rip), %rsi     # 0x1da08
subl %ecx, %r9d
addl %edx, %r9d
xorl %edx, %edx
callq 0x63f0
movl (%rsp), %esi
leal (%rbx,%r15), %edx
movl 0xc4d6(%rip), %eax      # 0x19e14
movl 0x102cc(%rip), %ecx     # 0x1dc10
addl %eax, %ecx
cmpl %ecx, %edx
jl 0xd9af
testl %esi, %esi
movl %ebp, %ecx
cmovel %esi, %ecx
movl 0x102c0(%rip), %r8d     # 0x1dc18
movl 0x102c1(%rip), %r9d     # 0x1dc20
addl %ebp, %r9d
addl 0x102ac(%rip), %eax     # 0x1dc14
cmpl %eax, %r9d
jl 0xd974
movl 0x102a8(%rip), %r9d     # 0x1dc1c
movq 0x101f5(%rip), %rdi     # 0x1db70
testb $0x20, 0x102a6(%rip)    # 0x1dc28
leaq 0xbc17(%rip), %rax      # 0x195a0
leaq 0xbc14(%rip), %rsi      # 0x195a4
cmovneq %rax, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0x10067(%rip), %rsi     # 0x1da08
subl %edx, %r8d
subl %ecx, %r9d
callq 0x63f0
movl (%rsp), %esi
testl %esi, %esi
jne 0xd9f3
movl 0xc45a(%rip), %r9d      # 0x19e14
movq 0x101af(%rip), %rdi     # 0x1db70
testb $0x20, 0x10260(%rip)    # 0x1dc28
leaq 0xbbd1(%rip), %rax      # 0x195a0
leaq 0xbbce(%rip), %rcx      # 0x195a4
cmovneq %rax, %rcx
movl (%rcx), %esi
shlq $0x4, %rsi
addq 0x10021(%rip), %rsi     # 0x1da08
movl %ebx, %edx
xorl %ecx, %ecx
movl %r15d, %r8d
callq 0x63f0
movl 0x10227(%rip), %ecx     # 0x1dc20
addl %ebp, %ecx
movl 0x10213(%rip), %eax     # 0x1dc14
addl 0xc40d(%rip), %eax      # 0x19e14
cmpl %eax, %ecx
jl 0xda4c
movl 0x1020a(%rip), %r9d     # 0x1dc1c
movq 0x10157(%rip), %rdi     # 0x1db70
testb $0x20, 0x10208(%rip)    # 0x1dc28
leaq 0xbb79(%rip), %rax      # 0x195a0
leaq 0xbb76(%rip), %rdx      # 0x195a4
cmovneq %rax, %rdx
movl (%rdx), %esi
shlq $0x4, %rsi
addq 0xffc9(%rip), %rsi      # 0x1da08
subl %ecx, %r9d
movl %ebx, %edx
movl %r15d, %r8d
callq 0x63f0
movq 0x1011d(%rip), %rdi     # 0x1db70
movl 0x101c6(%rip), %r9d     # 0x1dc20
movq %r12, %rsi
movl %ebx, %edx
movl %ebp, %ecx
movl %r15d, %r8d
callq 0x63f0
leaq 0x50(%rsp), %rcx
movl $0x0, (%rcx)
movzwl 0x101a5(%rip), %eax     # 0x1dc20
movw %ax, 0x6(%rcx)
movw %r15w, 0x4(%rcx)
movq 0x100e5(%rip), %rdi     # 0x1db70
movl %ebx, %esi
movl %ebp, %edx
movl $0x1, %r8d
callq 0x6650
btl $0xb, %r14d
jb 0xdabc
movq 0x100c8(%rip), %rdi     # 0x1db70
movq %r13, %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x63a0
jmp 0xdae9
movl %r15d, %eax
cltd
movq 0x18(%rsp), %r10
idivl %r10d
movl 0x10152(%rip), %ecx     # 0x1dc20
movl %ebx, %edi
movl %ebp, %esi
movl %eax, %edx
movq %r13, %r8
movq %r12, %r9
pushq %r10
pushq 0x18(%rsp)
callq 0x108d1
addq $0x10, %rsp
testb $0x8, %r14b
je 0xdb2d
cvtsi2ss %ebp, %xmm0
cvtsi2ssl 0xff25(%rip), %xmm1 # 0x1da20
movq 0x1006e(%rip), %rdi     # 0x1db70
mulss 0xc312(%rip), %xmm1     # 0x19e1c
addss %xmm0, %xmm1
addss 0x50c6(%rip), %xmm1     # 0x12bdc
cvttss2si %xmm1, %ecx
movq %r13, %rsi
movl %ebx, %edx
movl %r15d, %r8d
movl $0x1, %r9d
callq 0x63f0
testb %r14b, %r14b
jns 0xdb7a
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movl 0xfee1(%rip), %eax      # 0x1da20
addl %eax, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0xc2cc(%rip), %xmm1     # 0x19e1c
divss 0x5088(%rip), %xmm1     # 0x12be0
movq 0x10011(%rip), %rdi     # 0x1db70
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movq %r13, %rsi
movl %ebx, %edx
movl %r15d, %r8d
movl $0x1, %r9d
callq 0x63f0
movq 0xffef(%rip), %rdi      # 0x1db70
xorl %esi, %esi
callq 0x6610
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq