// File: /workspace/github_c_makefile_star2_O0/hughbarney[P]pEmacs/display.c
// Function: mlreplyt
int mlreplyt (char *prompt, char *buf, int nbuf, char eolchar)
{
  int cpos, i, c;

  cpos = 0;

  if (kbdmop != NULL)
    {
      while ((c = *kbdmop++) != '\0')
	buf[cpos++] = c;
      buf[cpos] = 0;
      if (buf[0] == 0)
	return (FALSE);
      return (TRUE);
    }
  mlwrite (prompt);

  for (;;)
    {
      /* get a character from the user. if it is a <ret> change it to a <NL> */
      c = (*term.t_getchar) ();
      if (c == 0x0d)
	c = '\n';

      if (c == eolchar)
	{
	  buf[cpos++] = 0;

	  if (kbdmip != NULL)
	    {
	      if (kbdmip + cpos > &kbdm[NKBDM - 3])
		{
		  ctrlg (FALSE, 0);
		  (*term.t_flush) ();
		  return (ABORT);
		}
	      for (i = 0; i < cpos; ++i)
		*kbdmip++ = buf[i];
	    }
	  (*term.t_putchar) ('\r');
	  ttcol = 0;
	  (*term.t_flush) ();

	  if (buf[0] == 0)
	    return (FALSE);

	  return (TRUE);

	}
      else if (c == 0x07)
	{			     /* Bell, abort */
	  (*term.t_putchar) ('^');
	  (*term.t_putchar) ('G');
	  ttcol += 2;
	  ctrlg (FALSE, 0);
	  (*term.t_flush) ();
	  return (ABORT);
	}
      else if (c == 0x7F || c == 0x08)
	{			       /* rubout/erase */
	  if (cpos != 0)
	    {
	      (*term.t_putchar) ('\b');
	      (*term.t_putchar) (' ');
	      (*term.t_putchar) ('\b');
	      --ttcol;

	      if (buf[--cpos] < 0x20)
		{
		  (*term.t_putchar) ('\b');
		  (*term.t_putchar) (' ');
		  (*term.t_putchar) ('\b');
		  --ttcol;
		}
	      if (buf[cpos] == '\n')
		{
		  (*term.t_putchar) ('\b');
		  (*term.t_putchar) ('\b');
		  (*term.t_putchar) (' ');
		  (*term.t_putchar) (' ');
		  (*term.t_putchar) ('\b');
		  (*term.t_putchar) ('\b');
		  --ttcol;
		  --ttcol;
		}
	      (*term.t_flush) ();
	    }
	}
      else if (c == 0x15)
	{				 /* C-U, kill */
	  while (cpos != 0)
	    {
	      (*term.t_putchar) ('\b');
	      (*term.t_putchar) (' ');
	      (*term.t_putchar) ('\b');
	      --ttcol;
	      if (buf[--cpos] < 0x20)
		{
		  (*term.t_putchar) ('\b');
		  (*term.t_putchar) (' ');
		  (*term.t_putchar) ('\b');
		  --ttcol;
		}
	    }
	  (*term.t_flush) ();
	}
      else
	{
	  if (cpos < nbuf - 1)
	    {
	      buf[cpos++] = c;
	      if ((c < ' ') && (c != '\n'))
		{
		  (*term.t_putchar) ('^');
		  ++ttcol;
		  c ^= 0x40;
		}
	      if (c != '\n')
		(*term.t_putchar) (c);
	      else
		{		/* put out <NL> for <ret> */
		  (*term.t_putchar) ('<');
		  (*term.t_putchar) ('N');
		  (*term.t_putchar) ('L');
		  (*term.t_putchar) ('>');
		  ttcol += 3;
		}
	      ++ttcol;
	      (*term.t_flush) ();
	    }
	}
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movb %al, -0x1d(%rbp)
movl $0x0, -0x24(%rbp)
leaq 0xb27a(%rip), %rax      # 0x10a80
cmpq $0x0, (%rax)
je 0x5880
jmp 0x580e
leaq 0xb26b(%rip), %rax      # 0x10a80
movq (%rax), %rax
movq %rax, %rdx
addq $0x2, %rdx
leaq 0xb25a(%rip), %rcx      # 0x10a80
movq %rdx, (%rcx)
movswl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x5850
movl -0x2c(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x580e
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x5874
movl $0x0, -0x4(%rbp)
jmp 0x5d34
movl $0x1, -0x4(%rbp)
jmp 0x5d34
movq -0x10(%rbp), %rdi
movb $0x0, %al
callq 0x56d0
leaq 0xafe6(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x20(%rcx)
movl %eax, -0x2c(%rbp)
cmpl $0xd, -0x2c(%rbp)
jne 0x58a7
movl $0xa, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movsbl -0x1d(%rbp), %ecx
cmpl %ecx, %eax
jne 0x59bb
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
leaq 0xb18d(%rip), %rax      # 0x10a60
cmpq $0x0, (%rax)
je 0x5970
leaq 0xb17c(%rip), %rax      # 0x10a60
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
shlq %rcx
addq %rcx, %rax
leaq 0xa888(%rip), %rcx      # 0x10180
addq $0x1fa, %rcx            # imm = 0x1FA
cmpq %rcx, %rax
jbe 0x5927
xorl %esi, %esi
movl %esi, %edi
movb $0x0, %al
callq 0x83d0
leaq 0xaf62(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x30(%rcx)
movl $0x2, -0x4(%rbp)
jmp 0x5d34
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x596e
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movw %ax, %cx
leaq 0xb114(%rip), %rax      # 0x10a60
movq (%rax), %rax
movq %rax, %rsi
addq $0x2, %rsi
leaq 0xb103(%rip), %rdx      # 0x10a60
movq %rsi, (%rdx)
movw %cx, (%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x592e
jmp 0x5970
movl $0xd, %edi
leaq 0xaefc(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x0, 0xa7e9(%rip)      # 0x10174
leaq 0xaee6(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x30(%rcx)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x59af
movl $0x0, -0x4(%rbp)
jmp 0x5d34
movl $0x1, -0x4(%rbp)
jmp 0x5d34
cmpl $0x7, -0x2c(%rbp)
jne 0x5a15
movl $0x5e, %edi
leaq 0xaeab(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x47, %edi
leaq 0xae9a(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa78b(%rip), %eax      # 0x10174
addl $0x2, %eax
movl %eax, 0xa782(%rip)      # 0x10174
xorl %esi, %esi
movl %esi, %edi
movb $0x0, %al
callq 0x83d0
leaq 0xae74(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x30(%rcx)
movl $0x2, -0x4(%rbp)
jmp 0x5d34
cmpl $0x7f, -0x2c(%rbp)
je 0x5a25
cmpl $0x8, -0x2c(%rbp)
jne 0x5b76
cmpl $0x0, -0x24(%rbp)
je 0x5b71
movl $0x8, %edi
leaq 0xae3d(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x20, %edi
leaq 0xae2c(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x8, %edi
leaq 0xae1b(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa70c(%rip), %eax      # 0x10174
addl $-0x1, %eax
movl %eax, 0xa703(%rip)      # 0x10174
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jge 0x5acc
movl $0x8, %edi
leaq 0xade2(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x20, %edi
leaq 0xadd1(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x8, %edi
leaq 0xadc0(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa6b1(%rip), %eax      # 0x10174
addl $-0x1, %eax
movl %eax, 0xa6a8(%rip)      # 0x10174
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x5b65
movl $0x8, %edi
leaq 0xad8b(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x8, %edi
leaq 0xad7a(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x20, %edi
leaq 0xad69(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x20, %edi
leaq 0xad58(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x8, %edi
leaq 0xad47(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x8, %edi
leaq 0xad36(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa627(%rip), %eax      # 0x10174
addl $-0x1, %eax
movl %eax, 0xa61e(%rip)      # 0x10174
movl 0xa618(%rip), %eax      # 0x10174
addl $-0x1, %eax
movl %eax, 0xa60f(%rip)      # 0x10174
leaq 0xad0c(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x30(%rcx)
jmp 0x5d2b
cmpl $0x15, -0x2c(%rbp)
jne 0x5c3f
jmp 0x5b82
cmpl $0x0, -0x24(%rbp)
je 0x5c2e
movl $0x8, %edi
leaq 0xace0(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x20, %edi
leaq 0xaccf(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x8, %edi
leaq 0xacbe(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa5af(%rip), %eax      # 0x10174
addl $-0x1, %eax
movl %eax, 0xa5a6(%rip)      # 0x10174
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jge 0x5c29
movl $0x8, %edi
leaq 0xac85(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x20, %edi
leaq 0xac74(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x8, %edi
leaq 0xac63(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa554(%rip), %eax      # 0x10174
addl $-0x1, %eax
movl %eax, 0xa54b(%rip)      # 0x10174
jmp 0x5b82
leaq 0xac43(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x30(%rcx)
jmp 0x5d29
movl -0x24(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x5d27
movl -0x2c(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
cmpl $0x20, -0x2c(%rbp)
jge 0x5c9f
cmpl $0xa, -0x2c(%rbp)
je 0x5c9f
movl $0x5e, %edi
leaq 0xabf6(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa4e7(%rip), %eax      # 0x10174
addl $0x1, %eax
movl %eax, 0xa4de(%rip)      # 0x10174
movl -0x2c(%rbp), %eax
xorl $0x40, %eax
movl %eax, -0x2c(%rbp)
cmpl $0xa, -0x2c(%rbp)
je 0x5cb9
leaq 0xabcc(%rip), %rax      # 0x10878
movq 0x28(%rax), %rcx
movl -0x2c(%rbp), %edi
movb $0x0, %al
callq *%rcx
jmp 0x5d0c
movl $0x3c, %edi
leaq 0xabb3(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x4e, %edi
leaq 0xaba2(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x4c, %edi
leaq 0xab91(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl $0x3e, %edi
leaq 0xab80(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x28(%rcx)
movl 0xa471(%rip), %eax      # 0x10174
addl $0x3, %eax
movl %eax, 0xa468(%rip)      # 0x10174
movl 0xa462(%rip), %eax      # 0x10174
addl $0x1, %eax
movl %eax, 0xa459(%rip)      # 0x10174
leaq 0xab56(%rip), %rcx      # 0x10878
movb $0x0, %al
callq *0x30(%rcx)
jmp 0x5d29
jmp 0x5d2b
jmp 0x5d2d
jmp 0x5d2f
jmp 0x588b
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)