// File: /workspace/github_c_makefile_star2_O0/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
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 0xcc2a(%rip), %rax      # 0x11828
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 0x41b0
movq -0x8(%rbp), %rax
leaq 0xcc4e(%rip), %rcx      # 0x11878
cmpq (%rcx), %rax
jne 0x4c3b
movl $0x3d, -0x21c(%rbp)
jmp 0x4c5f
leaq 0xcc1e(%rip), %rax      # 0x11860
cmpl $0x0, (%rax)
je 0x4c53
movl $0x20, -0x21c(%rbp)
jmp 0x4c5d
movl $0x2d, -0x21c(%rbp)
jmp 0x4c5f
movl -0x21c(%rbp), %edi
callq 0x41d0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x32(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4c92
movl $0x2a, %edi
callq 0x41d0
jmp 0x4c9d
movl -0x21c(%rbp), %edi
callq 0x41d0
movl $0x2, -0x224(%rbp)
leaq -0x210(%rbp), %rdi
leaq 0x84db(%rip), %rsi      # 0xd190
movl $0xf, %edx
callq 0x2060
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 0x4d0c
movl -0x220(%rbp), %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x4ccd
movl -0x21c(%rbp), %edi
callq 0x41d0
movl -0x21c(%rbp), %edi
callq 0x41d0
movl $0x20, %edi
callq 0x41d0
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 0x4d8b
movl -0x220(%rbp), %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x4d4c
movl $0x20, %edi
callq 0x41d0
movl -0x21c(%rbp), %edi
callq 0x41d0
movl -0x21c(%rbp), %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x224(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x33(%rax), %eax
cmpl $0x0, %eax
je 0x4e98
movl $0x20, %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
leaq 0x83b3(%rip), %rax      # 0xd19e
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 0x4e31
movl -0x220(%rbp), %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x4df2
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 0x4e7f
movl -0x220(%rbp), %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x4e40
movl $0x20, %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x4e9a
movl -0x224(%rbp), %eax
leaq 0xc909(%rip), %rcx      # 0x117b0
cmpl 0x4(%rcx), %eax
jge 0x4ec8
movl -0x21c(%rbp), %edi
callq 0x41d0
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x4e9a
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)