// File: /workspace/github_c_makefile_star2_O1/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 0x9d76(%rip), %rax      # 0xd808
movq (%rax,%rcx,8), %rax
orw $0x1, (%rax)
movl %ecx, 0x9d58(%rip)      # 0xd7f8
leaq 0x9db1(%rip), %rax      # 0xd858
leaq 0x9d92(%rip), %rcx      # 0xd840
cmpl $0x0, (%rcx)
movl $0x2d, %ecx
movl $0x20, %edx
cmovel %ecx, %edx
cmpq %rdi, (%rax)
movl $0x0, 0x9d31(%rip)      # 0xd7fc
movl $0x3d, %ebx
cmovnel %edx, %ebx
movl %ebx, %edi
callq 0x3303
movq 0x8(%r14), %r15
testb $0x2, 0x32(%r15)
jne 0x3aee
movl %ebx, %edi
callq 0x3303
jmp 0x3b37
movq 0x9d13(%rip), %rax      # 0xd808
movslq 0x9cfc(%rip), %rcx      # 0xd7f8
movq (%rax,%rcx,8), %rax
movslq 0x9cf5(%rip), %rcx      # 0xd7fc
leaq 0x9c82(%rip), %rdx      # 0xd790
movslq 0x4(%rdx), %rdx
cmpl %edx, %ecx
jge 0x3b26
leal 0x1(%rcx), %edx
movl %edx, 0x9cdd(%rip)      # 0xd7fc
movb $0x2a, 0x2(%rax,%rcx)
jmp 0x3b37
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9cca(%rip)      # 0xd7fc
movb $0x24, 0x1(%rdx,%rax)
movabsq $0x207363616d45, %rax   # imm = 0x207363616D45
movq %rax, 0x7(%rsp)
movabsq $0x456e616d646e6153, %rax # imm = 0x456E616D646E6153
movq %rax, (%rsp)
xorl %eax, %eax
testb %al, %al
jne 0x3b7b
movb $0x53, %al
movl $0x1, %r14d
movsbl %al, %edi
callq 0x3303
movb (%rsp,%r14), %al
incq %r14
testb %al, %al
jne 0x3b62
addl $0x4, %r14d
jmp 0x3b81
movl $0x5, %r14d
movl %ebx, %edi
callq 0x3303
movl %ebx, %edi
callq 0x3303
movq 0x9c72(%rip), %rax      # 0xd808
movslq 0x9c5b(%rip), %rcx      # 0xd7f8
movq (%rax,%rcx,8), %rax
movl 0x9c55(%rip), %ecx      # 0xd7fc
leaq 0x9be2(%rip), %r12      # 0xd790
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x3bc5
leal 0x1(%rcx), %edx
movl %edx, 0x9c3c(%rip)      # 0xd7fc
movb $0x20, %sil
jmp 0x3bd8
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9c2b(%rip)      # 0xd7fc
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
movb 0x83(%r15), %al
testb %al, %al
je 0x3c08
leaq 0x84(%r15), %r13
movsbl %al, %edi
callq 0x3303
incl %r14d
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x3bf2
movq 0x9bf9(%rip), %rax      # 0xd808
movslq 0x9be2(%rip), %rcx      # 0xd7f8
movq (%rax,%rcx,8), %rax
movl 0x9bdc(%rip), %ecx      # 0xd7fc
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x3c37
leal 0x1(%rcx), %edx
movl %edx, 0x9bca(%rip)      # 0xd7fc
movb $0x20, %sil
jmp 0x3c4a
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9bb9(%rip)      # 0xd7fc
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
movl %ebx, %edi
callq 0x3303
movl %ebx, %edi
callq 0x3303
cmpb $0x0, 0x33(%r15)
je 0x3c96
movq 0x9b9a(%rip), %rax      # 0xd808
movslq 0x9b83(%rip), %rcx      # 0xd7f8
movq (%rax,%rcx,8), %rax
movl 0x9b7d(%rip), %ecx      # 0xd7fc
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x3c9f
leal 0x1(%rcx), %edx
movl %edx, 0x9b6b(%rip)      # 0xd7fc
movb $0x20, %sil
jmp 0x3cb2
addl $0x3, %r14d
jmp 0x3d5a
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9b51(%rip)      # 0xd7fc
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
movb $0x46, %al
movl $0x1, %r13d
leaq 0x53f2(%rip), %rbp      # 0x90bb
movsbl %al, %edi
callq 0x3303
movb (%r13,%rbp), %al
incq %r13
cmpq $0x7, %r13
jne 0x3cc9
addl $0xa, %r14d
movb 0x33(%r15), %al
testb %al, %al
je 0x3d04
addq $0x34, %r15
movsbl %al, %edi
callq 0x3303
incl %r14d
movb (%r15), %al
incq %r15
testb %al, %al
jne 0x3cef
movq 0x9afd(%rip), %rax      # 0xd808
movslq 0x9ae6(%rip), %rcx      # 0xd7f8
movq (%rax,%rcx,8), %rax
movl 0x9ae0(%rip), %ecx      # 0xd7fc
movl 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x3d33
leal 0x1(%rcx), %edx
movl %edx, 0x9ace(%rip)      # 0xd7fc
movb $0x20, %sil
jmp 0x3d46
addl $0x7, %ecx
andl $-0x8, %ecx
movl %ecx, 0x9abd(%rip)      # 0xd7fc
decl %edx
movb $0x24, %sil
movl %edx, %ecx
movslq %ecx, %rcx
movb %sil, 0x2(%rax,%rcx)
jmp 0x3d57
movl %ebx, %edi
callq 0x3303
incl %r14d
cmpl 0x4(%r12), %r14d
jl 0x3d50
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq