// File: /workspace/github_c_makefile_star2_O1/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 0x12b3f(%rip), %rdi     # 0x1ec90
movl %esi, 0x34(%rsp)
movslq %esi, %r12
movl %ecx, %edx
subl %r12d, %edx
setg %bl
movq %r12, %r15
shlq $0x4, %r15
leaq (%r15,%r14), %rsi
movl %r12d, %ecx
movl %r8d, 0x10(%rsp)
callq 0xc36d
movl %eax, 0x30(%rsp)
testl %eax, %eax
setg %al
andb %bl, %al
movb %al, 0xb(%rsp)
movslq %ebp, %rbx
leaq (%r15,%r14), %rax
addq $0xc, %rax
movq %rax, 0x50(%rsp)
incq %r12
movq %r12, 0x58(%rsp)
movl $0x1, %eax
movq %rbx, 0x60(%rsp)
movq %rax, 0x38(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x12ad3(%rip), %rax     # 0x1ec90
movq %rax, 0x20(%rsp)
cmpb $0x0, 0xb(%rsp)
je 0xc31a
xorl %r15d, %r15d
movq 0x58(%rsp), %rbp
movq 0x50(%rsp), %r13
movl 0x34(%rsp), %r14d
movl $0x0, 0xc(%rsp)
movl 0x30(%rsp), %edx
movzwl -0x8(%r13), %r12d
cmpl $0x800, %r12d           # imm = 0x800
je 0xc300
movl %edx, 0x14(%rsp)
movq %rcx, 0x18(%rsp)
movl -0xc(%r13), %eax
movq %rax, 0x68(%rsp)
movl -0x4(%r13), %eax
movq %rax, 0x48(%rsp)
movzwl -0x6(%r13), %eax
movq %rax, 0x70(%rsp)
movl (%r13), %eax
movq %rax, 0x40(%rsp)
movl %r14d, %edi
movl 0x10(%rsp), %esi
callq 0x6582
movl %r12d, %ebx
xorl $0x40, %ebx
testl %eax, %eax
cmovel %r12d, %ebx
testl %r15d, %r15d
jle 0xc2ba
movq 0x28(%rsp), %rax
shrq $0x20, %rax
cmpw %ax, %bx
movq 0x18(%rsp), %rcx
jne 0xc26e
cmpl %ecx, 0x48(%rsp)
jne 0xc26e
movq %rcx, %rax
shrq $0x20, %rax
cmpl %eax, 0x40(%rsp)
je 0xc2bf
movq 0x38(%rsp), %rax
movl %eax, (%rsp)
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl %r15d, %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
callq 0xc7bd
movq 0x18(%rsp), %rcx
movl %r15d, %eax
shlq $0x4, %rax
addq %rax, %r12
movq %r12, 0x20(%rsp)
movl 0x14(%rsp), %edx
subl %r15d, %edx
xorl %r15d, %r15d
jmp 0xc2c3
movq 0x18(%rsp), %rcx
movl 0x14(%rsp), %edx
testl %r15d, %r15d
jne 0xc2f8
movzwl %bx, %eax
shlq $0x20, %rax
addq 0x68(%rsp), %rax
movq 0x70(%rsp), %rsi
shlq $0x30, %rsi
orq %rax, %rsi
movq 0x40(%rsp), %rcx
shlq $0x20, %rcx
addq 0x48(%rsp), %rcx
movq %rsi, 0x28(%rsp)
movl %r14d, 0xc(%rsp)
incl %r15d
movq 0x60(%rsp), %rbx
cmpq %rbx, %rbp
jge 0xc31d
incl %r14d
addq $0x10, %r13
incq %rbp
cmpl %edx, %r15d
jl 0xc1eb
jmp 0xc31d
xorl %r15d, %r15d
testl %r15d, %r15d
movq 0x38(%rsp), %r14
jle 0xc350
movl %r14d, (%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rcx, %r12
movq %rcx, %rdx
movl %r15d, %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
callq 0xc7bd
movq %r12, %rcx
leal (%r14,%r14), %eax
cmpl $0x2, %r14d
jb 0xc1a9
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq