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

	/* 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];
	}

	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;

	if (dmode & DRAW_BG) {
		/* Intelligent cleaning up of the borders. */
		if (x == 0) {
			xclear(0, (y == 0)? 0 : winy, win.vborderpx,
				winy + win.ch +
				((winy + win.ch >= win.vborderpx + win.th)? win.h : 0));
		}
		if (winx + width >= win.hborderpx + win.tw) {
			xclear(winx + width, (y == 0)? 0 : winy, win.w,
				((winy + win.ch >= win.vborderpx + win.th)? win.h : (winy + win.ch)));
		}
		if (y == 0)
			xclear(winx, 0, winx + width, win.hborderpx);
		if (winy + win.ch >= win.vborderpx + 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);
	}

	if (dmode & DRAW_FG) {
		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 + 1,
					width, 1);
		}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %eax
movq %rdx, %rbp
movq %rsi, %rcx
movq %rdi, 0x18(%rsp)
movq %rsi, %rbx
shrq $0x20, %rbx
shrq $0x29, %rcx
andb $0x1, %cl
movq %rax, 0x20(%rsp)
shll %cl, %eax
movl %eax, 0x14(%rsp)
movl 0x12b82(%rip), %r14d    # 0x1e9ac
movq %r14, 0x8(%rsp)
movl %r8d, 0x10(%rsp)
imull %r8d, %r14d
addl 0x12b61(%rip), %r14d    # 0x1e9a0
movl 0x12b62(%rip), %r15d    # 0x1e9a8
movl %r9d, 0x4(%rsp)
imull %r9d, %r15d
addl 0x12b4e(%rip), %r15d    # 0x1e9a4
movl %ebp, %eax
movl %ebx, %ecx
notl %ecx
testb $0x5, %cl
jne 0xbe7d
movl 0x129fd(%rip), %ecx     # 0x1e864
orl 0x129f3(%rip), %ecx     # 0x1e860
pushq $0xb
popq %rcx
cmovnel %ecx, %eax
btl $0x18, %eax
jb 0xbeac
movl %eax, %ecx
jmp 0xbe9c
pushq $0xb
popq %rcx
testb $0x4, %bl
je 0xbe8e
cmpl $0x0, 0x1299c(%rip)     # 0x1e828
jne 0xbe9c
testb $0x1, %bl
je 0xbe73
cmpl $0x0, 0x1295a(%rip)     # 0x1e7f4
je 0xbe73
movl %ecx, %r13d
shlq $0x4, %r13
addq 0x128ee(%rip), %r13     # 0x1e798
jmp 0xbef4
leaq 0x28(%rsp), %rcx
orw $-0x1, 0x6(%rcx)
movl %eax, %edx
shrl $0x8, %edx
movl $0xff00, %esi           # imm = 0xFF00
andl %esi, %edx
movw %dx, (%rcx)
andl %eax, %esi
movw %si, 0x2(%rcx)
shll $0x8, %eax
movw %ax, 0x4(%rcx)
movq 0x129b7(%rip), %rdi     # 0x1e890
movq 0x12a20(%rip), %rsi     # 0x1e900
movq 0x129b1(%rip), %rdx     # 0x1e898
leaq 0x58(%rsp), %r13
movq %r13, %r8
callq 0x67d0
movq %rbp, %r12
shrq $0x20, %r12
btq $0x38, %rbp
jb 0xbf0f
shlq $0x4, %r12
addq 0x1288b(%rip), %r12     # 0x1e798
jmp 0xbf5b
leaq 0x30(%rsp), %rcx
orw $-0x1, 0x6(%rcx)
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 0x12950(%rip), %rdi     # 0x1e890
movq 0x129b9(%rip), %rsi     # 0x1e900
movq 0x1294a(%rip), %rdx     # 0x1e898
leaq 0x48(%rsp), %r12
movq %r12, %r8
callq 0x67d0
movq 0x8(%rsp), %rbp
testb $0x20, 0x12a49(%rip)    # 0x1e9b0
je 0xc04a
movq 0x12824(%rip), %rax     # 0x1e798
movl 0xb682(%rip), %ecx      # 0x175fc
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
je 0xbfd7
movl 0x8(%r13), %eax
notl %eax
leaq 0x28(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%r13), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r13), %eax
movw %ax, 0x6(%rcx)
movq 0x128e3(%rip), %rdi     # 0x1e890
movq 0x1294c(%rip), %rsi     # 0x1e900
movq 0x128dd(%rip), %rdx     # 0x1e898
leaq 0x38(%rsp), %r13
movq %r13, %r8
callq 0x67d0
movq 0x127c9(%rip), %rax     # 0x1e798
movl 0xb62b(%rip), %ecx      # 0x17600
jmp 0xbfe7
movl 0xb623(%rip), %ecx      # 0x17600
movq %rcx, %r13
shlq $0x4, %r13
addq %rax, %r13
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r12
je 0xc03a
movl 0x8(%r12), %eax
notl %eax
leaq 0x30(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%r12), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r12), %eax
movw %ax, 0x6(%rcx)
movq 0x12873(%rip), %rdi     # 0x1e890
movq 0x128dc(%rip), %rsi     # 0x1e900
movq 0x1286d(%rip), %rdx     # 0x1e898
leaq 0x68(%rsp), %r12
movq %r12, %r8
callq 0x67d0
jmp 0xc04a
movl 0xb5bc(%rip), %ecx      # 0x175fc
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r12
movl 0xb0(%rsp), %ecx
movl %ebx, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0xc0ac
movq 0x8(%r13), %xmm0
psrlw $0x1, %xmm0
leaq 0x28(%rsp), %rcx
movd %xmm0, (%rcx)
movzwl 0xc(%r13), %eax
shrl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r13), %eax
movw %ax, 0x6(%rcx)
movq 0x12806(%rip), %rdi     # 0x1e890
movq 0x1286f(%rip), %rsi     # 0x1e900
movq 0x12800(%rip), %rdx     # 0x1e898
leaq 0x38(%rsp), %r13
movq %r13, %r8
callq 0x67d0
movl 0xb0(%rsp), %ecx
imull 0x14(%rsp), %ebp
testb $0x20, %bl
movq %r12, %rax
cmoveq %r13, %rax
cmoveq %r12, %r13
btl $0xb, 0x128e9(%rip)     # 0x1e9b0
movq %r13, %r12
cmovaeq %rax, %r12
testb $0x10, %bl
cmoveq %rax, %r12
testb $0x40, %bl
cmovneq %r13, %r12
testb $0x1, %cl
je 0xc1e6
cmpl $0x0, 0x10(%rsp)
jne 0xc127
movl 0x4(%rsp), %eax
testl %eax, %eax
movl %r15d, %esi
cmovel %eax, %esi
movl 0x128a6(%rip), %edx     # 0x1e9a4
movl 0x128a4(%rip), %eax     # 0x1e9a8
addl %r15d, %eax
movl 0x12887(%rip), %edi     # 0x1e994
addl %edx, %edi
movl $0x0, %ecx
cmpl %edi, %eax
jl 0xc11e
movl 0x1287e(%rip), %ecx     # 0x1e99c
addl %eax, %ecx
xorl %edi, %edi
callq 0xda5b
movq %rbp, 0x8(%rsp)
addl %r14d, %ebp
movl 0x1285b(%rip), %eax     # 0x1e990
addl 0x12865(%rip), %eax     # 0x1e9a0
cmpl %eax, %ebp
jl 0xc177
movl 0x4(%rsp), %eax
testl %eax, %eax
movl %r15d, %esi
cmovel %eax, %esi
movl 0x12847(%rip), %edx     # 0x1e998
movl 0x12851(%rip), %ecx     # 0x1e9a8
addl %r15d, %ecx
movl 0x12834(%rip), %eax     # 0x1e994
addl 0x1283e(%rip), %eax     # 0x1e9a4
cmpl %eax, %ecx
jl 0xc170
movl 0x1282c(%rip), %ecx     # 0x1e99c
movl %ebp, %edi
callq 0xda5b
cmpl $0x0, 0x4(%rsp)
jne 0xc190
movl 0x1281c(%rip), %ecx     # 0x1e9a0
movl %r14d, %edi
xorl %esi, %esi
movl %ebp, %edx
callq 0xda5b
movl 0x12811(%rip), %r9d     # 0x1e9a8
leal (%r9,%r15), %esi
movl 0x127f3(%rip), %eax     # 0x1e994
addl 0x127fd(%rip), %eax     # 0x1e9a4
cmpl %eax, %esi
jl 0xc1c2
movl 0x127eb(%rip), %ecx     # 0x1e99c
movl %r14d, %edi
movl %ebp, %edx
callq 0xda5b
movl 0x127e6(%rip), %r9d     # 0x1e9a8
movq 0x1272f(%rip), %rdi     # 0x1e8f8
movq %r13, %rsi
movl %r14d, %edx
movl %r15d, %ecx
movq 0x8(%rsp), %rbp
movl %ebp, %r8d
callq 0x6430
movl 0xb0(%rsp), %ecx
testb $0x2, %cl
je 0xc297
btl $0xb, %ebx
jb 0xc210
movq 0x126fc(%rip), %rdi     # 0x1e8f8
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x63d0
jmp 0xc23c
movl %ebp, %eax
cltd
movq 0x20(%rsp), %r10
idivl %r10d
movl 0x12787(%rip), %ecx     # 0x1e9a8
movl %r14d, %edi
movl %r15d, %esi
movl %eax, %edx
movq %r12, %r8
movq %r13, %r9
pushq %r10
pushq 0x20(%rsp)
callq 0xefa2
popq %rax
popq %rcx
testb $0x8, %bl
je 0xc266
movq 0x126b0(%rip), %rdi     # 0x1e8f8
movl 0x12562(%rip), %eax     # 0x1e7b0
leal (%r15,%rax), %ecx
incl %ecx
pushq $0x1
popq %r9
movq %r12, %rsi
movl %r14d, %edx
movl %ebp, %r8d
callq 0x6430
testb %bl, %bl
jns 0xc297
movq 0x12687(%rip), %rdi     # 0x1e8f8
movl 0x12539(%rip), %eax     # 0x1e7b0
addl %eax, %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
addl %eax, %r15d
pushq $0x1
popq %r9
movq %r12, %rsi
movl %r14d, %edx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x6430
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq