// File: /workspace/github_c_makefile_star2_O3/ThomasMadappattu[P]Sandmacs/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 & BFCHG) != 0)	/* "*" if changed */
    vtputc ('*');
  else
    vtputc (lchar);

  n = 2;
  strncpy (tline, "SandmanEmacs ", 15);

  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 0x9d2c(%rip), %rax      # 0xd808
movq (%rax,%rcx,8), %rax
orw $0x1, (%rax)
movl %ecx, 0x9d0e(%rip)      # 0xd7f8
leaq 0x9d67(%rip), %rax      # 0xd858
leaq 0x9d48(%rip), %rcx      # 0xd840
cmpl $0x0, (%rcx)
movl $0x2d, %ecx
movl $0x20, %edx
cmovel %ecx, %edx
cmpq %rdi, (%rax)
movl $0x0, 0x9ce7(%rip)      # 0xd7fc
movl $0x3d, %ebx
cmovnel %edx, %ebx
movl %ebx, %edi
callq 0x32dd
movq 0x8(%r14), %r15
testb $0x2, 0x32(%r15)
movl $0x2a, %edi
cmovel %ebx, %edi
callq 0x32dd
movabsq $0x207363616d45, %rax   # imm = 0x207363616D45
movq %rax, 0x7(%rsp)
movabsq $0x456e616d646e6153, %rax # imm = 0x456E616D646E6153
movq %rax, (%rsp)
movb $0x53, %al
movl $0x1, %r14d
movsbl %al, %edi
callq 0x32dd
movb (%rsp,%r14), %al
incq %r14
testb %al, %al
jne 0x3b5f
movl %ebx, %edi
callq 0x32dd
movl %ebx, %edi
callq 0x32dd
movl $0x20, %edi
callq 0x32dd
addq $0x4, %r14
movb 0x83(%r15), %al
testb %al, %al
je 0x3bb6
leaq 0x84(%r15), %r12
movsbl %al, %edi
callq 0x32dd
incl %r14d
movb (%r12), %al
incq %r12
testb %al, %al
jne 0x3ba0
movl $0x20, %edi
callq 0x32dd
movl %ebx, %edi
callq 0x32dd
movl %ebx, %edi
callq 0x32dd
cmpb $0x0, 0x33(%r15)
je 0x3c37
movl $0x20, %edi
callq 0x32dd
movb $0x46, %al
movl $0x1, %r12d
leaq 0x54cd(%rip), %r13      # 0x90bb
movsbl %al, %edi
callq 0x32dd
movb (%r12,%r13), %al
incq %r12
cmpq $0x7, %r12
jne 0x3bee
addl $0xa, %r14d
movb 0x33(%r15), %al
testb %al, %al
je 0x3c28
addq $0x34, %r15
movsbl %al, %edi
callq 0x32dd
incl %r14d
movb (%r15), %al
incq %r15
testb %al, %al
jne 0x3c13
movl $0x20, %edi
callq 0x32dd
incl %r14d
jmp 0x3c3b
addl $0x3, %r14d
leaq 0x9b4e(%rip), %r15      # 0xd790
cmpl 0x4(%r15), %r14d
jge 0x3c54
movl %ebx, %edi
callq 0x32dd
incl %r14d
jmp 0x3c42
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq