// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x38(%rax), %eax
movq -0x8(%rbp), %rcx
movsbl 0x39(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x224(%rbp)
movq 0xba42(%rip), %rax      # 0x10910
movslq -0x224(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movswl (%rax), %ecx
orl $0x1, %ecx
movw %cx, (%rax)
movl -0x224(%rbp), %edi
xorl %esi, %esi
callq 0x4480
movq -0x8(%rbp), %rax
leaq 0xbb5e(%rip), %rcx      # 0x10a58
cmpq (%rcx), %rax
jne 0x4f0b
movl $0x3d, -0x21c(%rbp)
jmp 0x4f2f
leaq 0xbb2e(%rip), %rax      # 0x10a40
cmpl $0x0, (%rax)
je 0x4f23
movl $0x20, -0x21c(%rbp)
jmp 0x4f2d
movl $0x2d, -0x21c(%rbp)
jmp 0x4f2f
movl -0x21c(%rbp), %edi
callq 0x44a0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x32(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4f62
movl $0x25, %edi
callq 0x44a0
jmp 0x4f6d
movl -0x21c(%rbp), %edi
callq 0x44a0
movq -0x10(%rbp), %rax
movsbl 0x32(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4f89
movl $0x2a, %edi
callq 0x44a0
jmp 0x4f94
movl -0x21c(%rbp), %edi
callq 0x44a0
movl $0x3, -0x224(%rbp)
leaq -0x210(%rbp), %rdi
leaq 0x7311(%rip), %rsi      # 0xc2bd
movl $0xa, %edx
callq 0x2070
leaq -0x210(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x218(%rbp)
movsbl (%rax), %eax
movl %eax, -0x220(%rbp)
cmpl $0x0, %eax
je 0x5003
movl -0x220(%rbp), %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x4fc4
movl -0x21c(%rbp), %edi
callq 0x44a0
movl -0x21c(%rbp), %edi
callq 0x44a0
movl $0x20, %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x224(%rbp)
movq -0x10(%rbp), %rax
addq $0x83, %rax
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x218(%rbp)
movsbl (%rax), %eax
movl %eax, -0x220(%rbp)
cmpl $0x0, %eax
je 0x5082
movl -0x220(%rbp), %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x5043
movl $0x20, %edi
callq 0x44a0
movl -0x21c(%rbp), %edi
callq 0x44a0
movl -0x21c(%rbp), %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x224(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x33(%rax), %eax
cmpl $0x0, %eax
je 0x518f
movl $0x20, %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
leaq 0x71f3(%rip), %rax      # 0xc2d5
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x218(%rbp)
movsbl (%rax), %eax
movl %eax, -0x220(%rbp)
cmpl $0x0, %eax
je 0x5128
movl -0x220(%rbp), %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x50e9
movq -0x10(%rbp), %rax
addq $0x33, %rax
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x218(%rbp)
movsbl (%rax), %eax
movl %eax, -0x220(%rbp)
cmpl $0x0, %eax
je 0x5176
movl -0x220(%rbp), %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x5137
movl $0x20, %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x5191
movl -0x224(%rbp), %eax
leaq 0xb6da(%rip), %rcx      # 0x10878
cmpl 0x4(%rcx), %eax
jge 0x51bf
movl -0x21c(%rbp), %edi
callq 0x44a0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x5191
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax,%rax)