// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]pEmacs/display.c
// Function: modeline
void modeline (WINDOW *wp)
{
  BUFFER *bp;
  char tline[NLINE];		/* buffer for part of mode line */
  char *cp;
  int lchar;			/* character to draw line in buffer with */
  int c;
  int n;			/* cursor position count */

  n = wp->w_toprow + wp->w_ntrows; /* Location */
  vscreen[n]->v_flag |= VFCHG; /* Redraw next time */
  vtmove (n, 0);	       /* Seek to right line */
  if (wp == curwp)	       /* mark the current buffer */
    lchar = '=';
  else
    if (revexist)
      lchar = ' ';
    else
      lchar = '-';

  vtputc (lchar);
  bp = wp->w_bufp;

  if ((bp->b_flag & BFRO) != 0)	/* "%" if readonly */
    vtputc ('%');
  else 
    vtputc (lchar);

  if ((bp->b_flag & BFCHG) != 0)	/* "*" if changed */
    vtputc ('*');
  else
    vtputc (lchar);

  n = 3;
  strncpy (tline, " pEmacs: ", 10);

  cp = &tline[0];
  while ((c = *cp++) != 0)
    {
      vtputc (c);
      ++n;
    }

  vtputc (lchar);
  vtputc (lchar);
  vtputc (' ');
  n += 3;
  cp = &bp->b_bname[0];

  while ((c = *cp++) != 0)
    {
      vtputc (c);
      ++n;
    }

  vtputc (' ');
  vtputc (lchar);
  vtputc (lchar);
  n += 3;

  if (bp->b_fname[0] != 0)     /* File name */
    {
      vtputc (' ');
      ++n;
      cp = "File: ";

      while ((c = *cp++) != 0)
	{
	  vtputc (c);
	  ++n;
	}

      cp = &bp->b_fname[0];

      while ((c = *cp++) != 0)
	{
	  vtputc (c);
	  ++n;
	}

      vtputc (' ');
      ++n;
    }

  while (n < term.t_ncol)      /* Pad to full width */
    {
      vtputc (lchar);
      ++n;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %r14
movsbq 0x38(%rdi), %rax
movsbq 0x39(%rdi), %rcx
addq %rax, %rcx
movq 0x9bd6(%rip), %rax      # 0xd900
movq (%rax,%rcx,8), %rax
orw $0x1, (%rax)
movl %ecx, 0x9bb8(%rip)      # 0xd8f0
leaq 0x9d09(%rip), %rax      # 0xda48
leaq 0x9cea(%rip), %rcx      # 0xda30
cmpl $0x0, (%rcx)
movl $0x2d, %ecx
movl $0x20, %edx
cmovel %ecx, %edx
cmpq %rdi, (%rax)
movl $0x0, 0x9b91(%rip)      # 0xd8f4
movl $0x3d, %ebx
cmovnel %edx, %ebx
movl %ebx, %edi
callq 0x359b
movq 0x8(%r14), %r14
testb $0x4, 0x32(%r14)
jne 0x3d86
movl %ebx, %edi
callq 0x359b
jmp 0x3dcf
movq 0x9b73(%rip), %rax      # 0xd900
movslq 0x9b5c(%rip), %rcx      # 0xd8f0
movq (%rax,%rcx,8), %rax
movslq 0x9b55(%rip), %rcx      # 0xd8f4
leaq 0x9ac2(%rip), %rdx      # 0xd868
movslq 0x4(%rdx), %rdx
cmpl %edx, %ecx
jge 0x3dbe
leal 0x1(%rcx), %edx
movl %edx, 0x9b3d(%rip)      # 0xd8f4
movb $0x25, 0x2(%rax,%rcx)
jmp 0x3dcf
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9b2a(%rip)      # 0xd8f4
movb $0x24, 0x1(%rdx,%rax)
testb $0x2, 0x32(%r14)
jne 0x3ddf
movl %ebx, %edi
callq 0x359b
jmp 0x3e28
movq 0x9b1a(%rip), %rax      # 0xd900
movslq 0x9b03(%rip), %rcx      # 0xd8f0
movq (%rax,%rcx,8), %rax
movslq 0x9afc(%rip), %rcx      # 0xd8f4
leaq 0x9a69(%rip), %rdx      # 0xd868
movslq 0x4(%rdx), %rdx
cmpl %edx, %ecx
jge 0x3e17
leal 0x1(%rcx), %edx
movl %edx, 0x9ae4(%rip)      # 0xd8f4
movb $0x2a, 0x2(%rax,%rcx)
jmp 0x3e28
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9ad1(%rip)      # 0xd8f4
movb $0x24, 0x1(%rdx,%rax)
movabsq $0x3a7363616d457020, %rax # imm = 0x3A7363616D457020
movq %rax, (%rsp)
movw $0x20, 0x8(%rsp)
xorl %eax, %eax
testb %al, %al
jne 0x3e64
movb $0x20, %al
movl $0x1, %r15d
movsbl %al, %edi
callq 0x359b
movb (%rsp,%r15), %al
incq %r15
testb %al, %al
jne 0x3e4b
addl $0x5, %r15d
jmp 0x3e6a
movl $0x6, %r15d
movl %ebx, %edi
callq 0x359b
movl %ebx, %edi
callq 0x359b
movq 0x9a81(%rip), %rax      # 0xd900
movslq 0x9a6a(%rip), %rcx      # 0xd8f0
movq (%rax,%rcx,8), %rax
movl 0x9a64(%rip), %ecx      # 0xd8f4
leaq 0x99d1(%rip), %r12      # 0xd868
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x3eae
leal 0x1(%rcx), %edx
movl %edx, 0x9a4b(%rip)      # 0xd8f4
movb $0x20, %sil
jmp 0x3ec1
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9a3a(%rip)      # 0xd8f4
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
movb 0x83(%r14), %al
testb %al, %al
je 0x3ef1
leaq 0x84(%r14), %r13
movsbl %al, %edi
callq 0x359b
incl %r15d
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x3edb
movq 0x9a08(%rip), %rax      # 0xd900
movslq 0x99f1(%rip), %rcx      # 0xd8f0
movq (%rax,%rcx,8), %rax
movl 0x99eb(%rip), %ecx      # 0xd8f4
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x3f20
leal 0x1(%rcx), %edx
movl %edx, 0x99d9(%rip)      # 0xd8f4
movb $0x20, %sil
jmp 0x3f33
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x99c8(%rip)      # 0xd8f4
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
movl %ebx, %edi
callq 0x359b
movl %ebx, %edi
callq 0x359b
cmpb $0x0, 0x33(%r14)
je 0x3f7f
movq 0x99a9(%rip), %rax      # 0xd900
movslq 0x9992(%rip), %rcx      # 0xd8f0
movq (%rax,%rcx,8), %rax
movl 0x998c(%rip), %ecx      # 0xd8f4
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x3f88
leal 0x1(%rcx), %edx
movl %edx, 0x997a(%rip)      # 0xd8f4
movb $0x20, %sil
jmp 0x3f9b
addl $0x3, %r15d
jmp 0x4043
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9960(%rip)      # 0xd8f4
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
movb $0x46, %al
movl $0x1, %r13d
leaq 0x51d6(%rip), %rbp      # 0x9188
movsbl %al, %edi
callq 0x359b
movb (%r13,%rbp), %al
incq %r13
cmpq $0x7, %r13
jne 0x3fb2
addl $0xa, %r15d
movb 0x33(%r14), %al
testb %al, %al
je 0x3fed
addq $0x34, %r14
movsbl %al, %edi
callq 0x359b
incl %r15d
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x3fd8
movq 0x990c(%rip), %rax      # 0xd900
movslq 0x98f5(%rip), %rcx      # 0xd8f0
movq (%rax,%rcx,8), %rax
movl 0x98ef(%rip), %ecx      # 0xd8f4
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x401c
leal 0x1(%rcx), %edx
movl %edx, 0x98dd(%rip)      # 0xd8f4
movb $0x20, %sil
jmp 0x402f
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x98cc(%rip)      # 0xd8f4
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
jmp 0x4040
movl %ebx, %edi
callq 0x359b
incl %r15d
cmpl 0x4(%r12), %r15d
jl 0x4039
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq