// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rdi, %r14
movsbq 0x38(%rdi), %rax
movsbq 0x39(%rdi), %rcx
addq %rax, %rcx
movq 0x9ba8(%rip), %rax      # 0xd900
movq (%rax,%rcx,8), %rax
orw $0x1, (%rax)
movl %ecx, 0x9b8a(%rip)      # 0xd8f0
leaq 0x9cdb(%rip), %rax      # 0xda48
leaq 0x9cbc(%rip), %rcx      # 0xda30
cmpl $0x0, (%rcx)
movl $0x2d, %ecx
movl $0x20, %edx
cmovel %ecx, %edx
cmpq %rdi, (%rax)
movl $0x0, 0x9b63(%rip)      # 0xd8f4
movl $0x3d, %ebx
cmovnel %edx, %ebx
movl %ebx, %edi
callq 0x3559
movq 0x8(%r14), %r15
testb $0x4, 0x32(%r15)
movl $0x25, %edi
cmovel %ebx, %edi
callq 0x3559
testb $0x2, 0x32(%r15)
movl $0x2a, %edi
cmovel %ebx, %edi
callq 0x3559
movabsq $0x3a7363616d457020, %rax # imm = 0x3A7363616D457020
movq %rax, (%rsp)
movw $0x20, 0x8(%rsp)
movb $0x20, %al
movl $0x1, %r14d
movsbl %al, %edi
callq 0x3559
movb (%rsp,%r14), %al
incq %r14
testb %al, %al
jne 0x3de5
movl %ebx, %edi
callq 0x3559
movl %ebx, %edi
callq 0x3559
movl $0x20, %edi
callq 0x3559
addq $0x5, %r14
movb 0x83(%r15), %al
testb %al, %al
je 0x3e3c
leaq 0x84(%r15), %r12
movsbl %al, %edi
callq 0x3559
incl %r14d
movb (%r12), %al
incq %r12
testb %al, %al
jne 0x3e26
movl $0x20, %edi
callq 0x3559
movl %ebx, %edi
callq 0x3559
movl %ebx, %edi
callq 0x3559
cmpb $0x0, 0x33(%r15)
je 0x3ebd
movl $0x20, %edi
callq 0x3559
movb $0x46, %al
movl $0x1, %r12d
leaq 0x5314(%rip), %r13      # 0x9188
movsbl %al, %edi
callq 0x3559
movb (%r12,%r13), %al
incq %r12
cmpq $0x7, %r12
jne 0x3e74
addl $0xa, %r14d
movb 0x33(%r15), %al
testb %al, %al
je 0x3eae
addq $0x34, %r15
movsbl %al, %edi
callq 0x3559
incl %r14d
movb (%r15), %al
incq %r15
testb %al, %al
jne 0x3e99
movl $0x20, %edi
callq 0x3559
incl %r14d
jmp 0x3ec1
addl $0x3, %r14d
leaq 0x99a0(%rip), %r15      # 0xd868
cmpl 0x4(%r15), %r14d
jge 0x3eda
movl %ebx, %edi
callq 0x3559
incl %r14d
jmp 0x3ec8
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq