LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: alloc_buffer
static ScreenCell *alloc_buffer(VTermScreen *screen, int rows, int cols)
{
  ScreenCell *new_buffer = vterm_allocator_malloc(screen->vt, sizeof(ScreenCell) * rows * cols);

  for(int row = 0; row < rows; row++) {
    for(int col = 0; col < cols; col++) {
      clearcell(screen, &new_buffer[row * cols + col]);
    }
  }

  return new_buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rdi
movslq %esi, %r15
movslq %edx, %rax
imulq %r15, %rax
shlq $0x2, %rax
leaq (%rax,%rax,8), %rsi
callq 0xacb9
testl %r15d, %r15d
jle 0x4f09
subq $-0x80, %r14
movl %ebx, %esi
movl %ebp, %ecx
movq %rax, %rdx
addq $0x18, %rdx
shlq $0x2, %rsi
leaq (%rsi,%rsi,8), %rsi
xorl %edi, %edi
testl %ebx, %ebx
jle 0x4efe
xorl %r8d, %r8d
movl $0x0, -0x18(%rdx,%r8)
movq (%r14), %r9
movq %r9, (%rdx,%r8)
movl 0x8(%r14), %r9d
movl %r9d, 0x8(%rdx,%r8)
addq $0x24, %r8
cmpq %r8, %rsi
jne 0x4edc
incq %rdi
addq %rsi, %rdx
cmpq %rcx, %rdi
jne 0x4ed5
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: moverect_user
static int moverect_user(VTermRect dest, VTermRect src, void *user)
{
  VTermScreen *screen = user;

  if(screen->callbacks && screen->callbacks->moverect) {
    if(screen->damage_merge != VTERM_DAMAGE_SCROLL)
      // Avoid an infinite loop
      vterm_screen_flush_damage(screen);

    if((*screen->callbacks->moverect)(dest, src, screen->cbdata))
      return 1;
  }

  damagerect(screen, dest);

  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%r8), %rax
testq %rax, %rax
je 0x4f8f
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x4f8f
movq %rcx, %r12
movq %rdx, %r13
cmpl $0x3, 0x24(%rbx)
je 0x4f79
movq %rbx, %rdi
callq 0x2040
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x18(%rbx), %r8
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq *%rax
testl %eax, %eax
jne 0x4f9d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x624c
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_get_attrs_extent
int vterm_screen_get_attrs_extent(const VTermScreen *screen, VTermRect *extent, VTermPos pos, VTermAttrMask attrs)
{
  ScreenCell *target = getcell(screen, pos.row, pos.col);

  // TODO: bounds check
  extent->start_row = pos.row;
  extent->end_row   = pos.row + 1;

  if(extent->start_col < 0)
    extent->start_col = 0;
  if(extent->end_col < 0)
    extent->end_col = screen->cols;

  int col;

  for(col = pos.col - 1; col >= extent->start_col; col--)
    if(attrs_differ(attrs, target, getcell(screen, pos.row, col)))
      break;
  extent->start_col = col + 1;

  for(col = pos.col + 1; col < extent->end_col; col++)
    if(attrs_differ(attrs, target, getcell(screen, pos.row, col)))
      break;
  extent->end_col = col - 1;

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdx, %rbp
shrq $0x20, %rbp
testl %r15d, %r15d
js 0x5036
xorl %r13d, %r13d
testq %r15, %r15
js 0x5039
cmpl %r15d, 0x50(%rdi)
jle 0x5039
movl 0x54(%rdi), %eax
cmpl %ebp, %eax
jle 0x5036
imull %r15d, %eax
leaq (%rax,%rax,8), %rax
shlq $0x2, %rax
addq 0x70(%rdi), %rax
leaq (,%rbp,8), %rcx
addq %rbp, %rcx
leaq (%rax,%rcx,4), %r13
jmp 0x5039
xorl %r13d, %r13d
movl %r15d, (%r14)
leal 0x1(%r15), %eax
movl %eax, 0x4(%r14)
cmpl $0x0, 0x8(%r14)
jns 0x5053
movl $0x0, 0x8(%r14)
cmpl $0x0, 0xc(%r14)
jns 0x5061
movl 0x54(%rdi), %eax
movl %eax, 0xc(%r14)
movq %rdi, 0x10(%rsp)
movl %ebp, %ebx
movl %ebx, %r12d
cmpl 0x8(%r14), %ebx
jle 0x50cd
leal -0x1(%r12), %ebx
testl %r15d, %r15d
js 0x509d
testl %r12d, %r12d
jle 0x509d
movl $0x0, %edx
movq 0x10(%rsp), %rax
cmpl %r15d, 0x50(%rax)
jle 0x509f
movq 0x10(%rsp), %rcx
movl 0x54(%rcx), %eax
cmpl %r12d, %eax
jge 0x50b1
xorl %edx, %edx
movl 0xc(%rsp), %edi
movq %r13, %rsi
callq 0x5147
testl %eax, %eax
je 0x5068
jmp 0x50cd
imull %r15d, %eax
leaq (%rax,%rax,8), %rax
shlq $0x2, %rax
addq 0x70(%rcx), %rax
movl %ebx, %ecx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,4), %rdx
jmp 0x509f
movl %r12d, 0x8(%r14)
movq 0x10(%rsp), %rbx
movl %ebp, %r12d
leal 0x1(%r12), %ebp
cmpl 0xc(%r14), %ebp
jge 0x512f
testl %r15d, %r15d
js 0x511d
cmpl $-0x1, %r12d
jl 0x511d
movl $0x0, %edx
cmpl %r15d, 0x50(%rbx)
jle 0x511f
movl 0x54(%rbx), %eax
cmpl %ebp, %eax
jle 0x511d
imull %r15d, %eax
leaq (%rax,%rax,8), %rax
shlq $0x2, %rax
addq 0x70(%rbx), %rax
movl %ebp, %ecx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,4), %rdx
jmp 0x511f
xorl %edx, %edx
movl 0xc(%rsp), %edi
movq %r13, %rsi
callq 0x5147
testl %eax, %eax
je 0x50d6
movl %r12d, 0xc(%r14)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: attrs_differ
static int attrs_differ(VTermAttrMask attrs, ScreenCell *a, ScreenCell *b)
{
  if((attrs & VTERM_ATTR_BOLD_MASK)       && (a->pen.bold != b->pen.bold))
    return 1;
  if((attrs & VTERM_ATTR_UNDERLINE_MASK)  && (a->pen.underline != b->pen.underline))
    return 1;
  if((attrs & VTERM_ATTR_ITALIC_MASK)     && (a->pen.italic != b->pen.italic))
    return 1;
  if((attrs & VTERM_ATTR_BLINK_MASK)      && (a->pen.blink != b->pen.blink))
    return 1;
  if((attrs & VTERM_ATTR_REVERSE_MASK)    && (a->pen.reverse != b->pen.reverse))
    return 1;
  if((attrs & VTERM_ATTR_CONCEAL_MASK)    && (a->pen.conceal != b->pen.conceal))
    return 1;
  if((attrs & VTERM_ATTR_STRIKE_MASK)     && (a->pen.strike != b->pen.strike))
    return 1;
  if((attrs & VTERM_ATTR_FONT_MASK)       && (a->pen.font != b->pen.font))
    return 1;
  if((attrs & VTERM_ATTR_FOREGROUND_MASK) && !vterm_color_is_equal(&a->pen.fg, &b->pen.fg))
    return 1;
  if((attrs & VTERM_ATTR_BACKGROUND_MASK) && !vterm_color_is_equal(&a->pen.bg, &b->pen.bg))
    return 1;
  if((attrs & VTERM_ATTR_SMALL_MASK)    && (a->pen.small != b->pen.small))
    return 1;
  if((attrs & VTERM_ATTR_BASELINE_MASK)    && (a->pen.baseline != b->pen.baseline))
    return 1;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
testb $0x1, %bpl
je 0x516e
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testb $0x1, %cl
jne 0x528f
testb $0x2, %bpl
je 0x5189
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testb $0x6, %cl
jne 0x528f
testb $0x4, %bpl
je 0x51a4
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testb $0x8, %cl
jne 0x528f
testb $0x8, %bpl
je 0x51bf
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testb $0x10, %cl
jne 0x528f
testb $0x10, %bpl
je 0x51da
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testb $0x20, %cl
jne 0x528f
btl $0x9, %ebp
jae 0x51f5
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testb $0x40, %cl
jne 0x528f
testb $0x20, %bpl
je 0x520d
movb 0x20(%r14), %cl
movl $0x1, %eax
xorb 0x20(%rbx), %cl
js 0x528f
testb $0x40, %bpl
je 0x5227
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testl $0xf00, %ecx            # imm = 0xF00
jne 0x528f
testb %bpl, %bpl
jns 0x523d
leaq 0x18(%rbx), %rdi
leaq 0x18(%r14), %rsi
callq 0x20b0
testl %eax, %eax
je 0x528a
btl $0x8, %ebp
jae 0x5254
leaq 0x1c(%rbx), %rdi
leaq 0x1c(%r14), %rsi
callq 0x20b0
testl %eax, %eax
je 0x528a
btl $0xa, %ebp
jae 0x526c
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
btl $0xc, %ecx
jb 0x528f
btl $0xb, %ebp
jae 0x5286
movl 0x20(%r14), %ecx
xorl 0x20(%rbx), %ecx
movl $0x1, %eax
testl $0x6000, %ecx           # imm = 0x6000
jne 0x528f
xorl %eax, %eax
jmp 0x528f
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_set_default_colors
void vterm_screen_set_default_colors(VTermScreen *screen, const VTermColor *default_fg, const VTermColor *default_bg)
{
  vterm_state_set_default_colors(screen->state, default_fg, default_bg);

  if(default_fg && VTERM_COLOR_IS_DEFAULT_FG(&screen->pen.fg)) {
    screen->pen.fg = *default_fg;
    screen->pen.fg.type = (screen->pen.fg.type & ~VTERM_COLOR_DEFAULT_MASK)
                        | VTERM_COLOR_DEFAULT_FG;
  }

  if(default_bg && VTERM_COLOR_IS_DEFAULT_BG(&screen->pen.bg)) {
    screen->pen.bg = *default_bg;
    screen->pen.bg.type = (screen->pen.bg.type & ~VTERM_COLOR_DEFAULT_MASK)
                        | VTERM_COLOR_DEFAULT_BG;
  }

  reset_default_colours(screen, screen->buffers[0]);
  if(screen->buffers[1])
    reset_default_colours(screen, screen->buffers[1]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x21c0
testq %r15, %r15
je 0x52d5
testb $0x2, 0x80(%rbx)
je 0x52d5
movl (%r15), %eax
movl %eax, 0x80(%rbx)
andb $-0x7, %al
orb $0x2, %al
movb %al, 0x80(%rbx)
testq %r14, %r14
je 0x52f6
testb $0x4, 0x84(%rbx)
je 0x52f6
movl (%r14), %eax
movl %eax, 0x84(%rbx)
andb $-0x7, %al
orb $0x4, %al
movb %al, 0x84(%rbx)
movq 0x60(%rbx), %rsi
movq %rbx, %rdi
callq 0x531b
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x5315
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x531b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: reset_default_colours
static void reset_default_colours(VTermScreen *screen, ScreenCell *buffer)
{
  for(int row = 0; row <= screen->rows - 1; row++)
    for(int col = 0; col <= screen->cols - 1; col++) {
      ScreenCell *cell = &buffer[row * screen->cols + col];
      if(VTERM_COLOR_IS_DEFAULT_FG(&cell->pen.fg))
        cell->pen.fg = screen->pen.fg;
      if(VTERM_COLOR_IS_DEFAULT_BG(&cell->pen.bg))
        cell->pen.bg = screen->pen.bg;
    }
}

// Assembly:
movl 0x50(%rdi), %edx
testl %edx, %edx
jle 0x5375
movl 0x54(%rdi), %ecx
xorl %eax, %eax
testl %ecx, %ecx
jle 0x536f
xorl %edx, %edx
imull %eax, %ecx
movslq %ecx, %rcx
addq %rdx, %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%rsi,%rcx,4), %rcx
addq $0x18, %rcx
testb $0x2, (%rcx)
je 0x5351
movl 0x80(%rdi), %r8d
movl %r8d, (%rcx)
testb $0x4, 0x4(%rcx)
je 0x5362
movl 0x84(%rdi), %r8d
movl %r8d, 0x4(%rcx)
movl 0x54(%rdi), %ecx
incq %rdx
cmpl %ecx, %edx
jl 0x532d
movl 0x50(%rdi), %edx
incl %eax
cmpl %edx, %eax
jl 0x5327
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: putglyph
static int putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
{
  VTermScreen *screen = user;
  ScreenCell *cell = getcell(screen, pos.row, pos.col);

  if(!cell)
    return 0;

  int i;
  for(i = 0; i < VTERM_MAX_CHARS_PER_CELL && info->chars[i]; i++) {
    cell->chars[i] = info->chars[i];
    cell->pen = screen->pen;
  }
  if(i < VTERM_MAX_CHARS_PER_CELL)
    cell->chars[i] = 0;

  for(int col = 1; col < info->width; col++)
    getcell(screen, pos.row, pos.col + col)->chars[0] = (uint32_t)-1;

  VTermRect rect = {
    .start_row = pos.row,
    .end_row   = pos.row+1,
    .start_col = pos.col,
    .end_col   = pos.col+info->width,
  };

  cell->pen.protected_cell = info->protected_cell;
  cell->pen.dwl            = info->dwl;
  cell->pen.dhl            = info->dhl;

  damagerect(screen, rect);

  return 1;
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
js 0x5597
testq %rsi, %rsi
js 0x5597
cmpl %esi, 0x50(%rdx)
jle 0x5597
movq %rsi, %r9
shrq $0x20, %r9
movl 0x54(%rdx), %ecx
cmpl %r9d, %ecx
jle 0x5597
movq 0x70(%rdx), %r8
testq %r8, %r8
je 0x5597
pushq %rbx
imull %esi, %ecx
leaq (%rcx,%rcx,8), %rax
leaq (%r8,%rax,4), %rax
leaq (%r9,%r9,8), %rcx
leaq (%rax,%rcx,4), %r8
leaq 0x18(%r8), %rax
leaq 0x80(%rdx), %r11
xorl %r10d, %r10d
movq (%rdi), %rbx
movl (%rbx,%r10,4), %ebx
testl %ebx, %ebx
je 0x54d1
movl %ebx, (%r8,%r10,4)
movl 0x8(%r11), %ebx
movl %ebx, 0x8(%rax)
movq (%r11), %rbx
movq %rbx, (%rax)
incq %r10
cmpq $0x6, %r10
jne 0x54aa
jmp 0x54d9
movl $0x0, (%r8,%r10,4)
movl 0x8(%rdi), %eax
cmpl $0x2, %eax
jl 0x5514
movq 0x70(%rdx), %rax
leaq (%rax,%rcx,4), %rcx
addq $0x24, %rcx
movl $0x1, %r10d
movl 0x54(%rdx), %eax
imull %esi, %eax
leaq (%rax,%rax,8), %rax
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
incq %r10
movslq 0x8(%rdi), %rax
addq $0x24, %rcx
cmpq %rax, %r10
jl 0x54f3
movl %esi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shlq $0x20, %rsi
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rsi, %rcx
addl %r9d, %eax
shlq $0x20, %rax
orq %r9, %rax
movzbl 0xc(%rdi), %esi
andl $0x1, %esi
shll $0xf, %esi
movl $0xffff7fff, %r9d       # imm = 0xFFFF7FFF
andl 0x20(%r8), %r9d
orl %esi, %r9d
movl %r9d, 0x20(%r8)
movl 0xc(%rdi), %esi
andl $0x2, %esi
shll $0xf, %esi
andl $0xfffeffff, %r9d       # imm = 0xFFFEFFFF
orl %esi, %r9d
movl %r9d, 0x20(%r8)
movl 0xc(%rdi), %esi
andl $0xc, %esi
shll $0xf, %esi
andl $0xfff9ffff, %r9d       # imm = 0xFFF9FFFF
orl %esi, %r9d
movl %r9d, 0x20(%r8)
movq %rdx, %rdi
movq %rcx, %rsi
movq %rax, %rdx
callq 0x624c
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: setpenattr
static int setpenattr(VTermAttr attr, VTermValue *val, void *user)
{
  VTermScreen *screen = user;

  switch(attr) {
  case VTERM_ATTR_BOLD:
    screen->pen.bold = val->boolean;
    return 1;
  case VTERM_ATTR_UNDERLINE:
    screen->pen.underline = val->number;
    return 1;
  case VTERM_ATTR_ITALIC:
    screen->pen.italic = val->boolean;
    return 1;
  case VTERM_ATTR_BLINK:
    screen->pen.blink = val->boolean;
    return 1;
  case VTERM_ATTR_REVERSE:
    screen->pen.reverse = val->boolean;
    return 1;
  case VTERM_ATTR_CONCEAL:
    screen->pen.conceal = val->boolean;
    return 1;
  case VTERM_ATTR_STRIKE:
    screen->pen.strike = val->boolean;
    return 1;
  case VTERM_ATTR_FONT:
    screen->pen.font = val->number;
    return 1;
  case VTERM_ATTR_FOREGROUND:
    screen->pen.fg = val->color;
    return 1;
  case VTERM_ATTR_BACKGROUND:
    screen->pen.bg = val->color;
    return 1;
  case VTERM_ATTR_SMALL:
    screen->pen.small = val->boolean;
    return 1;
  case VTERM_ATTR_BASELINE:
    screen->pen.baseline = val->number;
    return 1;

  case VTERM_N_ATTRS:
    return 0;
  }

  return 0;
}

// Assembly:
decl %edi
cmpl $0xb, %edi
ja 0x5932
leaq 0x6de4(%rip), %rax      # 0xc618
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
andl $0x1, %eax
andl $-0x2, %ecx
jmp 0x591a
movl (%rsi), %eax
andl $0x3, %eax
movl $0xffff9fff, %ecx       # imm = 0xFFFF9FFF
andl 0x88(%rdx), %ecx
shll $0xd, %eax
jmp 0x591a
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
shll $0x5, %eax
andl $0x20, %eax
andl $-0x21, %ecx
jmp 0x591a
movl (%rsi), %eax
movl %eax, 0x84(%rdx)
jmp 0x5922
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
andl $0x1, %eax
andl $-0x9, %ecx
leal (%rcx,%rax,8), %eax
jmp 0x58d7
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
shll $0x4, %eax
andl $0x10, %eax
andl $-0x11, %ecx
jmp 0x591a
movl (%rsi), %eax
andl $0xf, %eax
movl $0xfffff0ff, %ecx       # imm = 0xFFFFF0FF
andl 0x88(%rdx), %ecx
shll $0x8, %eax
jmp 0x591a
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
andl $0x3, %eax
andl $-0x7, %ecx
leal (%rcx,%rax,2), %eax
movl %eax, 0x88(%rdx)
jmp 0x5922
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
shll $0x6, %eax
andl $0x40, %eax
andl $-0x41, %ecx
jmp 0x591a
movl (%rsi), %eax
shll $0x7, %eax
movl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
andl 0x88(%rdx), %ecx
movzbl %al, %eax
jmp 0x591a
movl (%rsi), %eax
andl $0x1, %eax
movl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
andl 0x88(%rdx), %ecx
shll $0xc, %eax
orl %eax, %ecx
movl %ecx, 0x88(%rdx)
movl $0x1, %eax
retq
movl (%rsi), %eax
movl %eax, 0x80(%rdx)
jmp 0x5922
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: settermprop
static int settermprop(VTermProp prop, VTermValue *val, void *user)
{
  VTermScreen *screen = user;

  switch(prop) {
  case VTERM_PROP_ALTSCREEN:
    if(val->boolean && !screen->buffers[BUFIDX_ALTSCREEN])
      return 0;

    screen->buffer = val->boolean ? screen->buffers[BUFIDX_ALTSCREEN] : screen->buffers[BUFIDX_PRIMARY];
    /* only send a damage event on disable; because during enable there's an
     * erase that sends a damage anyway
     */
    if(!val->boolean)
      damagescreen(screen);
    break;
  case VTERM_PROP_REVERSE:
    screen->global_reverse = val->boolean;
    damagescreen(screen);
    break;
  default:
    ; /* ignore */
  }

  if(screen->callbacks && screen->callbacks->settermprop)
    return (*screen->callbacks->settermprop)(prop, val, screen->cbdata);

  return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
cmpl $0x6, %edi
je 0x595d
cmpl $0x3, %ebp
jne 0x5995
cmpl $0x0, (%rbx)
je 0x5970
movq 0x68(%r14), %rax
testq %rax, %rax
jne 0x5974
xorl %eax, %eax
jmp 0x59bb
movb (%rbx), %al
movb 0x58(%r14), %cl
andb $0x1, %al
andb $-0x2, %cl
orb %al, %cl
movb %cl, 0x58(%r14)
jmp 0x597d
movq 0x60(%r14), %rax
movq %rax, 0x70(%r14)
cmpl $0x0, (%rbx)
jne 0x5995
movl 0x50(%r14), %esi
movl 0x54(%r14), %edx
shlq $0x20, %rsi
shlq $0x20, %rdx
movq %r14, %rdi
callq 0x624c
movq 0x10(%r14), %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x59bb
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x59bb
movq 0x18(%r14), %rdx
movl %ebp, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmpq *%rcx
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: setlineinfo
static int setlineinfo(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user)
{
  VTermScreen *screen = user;

  if(newinfo->doublewidth != oldinfo->doublewidth ||
     newinfo->doubleheight != oldinfo->doubleheight) {
    for(int col = 0; col < screen->cols; col++) {
      ScreenCell *cell = getcell(screen, row, col);
      cell->pen.dwl = newinfo->doublewidth;
      cell->pen.dhl = newinfo->doubleheight;
    }

    VTermRect rect = {
      .start_row = row,
      .end_row   = row + 1,
      .start_col = 0,
      .end_col   = newinfo->doublewidth ? screen->cols / 2 : screen->cols,
    };
    damagerect(screen, rect);

    if(newinfo->doublewidth) {
      rect.start_col = screen->cols / 2;
      rect.end_col   = screen->cols;

      erase_internal(rect, 0, user);
    }
  }

  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movb (%rsi), %cl
movb (%rdx), %al
xorb %cl, %al
testb $0x7, %al
je 0x617c
movq %rsi, %r15
movl %edi, %r14d
movl 0x54(%rbx), %eax
testl %eax, %eax
jle 0x612b
movl $0x20, %ecx
xorl %edx, %edx
movl $0xfffeffff, %esi       # imm = 0xFFFEFFFF
imull %r14d, %eax
leaq (%rax,%rax,8), %rax
shlq $0x2, %rax
addq 0x70(%rbx), %rax
movzbl (%r15), %edi
andl $0x1, %edi
shll $0x10, %edi
movl (%rcx,%rax), %r8d
andl %esi, %r8d
orl %edi, %r8d
movl %r8d, (%rcx,%rax)
movl (%r15), %edi
andl $0x6, %edi
shll $0x10, %edi
andl $0xfff9ffff, %r8d       # imm = 0xFFF9FFFF
orl %edi, %r8d
movl %r8d, (%rcx,%rax)
incq %rdx
movslq 0x54(%rbx), %rax
addq $0x24, %rcx
cmpq %rax, %rdx
jl 0x60d9
movb (%r15), %cl
movl %r14d, %edx
incl %r14d
shlq $0x20, %r14
orq %rdx, %r14
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
testb $0x1, %cl
cmovel %eax, %edx
shlq $0x20, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x624c
testb $0x1, (%r15)
je 0x617c
movl 0x54(%rbx), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %esi, %eax
sarl %eax
shlq $0x20, %rsi
orq %rax, %rsi
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x6450
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: premove
static int premove(VTermRect rect, void *user)
{
  VTermScreen *screen = user;

  if(((screen->callbacks && screen->callbacks->sb_pushline) ||
        (screen->callbacks_has_pushline4 && screen->callbacks && screen->callbacks->sb_pushline4)) &&
     rect.start_row == 0 && rect.start_col == 0 &&        // starts top-left corner
     rect.end_col == screen->cols &&                      // full width
     screen->buffer == screen->buffers[BUFIDX_PRIMARY]) { // not altscreen
    for(int row = 0; row < rect.end_row; row++) {
      const VTermLineInfo *lineinfo = vterm_state_get_lineinfo(screen->state, row);
      sb_pushline_from_row(screen, row, lineinfo->continuation);
    }
  }

  return 1;
}

// Assembly:
movq 0x10(%rdx), %rax
testq %rax, %rax
je 0x6246
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
cmpq $0x0, 0x30(%rax)
je 0x61d9
testl %r14d, %r14d
jne 0x6242
jmp 0x61f1
cmpb $0x1, 0x20(%rbx)
jne 0x6242
cmpq $0x0, 0x48(%rax)
setne %al
testl %r14d, %r14d
sete %cl
testb %cl, %al
je 0x6242
testl %esi, %esi
jne 0x6242
shrq $0x20, %rsi
cmpl %esi, 0x54(%rbx)
jne 0x6242
shrq $0x20, %r14
movq 0x70(%rbx), %rax
cmpq 0x60(%rbx), %rax
sete %al
testl %r14d, %r14d
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6242
xorl %ebp, %ebp
movq 0x8(%rbx), %rdi
movl %ebp, %esi
callq 0x2090
movb (%rax), %al
andb $0x8, %al
shrb $0x3, %al
movzbl %al, %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6ff5
incl %ebp
cmpl %ebp, %r14d
jne 0x621c
popq %rbx
popq %r14
popq %rbp
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: damagerect
static void damagerect(VTermScreen *screen, VTermRect rect)
{
  VTermRect emit;

  switch(screen->damage_merge) {
  case VTERM_DAMAGE_CELL:
    /* Always emit damage event */
    emit = rect;
    break;

  case VTERM_DAMAGE_ROW:
    /* Emit damage longer than one row. Try to merge with existing damage in
     * the same row */
    if(rect.end_row > rect.start_row + 1) {
      // Bigger than 1 line - flush existing, emit this
      vterm_screen_flush_damage(screen);
      emit = rect;
    }
    else if(screen->damaged.start_row == -1) {
      // None stored yet
      screen->damaged = rect;
      return;
    }
    else if(rect.start_row == screen->damaged.start_row) {
      // Merge with the stored line
      if(screen->damaged.start_col > rect.start_col)
        screen->damaged.start_col = rect.start_col;
      if(screen->damaged.end_col < rect.end_col)
        screen->damaged.end_col = rect.end_col;
      return;
    }
    else {
      // Emit the currently stored line, store a new one
      emit = screen->damaged;
      screen->damaged = rect;
    }
    break;

  case VTERM_DAMAGE_SCREEN:
  case VTERM_DAMAGE_SCROLL:
    /* Never emit damage event */
    if(screen->damaged.start_row == -1)
      screen->damaged = rect;
    else {
      rect_expand(&screen->damaged, &rect);
    }
    return;

  default:
    DEBUG_LOG("TODO: Maybe merge damage for level %d\n", screen->damage_merge);
    return;
  }

  if(screen->callbacks && screen->callbacks->damage)
    (*screen->callbacks->damage)(emit, screen->cbdata);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rax
shrq $0x20, %rax
movl 0x24(%rdi), %ecx
leal -0x2(%rcx), %edx
cmpl $0x2, %edx
jb 0x628f
testl %ecx, %ecx
je 0x62ff
cmpl $0x1, %ecx
jne 0x6321
leal 0x1(%r15), %ecx
cmpl %eax, %ecx
jge 0x62c5
movq %r14, %rdi
callq 0x2040
jmp 0x62ff
movl 0x28(%r14), %ecx
cmpl $-0x1, %ecx
je 0x62df
cmpl %r15d, %ecx
jle 0x62a1
movl %r15d, 0x28(%r14)
cmpl %ebx, 0x30(%r14)
jle 0x62ab
movl %ebx, 0x30(%r14)
cmpl %eax, 0x2c(%r14)
jge 0x62b5
movl %eax, 0x2c(%r14)
shrq $0x20, %rbx
cmpl %ebx, 0x34(%r14)
jge 0x6321
movl %ebx, 0x34(%r14)
jmp 0x6321
movl 0x28(%r14), %eax
cmpl $-0x1, %eax
je 0x62df
cmpl %r15d, %eax
jne 0x62e9
cmpl %ebx, 0x30(%r14)
jle 0x62b5
movl %ebx, 0x30(%r14)
jmp 0x62b5
movq %r15, 0x28(%r14)
movq %rbx, 0x30(%r14)
jmp 0x6321
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
movq %r15, 0x28(%r14)
movq %rbx, 0x30(%r14)
movq %rcx, %rbx
movq %rax, %r15
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x6321
movq (%rax), %rax
testq %rax, %rax
je 0x6321
movq 0x18(%r14), %rdx
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: moverect_internal
static int moverect_internal(VTermRect dest, VTermRect src, void *user)
{
  VTermScreen *screen = user;

  int cols = src.end_col - src.start_col;
  int downward = src.start_row - dest.start_row;

  int init_row, test_row, inc_row;
  if(downward < 0) {
    init_row = dest.end_row - 1;
    test_row = dest.start_row - 1;
    inc_row  = -1;
  }
  else {
    init_row = dest.start_row;
    test_row = dest.end_row;
    inc_row  = +1;
  }

  for(int row = init_row; row != test_row; row += inc_row)
    memmove(getcell(screen, row, dest.start_col),
            getcell(screen, row + downward, src.start_col),
            cols * sizeof(ScreenCell));

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq %rdi, %rax
shrq $0x20, %rax
subl %edi, %r15d
leal -0x1(%rax), %ebp
testl %r15d, %r15d
cmovnsl %edi, %ebp
leal -0x1(%rdi), %r12d
cmovnsl %eax, %r12d
cmpl %r12d, %ebp
je 0x643c
movq %r8, %rbx
movl %r15d, %r14d
sarl $0x1f, %r14d
orl $0x1, %r14d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x8(%rsp), %rcx
andq %rax, %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rsp), %rdx
andq %rdx, %rax
movq %rdx, %rcx
shlq $0x20, %rcx
subq %rcx, %rdx
sarq $0x20, %rdx
shlq $0x2, %rdx
leaq (%rdx,%rdx,8), %r13
leaq (%rax,%rax,8), %rax
movq %rax, 0x18(%rsp)
testl %ebp, %ebp
js 0x63e9
cmpl $0x0, 0x8(%rsp)
js 0x63e9
movl $0x0, %edi
cmpl %ebp, 0x50(%rbx)
jle 0x63eb
movl 0x54(%rbx), %eax
cmpl 0x8(%rsp), %eax
jle 0x63e9
imull %ebp, %eax
leaq (%rax,%rax,8), %rax
shlq $0x2, %rax
addq 0x70(%rbx), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,4), %rdi
jmp 0x63eb
xorl %edi, %edi
movl %r15d, %eax
addl %ebp, %eax
js 0x6426
cmpl $0x0, 0x10(%rsp)
js 0x6426
movl $0x0, %esi
cmpl %eax, 0x50(%rbx)
jle 0x6428
movl 0x54(%rbx), %ecx
cmpl 0x10(%rsp), %ecx
jle 0x6426
imull %eax, %ecx
leaq (%rcx,%rcx,8), %rax
shlq $0x2, %rax
addq 0x70(%rbx), %rax
movq 0x18(%rsp), %rcx
leaq (%rax,%rcx,4), %rsi
jmp 0x6428
xorl %esi, %esi
movq %r13, %rdx
callq 0x2190
addl %r14d, %ebp
cmpl %ebp, %r12d
jne 0x63ad
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r15
movq %rdi, %rcx
shrq $0x20, %rcx
movq 0x8(%rbx), %rdi
cmpl %r15d, 0x30(%rdi)
setg %al
movq %rcx, (%rsp)
cmpl %ecx, %r15d
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6545
movl %edx, %ebp
movq %rsi, %r14
movq %rsi, %r13
shrq $0x20, %r13
movl %r15d, %esi
callq 0x2090
cmpl %r13d, %r14d
jge 0x652e
movl %r14d, %ecx
testl %r15d, %r15d
js 0x64df
testl %ecx, %ecx
js 0x64df
movl $0x0, %edx
cmpl %r15d, 0x50(%rbx)
jle 0x64e1
movl 0x54(%rbx), %edx
cmpl %ecx, %edx
jle 0x64df
imull %r15d, %edx
leaq (%rdx,%rdx,8), %rdx
shlq $0x2, %rdx
addq 0x70(%rbx), %rdx
movl %ecx, %esi
leaq (%rsi,%rsi,8), %rsi
leaq (%rdx,%rsi,4), %rdx
jmp 0x64e1
xorl %edx, %edx
testl %ebp, %ebp
je 0x64eb
testb $-0x80, 0x21(%rdx)
jne 0x6523
movl $0x0, (%rdx)
movq 0x80(%rbx), %rsi
andl $0xfff80000, %r12d      # imm = 0xFFF80000
movq %rsi, 0x18(%rdx)
movl %r12d, 0x20(%rdx)
movzbl (%rax), %esi
andl $0x1, %esi
shll $0x10, %esi
orl %r12d, %esi
movl %esi, 0x20(%rdx)
movl (%rax), %edi
andl $0x6, %edi
shll $0x10, %edi
orl %esi, %edi
movl %edi, 0x20(%rdx)
incl %ecx
cmpl %ecx, %r13d
jne 0x64a8
incl %r15d
movq 0x8(%rbx), %rdi
cmpl 0x30(%rdi), %r15d
jge 0x6545
cmpl (%rsp), %r15d
jl 0x6494
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: sb_pushline_from_row
static void sb_pushline_from_row(VTermScreen *screen, int row, bool continuation)
{
  VTermPos pos = { .row = row };
  for(pos.col = 0; pos.col < screen->cols; pos.col++)
    vterm_screen_get_cell(screen, pos, screen->sb_buffer + pos.col);

  if(screen->callbacks_has_pushline4 && screen->callbacks->sb_pushline4)
    (screen->callbacks->sb_pushline4)(screen->cols, screen->sb_buffer, continuation, screen->cbdata);
  else
    (screen->callbacks->sb_pushline)(screen->cols, screen->sb_buffer, screen->cbdata);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
movl 0x54(%rdi), %edi
testl %edi, %edi
jle 0x7044
movl %esi, %r14d
xorl %r15d, %r15d
movabsq $0x100000000, %r12      # imm = 0x100000000
xorl %r13d, %r13d
movq 0x78(%rbx), %rdx
addq %r15, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21f0
incq %r13
movslq 0x54(%rbx), %rdi
addq $0x28, %r15
addq %r12, %r14
cmpq %rdi, %r13
jl 0x701f
movq 0x10(%rbx), %rcx
cmpb $0x1, 0x20(%rbx)
jne 0x7073
movq 0x48(%rcx), %rax
testq %rax, %rax
je 0x7073
movq 0x18(%rbx), %rcx
movq 0x78(%rbx), %rsi
movzbl %bpl, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq 0x30(%rcx), %rax
movq 0x18(%rbx), %rdx
movq 0x78(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
nop
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: vterm_state_free
INTERNAL void vterm_state_free(VTermState *state)
{
  vterm_allocator_free(state->vt, state->tabstops);
  vterm_allocator_free(state->vt, state->lineinfos[BUFIDX_PRIMARY]);
  if(state->lineinfos[BUFIDX_ALTSCREEN])
    vterm_allocator_free(state->vt, state->lineinfos[BUFIDX_ALTSCREEN]);
  vterm_allocator_free(state->vt, state->combine_chars);
  vterm_allocator_free(state->vt, state);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x58(%rbx), %rsi
callq 0xad24
movq (%rbx), %rdi
movq 0x60(%rbx), %rsi
callq 0xad24
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x70bd
movq (%rbx), %rdi
callq 0xad24
movq (%rbx), %rdi
movq 0x90(%rbx), %rsi
callq 0xad24
movq (%rbx), %rdi
movq %rbx, %rsi
popq %rbx
jmp 0xad24
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: vterm_obtain_state
VTermState *vterm_obtain_state(VTerm *vt)
{
  if(vt->state)
    return vt->state;

  VTermState *state = vterm_state_new(vt);
  vt->state = state;

  vterm_parser_set_callbacks(vt, &parser_callbacks, state);

  return state;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x128(%rdi), %r14
testq %r14, %r14
jne 0x71fb
movq %rdi, %rbx
movl $0x1d8, %esi            # imm = 0x1D8
callq 0xacb9
movq %rax, %r14
movq %rbx, (%rax)
movq 0x10(%rbx), %rax
movq %rax, 0x30(%r14)
xorl %r15d, %r15d
movq %r15, 0x78(%r14)
movl %r15d, 0x80(%r14)
movl %r15d, 0x88(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movb $0x0, 0x18(%r14)
movq %r15, 0x1c8(%r14)
movups %xmm0, 0x1b8(%r14)
movq %r14, %rdi
callq 0x34a4
movl %r15d, 0x188(%r14)
movq $0x10, 0x98(%r14)
movq (%r14), %rdi
movl $0x40, %esi
callq 0xacb9
movq %rax, 0x90(%r14)
movq (%r14), %rdi
movl 0x34(%r14), %eax
leal 0x7(%rax), %ecx
addl $0xe, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x3, %eax
movslq %eax, %rsi
callq 0xacb9
movq %rax, 0x58(%r14)
movq (%r14), %rdi
movslq 0x30(%r14), %rsi
shlq $0x2, %rsi
callq 0xacb9
movq %rax, 0x60(%r14)
movq (%r14), %rdi
movslq 0x30(%r14), %rsi
shlq $0x2, %rsi
callq 0xacb9
movq %rax, 0x68(%r14)
movq 0x60(%r14), %rax
movq %rax, 0x70(%r14)
xorl %edi, %edi
movl $0x75, %esi
callq 0x2130
movq %rax, 0x110(%r14)
movq (%rax), %rcx
testq %rcx, %rcx
je 0x71e2
movq %r14, %rsi
addq $0x118, %rsi            # imm = 0x118
movq %rax, %rdi
callq *%rcx
movq %r14, 0x128(%rbx)
leaq 0x9bc0(%rip), %rsi      # 0x10db0
movq %rbx, %rdi
movq %r14, %rdx
callq 0x20d0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: set_lineinfo
static void set_lineinfo(VTermState *state, int row, int force, int dwl, int dhl)
{
  VTermLineInfo info = state->lineinfo[row];

  if(dwl == DWL_OFF)
    info.doublewidth = DWL_OFF;
  else if(dwl == DWL_ON)
    info.doublewidth = DWL_ON;
  // else -1 to ignore

  if(dhl == DHL_OFF)
    info.doubleheight = DHL_OFF;
  else if(dhl == DHL_TOP)
    info.doubleheight = DHL_TOP;
  else if(dhl == DHL_BOTTOM)
    info.doubleheight = DHL_BOTTOM;

  if((state->callbacks &&
      state->callbacks->setlineinfo &&
      (*state->callbacks->setlineinfo)(row, &info, state->lineinfo + row, state->cbdata))
      || force)
    state->lineinfo[row] = info;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rdi, %r14
movq 0x70(%rdi), %rax
movslq %esi, %rbx
movl (%rax,%rbx,4), %edx
movl %edx, 0xc(%rsp)
testl %ecx, %ecx
setne %cl
andb $-0x8, %dl
orb %cl, %dl
cmpl $0x1, %r8d
je 0x73ea
testl %r8d, %r8d
je 0x73ed
orb $0x4, %dl
jmp 0x73ed
orb $0x2, %dl
movb %dl, 0xc(%rsp)
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0x741f
movq 0x50(%rcx), %r8
testq %r8, %r8
je 0x741f
leaq (%rax,%rbx,4), %rdx
movq 0x10(%r14), %rcx
leaq 0xc(%rsp), %rsi
movl %ebx, %edi
callq *%r8
orl %ebp, %eax
je 0x742a
movq 0x70(%r14), %rax
jmp 0x7423
testl %ebp, %ebp
je 0x742a
movl 0xc(%rsp), %ecx
movl %ecx, (%rax,%rbx,4)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: erase
static void erase(VTermState *state, VTermRect rect, int selective)
{
  if(rect.end_col == state->cols) {
    /* If we're erasing the final cells of any lines, cancel the continuation
     * marker on the subsequent line
     */
    for(int row = rect.start_row + 1; row < rect.end_row + 1 && row < state->rows; row++)
      state->lineinfo[row].continuation = 0;
  }

  if(state->callbacks && state->callbacks->erase)
    if((*state->callbacks->erase)(rect, selective, state->cbdata))
      return;
}

// Assembly:
movq %rdx, %rax
shrq $0x20, %rax
cmpl %eax, 0x34(%rdi)
jne 0x747c
movq %rsi, %rax
shrq $0x20, %rax
cmpl %eax, %esi
jge 0x747c
movslq %esi, %rax
movq %rsi, %r8
sarq $0x20, %r8
negq %r8
incq %rax
movslq 0x30(%rdi), %r9
cmpq %r9, %rax
jge 0x747c
movq 0x70(%rdi), %r9
andb $-0x9, (%r9,%rax,4)
leaq (%r8,%rax), %r9
incq %r9
incq %rax
cmpq $0x1, %r9
jne 0x745a
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x74a0
movq 0x20(%rax), %r8
testq %r8, %r8
je 0x74a0
movq 0x10(%rdi), %rax
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
movq %rax, %rcx
jmpq *%r8
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: vterm_state_set_callbacks
void vterm_state_set_callbacks(VTermState *state, const VTermStateCallbacks *callbacks, void *user)
{
  if(callbacks) {
    state->callbacks = callbacks;
    state->cbdata = user;

    if(state->callbacks && state->callbacks->initpen)
      (*state->callbacks->initpen)(state->cbdata);
  }
  else {
    state->callbacks = NULL;
    state->cbdata = NULL;
  }
}

// Assembly:
testq %rsi, %rsi
je 0x74c4
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq 0x28(%rsi), %rax
testq %rax, %rax
je 0x74ce
movq %rdx, %rdi
jmpq *%rax
addq $0x8, %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: vterm_state_set_selection_callbacks
void vterm_state_set_selection_callbacks(VTermState *state, const VTermSelectionCallbacks *callbacks, void *user,
    char *buffer, size_t buflen)
{
  if(buflen && !buffer)
    buffer = vterm_allocator_malloc(state->vt, buflen);

  state->selection.callbacks = callbacks;
  state->selection.user      = user;
  state->selection.buffer    = buffer;
  state->selection.buflen    = buflen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
testq %r8, %r8
sete %al
testq %rcx, %rcx
setne %dl
orb %al, %dl
jne 0x76c9
movq (%r14), %rdi
movq %rbx, %rsi
callq 0xacb9
movq %rax, %rcx
movq %r12, 0x1b8(%r14)
movq %r15, 0x1c0(%r14)
movq %rcx, 0x1c8(%r14)
movq %rbx, 0x1d0(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: linefeed
static void linefeed(VTermState *state)
{
  if(state->pos.row == SCROLLREGION_BOTTOM(state) - 1) {
    VTermRect rect = {
      .start_row = state->scrollregion_top,
      .end_row   = SCROLLREGION_BOTTOM(state),
      .start_col = SCROLLREGION_LEFT(state),
      .end_col   = SCROLLREGION_RIGHT(state),
    };

    scroll(state, rect, 1, 0);
  }
  else if(state->pos.row < state->rows-1)
    state->pos.row++;
}

// Assembly:
movl 0x38(%rdi), %eax
movl 0x48(%rdi), %esi
testl %esi, %esi
js 0xa177
leal -0x1(%rsi), %ecx
cmpl %ecx, %eax
je 0xa181
movl 0x30(%rdi), %ecx
decl %ecx
jmp 0xa198
movl 0x30(%rdi), %esi
leal -0x1(%rsi), %ecx
cmpl %ecx, %eax
jne 0xa198
movl 0x44(%rdi), %eax
shlq $0x20, %rsi
orq %rax, %rsi
testb $0x10, 0xad(%rdi)
jne 0xa1a2
xorl %eax, %eax
jmp 0xa1ac
cmpl %ecx, %eax
jge 0xa1a1
incl %eax
movl %eax, 0x38(%rdi)
retq
movl 0x4c(%rdi), %eax
movl 0x50(%rdi), %edx
testl %edx, %edx
jns 0xa1af
movl 0x34(%rdi), %edx
shlq $0x20, %rdx
orq %rax, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
jmp 0xa1c0
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: updatecursor
static void updatecursor(VTermState *state, VTermPos *oldpos, int cancel_phantom)
{
  if(state->pos.col == oldpos->col && state->pos.row == oldpos->row)
    return;

  if(cancel_phantom)
    state->at_phantom = 0;

  if(state->callbacks && state->callbacks->movecursor)
    if((*state->callbacks->movecursor)(state->pos, *oldpos, state->mode.cursor_visible, state->cbdata))
      return;
}

// Assembly:
movl 0x3c(%rdi), %eax
cmpl 0x4(%rsi), %eax
jne 0xa43a
movl 0x38(%rdi), %eax
cmpl (%rsi), %eax
je 0xa470
testl %edx, %edx
je 0xa445
movl $0x0, 0x40(%rdi)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0xa470
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xa470
movl 0xac(%rdi), %edx
shrl $0x5, %edx
andl $0x1, %edx
movq 0x10(%rdi), %rcx
movq 0x38(%rdi), %rdi
movq (%rsi), %rsi
jmpq *%rax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: tab
static void tab(VTermState *state, int count, int direction)
{
  while(count > 0) {
    if(direction > 0) {
      if(state->pos.col >= THISROWWIDTH(state)-1)
        return;

      state->pos.col++;
    }
    else if(direction < 0) {
      if(state->pos.col < 1)
        return;

      state->pos.col--;
    }

    if(is_col_tabstop(state, state->pos.col))
      count--;
  }
}

// Assembly:
testl %esi, %esi
jle 0xa4e2
movl 0x3c(%rdi), %eax
testl %edx, %edx
jle 0xa4b2
movq 0x70(%rdi), %rcx
movslq 0x38(%rdi), %r8
movl 0x34(%rdi), %r9d
movl %r9d, %r10d
shrl $0x1f, %r10d
addl %r9d, %r10d
sarl %r10d
testb $0x1, (%rcx,%r8,4)
cmovel %r9d, %r10d
decl %r10d
movl $0x1, %ecx
cmpl %r10d, %eax
jge 0xa4e2
addl %ecx, %eax
movl %eax, 0x3c(%rdi)
jmp 0xa4b4
js 0xa4d9
movq 0x58(%rdi), %rcx
movl %eax, %r8d
sarl $0x3, %r8d
movslq %r8d, %r8
movzbl (%rcx,%r8), %ecx
movl %eax, %r8d
andl $0x7, %r8d
btl %r8d, %ecx
sbbl $0x0, %esi
jne 0xa478
jmp 0xa4e2
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jg 0xa4ab
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: savecursor
static void savecursor(VTermState *state, int save)
{
  if(save) {
    state->saved.pos = state->pos;
    state->saved.mode.cursor_visible = state->mode.cursor_visible;
    state->saved.mode.cursor_blink   = state->mode.cursor_blink;
    state->saved.mode.cursor_shape   = state->mode.cursor_shape;

    vterm_state_savepen(state, 1);
  }
  else {
    VTermPos oldpos = state->pos;

    state->pos = state->saved.pos;

    settermprop_bool(state, VTERM_PROP_CURSORVISIBLE, state->saved.mode.cursor_visible);
    settermprop_bool(state, VTERM_PROP_CURSORBLINK,   state->saved.mode.cursor_blink);
    settermprop_int (state, VTERM_PROP_CURSORSHAPE,   state->saved.mode.cursor_shape);

    vterm_state_savepen(state, 0);

    updatecursor(state, &oldpos, 1);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testl %esi, %esi
je 0xa53b
movq 0x38(%rbx), %rax
movq %rax, 0x190(%rbx)
movzwl 0xac(%rbx), %eax
movl %eax, %ecx
shrb $0x5, %cl
movb 0x1a4(%rbx), %dl
andb $-0x10, %dl
shrl $0x5, %eax
andb $0xc, %al
andb $0x3, %cl
orb %dl, %cl
orb %al, %cl
movb %cl, 0x1a4(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x397f
movq 0x38(%rbx), %rax
leaq 0x18(%rsp), %r14
movq %rax, (%r14)
movq 0x190(%rbx), %rax
movq %rax, 0x38(%rbx)
movzbl 0x1a4(%rbx), %eax
andl $0x1, %eax
leaq 0x8(%rsp), %r15
movl %eax, (%r15)
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x2150
movl 0x1a4(%rbx), %eax
shrl %eax
andl $0x1, %eax
movl %eax, (%r15)
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x2150
movl 0x1a4(%rbx), %eax
shrl $0x2, %eax
andl $0x3, %eax
movl %eax, (%r15)
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x2150
movq %rbx, %rdi
xorl %esi, %esi
callq 0x397f
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xa42b
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: is_cursor_in_scrollregion
static int is_cursor_in_scrollregion(const VTermState *state)
{
  if(state->pos.row < state->scrollregion_top ||
     state->pos.row >= SCROLLREGION_BOTTOM(state))
    return 0;
  if(state->pos.col < SCROLLREGION_LEFT(state) ||
     state->pos.col >= SCROLLREGION_RIGHT(state))
    return 0;

  return 1;
}

// Assembly:
movl 0x38(%rdi), %ecx
xorl %eax, %eax
cmpl 0x44(%rdi), %ecx
jl 0xa604
movl 0x48(%rdi), %edx
testl %edx, %edx
jns 0xa5f0
movl 0x30(%rdi), %edx
cmpl %edx, %ecx
jge 0xa604
movl 0x3c(%rdi), %ecx
testb $0x10, 0xad(%rdi)
jne 0xa605
testl %ecx, %ecx
jns 0xa611
retq
cmpl 0x4c(%rdi), %ecx
jl 0xa604
movl 0x50(%rdi), %edx
testl %edx, %edx
jns 0xa614
movl 0x34(%rdi), %edx
xorl %eax, %eax
cmpl %edx, %ecx
setl %al
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/state.c
// Function: request_dec_mode
static void request_dec_mode(VTermState *state, int num)
{
  int reply;

  switch(num) {
    case 1:
      reply = state->mode.cursor;
      break;

    case 5:
      reply = state->mode.screen;
      break;

    case 6:
      reply = state->mode.origin;
      break;

    case 7:
      reply = state->mode.autowrap;
      break;

    case 12:
      reply = state->mode.cursor_blink;
      break;

    case 25:
      reply = state->mode.cursor_visible;
      break;

    case 69:
      reply = state->mode.leftrightmargin;
      break;

    case 1000:
      reply = state->mouse_flags == MOUSE_WANT_CLICK;
      break;

    case 1002:
      reply = state->mouse_flags == (MOUSE_WANT_CLICK|MOUSE_WANT_DRAG);
      break;

    case 1003:
      reply = state->mouse_flags == (MOUSE_WANT_CLICK|MOUSE_WANT_MOVE);
      break;

    case 1004:
      reply = state->mode.report_focus;
      break;

    case 1005:
      reply = state->mouse_protocol == MOUSE_UTF8;
      break;

    case 1006:
      reply = state->mouse_protocol == MOUSE_SGR;
      break;

    case 1015:
      reply = state->mouse_protocol == MOUSE_RXVT;
      break;

    case 1047:
      reply = state->mode.alt_screen;
      break;

    case 2004:
      reply = state->mode.bracketpaste;
      break;

    default:
      vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "?%d;%d$y", num, 0);
      return;
  }

  vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "?%d;%d$y", num, reply ? 1 : 2);
}

// Assembly:
movl %esi, %ecx
cmpl $0x3e7, %esi            # imm = 0x3E7
jle 0xa907
leal -0x3e8(%rcx), %eax
cmpl $0xf, %eax
ja 0xa92c
leaq 0x20bc(%rip), %rdx      # 0xc9ac
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %eax, %eax
cmpl $0x1, 0x84(%rdi)
jmp 0xa9ed
leal -0x1(%rcx), %eax
cmpl $0xb, %eax
ja 0xa94e
leaq 0x2066(%rip), %rdx      # 0xc97c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl 0xac(%rdi), %eax
shrl %eax
jmp 0xaa06
cmpl $0x417, %ecx            # imm = 0x417
je 0xa9f2
cmpl $0x7d4, %ecx            # imm = 0x7D4
jne 0xa96a
movl 0xac(%rdi), %eax
shrl $0xd, %eax
jmp 0xaa06
cmpl $0x19, %ecx
je 0xa9fd
cmpl $0x45, %ecx
jne 0xa96a
movl 0xac(%rdi), %eax
shrl $0xc, %eax
jmp 0xaa06
movq (%rdi), %rdi
leaq 0x20ae(%rip), %rdx      # 0xca22
movl $0x9b, %esi
xorl %r8d, %r8d
jmp 0xaa25
movl 0xac(%rdi), %eax
shrl $0xb, %eax
jmp 0xaa06
movl 0xac(%rdi), %eax
shrl $0x2, %eax
jmp 0xaa06
movl 0xac(%rdi), %eax
shrl $0xa, %eax
jmp 0xaa06
movl 0xac(%rdi), %eax
shrl $0x6, %eax
jmp 0xaa06
xorl %eax, %eax
cmpl $0x3, 0x88(%rdi)
jmp 0xa9ed
xorl %eax, %eax
cmpl $0x3, 0x84(%rdi)
jmp 0xa9ed
xorl %eax, %eax
cmpl $0x2, 0x88(%rdi)
jmp 0xa9ed
movl 0xac(%rdi), %eax
shrl $0xe, %eax
jmp 0xaa06
xorl %eax, %eax
cmpl $0x5, 0x84(%rdi)
jmp 0xa9ed
xorl %eax, %eax
cmpl $0x1, 0x88(%rdi)
sete %al
jmp 0xaa09
movl 0xac(%rdi), %eax
shrl $0x9, %eax
jmp 0xaa06
movl 0xac(%rdi), %eax
shrl $0x5, %eax
andl $0x1, %eax
cmpl $0x1, %eax
movl $0x0, %r8d
adcl $0x1, %r8d
movq (%rdi), %rdi
leaq 0x2002(%rip), %rdx      # 0xca22
movl $0x9b, %esi
xorl %eax, %eax
jmp 0xaf11
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/unicode.c
// Function: bisearch
static int bisearch(uint32_t ucs, const struct interval *table, int max) {
  int min = 0;
  int mid;

  if (ucs < table[0].first || ucs > table[max].last)
    return 0;
  while (max >= min) {
    mid = (min + max) / 2;
    if (ucs > table[mid].last)
      min = mid + 1;
    else if (ucs < table[mid].first)
      max = mid - 1;
    else
      return 1;
  }

  return 0;
}

// Assembly:
xorl %eax, %eax
cmpl %edi, (%rsi)
ja 0xab8e
movl %edx, %ecx
cmpl %edi, 0x4(%rsi,%rcx,8)
setb %cl
testl %edx, %edx
sets %r8b
orb %cl, %r8b
jne 0xab8e
xorl %eax, %eax
leal (%rax,%rdx), %r8d
movl %r8d, %ecx
shrl $0x1f, %ecx
addl %r8d, %ecx
sarl %ecx
movslq %ecx, %r8
cmpl %edi, 0x4(%rsi,%r8,8)
jae 0xab7e
incl %ecx
movl %ecx, %eax
jmp 0xab88
cmpl %edi, (%rsi,%r8,8)
jbe 0xab8f
decl %ecx
movl %ecx, %edx
cmpl %eax, %edx
jge 0xab5f
xorl %eax, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/vterm.c
// Function: vterm_build
VTerm *vterm_build(const struct VTermBuilder *builder)
{
  const VTermAllocatorFunctions *allocator = DEFAULT(builder->allocator, &default_allocator);

  /* Need to bootstrap using the allocator function directly */
  VTerm *vt = (*allocator->malloc)(sizeof(VTerm), builder->allocdata);

  vt->allocator = allocator;
  vt->allocdata = builder->allocdata;

  vt->rows = builder->rows;
  vt->cols = builder->cols;

  vt->parser.state = NORMAL;

  vt->parser.callbacks = NULL;
  vt->parser.cbdata    = NULL;

  vt->parser.emit_nul  = false;

  vt->outfunc = NULL;
  vt->outdata = NULL;

  vt->outbuffer_len = DEFAULT(builder->outbuffer_len, 4096);
  vt->outbuffer_cur = 0;
  vt->outbuffer = vterm_allocator_malloc(vt, vt->outbuffer_len);

  vt->tmpbuffer_len = DEFAULT(builder->tmpbuffer_len, 4096);
  vt->tmpbuffer = vterm_allocator_malloc(vt, vt->tmpbuffer_len);

  return vt;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rsi
testq %rax, %rax
leaq 0x65a7(%rip), %r15      # 0x11190
cmovneq %rax, %r15
movl $0x138, %edi            # imm = 0x138
callq *(%r15)
movq %rax, %rbx
movq %r15, (%rax)
movq 0x18(%r14), %rsi
movq %rsi, 0x8(%rax)
movq 0x4(%r14), %rax
movq %rax, 0x10(%rbx)
movl $0x0, 0x20(%rbx)
movb $0x0, 0xe9(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xf0(%rbx)
movq 0x20(%r14), %rdi
testq %rdi, %rdi
movl $0x1000, %r12d          # imm = 0x1000
cmoveq %r12, %rdi
movq %rdi, 0x108(%rbx)
movq $0x0, 0x110(%rbx)
callq *(%r15)
movq %rax, 0x100(%rbx)
movq 0x28(%r14), %rdi
testq %rdi, %rdi
cmoveq %r12, %rdi
movq %rdi, 0x120(%rbx)
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
callq *(%rax)
movq %rax, 0x118(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq