// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r8d, 0x10(%rsp)
movl %ecx, %r8d
movq %rdx, %rbp
movq %rsi, %rcx
movq %rdi, %r15
movq %rsi, %rdx
shrq $0x20, %rdx
shrq $0x29, %rcx
andb $0x1, %cl
movl %r8d, %eax
shll %cl, %eax
movl %eax, 0x18(%rsp)
movl %ebp, %ebx
movl 0xbd0e(%rip), %ecx      # 0x18dfc
movl 0x12837(%rip), %r13d    # 0x1f92c
movl 0x1282c(%rip), %r14d    # 0x1f928
movl %r9d, 0x28(%rsp)
imull %r9d, %r14d
movl %edx, %eax
notl %eax
testb $0x5, %al
movq %rdx, 0x30(%rsp)
movl %r8d, 0x44(%rsp)
movl %ecx, 0x38(%rsp)
jne 0xd13b
movl 0x12693(%rip), %eax     # 0x1f7b4
orl 0x12689(%rip), %eax     # 0x1f7b0
movl $0xb, %eax
cmovel %ebx, %eax
movl %eax, %ebx
btl $0x18, %ebx
jb 0xd16e
movl %ebx, %eax
jmp 0xd15c
movl $0xb, %eax
testb $0x4, %dl
je 0xd14e
cmpl $0x0, 0x1261c(%rip)     # 0x1f768
jne 0xd15c
testb $0x1, %dl
je 0xd131
cmpl $0x0, 0x125ca(%rip)     # 0x1f724
je 0xd131
movl %eax, %r12d
shlq $0x4, %r12
addq 0x1254e(%rip), %r12     # 0x1f6b8
movl %eax, %ebx
jmp 0xd1ae
movl %ebx, %eax
shrl $0x8, %eax
movl $0xff00, %ecx           # imm = 0xFF00
andl %ecx, %eax
leaq 0x48(%rsp), %r12
movw %ax, 0x8(%r12)
andl %ebx, %ecx
movw %cx, 0xa(%r12)
movl %ebx, %eax
shll $0x8, %eax
movw %ax, 0xc(%r12)
movq 0x12651(%rip), %rdi     # 0x1f7f0
movq 0x12652(%rip), %rsi     # 0x1f7f8
movq %r12, %rdx
callq 0x6840
movq %rbp, %rcx
shrq $0x20, %rcx
btq $0x38, %rbp
movq %r14, 0x20(%rsp)
jb 0xd1d4
movq 0x124f0(%rip), %rax     # 0x1f6b8
shlq $0x4, %rcx
addq %rax, %rcx
movq %rcx, %rsi
jmp 0xd21a
movl $0xff00, %eax           # imm = 0xFF00
movl %ecx, %edx
andl %eax, %edx
leaq 0x58(%rsp), %r14
movw %dx, 0xa(%r14)
shrq $0x28, %rbp
andl %eax, %ebp
movw %bp, 0x8(%r14)
shll $0x8, %ecx
movw %cx, 0xc(%r14)
movq 0x125ef(%rip), %rdi     # 0x1f7f0
movq 0x125f0(%rip), %rsi     # 0x1f7f8
movq %r14, %rdx
callq 0x6840
movq %r14, %rsi
movq 0x1249e(%rip), %rax     # 0x1f6b8
movq 0x30(%rsp), %rcx
movl %ecx, %r14d
andl $0x3, %r14d
cmpl $0x1, %r14d
sete %dl
cmpl $0x8, %ebx
setb %cl
andb %dl, %cl
orl $0x8, %ebx
shlq $0x4, %rbx
addq %rax, %rbx
testb %cl, %cl
movq %r12, %rbp
cmovneq %rbx, %rbp
testb $0x20, 0x126e5(%rip)    # 0x1f934
je 0xd31c
movl 0xb351(%rip), %edx      # 0x185ac
shlq $0x4, %rdx
addq %rax, %rdx
cmpq %rdx, %rbp
je 0xd2bf
testb %cl, %cl
cmovneq %rbx, %r12
movl 0x8(%r12), %eax
notl %eax
leaq 0x48(%rsp), %rbp
movw %ax, 0x8(%rbp)
movzwl 0xa(%r12), %eax
notl %eax
movw %ax, 0xa(%rbp)
movl 0xc(%r12), %eax
notl %eax
movw %ax, 0xc(%rbp)
movq 0x12555(%rip), %rdi     # 0x1f7f0
movq %rsi, %rbx
movq 0x12553(%rip), %rsi     # 0x1f7f8
movq %rbp, %rdx
callq 0x6840
movq %rbx, %rsi
movq 0x12401(%rip), %rax     # 0x1f6b8
movl 0xb2f3(%rip), %ecx      # 0x185b0
jmp 0xd2cf
movl 0xb2eb(%rip), %ecx      # 0x185b0
movq %rcx, %rbp
shlq $0x4, %rbp
addq %rax, %rbp
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %rsi
je 0xd30c
movl 0x8(%rsi), %eax
notl %eax
leaq 0x58(%rsp), %rbx
movl %eax, 0x8(%rbx)
movl 0xc(%rsi), %eax
notl %eax
movw %ax, 0xc(%rbx)
movq 0x124f8(%rip), %rdi     # 0x1f7f0
movq 0x124f9(%rip), %rsi     # 0x1f7f8
movq %rbx, %rdx
callq 0x6840
movq %rbx, %rsi
jmp 0xd31c
movl 0xb29a(%rip), %ecx      # 0x185ac
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %rsi
movl %r13d, %eax
movl 0x10(%rsp), %ecx
imull %ecx, %eax
movq %rax, 0x8(%rsp)
cmpl $0x2, %r14d
jne 0xd376
movq 0x8(%rbp), %xmm0
psrlw $0x1, %xmm0
leaq 0x48(%rsp), %r12
movd %xmm0, 0x8(%r12)
movzwl 0xc(%rbp), %eax
shrl %eax
movw %ax, 0xc(%r12)
movq 0x12496(%rip), %rdi     # 0x1f7f0
movq %rsi, %rbx
movq 0x12494(%rip), %rsi     # 0x1f7f8
movq %r12, %rdx
callq 0x6840
movl 0x10(%rsp), %ecx
movq %rbx, %rsi
movq %r12, %rbp
movq 0x20(%rsp), %rbx
movq 0x30(%rsp), %r12
movl 0x28(%rsp), %r14d
movl 0x18(%rsp), %edx
movq 0x8(%rsp), %rax
movl 0x38(%rsp), %edi
addl %edi, %eax
movq %rax, 0x8(%rsp)
addl %edi, %ebx
imull %edx, %r13d
testb $0x20, %r12b
movq %rbp, %rdi
cmoveq %rsi, %rdi
movq %rsi, 0x28(%rsp)
movq %rsi, %rax
cmoveq %rbp, %rax
movl 0x12578(%rip), %edx     # 0x1f934
movl %edx, 0x10(%rsp)
btl $0xb, %edx
movq %rdi, %rdx
cmovaeq %rax, %rdx
testb $0x10, %r12b
cmoveq %rax, %rdx
testb $0x40, %r12b
movq %rdi, 0x38(%rsp)
cmovneq %rdi, %rdx
movq %rdx, 0x18(%rsp)
movl 0xba11(%rip), %eax      # 0x18dfc
testl %ecx, %ecx
jne 0xd458
testl %r14d, %r14d
movl %ebx, %edx
cmovel %r14d, %edx
movl 0x12529(%rip), %r8d     # 0x1f928
addl %ebx, %r8d
movl 0x12514(%rip), %esi     # 0x1f91c
addl %eax, %esi
movl $0x0, %ecx
cmpl %esi, %r8d
jl 0xd41a
movl 0x1250a(%rip), %ecx     # 0x1f924
movq 0x12297(%rip), %rsi     # 0x1f6b8
testb $0x20, 0x10(%rsp)
leaq 0xb17f(%rip), %rdi      # 0x185ac
leaq 0xb17c(%rip), %r9       # 0x185b0
cmovneq %rdi, %r9
movl (%r9), %edi
shlq $0x4, %rdi
subl %edx, %r8d
addl %ecx, %r8d
movq (%rsi,%rdi), %rdi
xorl %esi, %esi
movl %eax, %ecx
callq 0xcb84
movl 0xb9a4(%rip), %eax      # 0x18dfc
movq 0x8(%rsp), %rcx
leal (%rcx,%r13), %esi
movl 0x124b1(%rip), %ecx     # 0x1f918
addl %eax, %ecx
cmpl %ecx, %esi
jl 0xd4d3
testl %r14d, %r14d
movl %ebx, %edx
cmovel %r14d, %edx
movl 0x124a4(%rip), %ecx     # 0x1f920
movl 0x124a5(%rip), %r8d     # 0x1f928
addl %ebx, %r8d
addl 0x12490(%rip), %eax     # 0x1f91c
cmpl %eax, %r8d
jl 0xd498
movl 0x1248c(%rip), %r8d     # 0x1f924
movq 0x12219(%rip), %rax     # 0x1f6b8
testb $0x20, 0x1248e(%rip)    # 0x1f934
leaq 0xb0ff(%rip), %rdi      # 0x185ac
leaq 0xb0fc(%rip), %r9       # 0x185b0
cmovneq %rdi, %r9
movl (%r9), %edi
shlq $0x4, %rdi
subl %esi, %ecx
subl %edx, %r8d
movq (%rax,%rdi), %rdi
callq 0xcb84
movl 0xb929(%rip), %eax      # 0x18dfc
testl %r14d, %r14d
jne 0xd51a
testb $0x20, 0x12455(%rip)    # 0x1f934
leaq 0xb0c6(%rip), %rcx      # 0x185ac
leaq 0xb0c3(%rip), %rdx      # 0x185b0
cmovneq %rcx, %rdx
movq 0x121c0(%rip), %rcx     # 0x1f6b8
movl (%rdx), %edx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
movl %r13d, %ecx
movl %eax, %r8d
callq 0xcb84
movl 0xb8e2(%rip), %eax      # 0x18dfc
movl 0x12407(%rip), %r8d     # 0x1f928
movq %rbx, 0x20(%rsp)
leal (%r8,%rbx), %edx
addl 0x123ec(%rip), %eax     # 0x1f91c
cmpl %eax, %edx
jl 0xd57c
movl 0x123e9(%rip), %r8d     # 0x1f924
movq 0x12176(%rip), %rax     # 0x1f6b8
testb $0x20, 0x123eb(%rip)    # 0x1f934
leaq 0xb05c(%rip), %rcx      # 0x185ac
leaq 0xb059(%rip), %rsi      # 0x185b0
cmovneq %rcx, %rsi
movl (%rsi), %ecx
shlq $0x4, %rcx
subl %edx, %r8d
movq (%rax,%rcx), %rdi
movq 0x8(%rsp), %rsi
movl %r13d, %ecx
callq 0xcb84
movl 0x123ac(%rip), %r8d     # 0x1f928
testb $0x40, %r12b
sete %bl
btl $0xb, 0x10(%rsp)
setae %r14b
testb $0x10, %r12b
movq %r12, %rax
sete %r12b
testb $0x20, %al
movq %r13, %rcx
sete %r13b
movq 0x38(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rcx, 0x10(%rsp)
callq 0xcb84
movq 0x1229c(%rip), %rdi     # 0x1f860
movsd 0x123f4(%rip), %xmm0    # 0x1f9c0
callq 0x64e0
movq 0x12288(%rip), %rdi     # 0x1f860
orb %r14b, %r12b
andb %bl, %r12b
xorb %r13b, %r12b
movq 0x28(%rsp), %rcx
cmoveq %rbp, %rcx
movzwl 0x8(%rcx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x466b(%rip), %xmm3     # 0x11c68
divsd %xmm3, %xmm0
movzwl 0xa(%rcx), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm3, %xmm1
movzwl 0xc(%rcx), %eax
cvtsi2sd %eax, %xmm2
divsd %xmm3, %xmm2
callq 0x63e0
movl 0x44(%rsp), %eax
testl %eax, %eax
jle 0xd66b
movl %eax, %r13d
addq $0x8, %r15
xorl %ebp, %ebp
movq -0x8(%r15), %rax
movq 0x8(%rax), %r12
cmpq %r12, %rbp
je 0xd64e
movq 0x1221d(%rip), %rdi     # 0x1f860
movq %r12, %rsi
callq 0x6450
movq %r12, %rbp
movq 0x1220b(%rip), %rdi     # 0x1f860
movq %r15, %rsi
movl $0x1, %edx
callq 0x60a0
addq $0x20, %r15
decq %r13
jne 0xd62f
movq 0x30(%rsp), %r15
testb $0x8, %r15b
movq 0x10(%rsp), %rbx
movq 0x20(%rsp), %r14
je 0xd6ae
movl 0x1204a(%rip), %eax     # 0x1f6d0
movl 0x122a4(%rip), %ecx     # 0x1f930
addl %r14d, %ecx
leal (%rax,%rcx), %edx
incl %edx
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
movl %ebx, %ecx
movl $0x1, %r8d
callq 0xcb84
testb %r15b, %r15b
jns 0xd6f5
addl 0x12276(%rip), %r14d    # 0x1f930
movl 0x12010(%rip), %eax     # 0x1f6d0
addl %eax, %eax
cltq
imulq $0x55555556, %rax, %rdx # imm = 0x55555556
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x20, %rdx
addl %eax, %edx
addl %r14d, %edx
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
movl %ebx, %ecx
movl $0x1, %r8d
callq 0xcb84
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq