// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/src/screen.c
// Function: erase_internal
static int erase_internal(VTermRect rect, int selective, void *user)
{
  VTermScreen *screen = user;

  for(int row = rect.start_row; row < screen->state->rows && row < rect.end_row; row++) {
    const VTermLineInfo *info = vterm_state_get_lineinfo(screen->state, row);

    for(int col = rect.start_col; col < rect.end_col; col++) {
      ScreenCell *cell = getcell(screen, row, col);

      if(selective && cell->pen.protected_cell)
        continue;

      cell->chars[0] = 0;
      cell->pen = (ScreenPen){
        /* Only copy .fg and .bg; leave things like rv in reset state */
        .fg = screen->pen.fg,
        .bg = screen->pen.bg,
      };
      cell->pen.dwl = info->doublewidth;
      cell->pen.dhl = info->doubleheight;
    }
  }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
xorl %eax, %eax
cmpl 0x30(%rdx), %ecx
movb %al, -0x55(%rbp)
jge 0x89a6
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
setl %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0x89b2
jmp 0x8b55
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x2c(%rbp), %esi
callq 0x20a0
movq %rax, -0x38(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x8b45
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x6a70
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x8a08
movq -0x48(%rbp), %rax
movl 0x20(%rax), %eax
shrl $0xf, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x8a08
jmp 0x8b37
movq -0x48(%rbp), %rax
movl $0x0, (%rax)
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
movl 0x80(%rcx), %ecx
movl %ecx, -0x54(%rbp)
movq -0x28(%rbp), %rcx
movl 0x84(%rcx), %ecx
movl %ecx, -0x50(%rbp)
movl -0x4c(%rbp), %ecx
andl $-0x2, %ecx
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $-0x7, %ecx
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $-0x9, %ecx
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $-0x11, %ecx
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $-0x21, %ecx
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $-0x41, %ecx
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $0xfffff0ff, %ecx       # imm = 0xFFFFF0FF
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $0xffff9fff, %ecx       # imm = 0xFFFF9FFF
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $0xffff7fff, %ecx       # imm = 0xFFFF7FFF
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $0xfffeffff, %ecx       # imm = 0xFFFEFFFF
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
andl $0xfff9ffff, %ecx       # imm = 0xFFF9FFFF
orl $0x0, %ecx
movl %ecx, -0x4c(%rbp)
movq -0x54(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl -0x4c(%rbp), %ecx
movl %ecx, 0x20(%rax)
movq -0x38(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %edx
movq -0x48(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x1, %edx
shll $0x10, %edx
andl $0xfffeffff, %ecx       # imm = 0xFFFEFFFF
orl %edx, %ecx
movl %ecx, 0x20(%rax)
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb %al
andb $0x3, %al
movzbl %al, %edx
movq -0x48(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x3, %edx
shll $0x11, %edx
andl $0xfff9ffff, %ecx       # imm = 0xFFF9FFFF
orl %edx, %ecx
movl %ecx, 0x20(%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x89cc
jmp 0x8b47
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x8985
movl $0x1, %eax
addq $0x60, %rsp
popq %rbp
retq