// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]pEmacs/buffer.c
// Function: makelist
int makelist ()
{
  BUFFER *bp;
  LINE *lp;
  char *cp1, *cp2;
  char b[8], 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 ("ACV    Size Buffer           File") == FALSE ||
      addline ("--- ------- ------           ----") == FALSE)
    return (FALSE);
  bp = bheadp;

  /* build line to report global mode settings */
  cp1 = &line[0];
  *cp1++ = ' ';
  *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++ = ' ';

      /* output status of readonly flag */
      if ((bp->b_flag & BFRO) != 0) /* "%" if view mode */
	*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, 7, nbytes);	/* 7 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[3 + 1 + 7 + 1 + NBUFN + 1]) /* ACV, space, size, space, bufname, space */
	    *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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq 0xad48(%rip), %r14      # 0xda58
movq (%r14), %rdi
andb $-0x3, 0x32(%rdi)
callq 0x2bf3
movl %eax, %ebx
cmpl $0x1, %eax
jne 0x2ec6
movq (%r14), %rax
movb $0x0, 0x33(%rax)
leaq 0x6311(%rip), %rdi      # 0x9046
callq 0x2eda
xorl %ebx, %ebx
testl %eax, %eax
je 0x2ec6
leaq 0x631d(%rip), %rdi      # 0x9068
callq 0x2eda
testl %eax, %eax
je 0x2ec6
leaq 0xadd1(%rip), %rax      # 0xdb30
movq (%rax), %r12
movl $0x20202020, 0x10(%rsp) # imm = 0x20202020
movl $0x1, %ebx
testq %r12, %r12
je 0x2ec6
leaq 0x14(%rsp), %r13
movl $0x20, %ebp
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
movb 0x32(%r12), %al
testb $0x1, %al
jne 0x2eb5
cmpb $0x1, 0x30(%r12)
sete %cl
shlb $0x5, %cl
addb $0x20, %cl
movb %cl, 0x10(%rsp)
testb $0x2, %al
movl $0x2a, %ecx
cmovel %ebp, %ecx
movb %cl, 0x11(%rsp)
xorl %ecx, %ecx
testb $0x4, %al
setne %cl
leal 0x20(%rcx,%rcx,4), %eax
movb %al, 0x12(%rsp)
movb $0x20, 0x13(%rsp)
movq 0x28(%r12), %rax
movq (%rax), %rcx
xorl %edx, %edx
cmpq %rax, %rcx
je 0x2de9
movl 0x14(%rcx), %esi
addl %esi, %edx
incl %edx
movq (%rcx), %rcx
jmp 0x2dd8
movq %r14, %rdi
movl $0x7, %esi
callq 0x2f5f
movb 0x8(%rsp), %cl
movl $0x5, %eax
movq %r13, %rdx
testb %cl, %cl
je 0x2e14
movb %cl, (%rdx)
movb 0x4(%rsp,%rax), %cl
incq %rdx
incq %rax
jmp 0x2e02
movb $0x20, (%rdx)
movb 0x83(%r12), %cl
testb %cl, %cl
je 0x2e3b
leaq 0x84(%r12), %rdx
movb %cl, 0x10(%rsp,%rax)
incq %rax
movb (%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x2e2b
leaq (%rsp,%rax), %rcx
addq $0x10, %rcx
cmpb $0x0, 0x33(%r12)
je 0x2ea6
cmpq $0x1c, %rax
ja 0x2e70
leaq (%rsp,%rax), %rdi
addq $0x10, %rdi
movl $0x1d, %edx
subq %rax, %rdx
movl $0x20, %esi
callq 0x2130
movl $0x1d, %eax
leaq (%rsp,%rax), %rcx
addq $0x10, %rcx
movb 0x33(%r12), %sil
testb %sil, %sil
je 0x2ea6
leaq 0x34(%r12), %rdx
cmpq $0x7e, %rax
jg 0x2e93
incq %rax
movb %sil, (%rcx)
leaq (%rsp,%rax), %rcx
addq $0x10, %rcx
movb (%rdx), %sil
incq %rdx
testb %sil, %sil
jne 0x2e87
movb $0x0, (%rcx)
movq %r15, %rdi
callq 0x2eda
testl %eax, %eax
je 0x2ec4
movq (%r12), %r12
testq %r12, %r12
jne 0x2d8c
jmp 0x2ec6
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq