// File: /workspace/github_c_makefile_star2_O2/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 0x8f30(%rip), %rax      # 0xc8f0
movq (%rax,%rcx,8), %rax
orw $0x1, (%rax)
andl $0x0, 0x8f15(%rip)      # 0xc8e4
leaq 0x904a(%rip), %rax      # 0xca20
cmpl $0x0, (%rax)
pushq $0x2d
popq %rax
pushq $0x20
popq %rdx
cmovel %eax, %edx
leaq 0x904f(%rip), %rax      # 0xca38
cmpq %rdi, (%rax)
movl %ecx, 0x8eee(%rip)      # 0xc8e0
pushq $0x3d
popq %rbx
cmovnel %edx, %ebx
movl %ebx, %edi
callq 0x3398
movq 0x8(%r14), %r15
testb $0x4, 0x32(%r15)
pushq $0x25
popq %rdi
cmovel %ebx, %edi
callq 0x3398
testb $0x2, 0x32(%r15)
pushq $0x2a
popq %rdi
cmovel %ebx, %edi
callq 0x3398
movabsq $0x3a7363616d457020, %rax # imm = 0x3A7363616D457020
movq %rax, (%rsp)
movw $0x20, 0x8(%rsp)
movb $0x20, %al
pushq $0x1
popq %r14
testb %al, %al
je 0x3a53
movsbl %al, %edi
callq 0x3398
movb (%rsp,%r14), %al
incq %r14
jmp 0x3a3e
movl %ebx, %edi
callq 0x3398
movl %ebx, %edi
callq 0x3398
pushq $0x20
popq %rdi
callq 0x3398
leaq 0x83(%r15), %r12
addl $0x9, %r14d
movsbl (%r12), %edi
testl %edi, %edi
je 0x3a8a
incq %r12
callq 0x3398
incl %r14d
jmp 0x3a74
pushq $0x20
popq %rdi
callq 0x3398
movl %ebx, %edi
callq 0x3398
movl %ebx, %edi
callq 0x3398
cmpb $0x0, 0x33(%r15)
je 0x3aec
addq $0x33, %r15
pushq $0x20
popq %rbp
movl %ebp, %edi
callq 0x3398
xorl %r12d, %r12d
leaq 0x46c9(%rip), %r13      # 0x8188
cmpq $0x6, %r12
je 0x3ae2
movsbl (%r12,%r13), %edi
incq %r12
callq 0x3398
incl %r14d
jmp 0x3abf
incq %r15
callq 0x3398
incl %r14d
movsbl (%r15), %edi
testl %edi, %edi
jne 0x3ad7
jmp 0x3af1
decl %r14d
jmp 0x3afb
movl %ebp, %edi
callq 0x3398
incl %r14d
leaq 0x8d56(%rip), %rax      # 0xc858
movl %ebx, %ebp
cmpl 0x4(%rax), %r14d
jl 0x3af1
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq