// File: /workspace/github_c_makefile_star2_O0/odknt[P]st/x.c
// Function: xdrawglyphfontspecs
void
xdrawglyphfontspecs(const GlyphFontSpec *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, 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.red = TRUERED(base.fg);
		colfg.green = TRUEGREEN(base.fg);
		colfg.blue = TRUEBLUE(base.fg);
		XAllocColor(xw.dpy, xw.cmap, &colfg);
		fg = &colfg;
	} else {
		fg = &dc.col[base.fg];
	}

	if (IS_TRUECOL(base.bg)) {
		colbg.green = TRUEGREEN(base.bg);
		colbg.red = TRUERED(base.bg);
		colbg.blue = TRUEBLUE(base.bg);
		XAllocColor(xw.dpy, xw.cmap, &colbg);
		bg = &colbg;
	} 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->red;
			colfg.green = ~fg->green;
			colfg.blue = ~fg->blue;
			XAllocColor(xw.dpy, xw.cmap, &colfg);
			fg = &colfg;
		}

		if (bg == &dc.col[defaultbg]) {
			bg = &dc.col[defaultfg];
		} else {
			colbg.red = ~bg->red;
			colbg.green = ~bg->green;
			colbg.blue = ~bg->blue;
			XAllocColor(xw.dpy, xw.cmap, &colbg);
			bg = &colbg;
		}
	}

	if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) {
		colfg.red = fg->red / 2;
		colfg.green = fg->green / 2;
		colfg.blue = fg->blue / 2;
		XAllocColor(xw.dpy, xw.cmap, &colfg);
		fg = &colfg;
	}

	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. */
	xdrawrect(bg, winx, winy, width, win.ch);

	/* Render the glyphs. */
	xdrawglyphfontspec(fg, specs, len);

	/* Render underline and strikethrough. */
	if (base.mode & ATTR_UNDERLINE)
		xdrawrect(fg, winx, winy + win.cyo + dc.font.ascent + 1, width, 1);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
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 $0x200, %esi            # imm = 0x200
movl $0x1, %ecx
movl $0x2, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
imull %ecx, %eax
movl %eax, -0x28(%rbp)
movl 0xafd1(%rip), %eax      # 0x19ffc
movl -0x20(%rbp), %ecx
imull 0x13697(%rip), %ecx     # 0x226cc
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
movl 0xafbc(%rip), %eax      # 0x19ffc
movl -0x24(%rbp), %ecx
imull 0x1367e(%rip), %ecx     # 0x226c8
addl %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x28(%rbp), %eax
imull 0x13673(%rip), %eax     # 0x226cc
movl %eax, -0x34(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xf091
movzwl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xf091
cmpl $0x0, 0x134d5(%rip)     # 0x22550
jne 0xf086
cmpl $0x0, 0x134d0(%rip)     # 0x22554
je 0xf08f
movl 0xb250(%rip), %eax      # 0x1a2dc
movl %eax, -0x8(%rbp)
jmp 0xf0c6
movzwl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xf0a6
cmpl $0x0, 0x13464(%rip)     # 0x22508
jne 0xf0bb
movzwl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xf0c4
cmpl $0x0, 0x1340b(%rip)     # 0x224c4
je 0xf0c4
movl 0xb21b(%rip), %eax      # 0x1a2dc
movl %eax, -0x8(%rbp)
jmp 0xf0c6
movl -0x8(%rbp), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0xf11e
movl -0x8(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
shrl $0x8, %eax
movw %ax, -0x58(%rbp)
movl -0x8(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
movw %ax, -0x56(%rbp)
movl -0x8(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
movw %ax, -0x54(%rbp)
movq 0x1348c(%rip), %rdi     # 0x22590
movq 0x1348d(%rip), %rsi     # 0x22598
leaq -0x60(%rbp), %rdx
callq 0x6860
leaq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0xf133
movq 0x13333(%rip), %rax     # 0x22458
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 0xf18b
movl -0x4(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
movw %ax, -0x66(%rbp)
movl -0x4(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
shrl $0x8, %eax
movw %ax, -0x68(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
movw %ax, -0x64(%rbp)
movq 0x1341f(%rip), %rdi     # 0x22590
movq 0x13420(%rip), %rsi     # 0x22598
leaq -0x70(%rbp), %rdx
callq 0x6860
leaq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xf1a0
movq 0x132c6(%rip), %rax     # 0x22458
movl -0x4(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0xf1d3
xorl %eax, %eax
cmpl -0x8(%rbp), %eax
ja 0xf1d3
cmpl $0x7, -0x8(%rbp)
ja 0xf1d3
movq 0x13298(%rip), %rax     # 0x22458
movl -0x8(%rbp), %ecx
addl $0x8, %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl 0x134fb(%rip), %eax     # 0x226d4
andl $0x20, %eax
cmpl $0x0, %eax
je 0xf2ed
movq -0x40(%rbp), %rax
movq 0x13268(%rip), %rcx     # 0x22458
movl 0xa5b6(%rip), %edx      # 0x197ac
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0xf21c
movq 0x1324f(%rip), %rax     # 0x22458
movl 0xa5a1(%rip), %ecx      # 0x197b0
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0xf268
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x56(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xc(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x54(%rbp)
movq 0x13340(%rip), %rdi     # 0x22590
movq 0x13341(%rip), %rsi     # 0x22598
leaq -0x60(%rbp), %rdx
callq 0x6860
leaq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq 0x131e5(%rip), %rcx     # 0x22458
movl 0xa537(%rip), %edx      # 0x197b0
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0xf29f
movq 0x131cc(%rip), %rax     # 0x22458
movl 0xa51a(%rip), %ecx      # 0x197ac
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0xf2eb
movq -0x48(%rbp), %rax
movzwl 0x8(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x68(%rbp)
movq -0x48(%rbp), %rax
movzwl 0xa(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x66(%rbp)
movq -0x48(%rbp), %rax
movzwl 0xc(%rax), %eax
xorl $-0x1, %eax
movw %ax, -0x64(%rbp)
movq 0x132bd(%rip), %rdi     # 0x22590
movq 0x132be(%rip), %rsi     # 0x22598
leaq -0x70(%rbp), %rdx
callq 0x6860
leaq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xf2ed
movzwl -0xc(%rbp), %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0xf354
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x56(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xc(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x54(%rbp)
movq 0x13254(%rip), %rdi     # 0x22590
movq 0x13255(%rip), %rsi     # 0x22598
leaq -0x60(%rbp), %rdx
callq 0x6860
leaq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xf378
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 $0x10, %eax
cmpl $0x0, %eax
je 0xf39c
movl 0x1334a(%rip), %eax     # 0x226d4
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xf39c
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movzwl -0xc(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xf3b0
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0xf43d
cmpl $0x0, -0x24(%rbp)
jne 0xf3c7
xorl %eax, %eax
movl %eax, -0x7c(%rbp)
jmp 0xf3cd
movl -0x30(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x88(%rbp)
movl 0xac20(%rip), %eax      # 0x19ffc
movl %eax, -0x84(%rbp)
movl -0x30(%rbp), %eax
addl 0x132dd(%rip), %eax     # 0x226c8
movl %eax, -0x80(%rbp)
movl -0x30(%rbp), %eax
addl 0x132d1(%rip), %eax     # 0x226c8
movl 0xabff(%rip), %ecx      # 0x19ffc
addl 0x132b9(%rip), %ecx     # 0x226bc
cmpl %ecx, %eax
jl 0xf415
movl 0x132b7(%rip), %eax     # 0x226c4
movl %eax, -0x8c(%rbp)
jmp 0xf41f
xorl %eax, %eax
movl %eax, -0x8c(%rbp)
jmp 0xf41f
movl -0x84(%rbp), %edx
movl -0x88(%rbp), %esi
movl -0x80(%rbp), %ecx
movl -0x8c(%rbp), %eax
addl %eax, %ecx
xorl %edi, %edi
callq 0x111b0
movl -0x2c(%rbp), %eax
addl -0x34(%rbp), %eax
movl 0xabb3(%rip), %ecx      # 0x19ffc
addl 0x13269(%rip), %ecx     # 0x226b8
cmpl %ecx, %eax
jl 0xf4e7
movl -0x2c(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x90(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0xf473
xorl %eax, %eax
movl %eax, -0x94(%rbp)
jmp 0xf47c
movl -0x30(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl 0x13232(%rip), %eax     # 0x226c0
movl %eax, -0x98(%rbp)
movl -0x30(%rbp), %eax
addl 0x1322b(%rip), %eax     # 0x226c8
movl 0xab59(%rip), %ecx      # 0x19ffc
addl 0x13213(%rip), %ecx     # 0x226bc
cmpl %ecx, %eax
jl 0xf4bb
movl 0x13211(%rip), %eax     # 0x226c4
movl %eax, -0xa0(%rbp)
jmp 0xf4ca
movl -0x30(%rbp), %eax
addl 0x13204(%rip), %eax     # 0x226c8
movl %eax, -0xa0(%rbp)
movl -0x98(%rbp), %edx
movl -0x9c(%rbp), %esi
movl -0x90(%rbp), %edi
movl -0xa0(%rbp), %ecx
callq 0x111b0
cmpl $0x0, -0x24(%rbp)
jne 0xf503
movl -0x2c(%rbp), %edi
movl -0x2c(%rbp), %edx
addl -0x34(%rbp), %edx
movl 0xab00(%rip), %ecx      # 0x19ffc
xorl %esi, %esi
callq 0x111b0
movl -0x30(%rbp), %eax
addl 0x131bc(%rip), %eax     # 0x226c8
movl 0xaaea(%rip), %ecx      # 0x19ffc
addl 0x131a4(%rip), %ecx     # 0x226bc
cmpl %ecx, %eax
jl 0xf539
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
addl 0x131a0(%rip), %esi     # 0x226c8
movl -0x2c(%rbp), %edx
addl -0x34(%rbp), %edx
movl 0x13190(%rip), %ecx     # 0x226c4
callq 0x111b0
movq -0x48(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x34(%rbp), %ecx
movl 0x1317b(%rip), %r8d     # 0x226c8
callq 0xe980
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x11220
movzwl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xf595
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
addl 0x13152(%rip), %edx     # 0x226d0
addl 0x12eec(%rip), %edx     # 0x22470
addl $0x1, %edx
movl -0x34(%rbp), %ecx
movl $0x1, %r8d
callq 0xe980
movzwl -0xc(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xf5df
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %eax
addl 0x1311d(%rip), %eax     # 0x226d0
movl %eax, -0xa4(%rbp)
movl 0x12eb1(%rip), %eax     # 0x22470
shll %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl -0xa4(%rbp), %edx
addl %eax, %edx
movl -0x34(%rbp), %ecx
movl $0x1, %r8d
callq 0xe980
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)