// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_remove_lines
bool ce_buffer_remove_lines(CeBuffer_t* buffer, int64_t line_start, int64_t lines_to_remove){
     // check invalid input
     if(line_start < 0) return false;
     if(line_start >= buffer->line_count) return false;
     if(lines_to_remove <= 0) return false;
     if(line_start + lines_to_remove > buffer->line_count) return false;

     // free lines we are going to remove and overwrite
     for(int64_t i = line_start; i < line_start + lines_to_remove; i++){
          free(buffer->lines[i]);
     }

     // shift lines down, overwriting lines we want to remove
     int64_t last_line_to_shift = buffer->line_count - lines_to_remove;
     for(int64_t dst = line_start; dst < last_line_to_shift; dst++){
          int64_t src = dst + lines_to_remove;
          buffer->lines[dst] = buffer->lines[src];
     }

     // update line count, and shrink our allocation
     buffer->line_count -= lines_to_remove;
     if(buffer->line_count > 0){
          buffer->lines = realloc(buffer->lines, buffer->line_count * sizeof(*buffer->lines));
     }else{
          ce_buffer_empty(buffer);
     }

     buffer->status = CE_BUFFER_STATUS_MODIFIED;
     return buffer->lines != NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x107b4
movb $0x0, -0x1(%rbp)
jmp 0x108f1
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x107cb
movb $0x0, -0x1(%rbp)
jmp 0x108f1
cmpq $0x0, -0x20(%rbp)
jg 0x107db
movb $0x0, -0x1(%rbp)
jmp 0x108f1
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jle 0x107f6
movb $0x0, -0x1(%rbp)
jmp 0x108f1
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jge 0x10831
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd090
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x107fe
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0x1088b
movq -0x38(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x10849
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jle 0x108cd
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0xd500
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x108d6
movq -0x10(%rbp), %rdi
callq 0xe920
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)