// File: /workspace/github_c_makefile_star2_O0/hughbarney[P]pEmacs/line.c
// Function: ldelete
int ldelete (int n, int kflag)
{
  LINE *dotp;
  WINDOW *wp;
  char *cp1, *cp2;
  int doto, chunk;

  while (n != 0)
    {
      dotp = curwp->w_dotp;
      doto = curwp->w_doto;
      if (dotp == curbp->b_linep) /* Hit end of buffer */
	return (FALSE);
      chunk = dotp->l_used - doto; /* Size of chunk */
      if (chunk > n)
	chunk = n;
      if (chunk == 0)
	{			/* End of line, merge */
	  lchange (WFHARD);
	  if (ldelnewline () == FALSE
	      || (kflag != FALSE && kinsert ('\n') == FALSE))
	    return (FALSE);
	  --n;
	  continue;
	}
      lchange (WFEDIT);
      cp1 = &dotp->l_text[doto]; /* Scrunch text */
      cp2 = cp1 + chunk;
      if (kflag != FALSE)
	{			/* Kill? */
	  while (cp1 != cp2)
	    {
	      if (kinsert (*cp1) == FALSE)
		return (FALSE);
	      ++cp1;
	    }
	  cp1 = &dotp->l_text[doto];
	}
      while (cp2 != &dotp->l_text[dotp->l_used])
	*cp1++ = *cp2++;
      dotp->l_used -= chunk;
      wp = wheadp;		/* Fix windows */
      while (wp != NULL)
	{
	  if (wp->w_dotp == dotp && wp->w_doto >= doto)
	    {
	      wp->w_doto -= chunk;
	      if (wp->w_doto < doto)
		wp->w_doto = doto;
	    }
	  if (wp->w_markp == dotp && wp->w_marko >= doto)
	    {
	      wp->w_marko -= chunk;
	      if (wp->w_marko < doto)
		wp->w_marko = doto;
	    }
	  wp = wp->w_wndp;
	}
      n -= chunk;
    }
  return (TRUE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x75e7
leaq 0x96b9(%rip), %rax      # 0x10a58
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
leaq 0x96a7(%rip), %rax      # 0x10a58
movq (%rax), %rax
movq 0x20(%rax), %rax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
leaq 0x9682(%rip), %rcx      # 0x10a48
movq (%rcx), %rcx
cmpq 0x28(%rcx), %rax
jne 0x73db
movl $0x0, -0x4(%rbp)
jmp 0x75ee
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
subl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x8(%rbp), %eax
jle 0x73f6
movl -0x8(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x743f
movl $0x8, %edi
callq 0x6ce0
callq 0x76c0
cmpl $0x0, %eax
je 0x7425
cmpl $0x0, -0xc(%rbp)
je 0x7431
movl $0xa, %edi
callq 0x7600
cmpl $0x0, %eax
jne 0x7431
movl $0x0, -0x4(%rbp)
jmp 0x75ee
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x738e
movl $0x4, %edi
callq 0x6ce0
movq -0x18(%rbp), %rax
addq $0x18, %rax
movslq -0x34(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x74bb
jmp 0x7473
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x74a8
movq -0x28(%rbp), %rax
movsbl (%rax), %edi
callq 0x7600
cmpl $0x0, %eax
jne 0x749a
movl $0x0, -0x4(%rbp)
jmp 0x75ee
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x7473
movq -0x18(%rbp), %rax
addq $0x18, %rax
movslq -0x34(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
jmp 0x74bd
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
addq $0x18, %rcx
movq -0x18(%rbp), %rdx
movslq 0x14(%rdx), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
je 0x74fd
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movb (%rax), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x74bd
movl -0x38(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x14(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x14(%rax)
leaq 0x955d(%rip), %rax      # 0x10a70
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x75d7
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x7576
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
cmpq %rcx, %rax
jl 0x7576
movslq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
cmpq %rcx, %rax
jge 0x7574
movslq -0x34(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x7576
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x75c7
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
cmpq %rcx, %rax
jl 0x75c7
movslq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
cmpq %rcx, %rax
jge 0x75c5
movslq -0x34(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x75c7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x751a
movl -0x38(%rbp), %ecx
movl -0x8(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8(%rbp)
jmp 0x738e
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)