LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x55c5
leaq 0x6161(%rip), %rax      # 0xb628
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
andl $0x1, %eax
andl $-0x2, %ecx
jmp 0x55ad
movl (%rsi), %eax
andl $0x3, %eax
movl $0xffff9fff, %ecx       # imm = 0xFFFF9FFF
andl 0x88(%rdx), %ecx
shll $0xd, %eax
jmp 0x55ad
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
shll $0x5, %eax
andl $0x20, %eax
andl $-0x21, %ecx
jmp 0x55ad
movl (%rsi), %eax
movl %eax, 0x84(%rdx)
jmp 0x55b5
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
andl $0x1, %eax
andl $-0x9, %ecx
leal (%rcx,%rax,8), %eax
jmp 0x556a
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
shll $0x4, %eax
andl $0x10, %eax
andl $-0x11, %ecx
jmp 0x55ad
movl (%rsi), %eax
andl $0xf, %eax
movl $0xfffff0ff, %ecx       # imm = 0xFFFFF0FF
andl 0x88(%rdx), %ecx
shll $0x8, %eax
jmp 0x55ad
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
andl $0x3, %eax
andl $-0x7, %ecx
leal (%rcx,%rax,2), %eax
movl %eax, 0x88(%rdx)
jmp 0x55b5
movl (%rsi), %eax
movl 0x88(%rdx), %ecx
shll $0x6, %eax
andl $0x40, %eax
andl $-0x41, %ecx
jmp 0x55ad
movl (%rsi), %eax
shll $0x7, %eax
movl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
andl 0x88(%rdx), %ecx
movzbl %al, %eax
jmp 0x55ad
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 0x55b5
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x55f3
cmpl $0x3, %ebp
jne 0x5630
cmpl $0x0, (%rbx)
je 0x5606
movl $0x68, %eax
cmpq $0x0, 0x68(%r14)
jne 0x560b
xorl %eax, %eax
jmp 0x5656
movb (%rbx), %al
movb 0x58(%r14), %cl
andb $0x1, %al
andb $-0x2, %cl
orb %al, %cl
movb %cl, 0x58(%r14)
jmp 0x5618
movl $0x60, %eax
movq (%r14,%rax), %rax
movq %rax, 0x70(%r14)
cmpl $0x0, (%rbx)
jne 0x5630
movl 0x50(%r14), %esi
movl 0x54(%r14), %edx
shlq $0x20, %rsi
shlq $0x20, %rdx
movq %r14, %rdi
callq 0x5984
movq 0x10(%r14), %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x5656
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x5656
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_O1/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:
movb (%rdx), %al
xorb (%rsi), %al
testb $0x7, %al
je 0x58b8
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rsi, %r15
movl %edi, %r14d
movl 0x54(%rcx), %esi
testl %esi, %esi
jle 0x5861
movl $0x20, %eax
xorl %ecx, %ecx
movl $0xfffeffff, %edx       # imm = 0xFFFEFFFF
imull %r14d, %esi
leaq (%rsi,%rsi,8), %rsi
shlq $0x2, %rsi
addq 0x70(%rbx), %rsi
movzbl (%r15), %edi
andl $0x1, %edi
shll $0x10, %edi
movl (%rax,%rsi), %r8d
andl %edx, %r8d
orl %edi, %r8d
movl %r8d, (%rax,%rsi)
movl (%r15), %edi
andl $0x6, %edi
shll $0x10, %edi
andl $0xfff9ffff, %r8d       # imm = 0xFFF9FFFF
orl %edi, %r8d
movl %r8d, (%rax,%rsi)
incq %rcx
movslq 0x54(%rbx), %rsi
addq $0x24, %rax
cmpq %rsi, %rcx
jl 0x5812
movl %r14d, %eax
incl %r14d
shlq $0x20, %r14
orq %rax, %r14
movl %esi, %edx
shrl $0x1f, %edx
addl %esi, %edx
sarl %edx
testb $0x1, (%r15)
cmovel %esi, %edx
shlq $0x20, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5984
testb $0x1, (%r15)
je 0x58b3
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 0x5b88
popq %rbx
popq %r14
popq %r15
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rdx), %rax
testq %rax, %rax
je 0x590c
cmpq $0x0, 0x30(%rax)
je 0x590c
testl %r14d, %r14d
jne 0x597a
jmp 0x5929
testq %rax, %rax
je 0x597a
cmpb $0x0, 0x20(%rbx)
je 0x597a
cmpq $0x0, 0x48(%rax)
setne %al
testl %r14d, %r14d
sete %cl
testb %cl, %al
je 0x597a
testl %esi, %esi
jne 0x597a
shrq $0x20, %rsi
cmpl %esi, 0x54(%rbx)
jne 0x597a
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 0x597a
xorl %ebp, %ebp
movq 0x8(%rbx), %rdi
movl %ebp, %esi
callq 0x20a0
movb (%rax), %al
andb $0x8, %al
shrb $0x3, %al
movzbl %al, %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6694
incl %ebp
cmpl %ebp, %r14d
jne 0x5954
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x59c7
testl %ecx, %ecx
je 0x5a37
cmpl $0x1, %ecx
jne 0x5a59
leal 0x1(%r15), %ecx
cmpl %eax, %ecx
jge 0x59fd
movq %r14, %rdi
callq 0x2040
jmp 0x5a37
movl 0x28(%r14), %ecx
cmpl $-0x1, %ecx
je 0x5a17
cmpl %r15d, %ecx
jle 0x59d9
movl %r15d, 0x28(%r14)
cmpl %ebx, 0x30(%r14)
jle 0x59e3
movl %ebx, 0x30(%r14)
cmpl %eax, 0x2c(%r14)
jge 0x59ed
movl %eax, 0x2c(%r14)
shrq $0x20, %rbx
cmpl %ebx, 0x34(%r14)
jge 0x5a59
movl %ebx, 0x34(%r14)
jmp 0x5a59
movl 0x28(%r14), %eax
cmpl $-0x1, %eax
je 0x5a17
cmpl %r15d, %eax
jne 0x5a21
cmpl %ebx, 0x30(%r14)
jle 0x59ed
movl %ebx, 0x30(%r14)
jmp 0x59ed
movq %r15, 0x28(%r14)
movq %rbx, 0x30(%r14)
jmp 0x5a59
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 0x5a59
movq (%rax), %rax
testq %rax, %rax
je 0x5a59
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_O1/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 0x5b74
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 0x5b21
cmpl $0x0, 0x8(%rsp)
js 0x5b21
movl $0x0, %edi
cmpl %ebp, 0x50(%rbx)
jle 0x5b23
movl 0x54(%rbx), %eax
cmpl 0x8(%rsp), %eax
jle 0x5b21
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 0x5b23
xorl %edi, %edi
movl %r15d, %eax
addl %ebp, %eax
js 0x5b5e
cmpl $0x0, 0x10(%rsp)
js 0x5b5e
movl $0x0, %esi
cmpl %eax, 0x50(%rbx)
jle 0x5b60
movl 0x54(%rbx), %ecx
cmpl 0x10(%rsp), %ecx
jle 0x5b5e
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 0x5b60
xorl %esi, %esi
movq %r13, %rdx
callq 0x21b0
addl %r14d, %ebp
cmpl %ebp, %r12d
jne 0x5ae5
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_O1/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 0x5c7d
movl %edx, %ebp
movq %rsi, %r14
movq %rsi, %r13
shrq $0x20, %r13
movl %r15d, %esi
callq 0x20a0
cmpl %r13d, %r14d
jge 0x5c66
movl %r14d, %ecx
testl %r15d, %r15d
js 0x5c17
testl %ecx, %ecx
js 0x5c17
movl $0x0, %edx
cmpl %r15d, 0x50(%rbx)
jle 0x5c19
movl 0x54(%rbx), %edx
cmpl %ecx, %edx
jle 0x5c17
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 0x5c19
xorl %edx, %edx
testl %ebp, %ebp
je 0x5c23
testb $-0x80, 0x21(%rdx)
jne 0x5c5b
movl $0x0, (%rdx)
andl $0xfff80000, %r12d      # imm = 0xFFF80000
movq 0x80(%rbx), %rsi
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 0x5be0
incl %r15d
movq 0x8(%rbx), %rdi
cmpl 0x30(%rdi), %r15d
jge 0x5c7d
cmpl (%rsp), %r15d
jl 0x5bcc
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_O1/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 0x66e3
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 0x2210
incq %r13
movslq 0x54(%rbx), %rdi
addq $0x28, %r15
addq %r12, %r14
cmpq %rdi, %r13
jl 0x66be
cmpb $0x1, 0x20(%rbx)
jne 0x6712
movq 0x10(%rbx), %rax
movq 0x48(%rax), %rax
testq %rax, %rax
je 0x6712
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 0x10(%rbx), %rax
movq 0x18(%rbx), %rdx
movq 0x30(%rax), %rax
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_O1/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 0xa40a
movq (%rbx), %rdi
movq 0x60(%rbx), %rsi
callq 0xa40a
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x6761
movq (%rbx), %rdi
callq 0xa40a
movq (%rbx), %rdi
movq 0x90(%rbx), %rsi
callq 0xa40a
movq (%rbx), %rdi
movq %rbx, %rsi
popq %rbx
jmp 0xa40a
// File: /workspace/github_c_makefile_star2_O1/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 0x68a5
movq %rdi, %rbx
movl $0x1d8, %esi            # imm = 0x1D8
callq 0xa39f
movq %rax, %r14
movq %rbx, (%rax)
movl 0x10(%rbx), %eax
movl %eax, 0x30(%r14)
movl 0x14(%rbx), %eax
movl %eax, 0x34(%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 0x34ac
movl %r15d, 0x188(%r14)
movq $0x10, 0x98(%r14)
movq (%r14), %rdi
movl $0x40, %esi
callq 0xa39f
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 0xa39f
movq %rax, 0x58(%r14)
movq (%r14), %rdi
movslq 0x30(%r14), %rsi
shlq $0x2, %rsi
callq 0xa39f
movq %rax, 0x60(%r14)
movq (%r14), %rdi
movslq 0x30(%r14), %rsi
shlq $0x2, %rsi
callq 0xa39f
movq %rax, 0x68(%r14)
movq 0x60(%r14), %rax
movq %rax, 0x70(%r14)
xorl %edi, %edi
movl $0x75, %esi
callq 0x2140
movq %rax, 0x110(%r14)
movq (%rax), %rcx
testq %rcx, %rcx
je 0x688c
movq %r14, %rsi
addq $0x118, %rsi            # imm = 0x118
movq %rax, %rdi
callq *%rcx
movq %r14, 0x128(%rbx)
leaq 0x9516(%rip), %rsi      # 0xfdb0
movq %rbx, %rdi
movq %r14, %rdx
callq 0x20e0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 $-0x2, %dl
orb %cl, %dl
movb %dl, 0xc(%rsp)
andb $-0x7, %dl
cmpl $0x1, %r8d
je 0x6a9d
testl %r8d, %r8d
je 0x6aa0
orb $0x4, %dl
jmp 0x6aa0
orb $0x2, %dl
movb %dl, 0xc(%rsp)
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0x6ace
movq 0x50(%rcx), %r8
testq %r8, %r8
je 0x6ace
leaq (%rax,%rbx,4), %rdx
movq 0x10(%r14), %rcx
leaq 0xc(%rsp), %rsi
movl %ebx, %edi
callq *%r8
orl %ebp, %eax
jne 0x6ad2
jmp 0x6add
testl %ebp, %ebp
je 0x6add
movq 0x70(%r14), %rax
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_O1/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 0x6b2f
movq %rsi, %rax
shrq $0x20, %rax
cmpl %eax, %esi
jge 0x6b2f
movslq %esi, %rax
movq %rsi, %r8
sarq $0x20, %r8
negq %r8
incq %rax
movslq 0x30(%rdi), %r9
cmpq %r9, %rax
jge 0x6b2f
movq 0x70(%rdi), %r9
andb $-0x9, (%r9,%rax,4)
leaq (%r8,%rax), %r9
incq %r9
incq %rax
cmpq $0x1, %r9
jne 0x6b0d
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x6b53
movq 0x20(%rax), %r8
testq %r8, %r8
je 0x6b53
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_O1/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 0x6b77
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq 0x28(%rsi), %rax
testq %rax, %rax
je 0x6b81
movq %rdx, %rdi
jmpq *%rax
addq $0x8, %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6d7f
movq (%r14), %rdi
movq %rbx, %rsi
callq 0xa39f
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_O1/neovim[P]libvterm/src/state.c
// Function: grow_combine_buffer
static void grow_combine_buffer(VTermState *state)
{
  size_t    new_size = state->combine_chars_size * 2;
  uint32_t *new_chars = vterm_allocator_malloc(state->vt, new_size * sizeof(new_chars[0]));

  memcpy(new_chars, state->combine_chars, state->combine_chars_size * sizeof(new_chars[0]));

  vterm_allocator_free(state->vt, state->combine_chars);

  state->combine_chars = new_chars;
  state->combine_chars_size = new_size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x98(%rbx), %rsi
leaq (%rsi,%rsi), %r15
shlq $0x3, %rsi
callq 0xa39f
movq %rax, %r14
movq 0x90(%rbx), %rsi
movq 0x98(%rbx), %rdx
shlq $0x2, %rdx
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rdi
movq 0x90(%rbx), %rsi
callq 0xa40a
movq %r14, 0x90(%rbx)
movq %r15, 0x98(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/state.c
// Function: putglyph
static void putglyph(VTermState *state, const uint32_t chars[], int width, VTermPos pos)
{
  VTermGlyphInfo info = {
    .chars = chars,
    .width = width,
    .protected_cell = state->protected_cell,
    .dwl = state->lineinfo[pos.row].doublewidth,
    .dhl = state->lineinfo[pos.row].doubleheight,
  };

  if(state->callbacks && state->callbacks->putglyph)
    if((*state->callbacks->putglyph)(&info, pos, state->cbdata))
      return;

  DEBUG_LOG("libvterm: Unhandled putglyph U+%04x at (%d,%d)\n", chars[0], pos.col, pos.row);
}

// Assembly:
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movl %edx, 0x10(%rsp)
movb 0x18c(%rdi), %al
andb $0x1, %al
movb 0x14(%rsp), %dl
andb $-0x2, %dl
orb %al, %dl
movb %dl, 0x14(%rsp)
movq 0x70(%rdi), %rax
movslq %ecx, %rsi
movb (%rax,%rsi,4), %r8b
addb %r8b, %r8b
andb $0x2, %r8b
andb $-0x3, %dl
orb %r8b, %dl
movb %dl, 0x14(%rsp)
movb (%rax,%rsi,4), %al
addb %al, %al
andb $0xc, %al
andb $-0xd, %dl
orb %al, %dl
movb %dl, 0x14(%rsp)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x981d
movq (%rax), %rax
testq %rax, %rax
je 0x981d
movq 0x10(%rdi), %rdx
leaq 0x8(%rsp), %rdi
movq %rcx, %rsi
callq *%rax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %esi, %ecx
testl %esi, %esi
jns 0x9831
movl 0x30(%rdi), %ecx
decl %ecx
cmpl %ecx, %eax
jne 0x9855
movl 0x44(%rdi), %eax
testl %esi, %esi
jns 0x9841
movl 0x30(%rdi), %esi
shlq $0x20, %rsi
movl 0xac(%rdi), %edx
btl $0xc, %edx
jb 0x9864
xorl %ecx, %ecx
jmp 0x9867
movl 0x30(%rdi), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0x9863
incl %eax
movl %eax, 0x38(%rdi)
retq
movl 0x4c(%rdi), %ecx
orq %rax, %rsi
btl $0xc, %edx
jae 0x9877
movl 0x50(%rdi), %edx
testl %edx, %edx
jns 0x987a
movl 0x34(%rdi), %edx
shlq $0x20, %rdx
orq %rcx, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
jmp 0x988b
// File: /workspace/github_c_makefile_star2_O1/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 0x9b04
movl 0x38(%rdi), %eax
cmpl (%rsi), %eax
je 0x9b3a
testl %edx, %edx
je 0x9b0f
movl $0x0, 0x40(%rdi)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x9b3a
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x9b3a
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_O1/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 0x9ba1
testl %edx, %edx
jle 0x9b56
movq 0x70(%rdi), %rax
movslq 0x38(%rdi), %rcx
testb $0x1, (%rax,%rcx,4)
jne 0x9b66
movl 0x34(%rdi), %eax
jmp 0x9b72
jns 0x9b80
movl 0x3c(%rdi), %eax
testl %eax, %eax
jle 0x9ba1
decl %eax
movl %eax, 0x3c(%rdi)
jmp 0x9b80
movl 0x34(%rdi), %ecx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
movl 0x3c(%rdi), %ecx
decl %eax
cmpl %eax, %ecx
jge 0x9ba1
incl %ecx
movl %ecx, 0x3c(%rdi)
movl 0x3c(%rdi), %eax
movq 0x58(%rdi), %rcx
movl %eax, %r8d
sarl $0x3, %r8d
movslq %r8d, %r8
movzbl (%rcx,%r8), %ecx
andl $0x7, %eax
btl %eax, %ecx
sbbl $0x0, %esi
jmp 0x9b3b
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9bfa
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 0x375c
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 0x2160
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 0x2160
movl 0x1a4(%rbx), %eax
shrl $0x2, %eax
andl $0x3, %eax
movl %eax, (%r15)
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x2160
movq %rbx, %rdi
xorl %esi, %esi
callq 0x375c
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x9af5
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9ce7
movl 0x48(%rdi), %edx
testl %edx, %edx
jns 0x9caf
movl 0x30(%rdi), %edx
cmpl %edx, %ecx
jge 0x9ce7
movl 0x3c(%rdi), %ecx
movl 0xac(%rdi), %edx
xorl %eax, %eax
btl $0xc, %edx
movl $0x0, %esi
jae 0x9ccc
movl 0x4c(%rdi), %esi
cmpl %esi, %ecx
jl 0x9ce7
btl $0xc, %edx
jae 0x9cdd
movl 0x50(%rdi), %edx
testl %edx, %edx
jns 0x9ce0
movl 0x34(%rdi), %edx
xorl %eax, %eax
cmpl %edx, %ecx
setl %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9fd3
leal -0x3e8(%rcx), %eax
cmpl $0xf, %eax
ja 0x9ff8
leaq 0x1960(%rip), %rdx      # 0xb91c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %eax, %eax
cmpl $0x1, 0x84(%rdi)
jmp 0xa0b9
leal -0x1(%rcx), %eax
cmpl $0xb, %eax
ja 0xa01a
leaq 0x190a(%rip), %rdx      # 0xb8ec
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl 0xac(%rdi), %eax
shrl %eax
jmp 0xa0d2
cmpl $0x417, %ecx            # imm = 0x417
je 0xa0be
cmpl $0x7d4, %ecx            # imm = 0x7D4
jne 0xa036
movl 0xac(%rdi), %eax
shrl $0xd, %eax
jmp 0xa0d2
cmpl $0x19, %ecx
je 0xa0c9
cmpl $0x45, %ecx
jne 0xa036
movl 0xac(%rdi), %eax
shrl $0xc, %eax
jmp 0xa0d2
movq (%rdi), %rdi
leaq 0x1952(%rip), %rdx      # 0xb992
movl $0x9b, %esi
xorl %r8d, %r8d
jmp 0xa0f1
movl 0xac(%rdi), %eax
shrl $0xb, %eax
jmp 0xa0d2
movl 0xac(%rdi), %eax
shrl $0x2, %eax
jmp 0xa0d2
movl 0xac(%rdi), %eax
shrl $0xa, %eax
jmp 0xa0d2
movl 0xac(%rdi), %eax
shrl $0x6, %eax
jmp 0xa0d2
xorl %eax, %eax
cmpl $0x3, 0x88(%rdi)
jmp 0xa0b9
xorl %eax, %eax
cmpl $0x3, 0x84(%rdi)
jmp 0xa0b9
xorl %eax, %eax
cmpl $0x2, 0x88(%rdi)
jmp 0xa0b9
movl 0xac(%rdi), %eax
shrl $0xe, %eax
jmp 0xa0d2
xorl %eax, %eax
cmpl $0x5, 0x84(%rdi)
jmp 0xa0b9
xorl %eax, %eax
cmpl $0x1, 0x88(%rdi)
sete %al
jmp 0xa0d5
movl 0xac(%rdi), %eax
shrl $0x9, %eax
jmp 0xa0d2
movl 0xac(%rdi), %eax
shrl $0x5, %eax
andl $0x1, %eax
cmpl $0x1, %eax
movl $0x0, %r8d
adcl $0x1, %r8d
movq (%rdi), %rdi
leaq 0x18a6(%rip), %rdx      # 0xb992
movl $0x9b, %esi
xorl %eax, %eax
jmp 0xa5f7
// File: /workspace/github_c_makefile_star2_O1/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 0xa26d
movl %edx, %ecx
cmpl %edi, 0x4(%rsi,%rcx,8)
setb %cl
testl %edx, %edx
sets %r8b
orb %cl, %r8b
jne 0xa26d
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 0xa25d
incl %ecx
movl %ecx, %eax
jmp 0xa267
cmpl %edi, (%rsi,%r8,8)
jbe 0xa26e
decl %ecx
movl %ecx, %edx
cmpl %eax, %edx
jge 0xa23e
xorl %eax, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5ed7(%rip), %r15      # 0x101a0
cmovneq %rax, %r15
movl $0x138, %edi            # imm = 0x138
callq *(%r15)
movq %rax, %rbx
movq %r15, (%rax)
movq 0x18(%r14), %rsi
movq %rsi, 0x8(%rax)
movl 0x4(%r14), %eax
movl %eax, 0x10(%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x14(%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
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_free
void vterm_free(VTerm *vt)
{
  if(vt->screen)
    vterm_screen_free(vt->screen);

  if(vt->state)
    vterm_state_free(vt->state);

  vterm_allocator_free(vt, vt->outbuffer);
  vterm_allocator_free(vt, vt->tmpbuffer);

  vterm_allocator_free(vt, vt);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x130(%rdi), %rdi
testq %rdi, %rdi
je 0xa3c6
callq 0x44c4
movq 0x128(%rbx), %rdi
testq %rdi, %rdi
je 0xa3d7
callq 0x6734
movq 0x100(%rbx), %rdi
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
callq *0x8(%rax)
movq 0x118(%rbx), %rdi
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
callq *0x8(%rax)
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
movq 0x8(%rax), %rax
movq %rbx, %rdi
popq %rbx
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_get_size
void vterm_get_size(const VTerm *vt, int *rowsp, int *colsp)
{
  if(rowsp)
    *rowsp = vt->rows;
  if(colsp)
    *colsp = vt->cols;
}

// Assembly:
testq %rsi, %rsi
je 0xa427
movl 0x10(%rdi), %eax
movl %eax, (%rsi)
testq %rdx, %rdx
je 0xa431
movl 0x14(%rdi), %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_set_size
void vterm_set_size(VTerm *vt, int rows, int cols)
{
  if(rows < 1 || cols < 1)
    return;

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

  if(vt->parser.callbacks && vt->parser.callbacks->resize)
    (*vt->parser.callbacks->resize)(rows, cols, vt->parser.cbdata);
}

// Assembly:
testl %esi, %esi
setle %al
testl %edx, %edx
setle %cl
orb %al, %cl
jne 0xa46b
movl %esi, 0x10(%rdi)
movl %edx, 0x14(%rdi)
movq 0xd8(%rdi), %rax
testq %rax, %rax
je 0xa46b
movq 0x48(%rax), %rcx
testq %rcx, %rcx
je 0xa46b
movq 0xe0(%rdi), %rax
movl %esi, %edi
movl %edx, %esi
movq %rax, %rdx
jmpq *%rcx
retq
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_push_output_bytes
INTERNAL void vterm_push_output_bytes(VTerm *vt, const char *bytes, size_t len)
{
  if(vt->outfunc) {
    (vt->outfunc)(bytes, len, vt->outdata);
    return;
  }

  if(len > vt->outbuffer_len - vt->outbuffer_cur)
    return;

  memcpy(vt->outbuffer + vt->outbuffer_cur, bytes, len);
  vt->outbuffer_cur += len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0xf0(%rdi), %rax
testq %rax, %rax
je 0xa4bf
movq 0xf8(%r14), %rdx
movq %rsi, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
movq 0x108(%r14), %rax
movq 0x110(%r14), %rdi
subq %rdi, %rax
cmpq %rbx, %rax
jb 0xa4eb
addq 0x100(%r14), %rdi
movq %rbx, %rdx
callq 0x2130
addq %rbx, 0x110(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_push_output_sprintf_ctrl
INTERNAL void vterm_push_output_sprintf_ctrl(VTerm *vt, unsigned char ctrl, const char *fmt, ...)
{
  size_t cur;

  if(ctrl >= 0x80 && !vt->mode.ctrl8bit)
    cur = snprintf(vt->tmpbuffer, vt->tmpbuffer_len,
        ESC_S "%c", ctrl - 0x40);
  else
    cur = snprintf(vt->tmpbuffer, vt->tmpbuffer_len,
        "%c", ctrl);

  if(cur >= vt->tmpbuffer_len)
    return;

  va_list args;
  va_start(args, fmt);
  cur += vsnprintf(vt->tmpbuffer + cur, vt->tmpbuffer_len - cur,
      fmt, args);
  va_end(args);

  if(cur >= vt->tmpbuffer_len)
    return;

  vterm_push_output_bytes(vt, vt->tmpbuffer, cur);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rcx, %r10
movq %rdx, %r14
movl %esi, %ecx
movq %rdi, %rbx
movq %r10, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xa658
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testb %cl, %cl
jns 0xa67c
testb $0x2, 0x18(%rbx)
jne 0xa67c
movq 0x118(%rbx), %rdi
movq 0x120(%rbx), %rsi
addl $-0x40, %ecx
leaq 0xc35(%rip), %rdx       # 0xb2af
jmp 0xa691
movq 0x118(%rbx), %rdi
movq 0x120(%rbx), %rsi
leaq 0xc1f(%rip), %rdx       # 0xb2b0
xorl %eax, %eax
callq 0x20f0
movslq %eax, %r15
cmpq %r15, 0x120(%rbx)
jbe 0xa748
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
movq 0x118(%rbx), %rdi
addq %r15, %rdi
movq 0x120(%rbx), %rsi
subq %r15, %rsi
movq %r14, %rdx
callq 0x2090
movslq %eax, %r14
addq %r15, %r14
cmpq 0x120(%rbx), %r14
jae 0xa748
movq 0xf0(%rbx), %rax
movq 0x118(%rbx), %rsi
testq %rax, %rax
je 0xa71c
movq 0xf8(%rbx), %rdx
movq %rsi, %rdi
movq %r14, %rsi
callq *%rax
jmp 0xa748
movq 0x108(%rbx), %rax
movq 0x110(%rbx), %rdi
subq %rdi, %rax
cmpq %r14, %rax
jb 0xa748
addq 0x100(%rbx), %rdi
movq %r14, %rdx
callq 0x2130
addq %r14, 0x110(%rbx)
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_push_output_sprintf_str
INTERNAL void vterm_push_output_sprintf_str(VTerm *vt, unsigned char ctrl, bool term, const char *fmt, ...)
{
  size_t cur = 0;

  if(ctrl) {
    if(ctrl >= 0x80 && !vt->mode.ctrl8bit)
      cur = snprintf(vt->tmpbuffer, vt->tmpbuffer_len,
          ESC_S "%c", ctrl - 0x40);
    else
      cur = snprintf(vt->tmpbuffer, vt->tmpbuffer_len,
          "%c", ctrl);

    if(cur >= vt->tmpbuffer_len)
      return;
  }

  va_list args;
  va_start(args, fmt);
  cur += vsnprintf(vt->tmpbuffer + cur, vt->tmpbuffer_len - cur,
      fmt, args);
  va_end(args);

  if(cur >= vt->tmpbuffer_len)
    return;

  if(term) {
    cur += snprintf(vt->tmpbuffer + cur, vt->tmpbuffer_len - cur,
        vt->mode.ctrl8bit ? "\x9C" : ESC_S "\\"); // ST

    if(cur >= vt->tmpbuffer_len)
      return;
  }

  vterm_push_output_bytes(vt, vt->tmpbuffer, cur);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rcx, %r14
movl %edx, %ebp
movq %rdi, %rbx
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xa7af
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testl %esi, %esi
je 0xa808
movzbl %sil, %ecx
testb %cl, %cl
jns 0xa7db
testb $0x2, 0x18(%rbx)
jne 0xa7db
movq 0x118(%rbx), %rdi
movq 0x120(%rbx), %rsi
addl $-0x40, %ecx
leaq 0xad6(%rip), %rdx       # 0xb2af
jmp 0xa7f0
movq 0x118(%rbx), %rdi
movq 0x120(%rbx), %rsi
leaq 0xac0(%rip), %rdx       # 0xb2b0
xorl %eax, %eax
callq 0x20f0
movslq %eax, %r15
cmpq %r15, 0x120(%rbx)
ja 0xa80b
jmp 0xa8ec
xorl %r15d, %r15d
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, (%rcx)
movq 0x118(%rbx), %rdi
addq %r15, %rdi
movq 0x120(%rbx), %rsi
subq %r15, %rsi
movq %r14, %rdx
callq 0x2090
movslq %eax, %r14
addq %r15, %r14
movq 0x120(%rbx), %rsi
subq %r14, %rsi
jbe 0xa8ec
testb %bpl, %bpl
je 0xa89c
movq 0x118(%rbx), %rdi
addq %r14, %rdi
testb $0x2, 0x18(%rbx)
leaq 0x1151(%rip), %rax      # 0xb9cd
leaq 0x1147(%rip), %rdx      # 0xb9ca
cmoveq %rax, %rdx
xorl %eax, %eax
callq 0x20f0
cltq
addq %rax, %r14
cmpq 0x120(%rbx), %r14
jae 0xa8ec
movq 0xf0(%rbx), %rax
movq 0x118(%rbx), %rsi
testq %rax, %rax
je 0xa8c0
movq 0xf8(%rbx), %rdx
movq %rsi, %rdi
movq %r14, %rsi
callq *%rax
jmp 0xa8ec
movq 0x108(%rbx), %rax
movq 0x110(%rbx), %rdi
subq %rdi, %rax
cmpq %r14, %rax
jb 0xa8ec
addq 0x100(%rbx), %rdi
movq %r14, %rdx
callq 0x2130
addq %r14, 0x110(%rbx)
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_output_read
size_t vterm_output_read(VTerm *vt, char *buffer, size_t len)
{
  if(len > vt->outbuffer_cur)
    len = vt->outbuffer_cur;

  memcpy(buffer, vt->outbuffer, len);

  if(len < vt->outbuffer_cur)
    memmove(vt->outbuffer, vt->outbuffer + len, vt->outbuffer_cur - len);

  vt->outbuffer_cur -= len;

  return len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %r14
movq 0x100(%rdi), %rsi
movq 0x110(%rdi), %rcx
cmpq %rdx, %rcx
cmovbq %rcx, %rbx
movq %rax, %rdi
movq %rbx, %rdx
callq 0x2130
movq 0x110(%r14), %rdx
subq %rbx, %rdx
jbe 0xa962
movq 0x100(%r14), %rdi
leaq (%rdi,%rbx), %rsi
callq 0x21b0
subq %rbx, 0x110(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/neovim[P]libvterm/src/vterm.c
// Function: vterm_copy_cells
void vterm_copy_cells(VTermRect dest,
    VTermRect src,
    void (*copycell)(VTermPos dest, VTermPos src, void *user),
    void *user)
{
  int downward  = src.start_row - dest.start_row;
  int rightward = src.start_col - dest.start_col;

  int init_row, test_row, init_col, test_col;
  int inc_row, inc_col;

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

  if(rightward < 0) {
    init_col = dest.end_col - 1;
    test_col = dest.start_col - 1;
    inc_col = -1;
  }
  else /* rightward >= 0 */ {
    init_col = dest.start_col;
    test_col = dest.end_col;
    inc_col = +1;
  }

  VTermPos pos;
  for(pos.row = init_row; pos.row != test_row; pos.row += inc_row)
    for(pos.col = init_col; pos.col != test_col; pos.col += inc_col) {
      VTermPos srcpos = { pos.row + downward, pos.col + rightward };
      (*copycell)(pos, srcpos, user);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r12
movq %rdi, %rax
shrq $0x20, %rax
movq %rsi, %r10
shrq $0x20, %r10
subl %edi, %edx
subl %esi, %r12d
leal -0x1(%rax), %ebx
leal -0x1(%rdi), %ebp
movq %rdx, 0x20(%rsp)
testl %edx, %edx
cmovnsl %eax, %ebp
cmovnsl %edi, %ebx
leal -0x1(%r10), %eax
testl %r12d, %r12d
cmovnsl %esi, %eax
movl %eax, 0xc(%rsp)
leal -0x1(%rsi), %r13d
cmovnsl %r10d, %r13d
movq %rbx, 0x10(%rsp)
movl %ebp, 0x1c(%rsp)
cmpl %ebp, %ebx
je 0xabd1
movq %r9, %r15
movq 0x20(%rsp), %rax
sarl $0x1f, %eax
orl $0x1, %eax
movl %eax, 0x18(%rsp)
movl %r12d, %ebx
sarl $0x1f, %ebx
orl $0x1, %ebx
cmpl %r13d, 0xc(%rsp)
je 0xabbd
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rdx
addl %edx, %eax
movq %rax, 0x30(%rsp)
movl %edx, %eax
movq %rax, 0x28(%rsp)
movl 0xc(%rsp), %eax
movl %eax, %r14d
leal (%r12,%r14), %esi
movq %r14, %rdi
shlq $0x20, %rdi
addq 0x28(%rsp), %rdi
shlq $0x20, %rsi
addq 0x30(%rsp), %rsi
movq %r15, %rdx
movq %r8, %rbp
callq *%r8
movq %rbp, %r8
addl %ebx, %r14d
cmpl %r14d, %r13d
jne 0xab90
movq 0x10(%rsp), %rax
addl 0x18(%rsp), %eax
movq %rax, 0x10(%rsp)
cmpl 0x1c(%rsp), %eax
jne 0xab6a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq