// File: /workspace/github_c_makefile_star2_O2/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 0x7adb(%rip), %rax      # 0xca38
movq (%rax), %rax
movq 0x18(%rax), %rbx
movq (%rbx), %r14
leaq 0x7aba(%rip), %rax      # 0xca28
movq (%rax), %rax
cmpq 0x28(%rax), %r14
je 0x4fc4
movl 0x14(%r14), %eax
movl 0x10(%rbx), %ecx
movslq 0x14(%rbx), %rdi
subl %edi, %ecx
cmpl %ecx, %eax
jle 0x4fde
addl %eax, %edi
callq 0x4960
testq %rax, %rax
je 0x5117
leaq 0x18(%rbx), %rdx
movq %rax, %rcx
addq $0x18, %rcx
movq %rdx, %rsi
movslq 0x14(%rbx), %rdi
addq %rdx, %rdi
cmpq %rdi, %rsi
je 0x5058
movb (%rsi), %dil
incq %rsi
movb %dil, (%rcx)
incq %rcx
jmp 0x4fa6
pushq $0x1
popq %rbp
cmpl $0x0, 0x14(%rbx)
jne 0x5110
movq %rbx, %rdi
callq 0x49ac
jmp 0x5110
leaq 0x18(%r14), %rcx
addq %rbx, %rdi
pushq $0x18
popq %rdx
leaq (%r14,%rdx), %rsi
movslq %eax, %r8
addq %rcx, %r8
cmpq %r8, %rsi
je 0x5007
movb (%r14,%rdx), %al
movb %al, (%rdi,%rdx)
movl 0x14(%r14), %eax
incq %rdx
jmp 0x4fe8
leaq 0x7a42(%rip), %rcx      # 0xca50
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x5046
cmpq %r14, 0x10(%rcx)
jne 0x5020
movq %rbx, 0x10(%rcx)
cmpq %r14, 0x18(%rcx)
jne 0x5032
movq %rbx, 0x18(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x20(%rcx)
cmpq %r14, 0x28(%rcx)
jne 0x500e
movq %rbx, 0x28(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x30(%rcx)
jmp 0x500e
addl %eax, 0x14(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
movq %rbx, 0x8(%rax)
jmp 0x5105
leaq 0x18(%r14), %rdx
movq %rdx, %rsi
movslq 0x14(%r14), %rdi
addq %rdx, %rdi
cmpq %rdi, %rsi
je 0x5079
movb (%rsi), %dil
incq %rsi
movb %dil, (%rcx)
incq %rcx
jmp 0x505f
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq (%r14), %rcx
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
leaq 0x79b7(%rip), %rcx      # 0xca50
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x50fd
movq 0x10(%rcx), %rdx
cmpq %rbx, %rdx
setne %sil
cmpq %r14, %rdx
setne %dl
testb %dl, %sil
jne 0x50bb
movq %rax, 0x10(%rcx)
movq 0x18(%rcx), %rdx
cmpq %rbx, %rdx
je 0x50d7
cmpq %r14, %rdx
jne 0x50db
movq %rax, 0x18(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x20(%rcx)
jmp 0x50db
movq %rax, 0x18(%rcx)
movq 0x28(%rcx), %rdx
cmpq %rbx, %rdx
je 0x50f7
cmpq %r14, %rdx
jne 0x5099
movq %rax, 0x28(%rcx)
movslq 0x14(%rbx), %rdx
addq %rdx, 0x30(%rcx)
jmp 0x5099
movq %rax, 0x28(%rcx)
jmp 0x5099
movq %rbx, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2040
pushq $0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x5110