// File: /workspace/github_c_makefile_star2_O0/ThomasMadappattu[P]Sandmacs/buffer.c
// Function: makelist
int makelist ()
{
  BUFFER *bp;
  LINE *lp;
  char *cp1, *cp2;
  char b[7], line[128];
  int nbytes, s, c;

  blistp->b_flag &= ~BFCHG;	/* Don't complain! */
  if ((s = bclear (blistp)) != TRUE) /* Blow old text away */
    return (s);
  strncpy (blistp->b_fname, "", 1);
  if (addline ("AC    Size Buffer	  File") == FALSE ||
      addline ("-- ------- ------	  ----") == FALSE)
    return (FALSE);
  bp = bheadp;

  /* build line to report global mode settings */
  cp1 = &line[0];
  *cp1++ = ' ';
  *cp1++ = ' ';
  *cp1++ = ' ';

  /* output the list of buffers */
  while (bp != 0)
    {
      if ((bp->b_flag & BFTEMP) != 0)
	{				/* Skip magic ones */
	  bp = bp->b_bufp;
	  continue;
	}
      cp1 = &line[0];		/* Start at left edge */

      /* output status of ACTIVE flag (has the file been read in? */
      if (bp->b_active == TRUE)	 /* "@" if activated */
	*cp1++ = '@';
      else
	*cp1++ = ' ';

      /* output status of changed flag */
      if ((bp->b_flag & BFCHG) != 0) /* "*" if changed */
	*cp1++ = '*';
      else
	*cp1++ = ' ';
      *cp1++ = ' ';		/* Gap */

      nbytes = 0;			/* Count bytes in buf */
      lp = lforw (bp->b_linep);
      while (lp != bp->b_linep)
	{
	  nbytes += llength (lp) + 1;
	  lp = lforw (lp);
	}
      itoa (b, 6, nbytes);	/* 6 digit buffer size */
      cp2 = &b[0];
      while ((c = *cp2++) != 0)
	*cp1++ = (char)c;
      *cp1++ = ' ';		/* Gap */
      cp2 = &bp->b_bname[0];	/* Buffer name */
      while ((c = *cp2++) != 0)
	*cp1++ = (char)c;
      cp2 = &bp->b_fname[0];	/* File name */
      if (*cp2 != 0)
	{
	  while (cp1 < &line[2 + 1 + 5 + 1 + 6 + 1 + NBUFN]) /* XXX ??? */
	    *cp1++ = ' ';
	  while ((c = *cp2++) != 0)
	    {
	      if (cp1 < &line[128 - 1])
		*cp1++ = (char)c;
	    }
	}
      *cp1 = 0;			/* Add to the buffer */
      if (addline (line) == FALSE)
	return (FALSE);
      bp = bp->b_bufp;
    }
  return (TRUE);		/* All done */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
leaq 0xdea6(%rip), %rax      # 0x11888
movq (%rax), %rax
movsbl 0x32(%rax), %ecx
andl $-0x3, %ecx
movb %cl, 0x32(%rax)
leaq 0xde92(%rip), %rax      # 0x11888
movq (%rax), %rdi
callq 0x36b0
movl %eax, -0xb8(%rbp)
cmpl $0x1, %eax
je 0x3a17
movl -0xb8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3d21
leaq 0xde6a(%rip), %rax      # 0x11888
movq (%rax), %rdi
addq $0x33, %rdi
leaq 0x9d00(%rip), %rsi      # 0xd72c
movl $0x1, %edx
callq 0x2060
leaq 0x961f(%rip), %rdi      # 0xd05c
callq 0x3d30
cmpl $0x0, %eax
je 0x3a58
leaq 0x9627(%rip), %rdi      # 0xd075
callq 0x3d30
cmpl $0x0, %eax
jne 0x3a64
movl $0x0, -0x4(%rbp)
jmp 0x3d21
leaq 0xde35(%rip), %rax      # 0x118a0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
cmpq $0x0, -0x10(%rbp)
je 0x3d1a
movq -0x10(%rbp), %rax
movsbl 0x32(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3adb
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x3ab3
leaq -0xb0(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x30(%rax), %eax
cmpl $0x1, %eax
jne 0x3b07
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x40, (%rax)
jmp 0x3b19
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
movq -0x10(%rbp), %rax
movsbl 0x32(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3b3d
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x2a, (%rax)
jmp 0x3b4f
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
movl $0x0, -0xb4(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x28(%rcx), %rax
je 0x3bab
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x1, %eax
addl -0xb4(%rbp), %eax
movl %eax, -0xb4(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x3b7a
leaq -0x2f(%rbp), %rdi
movl -0xb4(%rbp), %edx
movl $0x6, %esi
callq 0x3e40
leaq -0x2f(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movsbl (%rax), %eax
movl %eax, -0xbc(%rbp)
cmpl $0x0, %eax
je 0x3bff
movl -0xbc(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
movq -0x10(%rbp), %rax
addq $0x83, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movsbl (%rax), %eax
movl %eax, -0xbc(%rbp)
cmpl $0x0, %eax
je 0x3c57
movl -0xbc(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x3c1f
movq -0x10(%rbp), %rax
addq $0x33, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x3ce9
jmp 0x3c71
movq -0x20(%rbp), %rax
leaq -0xb0(%rbp), %rcx
addq $0x20, %rcx
cmpq %rcx, %rax
jae 0x3c99
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x20, (%rax)
jmp 0x3c71
jmp 0x3c9b
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movsbl (%rax), %eax
movl %eax, -0xbc(%rbp)
cmpl $0x0, %eax
je 0x3ce7
movq -0x20(%rbp), %rax
leaq -0xb0(%rbp), %rcx
addq $0x7f, %rcx
cmpq %rcx, %rax
jae 0x3ce5
movl -0xbc(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x3c9b
jmp 0x3ce9
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
leaq -0xb0(%rbp), %rdi
callq 0x3d30
cmpl $0x0, %eax
jne 0x3d0a
movl $0x0, -0x4(%rbp)
jmp 0x3d21
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x3ab3
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)