// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movl %r8d, 0x8(%rsp)
movl %ecx, %r8d
movq %rdx, %r12
movq %rsi, %rcx
movq %rdi, %rbx
movq %rsi, %r13
shrq $0x20, %r13
shrq $0x29, %rcx
andb $0x1, %cl
movl %r8d, %edx
shll %cl, %edx
movl %r12d, %r14d
movl %r13d, %eax
notl %eax
testb $0x5, %al
jne 0xcae0
movl 0x11cf8(%rip), %eax     # 0x1e7c4
orl 0x11cee(%rip), %eax     # 0x1e7c0
movl $0xb, %eax
cmovel %r14d, %eax
movl %eax, %r14d
jmp 0xcb04
testb $0x4, %r13b
je 0xcaef
cmpl $0x0, 0x11c8b(%rip)     # 0x1e778
jne 0xcafe
testb $0x1, %r13b
je 0xcb04
cmpl $0x0, 0x11c38(%rip)     # 0x1e734
je 0xcb04
movl $0xb, %r14d
movl 0x11e32(%rip), %eax     # 0x1e93c
movq %rax, 0x18(%rsp)
movl 0xb2f7(%rip), %ecx      # 0x17e0c
movl 0x11e1d(%rip), %eax     # 0x1e938
imull %r9d, %eax
movl %eax, 0x4(%rsp)
btl $0x18, %r14d
movl %r9d, 0x14(%rsp)
movl %r8d, 0x34(%rsp)
movl %edx, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
jb 0xcb4c
movl %r14d, %r15d
shlq $0x4, %r15
addq 0x11b7e(%rip), %r15     # 0x1e6c8
jmp 0xcb8c
movl %r14d, %eax
shrl $0x8, %eax
movl $0xff00, %ecx           # imm = 0xFF00
andl %ecx, %eax
leaq 0x38(%rsp), %r15
movw %ax, 0x8(%r15)
andl %r14d, %ecx
movw %cx, 0xa(%r15)
movl %r14d, %eax
shll $0x8, %eax
movw %ax, 0xc(%r15)
movq 0x11c83(%rip), %rdi     # 0x1e800
movq 0x11c84(%rip), %rsi     # 0x1e808
movq %r15, %rdx
callq 0x6860
movq %r13, 0x28(%rsp)
movq %r12, %rax
shrq $0x20, %rax
btq $0x38, %r12
jb 0xcbaf
shlq $0x4, %rax
addq 0x11b1e(%rip), %rax     # 0x1e6c8
movq %rax, %r13
jmp 0xcbec
movl $0xff00, %ecx           # imm = 0xFF00
movl %eax, %edx
andl %ecx, %edx
leaq 0x48(%rsp), %r13
movw %dx, 0xa(%r13)
shrq $0x28, %r12
andl %ecx, %r12d
movw %r12w, 0x8(%r13)
shll $0x8, %eax
movw %ax, 0xc(%r13)
movq 0x11c23(%rip), %rdi     # 0x1e800
movq 0x11c24(%rip), %rsi     # 0x1e808
movq %r13, %rdx
callq 0x6860
movq 0x28(%rsp), %rax
movl %eax, %ebp
andl $0x3, %ebp
cmpl $0x1, %ebp
sete %al
cmpl $0x8, %r14d
setb %cl
andb %al, %cl
movq 0x11abc(%rip), %rax     # 0x1e6c8
orl $0x8, %r14d
shlq $0x4, %r14
addq %rax, %r14
testb %cl, %cl
movq %r15, %r12
cmovneq %r14, %r12
testb $0x20, 0x11d1d(%rip)    # 0x1e944
je 0xcd02
movl 0xa989(%rip), %edx      # 0x175bc
shlq $0x4, %rdx
addq %rax, %rdx
cmpq %rdx, %r12
je 0xcc87
testb %cl, %cl
cmovneq %r14, %r15
movl 0x8(%r15), %eax
notl %eax
leaq 0x38(%rsp), %r12
movw %ax, 0x8(%r12)
movzwl 0xa(%r15), %eax
notl %eax
movw %ax, 0xa(%r12)
movl 0xc(%r15), %eax
notl %eax
movw %ax, 0xc(%r12)
movq 0x11b8a(%rip), %rdi     # 0x1e800
movq 0x11b8b(%rip), %rsi     # 0x1e808
movq %r12, %rdx
callq 0x6860
jmp 0xcc97
movl 0xa933(%rip), %ecx      # 0x175c0
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r12
movq 0x11a2a(%rip), %rax     # 0x1e6c8
movl 0xa91c(%rip), %ecx      # 0x175c0
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
je 0xccf2
movl 0x8(%r13), %eax
notl %eax
leaq 0x48(%rsp), %r14
movw %ax, 0x8(%r14)
movzwl 0xa(%r13), %eax
notl %eax
movw %ax, 0xa(%r14)
movl 0xc(%r13), %eax
notl %eax
movw %ax, 0xc(%r14)
movq 0x11b22(%rip), %rdi     # 0x1e800
movq 0x11b23(%rip), %rsi     # 0x1e808
movq %r14, %rdx
callq 0x6860
movq %r14, %r13
jmp 0xcd02
movl 0xa8c4(%rip), %ecx      # 0x175bc
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r13
movq 0x18(%rsp), %r14
movl %r14d, %r9d
imull 0x8(%rsp), %r9d
cmpl $0x2, %ebp
jne 0xcd60
movzwl 0x8(%r12), %eax
shrl %eax
leaq 0x38(%rsp), %r15
movw %ax, 0x8(%r15)
movzwl 0xa(%r12), %eax
shrl %eax
movw %ax, 0xa(%r15)
movzwl 0xc(%r12), %eax
shrl %eax
movw %ax, 0xc(%r15)
movq 0x11ab8(%rip), %rdi     # 0x1e800
movq 0x11ab9(%rip), %rsi     # 0x1e808
movq %r15, %rdx
movq %r9, %r12
callq 0x6860
movq %r12, %r9
movq %r15, %r12
movl 0x14(%rsp), %r8d
movl 0x24(%rsp), %eax
movl 0x20(%rsp), %ecx
addl %ecx, %r9d
addl %ecx, 0x4(%rsp)
imull %eax, %r14d
movq 0x28(%rsp), %rcx
testb $0x20, %cl
movq %r12, %r15
cmoveq %r13, %r15
movq %r13, %rax
cmoveq %r12, %rax
movl 0x11bb0(%rip), %edx     # 0x1e944
movl %edx, 0x18(%rsp)
btl $0xb, %edx
movq %r15, %rbp
cmovaeq %rax, %rbp
testb $0x10, %cl
cmoveq %rax, %rbp
testb $0x40, %cl
cmovneq %r15, %rbp
cmpl $0x0, 0x8(%rsp)
movq %r9, 0x8(%rsp)
jne 0xce2d
testl %r8d, %r8d
movl 0x4(%rsp), %eax
movl %eax, %edx
cmovel %r8d, %edx
movl 0xb03c(%rip), %ecx      # 0x17e0c
movl 0x11b61(%rip), %r8d     # 0x1e938
addl %eax, %r8d
movl 0x11b4c(%rip), %esi     # 0x1e92c
addl %ecx, %esi
movl $0x0, %eax
cmpl %esi, %r8d
jl 0xcdf2
movl 0x11b42(%rip), %eax     # 0x1e934
testb $0x20, 0x18(%rsp)
leaq 0xa7be(%rip), %rsi      # 0x175bc
leaq 0xa7bb(%rip), %rdi      # 0x175c0
cmovneq %rsi, %rdi
movl (%rdi), %edi
shlq $0x4, %rdi
addq 0x118b2(%rip), %rdi     # 0x1e6c8
subl %edx, %r8d
addl %eax, %r8d
xorl %esi, %esi
callq 0xc536
movl 0x14(%rsp), %r8d
movq 0x8(%rsp), %r9
leal (%r9,%r14), %esi
movl 0xafd5(%rip), %eax      # 0x17e0c
movl 0x11aeb(%rip), %ecx     # 0x1e928
addl %eax, %ecx
cmpl %ecx, %esi
jl 0xceac
testl %r8d, %r8d
movl 0x4(%rsp), %edi
movl %edi, %edx
cmovel %r8d, %edx
movl 0x11ada(%rip), %ecx     # 0x1e930
movl 0x11adb(%rip), %r8d     # 0x1e938
addl %edi, %r8d
addl 0x11ac6(%rip), %eax     # 0x1e92c
cmpl %eax, %r8d
jl 0xce72
movl 0x11ac2(%rip), %r8d     # 0x1e934
testb $0x20, 0x11acb(%rip)    # 0x1e944
leaq 0xa73c(%rip), %rax      # 0x175bc
leaq 0xa739(%rip), %rdi      # 0x175c0
cmovneq %rax, %rdi
movl (%rdi), %edi
shlq $0x4, %rdi
addq 0x11830(%rip), %rdi     # 0x1e6c8
subl %esi, %ecx
subl %edx, %r8d
callq 0xc536
movl 0x14(%rsp), %r8d
movq 0x8(%rsp), %r9
testl %r8d, %r8d
jne 0xcef0
movl 0xaf54(%rip), %r8d      # 0x17e0c
testb $0x20, 0x11a85(%rip)    # 0x1e944
leaq 0xa6f6(%rip), %rax      # 0x175bc
leaq 0xa6f3(%rip), %rcx      # 0x175c0
cmovneq %rax, %rcx
movl (%rcx), %edi
shlq $0x4, %rdi
addq 0x117ea(%rip), %rdi     # 0x1e6c8
movl %r9d, %esi
xorl %edx, %edx
movl %r14d, %ecx
callq 0xc536
movq 0x8(%rsp), %r9
movl 0x11a42(%rip), %edx     # 0x1e938
addl 0x4(%rsp), %edx
movl 0x11a2c(%rip), %eax     # 0x1e92c
addl 0xaf06(%rip), %eax      # 0x17e0c
cmpl %eax, %edx
jl 0xcf4a
movl 0x11a23(%rip), %r8d     # 0x1e934
testb $0x20, 0x11a2c(%rip)    # 0x1e944
leaq 0xa69d(%rip), %rax      # 0x175bc
leaq 0xa69a(%rip), %rcx      # 0x175c0
cmovneq %rax, %rcx
movl (%rcx), %edi
shlq $0x4, %rdi
addq 0x11791(%rip), %rdi     # 0x1e6c8
subl %edx, %r8d
movl %r9d, %esi
movl %r14d, %ecx
callq 0xc536
movq 0x8(%rsp), %r9
btl $0xb, 0x18(%rsp)
movq %r14, %rcx
setae %r14b
movl 0x119da(%rip), %r8d     # 0x1e938
movq %r15, %rdi
movl %r9d, %esi
movl 0x4(%rsp), %edx
movq %rcx, 0x18(%rsp)
callq 0xc536
movq 0x118f7(%rip), %rdi     # 0x1e870
movsd 0x11a4f(%rip), %xmm0    # 0x1e9d0
callq 0x64e0
movq 0x28(%rsp), %rsi
testb $0x20, %sil
movq %r13, %rax
cmoveq %r12, %rax
movq %r12, %rcx
cmoveq %r13, %rcx
sete %dl
xorb %r14b, %dl
cmoveq %r12, %r13
testb $0x10, %sil
cmoveq %rax, %r13
testb $0x40, %sil
movq 0x118b6(%rip), %rdi     # 0x1e870
cmovneq %rcx, %r13
movzwl 0x8(%r13), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x3c76(%rip), %xmm3     # 0x10c48
divsd %xmm3, %xmm0
movzwl 0xa(%r13), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm3, %xmm1
movzwl 0xc(%r13), %eax
cvtsi2sd %eax, %xmm2
divsd %xmm3, %xmm2
callq 0x63e0
movl 0x34(%rsp), %eax
testl %eax, %eax
jle 0xd043
movl %eax, %r12d
addq $0x8, %rbx
xorl %r13d, %r13d
movq -0x8(%rbx), %rax
movq 0x8(%rax), %r15
cmpq %r15, %r13
je 0xd026
movq 0x11855(%rip), %rdi     # 0x1e870
movq %r15, %rsi
callq 0x6450
movq %r15, %r13
movq 0x11843(%rip), %rdi     # 0x1e870
movq %rbx, %rsi
movl $0x1, %edx
callq 0x60a0
addq $0x20, %rbx
decq %r12
jne 0xd007
movq 0x28(%rsp), %rbx
testb $0x8, %bl
movq 0x18(%rsp), %r14
je 0xd07d
movl 0x11688(%rip), %eax     # 0x1e6e0
movl 0x118e2(%rip), %ecx     # 0x1e940
addl 0x4(%rsp), %ecx
leal (%rax,%rcx), %edx
incl %edx
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
movl %r14d, %ecx
movl $0x1, %r8d
callq 0xc536
testb %bl, %bl
movq 0x8(%rsp), %rsi
jns 0xd0c1
movl 0x4(%rsp), %ecx
addl 0x118b0(%rip), %ecx     # 0x1e940
movl 0x1164a(%rip), %eax     # 0x1e6e0
addl %eax, %eax
cltq
imulq $0x55555556, %rax, %rdx # imm = 0x55555556
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x20, %rdx
addl %eax, %edx
addl %ecx, %edx
movq %rbp, %rdi
movl %r14d, %ecx
movl $0x1, %r8d
callq 0xc536
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq