// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq 0x14ac4(%rip), %rdi     # 0x23280
movq -0x8(%rbp), %rsi
movslq -0xc(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movl -0x14(%rbp), %edx
subl -0xc(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
callq 0xe960
movl %eax, -0x28(%rbp)
movl $0x1, -0x54(%rbp)
cmpl $0x2, -0x54(%rbp)
jg 0xe959
movq 0x14a88(%rip), %rax     # 0x23280
movq %rax, -0x50(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0x55(%rbp)
jge 0xe82f
movl -0x18(%rbp), %eax
cmpl -0x24(%rbp), %eax
setl %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0xe83b
jmp 0xe922
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movzwl -0x44(%rbp), %eax
cmpl $0x800, %eax            # imm = 0x800
jne 0xe869
jmp 0xe914
movl -0x1c(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x63d0
cmpl $0x0, %eax
je 0xe884
movzwl -0x44(%rbp), %eax
xorl $0x40, %eax
movw %ax, -0x44(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0xe8ef
movzwl -0x34(%rbp), %eax
movzwl -0x44(%rbp), %ecx
cmpl %ecx, %eax
jne 0xe8a6
movl -0x30(%rbp), %eax
cmpl -0x40(%rbp), %eax
jne 0xe8a6
movl -0x2c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xe8ef
movq -0x50(%rbp), %rdi
movl -0x18(%rbp), %ecx
movl -0x20(%rbp), %r8d
movl -0x10(%rbp), %r9d
movl -0x54(%rbp), %eax
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl %eax, (%rsp)
callq 0xefb0
movl -0x18(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x18(%rbp), %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0xe90b
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe816
cmpl $0x0, -0x18(%rbp)
jle 0xe94a
movq -0x50(%rbp), %rdi
movl -0x18(%rbp), %ecx
movl -0x20(%rbp), %r8d
movl -0x10(%rbp), %r9d
movl -0x54(%rbp), %eax
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl %eax, (%rsp)
callq 0xefb0
jmp 0xe94c
movl -0x54(%rbp), %eax
shll %eax
movl %eax, -0x54(%rbp)
jmp 0xe7e7
addq $0x60, %rsp
popq %rbp
retq
nop