// File: /workspace/github_c_makefile_star2_O3/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, 0x10(%rsp)
movq %rsi, %rbx
shrq $0x20, %rbx
shrq $0x29, %rcx
andb $0x1, %cl
movq %rax, 0x18(%rsp)
movl %eax, %r14d
shll %cl, %r14d
movl 0x12d53(%rip), %eax     # 0x1f99c
movq %rax, 0x28(%rsp)
movl %r8d, 0xc(%rsp)
imull %r8d, %eax
addl 0x12d33(%rip), %eax     # 0x1f990
movq %rax, (%rsp)
movl 0x12d30(%rip), %r15d    # 0x1f998
movl %r9d, 0x8(%rsp)
imull %r9d, %r15d
addl 0x12d1c(%rip), %r15d    # 0x1f994
movl %ebp, %eax
movl %ebx, %ecx
notl %ecx
testb $0x5, %cl
jne 0xcca1
movl 0x12bcb(%rip), %ecx     # 0x1f854
orl 0x12bc1(%rip), %ecx     # 0x1f850
movl $0xb, %ecx
cmovnel %ecx, %eax
btl $0x18, %eax
jb 0xccd2
movl %eax, %ecx
jmp 0xccc2
movl $0xb, %ecx
testb $0x4, %bl
je 0xccb4
cmpl $0x0, 0x12b66(%rip)     # 0x1f818
jne 0xccc2
testb $0x1, %bl
je 0xcc97
cmpl $0x0, 0x12b24(%rip)     # 0x1f7e4
je 0xcc97
movl %ecx, %r13d
shlq $0x4, %r13
addq 0x12ab8(%rip), %r13     # 0x1f788
jmp 0xcd1b
leaq 0x20(%rsp), %rcx
movw $0xffff, 0x6(%rcx)      # imm = 0xFFFF
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 0x12b80(%rip), %rdi     # 0x1f880
movq 0x12be9(%rip), %rsi     # 0x1f8f0
movq 0x12b7a(%rip), %rdx     # 0x1f888
leaq 0x58(%rsp), %r13
movq %r13, %r8
callq 0x67d0
movq %rbp, %r12
shrq $0x20, %r12
btq $0x38, %rbp
jb 0xcd36
shlq $0x4, %r12
addq 0x12a54(%rip), %r12     # 0x1f788
jmp 0xcd83
leaq 0x30(%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 0x12b18(%rip), %rdi     # 0x1f880
movq 0x12b81(%rip), %rsi     # 0x1f8f0
movq 0x12b12(%rip), %rdx     # 0x1f888
leaq 0x48(%rsp), %r12
movq %r12, %r8
callq 0x67d0
testb $0x20, 0x12c16(%rip)    # 0x1f9a0
je 0xce6d
movq 0x129f1(%rip), %rax     # 0x1f788
movl 0xb85f(%rip), %ecx      # 0x185fc
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
je 0xcdfa
movl 0x8(%r13), %eax
notl %eax
leaq 0x20(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%r13), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r13), %eax
movw %ax, 0x6(%rcx)
movq 0x12ab0(%rip), %rdi     # 0x1f880
movq 0x12b19(%rip), %rsi     # 0x1f8f0
movq 0x12aaa(%rip), %rdx     # 0x1f888
leaq 0x38(%rsp), %r13
movq %r13, %r8
callq 0x67d0
movq 0x12996(%rip), %rax     # 0x1f788
movl 0xb808(%rip), %ecx      # 0x18600
jmp 0xce0a
movl 0xb800(%rip), %ecx      # 0x18600
movq %rcx, %r13
shlq $0x4, %r13
addq %rax, %r13
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r12
je 0xce5d
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 0x12a40(%rip), %rdi     # 0x1f880
movq 0x12aa9(%rip), %rsi     # 0x1f8f0
movq 0x12a3a(%rip), %rdx     # 0x1f888
leaq 0x68(%rsp), %r12
movq %r12, %r8
callq 0x67d0
jmp 0xce6d
movl 0xb799(%rip), %ecx      # 0x185fc
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r12
movl 0xb0(%rsp), %ebp
movl %ebx, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0xcec8
movq 0x8(%r13), %xmm0
psrlw $0x1, %xmm0
leaq 0x20(%rsp), %rcx
movd %xmm0, (%rcx)
movzwl 0xc(%r13), %eax
shrl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r13), %eax
movw %ax, 0x6(%rcx)
movq 0x129d3(%rip), %rdi     # 0x1f880
movq 0x12a3c(%rip), %rsi     # 0x1f8f0
movq 0x129cd(%rip), %rdx     # 0x1f888
leaq 0x38(%rsp), %r13
movq %r13, %r8
callq 0x67d0
movq 0x28(%rsp), %rax
imull %r14d, %eax
movq %rax, %r14
testb $0x20, %bl
movq %r12, %rcx
cmoveq %r13, %rcx
cmoveq %r12, %r13
movl 0x12ab8(%rip), %eax     # 0x1f9a0
btl $0xb, %eax
movq %r13, %r12
cmovaeq %rcx, %r12
testb $0x10, %bl
cmoveq %rcx, %r12
testb $0x40, %bl
cmovneq %r13, %r12
testb $0x1, %bpl
je 0xd0c9
cmpl $0x0, 0xc(%rsp)
jne 0xcf7d
movl 0x8(%rsp), %edx
testl %edx, %edx
movl %r15d, %ecx
cmovel %edx, %ecx
movl 0x12a6f(%rip), %r8d     # 0x1f994
movl 0x12a6c(%rip), %r9d     # 0x1f998
addl %r15d, %r9d
movl 0x12a4f(%rip), %esi     # 0x1f984
addl %r8d, %esi
movl $0x0, %edx
cmpl %esi, %r9d
jl 0xcf48
movl 0x12a44(%rip), %edx     # 0x1f98c
movq 0x12999(%rip), %rdi     # 0x1f8e8
testb $0x20, %al
leaq 0xb6a4(%rip), %rax      # 0x185fc
leaq 0xb6a1(%rip), %rsi      # 0x18600
cmovneq %rax, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0x12818(%rip), %rsi     # 0x1f788
subl %ecx, %r9d
addl %edx, %r9d
xorl %edx, %edx
callq 0x6430
movq (%rsp), %rax
leal (%rax,%r14), %edx
movl 0x129f5(%rip), %eax     # 0x1f980
addl 0x129ff(%rip), %eax     # 0x1f990
cmpl %eax, %edx
jl 0xd002
movl 0x8(%rsp), %eax
testl %eax, %eax
movl %r15d, %ecx
cmovel %eax, %ecx
movl 0x129e0(%rip), %r8d     # 0x1f988
movl 0x129e9(%rip), %r9d     # 0x1f998
addl %r15d, %r9d
movl 0x129cc(%rip), %eax     # 0x1f984
addl 0x129d6(%rip), %eax     # 0x1f994
cmpl %eax, %r9d
jl 0xcfca
movl 0x129c2(%rip), %r9d     # 0x1f98c
movq 0x12917(%rip), %rdi     # 0x1f8e8
testb $0x20, 0x129c8(%rip)    # 0x1f9a0
leaq 0xb61d(%rip), %rax      # 0x185fc
leaq 0xb61a(%rip), %rsi      # 0x18600
cmovneq %rax, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0x12791(%rip), %rsi     # 0x1f788
subl %edx, %r8d
subl %ecx, %r9d
callq 0x6430
cmpl $0x0, 0x8(%rsp)
jne 0xd04b
movl 0x12980(%rip), %r9d     # 0x1f990
movq 0x128d1(%rip), %rdi     # 0x1f8e8
testb $0x20, 0x12982(%rip)    # 0x1f9a0
leaq 0xb5d7(%rip), %rax      # 0x185fc
leaq 0xb5d4(%rip), %rcx      # 0x18600
cmovneq %rax, %rcx
movl (%rcx), %esi
shlq $0x4, %rsi
addq 0x1274b(%rip), %rsi     # 0x1f788
movq (%rsp), %rdx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x6430
movl 0x12946(%rip), %r9d     # 0x1f998
leal (%r9,%r15), %ecx
movl 0x12928(%rip), %eax     # 0x1f984
addl 0x12932(%rip), %eax     # 0x1f994
cmpl %eax, %ecx
jl 0xd0b0
movl 0x1291f(%rip), %r9d     # 0x1f98c
movq 0x12874(%rip), %rdi     # 0x1f8e8
testb $0x20, 0x12925(%rip)    # 0x1f9a0
leaq 0xb57a(%rip), %rax      # 0x185fc
leaq 0xb577(%rip), %rdx      # 0x18600
cmovneq %rax, %rdx
movl (%rdx), %esi
shlq $0x4, %rsi
addq 0x126ee(%rip), %rsi     # 0x1f788
subl %ecx, %r9d
movq (%rsp), %rdx
movl %r14d, %r8d
callq 0x6430
movl 0x128e8(%rip), %r9d     # 0x1f998
movq 0x12831(%rip), %rdi     # 0x1f8e8
movq %r13, %rsi
movq (%rsp), %rdx
movl %r15d, %ecx
movl %r14d, %r8d
callq 0x6430
testb $0x2, %bpl
je 0xd192
btl $0xb, %ebx
jb 0xd0f4
movq 0x12808(%rip), %rdi     # 0x1f8e8
movq %r12, %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x63d0
jmp 0xd124
movl %r14d, %eax
cltd
movq 0x18(%rsp), %r10
idivl %r10d
movl 0x12892(%rip), %ecx     # 0x1f998
movq (%rsp), %rdi
movl %r15d, %esi
movl %eax, %edx
movq %r12, %r8
movq %r13, %r9
pushq %r10
pushq 0x18(%rsp)
callq 0xff3b
addq $0x10, %rsp
testb $0x8, %bl
je 0xd151
movq 0x127b8(%rip), %rdi     # 0x1f8e8
movl 0x1266a(%rip), %eax     # 0x1f7a0
leal (%r15,%rax), %ecx
incl %ecx
movq %r12, %rsi
movq (%rsp), %rdx
movl %r14d, %r8d
movl $0x1, %r9d
callq 0x6430
testb %bl, %bl
jns 0xd192
movq 0x1278c(%rip), %rdi     # 0x1f8e8
movl 0x1263e(%rip), %eax     # 0x1f7a0
addl %eax, %eax
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rax
shrq $0x3f, %rax
shrq $0x20, %rcx
addl %eax, %ecx
addl %r15d, %ecx
movq %r12, %rsi
movq (%rsp), %rdx
movl %r14d, %r8d
movl $0x1, %r9d
callq 0x6430
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq