// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/x.c
// Function: xdrawline
void
xdrawline(Line line, int x1, int y1, int x2)
{
	int i, x, ox, numspecs, numspecs_cached;
	Glyph base, new;
	XftGlyphFontSpec *specs;

	numspecs_cached = xmakeglyphfontspecs(xw.specbuf, &line[x1], x2 - x1, x1, y1);

	/* Draw line in 2 passes: background and foreground. This way wide glyphs
       won't get truncated (#223) */
	for (int dmode = DRAW_BG; dmode <= DRAW_FG; dmode <<= 1) {
		specs = xw.specbuf;
		numspecs = numspecs_cached;
		i = ox = 0;
		for (x = x1; x < x2 && i < numspecs; x++) {
			new = line[x];
			if (new.mode == ATTR_WDUMMY)
				continue;
			if (selected(x, y1))
				new.mode ^= ATTR_REVERSE;
			if (i > 0 && ATTRCMP(base, new)) {
				xdrawglyphfontspecs(specs, base, i, ox, y1, dmode);
				specs += i;
				numspecs -= i;
				i = 0;
			}
			if (i == 0) {
				ox = x;
				base = new;
			}
			i++;
		}
		if (i > 0)
			xdrawglyphfontspecs(specs, base, i, ox, y1, dmode);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %ebx
movl %edx, %r8d
movq %rdi, %r14
movq 0x12a16(%rip), %rdi     # 0x1ec80
movl %esi, 0x34(%rsp)
movslq %esi, %r12
movl %ecx, %edx
subl %r12d, %edx
setg %bpl
movq %r12, %r15
shlq $0x4, %r15
leaq (%r15,%r14), %rsi
movl %r12d, %ecx
movl %r8d, 0x10(%rsp)
callq 0xc474
movl %eax, 0x30(%rsp)
testl %eax, %eax
setg %al
andb %bpl, %al
movb %al, 0xb(%rsp)
movslq %ebx, %rax
movq %rax, 0x70(%rsp)
leaq (%r15,%r14), %rax
addq $0xc, %rax
movq %rax, 0x50(%rsp)
incq %r12
movq %r12, 0x58(%rsp)
movl $0x1, %eax
movq %rax, 0x18(%rsp)
cmpb $0x0, 0xb(%rsp)
je 0xc44f
xorl %r14d, %r14d
movq 0x129a2(%rip), %rax     # 0x1ec80
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rbx
movq 0x50(%rsp), %rbp
movl 0x34(%rsp), %r15d
movl $0x0, 0xc(%rsp)
movl 0x30(%rsp), %ecx
movzwl -0x8(%rbp), %r13d
cmpl $0x800, %r13d           # imm = 0x800
je 0xc406
movl %ecx, 0x14(%rsp)
movq %rdx, 0x48(%rsp)
movl -0xc(%rbp), %eax
movq %rax, 0x60(%rsp)
movl -0x4(%rbp), %eax
movq %rax, 0x40(%rsp)
movzwl -0x6(%rbp), %eax
movq %rax, 0x68(%rsp)
movl (%rbp), %eax
movq %rax, 0x38(%rsp)
movl %r15d, %edi
movl 0x10(%rsp), %esi
callq 0x6656
movl %r13d, %r12d
xorl $0x40, %r12d
testl %eax, %eax
cmovel %r13d, %r12d
testl %r14d, %r14d
jle 0xc385
movq 0x28(%rsp), %rax
shrq $0x20, %rax
cmpw %ax, %r12w
movq 0x48(%rsp), %rdx
jne 0xc392
cmpl %edx, 0x40(%rsp)
jne 0xc392
movq %rdx, %rax
shrq $0x20, %rax
cmpl %eax, 0x38(%rsp)
jne 0xc392
movl 0x14(%rsp), %ecx
jmp 0xc403
movq 0x48(%rsp), %rdx
movl 0x14(%rsp), %ecx
jne 0xc403
jmp 0xc3cf
movq 0x18(%rsp), %rax
movl %eax, (%rsp)
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq 0x28(%rsp), %rsi
movl %r14d, %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
callq 0xc8bd
movl %r14d, %eax
shlq $0x4, %rax
addq %rax, %r13
movq %r13, 0x20(%rsp)
movl 0x14(%rsp), %ecx
subl %r14d, %ecx
movzwl %r12w, %eax
shlq $0x20, %rax
addq 0x60(%rsp), %rax
movq 0x68(%rsp), %rsi
shlq $0x30, %rsi
orq %rax, %rsi
movq 0x38(%rsp), %rdx
shlq $0x20, %rdx
addq 0x40(%rsp), %rdx
xorl %r14d, %r14d
movq %rsi, 0x28(%rsp)
movl %r15d, 0xc(%rsp)
incl %r14d
cmpq 0x70(%rsp), %rbx
jge 0xc420
incl %r15d
addq $0x10, %rbp
incq %rbx
cmpl %ecx, %r14d
jl 0xc2fe
testl %r14d, %r14d
jle 0xc44f
movq 0x18(%rsp), %rax
movl %eax, (%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rdx, %rbx
movl %r14d, %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
callq 0xc8bd
movq %rbx, %rdx
movq 0x18(%rsp), %rcx
leal (%rcx,%rcx), %eax
cmpl $0x2, %ecx
movq %rax, 0x18(%rsp)
jb 0xc2c9
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq