// File: /workspace/github_c_makefile_star2_O2/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 %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 0x90c4(%rip), %rax      # 0xc7f8
movq (%rax,%rcx,8), %rax
orw $0x1, (%rax)
andl $0x0, 0x90a9(%rip)      # 0xc7ec
leaq 0x90e6(%rip), %rax      # 0xc830
cmpl $0x0, (%rax)
pushq $0x2d
popq %rax
pushq $0x20
popq %rdx
cmovel %eax, %edx
leaq 0x90eb(%rip), %rax      # 0xc848
cmpq %rdi, (%rax)
movl %ecx, 0x9082(%rip)      # 0xc7e8
pushq $0x3d
popq %rbx
cmovnel %edx, %ebx
movl %ebx, %edi
callq 0x310c
movq 0x8(%r14), %r15
testb $0x2, 0x32(%r15)
pushq $0x2a
popq %rdi
cmovel %ebx, %edi
callq 0x310c
movabsq $0x207363616d45, %rax   # imm = 0x207363616D45
movq %rax, 0x7(%rsp)
movabsq $0x456e616d646e6153, %rax # imm = 0x456E616D646E6153
movq %rax, (%rsp)
movb $0x53, %al
pushq $0x1
popq %r14
testb %al, %al
je 0x37bf
movsbl %al, %edi
callq 0x310c
movb (%rsp,%r14), %al
incq %r14
jmp 0x37aa
movl %ebx, %edi
callq 0x310c
movl %ebx, %edi
callq 0x310c
pushq $0x20
popq %rdi
callq 0x310c
leaq 0x83(%r15), %r12
addl $0x8, %r14d
movsbl (%r12), %edi
testl %edi, %edi
je 0x37f6
incq %r12
callq 0x310c
incl %r14d
jmp 0x37e0
pushq $0x20
popq %rdi
callq 0x310c
movl %ebx, %edi
callq 0x310c
movl %ebx, %edi
callq 0x310c
cmpb $0x0, 0x33(%r15)
je 0x3858
addq $0x33, %r15
pushq $0x20
popq %rbp
movl %ebp, %edi
callq 0x310c
xorl %r12d, %r12d
leaq 0x4890(%rip), %r13      # 0x80bb
cmpq $0x6, %r12
je 0x384e
movsbl (%r12,%r13), %edi
incq %r12
callq 0x310c
incl %r14d
jmp 0x382b
incq %r15
callq 0x310c
incl %r14d
movsbl (%r15), %edi
testl %edi, %edi
jne 0x3843
jmp 0x385d
decl %r14d
jmp 0x3867
movl %ebp, %edi
callq 0x310c
incl %r14d
leaq 0x8f12(%rip), %rax      # 0xc780
movl %ebx, %ebp
cmpl 0x4(%rax), %r14d
jl 0x385d
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq