// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]pEmacs/line.c
// Function: ldelnewline
int ldelnewline ()
{
  LINE *lp1, *lp2, *lp3;
  WINDOW *wp;
  char *cp1, *cp2;

  lp1 = curwp->w_dotp;
  lp2 = lp1->l_fp;
  if (lp2 == curbp->b_linep)
    {			       /* At the buffer end */
      if (lp1->l_used == 0)	 /* Blank line */
	lfree (lp1);
      return (TRUE);
    }
  if (lp2->l_used <= lp1->l_size - lp1->l_used)
    {
      cp1 = &lp1->l_text[lp1->l_used];
      cp2 = &lp2->l_text[0];
      while (cp2 != &lp2->l_text[lp2->l_used])
	*cp1++ = *cp2++;
      wp = wheadp;
      while (wp != NULL)
	{
	  if (wp->w_linep == lp2)
	    wp->w_linep = lp1;
	  if (wp->w_dotp == lp2)
	    {
	      wp->w_dotp = lp1;
	      wp->w_doto += lp1->l_used;
	    }
	  if (wp->w_markp == lp2)
	    {
	      wp->w_markp = lp1;
	      wp->w_marko += lp1->l_used;
	    }
	  wp = wp->w_wndp;
	}
      lp1->l_used += lp2->l_used;
      lp1->l_fp = lp2->l_fp;
      lp2->l_fp->l_bp = lp1;
      free ((char *) lp2);
      return (TRUE);
    }
  if ((lp3 = lalloc (lp1->l_used + lp2->l_used)) == NULL)
    return (FALSE);
  cp1 = &lp1->l_text[0];
  cp2 = &lp3->l_text[0];
  while (cp1 != &lp1->l_text[lp1->l_used])
    *cp2++ = *cp1++;
  cp1 = &lp2->l_text[0];
  while (cp1 != &lp2->l_text[lp2->l_used])
    *cp2++ = *cp1++;
  lp1->l_bp->l_fp = lp3;
  lp3->l_fp = lp2->l_fp;
  lp2->l_fp->l_bp = lp3;
  lp3->l_bp = lp1->l_bp;
  wp = wheadp;
  while (wp != NULL)
    {
      if (wp->w_linep == lp1 || wp->w_linep == lp2)
	wp->w_linep = lp3;
      if (wp->w_dotp == lp1)
	wp->w_dotp = lp3;
      else if (wp->w_dotp == lp2)
	{
	  wp->w_dotp = lp3;
	  wp->w_doto += lp1->l_used;
	}
      if (wp->w_markp == lp1)
	wp->w_markp = lp3;
      else if (wp->w_markp == lp2)
	{
	  wp->w_markp = lp3;
	  wp->w_marko += lp1->l_used;
	}
      wp = wp->w_wndp;
    }
  free ((char *) lp1);
  free ((char *) lp2);
  return (TRUE);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x83c1(%rip), %rax      # 0xda48
movq (%rax), %rax
movq 0x18(%rax), %rbx
movq (%rbx), %r14
leaq 0x83a0(%rip), %rax      # 0xda38
movq (%rax), %rax
cmpq 0x28(%rax), %r14
je 0x57a4
movl 0x14(%r14), %eax
movl 0x10(%rbx), %ecx
movslq 0x14(%rbx), %rdi
subl %edi, %ecx
cmpl %ecx, %eax
jle 0x57c0
addl %eax, %edi
callq 0x503c
testq %rax, %rax
je 0x585b
leaq 0x18(%rax), %rcx
cmpl $0x0, 0x14(%rbx)
je 0x56f3
leaq 0x18(%rbx), %rdx
movq %rdx, %rsi
movb (%rsi), %dil
incq %rsi
movb %dil, (%rcx)
incq %rcx
movslq 0x14(%rbx), %rdi
addq %rdx, %rdi
cmpq %rdi, %rsi
jne 0x56db
cmpl $0x0, 0x14(%r14)
je 0x5719
leaq 0x18(%r14), %rdx
movq %rdx, %rsi
movb (%rsi), %dil
incq %rsi
movb %dil, (%rcx)
incq %rcx
movslq 0x14(%r14), %rdi
addq %rdx, %rdi
cmpq %rdi, %rsi
jne 0x5701
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq (%r14), %rcx
movq %rcx, (%rax)
movq (%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
leaq 0x8324(%rip), %rcx      # 0xda60
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x583f
movq 0x10(%rcx), %rdx
cmpq %rbx, %rdx
setne %sil
cmpq %r14, %rdx
setne %dl
testb %dl, %sil
jne 0x5762
movq %rax, 0x10(%rcx)
movq 0x18(%rcx), %rdx
cmpq %rbx, %rdx
je 0x577e
cmpq %r14, %rdx
jne 0x5782
movq %rax, 0x18(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x20(%rcx)
jmp 0x5782
movq %rax, 0x18(%rcx)
movq 0x28(%rcx), %rdx
cmpq %rbx, %rdx
je 0x579e
cmpq %r14, %rdx
jne 0x573c
movq %rax, 0x28(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x30(%rcx)
jmp 0x573c
movq %rax, 0x28(%rcx)
jmp 0x573c
movl $0x1, %ebp
cmpl $0x0, 0x14(%rbx)
jne 0x5854
movq %rbx, %rdi
callq 0x508c
jmp 0x5854
movl 0x14(%r14), %eax
testl %eax, %eax
je 0x57ee
leaq 0x18(%r14), %rcx
leaq (%rbx,%rdi), %rdx
addq $0x18, %rdx
movq %rcx, %rsi
movb (%rsi), %al
incq %rsi
movb %al, (%rdx)
incq %rdx
movslq 0x14(%r14), %rax
leaq (%rcx,%rax), %rdi
cmpq %rdi, %rsi
jne 0x57d7
leaq 0x826b(%rip), %rcx      # 0xda60
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x582d
cmpq %r14, 0x10(%rcx)
jne 0x5807
movq %rbx, 0x10(%rcx)
cmpq %r14, 0x18(%rcx)
jne 0x5819
movq %rbx, 0x18(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x20(%rcx)
cmpq %r14, 0x28(%rcx)
jne 0x57f5
movq %rbx, 0x28(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x30(%rcx)
jmp 0x57f5
addl %eax, 0x14(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
movq (%r14), %rax
movq %rbx, 0x8(%rax)
jmp 0x5847
movq %rbx, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2040
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x5854