// File: /workspace/github_c_makefile_star2_O0/anachronic[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 = 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;

    if (dmode & DRAW_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);
        /* Fill the background */
        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 + win.cyo + dc.font.ascent + 1,
						width, 1);
		}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl 0x10(%rbp), %eax
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movzwl -0xc(%rbp), %esi
andl $0x400, %esi            # imm = 0x400
movl $0x1, %ecx
movl $0x2, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
imull %ecx, %eax
movl %eax, -0x28(%rbp)
movl 0xbf16(%rip), %eax      # 0x1af14
movl -0x20(%rbp), %ecx
imull 0x14374(%rip), %ecx     # 0x2337c
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
movl 0xbf01(%rip), %eax      # 0x1af14
movl -0x24(%rbp), %ecx
imull 0x1435b(%rip), %ecx     # 0x23378
addl %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x28(%rbp), %eax
imull 0x14350(%rip), %eax     # 0x2337c
movl %eax, -0x34(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xf064
movzwl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xf064
cmpl $0x0, 0x141e2(%rip)     # 0x23230
jne 0xf059
cmpl $0x0, 0x141dd(%rip)     # 0x23234
je 0xf062
movl 0xbec9(%rip), %eax      # 0x1af28
movl %eax, -0x8(%rbp)
jmp 0xf099
movzwl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xf079
cmpl $0x0, 0x14181(%rip)     # 0x231f8
jne 0xf08e
movzwl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xf097
cmpl $0x0, 0x14138(%rip)     # 0x231c4
je 0xf097
movl 0xbe94(%rip), %eax      # 0x1af28
movl %eax, -0x8(%rbp)
jmp 0xf099
movl -0x8(%rbp), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0xf111
movw $0xffff, -0x92(%rbp)    # imm = 0xFFFF
movl -0x8(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
shrl $0x8, %eax
movw %ax, -0x98(%rbp)
movl -0x8(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
movw %ax, -0x96(%rbp)
movl -0x8(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
movw %ax, -0x94(%rbp)
movq 0x14177(%rip), %rdi     # 0x23260
movq 0x141e8(%rip), %rsi     # 0x232d8
movq 0x14171(%rip), %rdx     # 0x23268
leaq -0x98(%rbp), %rcx
leaq -0x80(%rbp), %r8
callq 0x56e0
leaq -0x80(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0xf126
movq 0x14050(%rip), %rax     # 0x23168
movl -0x8(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x4(%rbp), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0xf1a4
movw $0xffff, -0x9a(%rbp)    # imm = 0xFFFF
movl -0x4(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
movw %ax, -0x9e(%rbp)
movl -0x4(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
shrl $0x8, %eax
movw %ax, -0xa0(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
movw %ax, -0x9c(%rbp)
movq 0x140ea(%rip), %rdi     # 0x23260
movq 0x1415b(%rip), %rsi     # 0x232d8
movq 0x140e4(%rip), %rdx     # 0x23268
leaq -0xa0(%rbp), %rcx
leaq -0x90(%rbp), %r8
callq 0x56e0
leaq -0x90(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xf1b9
movq 0x13fbd(%rip), %rax     # 0x23168
movl -0x4(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x6, %eax
cmpl $0x2, %eax
jne 0xf1ec
xorl %eax, %eax
cmpl -0x8(%rbp), %eax
ja 0xf1ec
cmpl $0x7, -0x8(%rbp)
ja 0xf1ec
movq 0x13f8f(%rip), %rax     # 0x23168
movl -0x8(%rbp), %ecx
addl $0x8, %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl 0x14192(%rip), %eax     # 0x23384
andl $0x20, %eax
cmpl $0x0, %eax
je 0xf352
movq -0x40(%rbp), %rax
movq 0x13f5f(%rip), %rcx     # 0x23168
movl 0xb4cd(%rip), %edx      # 0x1a6dc
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0xf235
movq 0x13f46(%rip), %rax     # 0x23168
movl 0xb4b8(%rip), %ecx      # 0x1a6e0
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0xf2a7
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x98(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x96(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xc(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x94(%rbp)
movq -0x40(%rbp), %rax
movw 0xe(%rax), %ax
movw %ax, -0x92(%rbp)
movq 0x13fdf(%rip), %rdi     # 0x23260
movq 0x14050(%rip), %rsi     # 0x232d8
movq 0x13fd9(%rip), %rdx     # 0x23268
leaq -0x98(%rbp), %rcx
leaq -0x60(%rbp), %r8
callq 0x56e0
leaq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq 0x13eb6(%rip), %rcx     # 0x23168
movl 0xb428(%rip), %edx      # 0x1a6e0
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0xf2de
movq 0x13e9d(%rip), %rax     # 0x23168
movl 0xb40b(%rip), %ecx      # 0x1a6dc
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0xf350
movq -0x48(%rbp), %rax
movzwl 0x8(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0xa0(%rbp)
movq -0x48(%rbp), %rax
movzwl 0xa(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x9e(%rbp)
movq -0x48(%rbp), %rax
movzwl 0xc(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x9c(%rbp)
movq -0x48(%rbp), %rax
movw 0xe(%rax), %ax
movw %ax, -0x9a(%rbp)
movq 0x13f36(%rip), %rdi     # 0x23260
movq 0x13fa7(%rip), %rsi     # 0x232d8
movq 0x13f30(%rip), %rdx     # 0x23268
leaq -0xa0(%rbp), %rcx
leaq -0x70(%rbp), %r8
callq 0x56e0
leaq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xf352
movzwl -0xc(%rbp), %eax
andl $0x6, %eax
cmpl $0x4, %eax
jne 0xf3e3
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x98(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x96(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xc(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x94(%rbp)
movq -0x40(%rbp), %rax
movw 0xe(%rax), %ax
movw %ax, -0x92(%rbp)
movq 0x13ea3(%rip), %rdi     # 0x23260
movq 0x13f14(%rip), %rsi     # 0x232d8
movq 0x13e9d(%rip), %rdx     # 0x23268
leaq -0x98(%rbp), %rcx
leaq -0x60(%rbp), %r8
callq 0x56e0
leaq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xf407
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xf42b
movl 0x13f6b(%rip), %eax     # 0x23384
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xf42b
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xf441
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movl 0x10(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xf609
cmpl $0x0, -0x20(%rbp)
jne 0xf4ec
cmpl $0x0, -0x24(%rbp)
jne 0xf46a
xorl %eax, %eax
movl %eax, -0xac(%rbp)
jmp 0xf473
movl -0x30(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl 0xba8f(%rip), %eax      # 0x1af14
movl %eax, -0xb4(%rbp)
movl -0x30(%rbp), %eax
addl 0x13ee4(%rip), %eax     # 0x23378
movl %eax, -0xb0(%rbp)
movl -0x30(%rbp), %eax
addl 0x13ed5(%rip), %eax     # 0x23378
movl 0xba6b(%rip), %ecx      # 0x1af14
addl 0x13ebd(%rip), %ecx     # 0x2336c
cmpl %ecx, %eax
jl 0xf4c1
movl 0x13ebb(%rip), %eax     # 0x23374
movl %eax, -0xbc(%rbp)
jmp 0xf4cb
xorl %eax, %eax
movl %eax, -0xbc(%rbp)
jmp 0xf4cb
movl -0xb4(%rbp), %edx
movl -0xb8(%rbp), %esi
movl -0xb0(%rbp), %ecx
movl -0xbc(%rbp), %eax
addl %eax, %ecx
xorl %edi, %edi
callq 0x11060
movl -0x2c(%rbp), %eax
addl -0x34(%rbp), %eax
movl 0xba1c(%rip), %ecx      # 0x1af14
addl 0x13e6a(%rip), %ecx     # 0x23368
cmpl %ecx, %eax
jl 0xf596
movl -0x2c(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0xc0(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0xf522
xorl %eax, %eax
movl %eax, -0xc4(%rbp)
jmp 0xf52b
movl -0x30(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movl %eax, -0xcc(%rbp)
movl 0x13e33(%rip), %eax     # 0x23370
movl %eax, -0xc8(%rbp)
movl -0x30(%rbp), %eax
addl 0x13e2c(%rip), %eax     # 0x23378
movl 0xb9c2(%rip), %ecx      # 0x1af14
addl 0x13e14(%rip), %ecx     # 0x2336c
cmpl %ecx, %eax
jl 0xf56a
movl 0x13e12(%rip), %eax     # 0x23374
movl %eax, -0xd0(%rbp)
jmp 0xf579
movl -0x30(%rbp), %eax
addl 0x13e05(%rip), %eax     # 0x23378
movl %eax, -0xd0(%rbp)
movl -0xc8(%rbp), %edx
movl -0xcc(%rbp), %esi
movl -0xc0(%rbp), %edi
movl -0xd0(%rbp), %ecx
callq 0x11060
cmpl $0x0, -0x24(%rbp)
jne 0xf5b2
movl -0x2c(%rbp), %edi
movl -0x2c(%rbp), %edx
addl -0x34(%rbp), %edx
movl 0xb969(%rip), %ecx      # 0x1af14
xorl %esi, %esi
callq 0x11060
movl -0x30(%rbp), %eax
addl 0x13dbd(%rip), %eax     # 0x23378
movl 0xb953(%rip), %ecx      # 0x1af14
addl 0x13da5(%rip), %ecx     # 0x2336c
cmpl %ecx, %eax
jl 0xf5e8
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
addl 0x13da1(%rip), %esi     # 0x23378
movl -0x2c(%rbp), %edx
addl -0x34(%rbp), %edx
movl 0x13d91(%rip), %ecx     # 0x23374
callq 0x11060
movq 0x13ce1(%rip), %rdi     # 0x232d0
movq -0x48(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x34(%rbp), %r8d
movl 0x13d74(%rip), %r9d     # 0x23378
callq 0x53d0
movl 0x10(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xf701
movzwl -0xc(%rbp), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xf659
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %eax
cltd
idivl -0x1c(%rbp)
movl %eax, %edx
movl 0x13d3d(%rip), %ecx     # 0x23378
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x18(%rbp), %r10
movl -0x1c(%rbp), %eax
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x138f0
jmp 0xf670
movq 0x13c70(%rip), %rdi     # 0x232d0
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x5380
movzwl -0xc(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xf6ab
movq 0x13c4d(%rip), %rdi     # 0x232d0
movq -0x40(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
addl 0x13ced(%rip), %ecx     # 0x23380
addl 0x13ae7(%rip), %ecx     # 0x23180
addl $0x1, %ecx
movl -0x34(%rbp), %r8d
movl $0x1, %r9d
callq 0x53d0
movzwl -0xc(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0xf6ff
movq 0x13c10(%rip), %rdi     # 0x232d0
movq -0x40(%rbp), %rsi
movl -0x2c(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0x30(%rbp), %ecx
addl 0x13caa(%rip), %ecx     # 0x23380
movl 0x13aa4(%rip), %eax     # 0x23180
shll %eax
movl $0x3, %r8d
cltd
idivl %r8d
movl -0xd4(%rbp), %edx
addl %eax, %ecx
movl -0x34(%rbp), %r8d
movl $0x1, %r9d
callq 0x53d0
jmp 0xf701
addq $0xf0, %rsp
popq %rbp
retq
nopw (%rax,%rax)