// File: /workspace/github_c_makefile_star2_O2/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, %ebp
movl %edx, %r8d
movq %rdi, %r14
movq 0x1372a(%rip), %rdi     # 0x1ec90
movslq %esi, %rcx
movl %ebp, %edx
subl %ecx, %edx
movq %rcx, %rbx
shlq $0x4, %rbx
leaq (%rbx,%r14), %rsi
movq %rcx, 0x58(%rsp)
movl %r8d, 0x14(%rsp)
callq 0xb73c
movl %eax, 0x34(%rsp)
movslq %ebp, %r13
leaq (%rbx,%r14), %rax
addq $0xc, %rax
movq %rax, 0x50(%rsp)
pushq $0x1
popq %rbx
movq %r13, 0x60(%rsp)
cmpl $0x3, %ebx
jae 0xb72d
movl %ebx, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movq 0x136d1(%rip), %rax     # 0x1ec90
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r12
movl 0x34(%rsp), %ecx
xorl %r14d, %r14d
cmpq %r13, %r12
jge 0xb6f8
movl %ecx, %ebp
subl %r14d, %ebp
jle 0xb6f8
movzwl -0x8(%rbx), %r15d
cmpw $0x800, %r15w           # imm = 0x800
je 0xb6ec
movl %ecx, 0x1c(%rsp)
movq %rdx, 0x48(%rsp)
movl -0xc(%rbx), %eax
movq %rax, 0x68(%rsp)
movzwl -0x6(%rbx), %eax
movq %rax, 0x70(%rsp)
movl -0x4(%rbx), %eax
movq %rax, 0x40(%rsp)
movl (%rbx), %eax
movq %rax, 0x38(%rsp)
movl %r12d, %edi
movl 0x14(%rsp), %esi
callq 0x5fe9
movl %r15d, %r13d
xorl $0x40, %r13d
testl %eax, %eax
cmovel %r15d, %r13d
testl %r14d, %r14d
jle 0xb6a5
movq 0x28(%rsp), %rax
shrq $0x20, %rax
cmpw %ax, %r13w
movq 0x48(%rsp), %rdx
movl 0x1c(%rsp), %ecx
jne 0xb66c
cmpl %edx, 0x40(%rsp)
jne 0xb66c
movq %rdx, %rax
shrq $0x20, %rax
cmpl %eax, 0x38(%rsp)
je 0xb6e4
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
movq 0x20(%rsp), %r15
movq %r15, %rdi
movq 0x28(%rsp), %rsi
movl %r14d, %ecx
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %r9d
callq 0xbb50
movl %r14d, %eax
shlq $0x4, %rax
addq %rax, %r15
movq %r15, 0x20(%rsp)
movl %ebp, %ecx
jmp 0xb6b0
movq 0x48(%rsp), %rdx
movl 0x1c(%rsp), %ecx
jne 0xb6e4
movzwl %r13w, %eax
shlq $0x20, %rax
addq 0x68(%rsp), %rax
movq 0x70(%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 %r12d, 0x10(%rsp)
incl %r14d
movq 0x60(%rsp), %r13
incq %r12
addq $0x10, %rbx
jmp 0xb5d5
testl %r14d, %r14d
movl 0x18(%rsp), %ebx
jle 0xb726
movl %ebx, (%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rdx, %r15
movl %r14d, %ecx
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %r9d
callq 0xbb50
movq %r15, %rdx
addl %ebx, %ebx
jmp 0xb5a3
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq