LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/common.c
// Function: ignore_signal
int ignore_signal(int signum)
{
	struct sigaction action;
	int ret;

	ret = sigaction(signum, NULL, &action);
	if (ret < 0)
		return -errno;
	action.sa_handler = SIG_IGN;
	ret = sigaction(signum, &action, NULL);
	if (ret < 0)
		return -errno;

	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebp
xorl %ebx, %ebx
movq %rsp, %rdx
xorl %esi, %esi
callq 0x1050
testl %eax, %eax
js 0x2063
movq %rsp, %rsi
movq $0x1, (%rsi)
movl %ebp, %edi
xorl %edx, %edx
callq 0x1050
testl %eax, %eax
jns 0x206c
callq 0x1040
xorl %ebx, %ebx
subl (%rax), %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/common.c
// Function: send_block
int send_block(int sd, const void *buff, unsigned int length)
{
	const unsigned char *bp = buff;
	unsigned int rest = length;
	ssize_t chunk;

	while (rest > 0) {
		chunk = send(sd, bp, rest, 0);
		if (chunk < 0) {
			if (errno == EINTR)
				continue;
			return -errno;
		}

		bp += chunk;
		rest -= chunk;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movl %edi, %ebp
xorl %ebx, %ebx
testl %r14d, %r14d
je 0x20bf
movl %r14d, %r14d
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x10a0
testq %rax, %rax
jns 0x20b3
callq 0x1040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x2091
jmp 0x20bb
addq %rax, %r15
subl %eax, %r14d
jmp 0x2089
negl %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/common.c
// Function: recv_block
int recv_block(int sd, void *buff, unsigned int length)
{
	unsigned int rest = length;
	unsigned char *bp = buff;
	ssize_t chunk;

	while (rest > 0) {
		chunk = recv(sd, bp, rest, MSG_WAITALL);
		if (chunk < 0) {
			if (errno == EINTR)
				continue;
			return -errno;
		}
		if (!chunk)
			return -EINVAL;

		bp += chunk;
		rest -= chunk;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movl %edi, %ebp
pushq $-0x16
popq %rbx
testl %r14d, %r14d
je 0x2126
movl %r14d, %r14d
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x1030
testq %rax, %rax
jns 0x210b
callq 0x1040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x20e6
jmp 0x2115
je 0x2119
addq %rax, %r15
subl %eax, %r14d
jmp 0x20de
negl %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x2119
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/common.c
// Function: ctrl_recv_msg
int ctrl_recv_msg(int sd, void *buff, unsigned int length)
{
	const struct __common_ctrl_header *hdr = buff;
	unsigned int rest = length;
	unsigned char *bp = buff;
	ssize_t chunk;

	while (rest > length - sizeof(*hdr)) {
		chunk = recv(sd, bp, rest, 0);
		if (chunk < 0) {
			if (errno == EINTR)
				continue;
			return -errno;
		}
		if (!chunk)
			return -EINVAL;

		bp += chunk;
		rest -= chunk;
	}

	if (ntohl(hdr->length) != length || ntohl(hdr->version) != CTRL_VERSION)
		return -EINVAL;

	while (rest > 0) {
		chunk = recv(sd, bp, rest, MSG_WAITALL);
		if (chunk < 0)
			return -errno;

		bp += chunk;
		rest -= chunk;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movl %edi, %ebx
movl %edx, %ebp
addq $-0x8, %rbp
movl %edx, %r12d
movq %rsi, (%rsp)
movl %r12d, %r13d
cmpq %r13, %rbp
jae 0x2196
movl %ebx, %edi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x1030
testq %rax, %rax
jns 0x2179
callq 0x1040
movl (%rax), %ecx
cmpl $0x4, %ecx
je 0x2157
jmp 0x2183
je 0x21d3
addq %rax, %r14
subl %eax, %r12d
jmp 0x214f
negl %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rcx
movl (%rcx), %eax
bswapl %eax
cmpl %r15d, %eax
jne 0x21d3
cmpl $0x1000000, 0x4(%rcx)   # imm = 0x1000000
pushq $-0x16
popq %rcx
jne 0x2185
testl %r12d, %r12d
je 0x21d8
movl %r12d, %edx
movl %ebx, %edi
movq %r14, %rsi
movl $0x100, %ecx            # imm = 0x100
callq 0x1030
testq %rax, %rax
js 0x21dc
addq %rax, %r14
subl %eax, %r12d
jmp 0x21af
pushq $-0x16
popq %rcx
jmp 0x2185
xorl %ecx, %ecx
jmp 0x2185
callq 0x1040
xorl %ecx, %ecx
subl (%rax), %ecx
jmp 0x2185
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/encoding.c
// Function: decode_table
static void decode_table(VTermEncoding *enc, void *data,
                         uint32_t cp[], int *cpi, int cplen,
                         const char bytes[], size_t *pos, size_t bytelen)
{
  struct StaticTableEncoding *table = (struct StaticTableEncoding *)enc;
  int is_gr = bytes[*pos] & 0x80;

  for(; *pos < bytelen && *cpi < cplen; (*pos)++) {
    unsigned char c = bytes[*pos] ^ is_gr;

    if(c < 0x20 || c == 0x7f || c >= 0x80)
      return;

    if(table->chars[c])
      cp[(*cpi)++] = table->chars[c];
    else
      cp[(*cpi)++] = c;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rsi
movq (%rsi), %r10
movb (%r9,%r10), %r11b
andb $-0x80, %r11b
cmpq %rax, %r10
jae 0x25b5
movslq (%rcx), %rbx
cmpl %r8d, %ebx
jge 0x25b5
movb (%r9,%r10), %r14b
xorb %r11b, %r14b
leal -0x20(%r14), %ebp
cmpb $0x5e, %bpl
ja 0x25b5
movzbl %r14b, %r14d
movl 0x10(%rdi,%r14,4), %ebp
leal 0x1(%rbx), %r15d
testl %ebp, %ebp
cmovel %r14d, %ebp
movl %r15d, (%rcx)
movl %ebp, (%rdx,%rbx,4)
incq %r10
movq %r10, (%rsi)
jmp 0x2576
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/encoding.c
// Function: decode_usascii
static void decode_usascii(VTermEncoding *enc, void *data,
                           uint32_t cp[], int *cpi, int cplen,
                           const char bytes[], size_t *pos, size_t bytelen)
{
  int is_gr = bytes[*pos] & 0x80;

  for(; *pos < bytelen && *cpi < cplen; (*pos)++) {
    unsigned char c = bytes[*pos] ^ is_gr;

    if(c < 0x20 || c == 0x7f || c >= 0x80)
      return;

    cp[(*cpi)++] = c;
  }
}

// Assembly:
pushq %rbp
pushq %rbx
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rsi
movq (%rsi), %rdi
movb (%r9,%rdi), %r10b
andb $-0x80, %r10b
cmpq %rax, %rdi
jae 0x2605
movslq (%rcx), %r11
cmpl %r8d, %r11d
jge 0x2605
movb (%r9,%rdi), %bl
xorb %r10b, %bl
leal -0x20(%rbx), %ebp
cmpb $0x5e, %bpl
ja 0x2605
movzbl %bl, %ebx
leal 0x1(%r11), %ebp
movl %ebp, (%rcx)
movl %ebx, (%rdx,%r11,4)
incq %rdi
movq %rdi, (%rsi)
jmp 0x25d3
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/mouse.c
// Function: vterm_mouse_move
void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod)
{
  VTermState *state = vt->state;

  if(col == state->mouse_col && row == state->mouse_row)
    return;

  state->mouse_col = col;
  state->mouse_row = row;

  if((state->mouse_flags & MOUSE_WANT_DRAG && state->mouse_buttons) ||
     (state->mouse_flags & MOUSE_WANT_MOVE)) {
    int button = state->mouse_buttons & 0x01 ? 1 :
                 state->mouse_buttons & 0x02 ? 2 :
                 state->mouse_buttons & 0x04 ? 3 : 4;
    output_mouse(state, button-1 + 0x20, 1, mod, col, row);
  }
}

// Assembly:
movl %edx, %r8d
movl %esi, %r9d
movq 0x128(%rdi), %rdi
cmpl %edx, 0x78(%rdi)
jne 0x297c
cmpl %r9d, 0x7c(%rdi)
je 0x29be
movl %r8d, 0x78(%rdi)
movl %r9d, 0x7c(%rdi)
movl 0x84(%rdi), %edx
testb $0x2, %dl
jne 0x299c
testb $0x4, %dl
je 0x29be
movl 0x80(%rdi), %eax
jmp 0x29a9
movl 0x80(%rdi), %eax
andl $0x4, %edx
orl %eax, %edx
je 0x29be
testb $0x1, %al
jne 0x29bf
testb $0x2, %al
jne 0x29c3
andl $0x4, %eax
xorl %esi, %esi
cmpl $0x1, %eax
adcl $0x22, %esi
jmp 0x29c6
retq
pushq $0x20
jmp 0x29c5
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
jmp 0x29cb
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/mouse.c
// Function: output_mouse
static void output_mouse(VTermState *state, int code, int pressed, int modifiers, int col, int row)
{
  modifiers <<= 2;

  switch(state->mouse_protocol) {
  case MOUSE_X10:
    if(col + 0x21 > 0xff)
      col = 0xff - 0x21;
    if(row + 0x21 > 0xff)
      row = 0xff - 0x21;

    if(!pressed)
      code = 3;

    vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "M%c%c%c",
        (code | modifiers) + 0x20, col + 0x21, row + 0x21);
    break;

  case MOUSE_UTF8:
    {
      char utf8[18]; size_t len = 0;

      if(!pressed)
        code = 3;

      len += fill_utf8((code | modifiers) + 0x20, utf8 + len);
      len += fill_utf8(col + 0x21, utf8 + len);
      len += fill_utf8(row + 0x21, utf8 + len);
      utf8[len] = 0;

      vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "M%s", utf8);
    }
    break;

  case MOUSE_SGR:
    vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "<%d;%d;%d%c",
        code | modifiers, col + 1, row + 1, pressed ? 'M' : 'm');
    break;

  case MOUSE_RXVT:
    if(!pressed)
      code = 3;

    vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "%d;%d;%dM",
        code | modifiers, col + 1, row + 1);
    break;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %esi, %eax
movl 0x88(%rdi), %esi
cmpq $0x3, %rsi
ja 0x2b22
movl %r9d, %ebp
movl %r8d, %ebx
movq %rdi, %r14
shll $0x2, %ecx
leaq 0x78c8(%rip), %rdi      # 0xa2c4
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
movl $0xde, %r9d
cmpl %r9d, %ebx
cmovgel %r9d, %ebx
cmpl %r9d, %ebp
cmovll %ebp, %r9d
testl %edx, %edx
pushq $0x3
popq %rdx
cmovel %edx, %eax
movq (%r14), %rdi
orl %ecx, %eax
addl $0x20, %eax
addl $0x21, %ebx
addl $0x21, %r9d
leaq 0x78b5(%rip), %rdx      # 0xa2ec
movl $0x9b, %esi
movl %eax, %ecx
movl %ebx, %r8d
jmp 0x2a9f
movq (%r14), %rdi
orl %eax, %ecx
incl %ebx
incl %ebp
xorl %eax, %eax
testl %edx, %edx
sete %al
shll $0x5, %eax
orl $0x4d, %eax
movl %eax, (%rsp)
leaq 0x7895(%rip), %rdx      # 0xa2f8
movl $0x9b, %esi
movl %ebx, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x9800
jmp 0x2b22
testl %edx, %edx
pushq $0x3
popq %rdx
cmovel %edx, %eax
movq (%r14), %rdi
orl %ecx, %eax
incl %ebx
incl %ebp
leaq 0x7872(%rip), %rdx      # 0xa304
movl $0x9b, %esi
movl %eax, %ecx
movl %ebx, %r8d
movl %ebp, %r9d
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9800
testl %edx, %edx
pushq $0x3
popq %rdx
cmovel %edx, %eax
orl %ecx, %eax
addl $0x20, %eax
movslq %eax, %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x2b98
movl %eax, %r12d
movl %eax, %eax
addl $0x21, %ebx
movslq %ebx, %rdi
leaq (%rsp,%rax), %rsi
addq $0x10, %rsi
callq 0x2b98
movl %eax, %ebx
addl %r12d, %ebx
addl $0x21, %ebp
movslq %ebp, %rdi
leaq (%rsp,%rbx), %rsi
addq $0x10, %rsi
callq 0x2b98
movl %eax, %eax
addq %rbx, %rax
movb $0x0, 0x10(%rsp,%rax)
movq (%r14), %rdi
leaq 0x77e1(%rip), %rdx      # 0xa2f4
movl $0x9b, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0x9800
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/mouse.c
// Function: vterm_mouse_button
void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod)
{
  VTermState *state = vt->state;

  int old_buttons = state->mouse_buttons;

  if(button > 0 && button <= 3) {
    if(pressed)
      state->mouse_buttons |= (1 << (button-1));
    else
      state->mouse_buttons &= ~(1 << (button-1));
  }

  /* Most of the time we don't get button releases from 4/5 */
  if(state->mouse_buttons == old_buttons && button < 4)
    return;

  if(!state->mouse_flags)
    return;

  if(button < 4) {
    output_mouse(state, button-1, pressed, mod, state->mouse_col, state->mouse_row);
  }
  else if(button < 8) {
    output_mouse(state, button-4 + 0x40, pressed, mod, state->mouse_col, state->mouse_row);
  }
}

// Assembly:
movq 0x128(%rdi), %rdi
movl 0x80(%rdi), %r8d
leal -0x1(%rsi), %eax
movl %r8d, %r9d
cmpl $0x2, %eax
ja 0x2b63
movl %r8d, %r10d
btsl %eax, %r10d
movl %r8d, %r9d
btrl %eax, %r9d
testb %dl, %dl
cmovnel %r10d, %r9d
movl %r9d, 0x80(%rdi)
cmpl $0x3, %esi
jg 0x2b6d
cmpl %r8d, %r9d
je 0x2b97
cmpl $0x0, 0x84(%rdi)
je 0x2b97
cmpl $0x4, %esi
jl 0x2b85
cmpl $0x7, %esi
ja 0x2b97
addl $0x3c, %esi
movl %esi, %eax
movzbl %dl, %edx
movl 0x78(%rdi), %r8d
movl 0x7c(%rdi), %r9d
movl %eax, %esi
jmp 0x29cb
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/utf8.h
// Function: fill_utf8
static int fill_utf8(long codepoint, char *str)
{
  int nbytes = utf8_seqlen(codepoint);

  // This is easier done backwards
  int b = nbytes;
  while(b > 1) {
    b--;
    str[b] = 0x80 | (codepoint & 0x3f);
    codepoint >>= 6;
  }

  switch(nbytes) {
    case 1: str[0] =        (codepoint & 0x7f); break;
    case 2: str[0] = 0xc0 | (codepoint & 0x1f); break;
    case 3: str[0] = 0xe0 | (codepoint & 0x0f); break;
    case 4: str[0] = 0xf0 | (codepoint & 0x07); break;
    case 5: str[0] = 0xf8 | (codepoint & 0x03); break;
    case 6: str[0] = 0xfc | (codepoint & 0x01); break;
  }

  return nbytes;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x489f
movl %eax, %eax
movq %rax, %rcx
cmpq $0x2, %rcx
jl 0x4911
movl %r14d, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, -0x1(%rbx,%rcx)
decq %rcx
shrq $0x6, %r14
jmp 0x48f5
leal -0x1(%rax), %ecx
leaq 0x5ce5(%rip), %rdx      # 0xa600
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
andb $0x7f, %r14b
jmp 0x495a
andb $0x3, %r14b
orb $-0x8, %r14b
jmp 0x495a
andb $0xf, %r14b
orb $-0x20, %r14b
jmp 0x495a
andb $0x7, %r14b
orb $-0x10, %r14b
jmp 0x495a
andb $0x1f, %r14b
orb $-0x40, %r14b
jmp 0x495a
andb $0x1, %r14b
orb $-0x4, %r14b
movb %r14b, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/parser.c
// Function: string_fragment
static void string_fragment(VTerm *vt, const char *str, size_t len, bool final)
{
  VTermStringFragment frag = {
    .str     = str,
    .len     = len,
    .initial = vt->parser.string_initial,
    .final   = final,
  };

  switch(vt->parser.state) {
    case OSC:
      if(vt->parser.callbacks && vt->parser.callbacks->osc)
        (*vt->parser.callbacks->osc)(vt->parser.v.osc.command, frag, vt->parser.cbdata);
      break;

    case DCS:
      if(vt->parser.callbacks && vt->parser.callbacks->dcs)
        (*vt->parser.callbacks->dcs)(vt->parser.v.dcs.command, vt->parser.v.dcs.commandlen, frag, vt->parser.cbdata);
      break;

    case APC:
      if(vt->parser.callbacks && vt->parser.callbacks->apc)
        (*vt->parser.callbacks->apc)(frag, vt->parser.cbdata);
      break;

    case PM:
      if(vt->parser.callbacks && vt->parser.callbacks->pm)
        (*vt->parser.callbacks->pm)(frag, vt->parser.cbdata);
      break;

    case SOS:
      if(vt->parser.callbacks && vt->parser.callbacks->sos)
        (*vt->parser.callbacks->sos)(frag, vt->parser.cbdata);
      break;

    case NORMAL:
    case CSI_LEADER:
    case CSI_ARGS:
    case CSI_INTERMED:
    case OSC_COMMAND:
    case DCS_COMMAND:
      break;
  }

  vt->parser.string_initial = false;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movl 0x20(%rdi), %esi
addl $-0x6, %esi
cmpl $0x4, %esi
ja 0x32dd
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
movzbl 0xe8(%rbx), %edi
shlq $0x1e, %rdi
orq %rdx, %rdi
shll $0x1f, %ecx
orq %rdi, %rcx
leaq 0x7132(%rip), %rdx      # 0xa35c
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x32dd
movq 0x20(%rdx), %r9
testq %r9, %r9
je 0x32dd
movl 0x40(%rbx), %edi
movq 0xe0(%rbx), %r8
movq %rax, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq *%r9
jmp 0x32dd
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x32dd
movq 0x40(%rdx), %r8
jmp 0x329c
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x32dd
movq 0x30(%rdx), %r8
jmp 0x329c
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x32dd
movq 0x38(%rdx), %r8
testq %r8, %r8
je 0x32dd
movq 0xe0(%rbx), %rdx
movq %rax, %rdi
movq %rcx, %rsi
callq *%r8
jmp 0x32dd
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x32dd
movq 0x28(%rdx), %r9
testq %r9, %r9
je 0x32dd
leaq 0x44(%rbx), %rdi
movslq 0x40(%rbx), %rsi
movq 0xe0(%rbx), %r8
movq %rax, %rdx
callq *%r9
movb $0x0, 0xe8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: vterm_state_newpen
INTERNAL void vterm_state_newpen(VTermState *state)
{
  // 90% grey so that pure white is brighter
  vterm_color_rgb(&state->default_fg, 240, 240, 240);
  vterm_color_rgb(&state->default_bg, 0, 0, 0);
  vterm_state_set_default_colors(state, &state->default_fg, &state->default_bg);

  for(int col = 0; col < 16; col++)
    lookup_default_colour_ansi(col, &state->colors[col]);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x140(%rdi), %rsi
movl $0xf0f0f000, %eax       # imm = 0xF0F0F000
movq %rax, 0x140(%rdi)
leaq 0x144(%rdi), %rdx
callq 0x21c0
leaq 0x71fc(%rip), %rax      # 0xa552
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x3386
movzwl -0x2(%rax), %edx
movb (%rax), %sil
movb $0x0, 0x148(%rbx,%rcx,4)
movw %dx, 0x149(%rbx,%rcx,4)
movb %sil, 0x14b(%rbx,%rcx,4)
incq %rcx
addq $0x3, %rax
jmp 0x3358
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: vterm_state_set_default_colors
void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg)
{
  if(default_fg) {
    state->default_fg = *default_fg;
    state->default_fg.type = (state->default_fg.type & ~VTERM_COLOR_DEFAULT_MASK)
                           | VTERM_COLOR_DEFAULT_FG;
  }

  if(default_bg) {
    state->default_bg = *default_bg;
    state->default_bg.type = (state->default_bg.type & ~VTERM_COLOR_DEFAULT_MASK)
                           | VTERM_COLOR_DEFAULT_BG;
  }
}

// Assembly:
testq %rsi, %rsi
je 0x339f
movl (%rsi), %eax
movl %eax, 0x140(%rdi)
andb $-0x7, %al
orb $0x2, %al
movb %al, 0x140(%rdi)
testq %rdx, %rdx
je 0x33b6
movl (%rdx), %eax
movl %eax, 0x144(%rdi)
andb $-0x7, %al
orb $0x4, %al
movb %al, 0x144(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: vterm_state_resetpen
INTERNAL void vterm_state_resetpen(VTermState *state)
{
  state->pen.bold = 0;      setpenattr_bool(state, VTERM_ATTR_BOLD, 0);
  state->pen.underline = 0; setpenattr_int (state, VTERM_ATTR_UNDERLINE, 0);
  state->pen.italic = 0;    setpenattr_bool(state, VTERM_ATTR_ITALIC, 0);
  state->pen.blink = 0;     setpenattr_bool(state, VTERM_ATTR_BLINK, 0);
  state->pen.reverse = 0;   setpenattr_bool(state, VTERM_ATTR_REVERSE, 0);
  state->pen.conceal = 0;   setpenattr_bool(state, VTERM_ATTR_CONCEAL, 0);
  state->pen.strike = 0;    setpenattr_bool(state, VTERM_ATTR_STRIKE, 0);
  state->pen.font = 0;      setpenattr_int (state, VTERM_ATTR_FONT, 0);
  state->pen.small = 0;     setpenattr_bool(state, VTERM_ATTR_SMALL, 0);
  state->pen.baseline = 0;  setpenattr_int (state, VTERM_ATTR_BASELINE, 0);

  state->pen.fg = state->default_fg;  setpenattr_col(state, VTERM_ATTR_FOREGROUND, state->default_fg);
  state->pen.bg = state->default_bg;  setpenattr_col(state, VTERM_ATTR_BACKGROUND, state->default_bg);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andb $-0x2, 0x13c(%rdi)
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x34ac
andb $-0x7, 0x13c(%rbx)
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34c4
andb $-0x9, 0x13c(%rbx)
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34ac
andb $-0x11, 0x13c(%rbx)
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34ac
andb $-0x21, 0x13c(%rbx)
pushq $0x5
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34ac
andb $-0x41, 0x13c(%rbx)
pushq $0x6
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34ac
andb $0x7f, 0x13c(%rbx)
pushq $0x7
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34ac
andb $-0x10, 0x13d(%rbx)
pushq $0x8
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34c4
andb $-0x11, 0x13d(%rbx)
pushq $0xb
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34ac
andb $-0x61, 0x13d(%rbx)
pushq $0xc
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34c4
movl 0x140(%rbx), %edx
movl %edx, 0x134(%rbx)
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x34dc
movl 0x144(%rbx), %edx
movl %edx, 0x138(%rbx)
pushq $0xa
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x34dc
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: vterm_state_savepen
INTERNAL void vterm_state_savepen(VTermState *state, int save)
{
  if(save) {
    state->saved.pen = state->pen;
  }
  else {
    state->pen = state->saved.pen;

    setpenattr_bool(state, VTERM_ATTR_BOLD,      state->pen.bold);
    setpenattr_int (state, VTERM_ATTR_UNDERLINE, state->pen.underline);
    setpenattr_bool(state, VTERM_ATTR_ITALIC,    state->pen.italic);
    setpenattr_bool(state, VTERM_ATTR_BLINK,     state->pen.blink);
    setpenattr_bool(state, VTERM_ATTR_REVERSE,   state->pen.reverse);
    setpenattr_bool(state, VTERM_ATTR_CONCEAL,   state->pen.conceal);
    setpenattr_bool(state, VTERM_ATTR_STRIKE,    state->pen.strike);
    setpenattr_int (state, VTERM_ATTR_FONT,      state->pen.font);
    setpenattr_bool(state, VTERM_ATTR_SMALL,     state->pen.small);
    setpenattr_int (state, VTERM_ATTR_BASELINE,  state->pen.baseline);

    setpenattr_col( state, VTERM_ATTR_FOREGROUND, state->pen.fg);
    setpenattr_col( state, VTERM_ATTR_BACKGROUND, state->pen.bg);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x3518
movl 0x13c(%rbx), %eax
movl %eax, 0x1a0(%rbx)
movq 0x134(%rbx), %rax
movq %rax, 0x198(%rbx)
popq %rbx
retq
movq 0x198(%rbx), %rax
movq %rax, 0x134(%rbx)
movl 0x1a0(%rbx), %edx
movl %edx, 0x13c(%rbx)
andl $0x1, %edx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x34ac
movl 0x13c(%rbx), %edx
shrl %edx
andl $0x3, %edx
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x34c4
movl 0x13c(%rbx), %edx
shrl $0x3, %edx
andl $0x1, %edx
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x34ac
movl 0x13c(%rbx), %edx
shrl $0x4, %edx
andl $0x1, %edx
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x34ac
movl 0x13c(%rbx), %edx
shrl $0x5, %edx
andl $0x1, %edx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x34ac
movl 0x13c(%rbx), %edx
shrl $0x6, %edx
andl $0x1, %edx
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x34ac
movl 0x13c(%rbx), %edx
shrl $0x7, %edx
andl $0x1, %edx
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x34ac
movzbl 0x13d(%rbx), %edx
andl $0xf, %edx
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x34c4
movl 0x13c(%rbx), %edx
shrl $0xc, %edx
andl $0x1, %edx
pushq $0xb
popq %rsi
movq %rbx, %rdi
callq 0x34ac
movl 0x13c(%rbx), %edx
shrl $0xd, %edx
andl $0x3, %edx
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0x34c4
movl 0x134(%rbx), %edx
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x34dc
movl 0x138(%rbx), %edx
pushq $0xa
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x34dc
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: vterm_color_is_equal
int vterm_color_is_equal(const VTermColor *a, const VTermColor *b)
{
  /* First make sure that the two colours are of the same type (RGB/Indexed) */
  if (a->type != b->type) {
    return false;
  }

  /* Depending on the type inspect the corresponding members */
  if (VTERM_COLOR_IS_INDEXED(a)) {
    return a->indexed.idx == b->indexed.idx;
  }
  else if (VTERM_COLOR_IS_RGB(a)) {
    return    (a->rgb.red   == b->rgb.red)
           && (a->rgb.green == b->rgb.green)
           && (a->rgb.blue  == b->rgb.blue);
  }

  return 0;
}

// Assembly:
movb (%rdi), %al
cmpb (%rsi), %al
jne 0x3660
movb 0x1(%rsi), %cl
cmpb %cl, 0x1(%rdi)
sete %cl
movl %ecx, %edx
notb %dl
orb %al, %dl
testb $0x1, %dl
je 0x364d
andb %cl, %al
jmp 0x3662
movb 0x2(%rdi), %al
cmpb 0x2(%rsi), %al
jne 0x3660
movb 0x3(%rdi), %al
cmpb 0x3(%rsi), %al
sete %al
jmp 0x3662
xorl %eax, %eax
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: lookup_colour_palette
static bool lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
{
  if(index >= 0 && index < 16) {
    // Normal 8 colours or high intensity - parse as palette 0
    return lookup_colour_ansi(state, index, col);
  }
  else if(index >= 16 && index < 232) {
    // 216-colour cube
    index -= 16;

    vterm_color_rgb(col, ramp6[index/6/6 % 6],
                         ramp6[index/6   % 6],
                         ramp6[index     % 6]);

    return true;
  }
  else if(index >= 232 && index < 256) {
    // 24 greyscales
    index -= 232;

    vterm_color_rgb(col, ramp24[index], ramp24[index], ramp24[index]);

    return true;
  }

  return false;
}

// Assembly:
cmpq $0xf, %rsi
ja 0x368c
movl 0x148(%rdi,%rsi,4), %eax
movl %eax, (%rdx)
retq
leaq -0x10(%rsi), %rax
cmpq $0xd7, %rax
ja 0x36d9
movzbl %al, %ecx
movb $0x24, %sil
movl %ecx, %eax
divb %sil
movzbl %al, %eax
leaq 0x6ed3(%rip), %rsi      # 0xa580
movb (%rsi,%rax,4), %dil
movb $0x6, %r8b
movl %ecx, %eax
divb %r8b
movzbl %ah, %ecx
movzbl %al, %eax
divb %r8b
movzbl %ah, %eax
movb (%rsi,%rax,4), %al
movb (%rsi,%rcx,4), %cl
movb $0x0, (%rdx)
movb %dil, 0x1(%rdx)
movb %al, 0x2(%rdx)
movb %cl, 0x3(%rdx)
retq
leaq -0xe8(%rsi), %rax
cmpq $0x17, %rax
ja 0x3700
leaq 0x6eb3(%rip), %rax      # 0xa5a0
movb -0x3a0(%rax,%rsi,4), %al
movb $0x0, (%rdx)
movb %al, 0x1(%rdx)
movb %al, 0x2(%rdx)
movb %al, 0x3(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: lookup_colour
static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col)
{
  switch(palette) {
  case 2: // RGB mode - 3 args contain colour values directly
    if(argcount < 3)
      return argcount;

    vterm_color_rgb(col, CSI_ARG(args[0]), CSI_ARG(args[1]), CSI_ARG(args[2]));

    return 3;

  case 5: // XTerm 256-colour mode
    if (!argcount || CSI_ARG_IS_MISSING(args[0])) {
      return argcount ? 1 : 0;
    }

    vterm_color_indexed(col, args[0]);

    return argcount ? 1 : 0;

  default:
    DEBUG_LOG("Unrecognised colour palette %d\n", palette);
    return 0;
  }
}

// Assembly:
cmpl $0x5, %edi
je 0x3b92
xorl %eax, %eax
cmpl $0x2, %edi
jne 0x3bb6
movl %edx, %eax
cmpl $0x3, %edx
jl 0x3bb6
movb (%rsi), %al
movb 0x8(%rsi), %dl
movb 0x10(%rsi), %sil
movb $0x0, (%rcx)
movb %al, 0x1(%rcx)
movb %dl, 0x2(%rcx)
movb %sil, 0x3(%rcx)
pushq $0x3
popq %rax
retq
testl %edx, %edx
je 0x3ba5
movq (%rsi), %rax
movl %eax, %esi
notl %esi
testl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
jne 0x3bad
xorl %eax, %eax
testl %edx, %edx
setne %al
retq
movb $0x1, (%rcx)
movb %al, 0x1(%rcx)
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: vterm_state_getpen
INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount)
{
  int argi = 0;

  if(state->pen.bold)
    args[argi++] = 1;

  if(state->pen.italic)
    args[argi++] = 3;

  if(state->pen.underline == VTERM_UNDERLINE_SINGLE)
    args[argi++] = 4;
  if(state->pen.underline == VTERM_UNDERLINE_CURLY)
    args[argi++] = 4 | CSI_ARG_FLAG_MORE, args[argi++] = 3;

  if(state->pen.blink)
    args[argi++] = 5;

  if(state->pen.reverse)
    args[argi++] = 7;

  if(state->pen.conceal)
    args[argi++] = 8;

  if(state->pen.strike)
    args[argi++] = 9;

  if(state->pen.font)
    args[argi++] = 10 + state->pen.font;

  if(state->pen.underline == VTERM_UNDERLINE_DOUBLE)
    args[argi++] = 21;

  argi = vterm_state_getpen_color(&state->pen.fg, argi, args, true);

  argi = vterm_state_getpen_color(&state->pen.bg, argi, args, false);

  if(state->pen.small) {
    if(state->pen.baseline == VTERM_BASELINE_RAISE)
      args[argi++] = 73;
    else if(state->pen.baseline == VTERM_BASELINE_LOWER)
      args[argi++] = 74;
  }

  return argi;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x13c(%rdi), %eax
testb $0x1, %al
jne 0x3bd0
xorl %esi, %esi
jmp 0x3be2
movq $0x1, (%rbx)
movzwl 0x13c(%r14), %eax
pushq $0x1
popq %rsi
testb $0x8, %al
je 0x3bfa
movl %esi, %eax
incl %esi
movq $0x3, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
movl %eax, %ecx
andl $0x6, %ecx
cmpw $0x2, %cx
jne 0x3c19
movl %esi, %eax
incl %esi
movq $0x4, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
movl %eax, %ecx
notl %ecx
testb $0x6, %cl
jne 0x3c41
movl %esi, %eax
movl $0x80000004, %ecx       # imm = 0x80000004
movq %rcx, (%rbx,%rax,8)
addl $0x2, %esi
movq $0x3, 0x8(%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb $0x10, %al
je 0x3c59
movl %esi, %eax
incl %esi
movq $0x5, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb $0x20, %al
je 0x3c71
movl %esi, %eax
incl %esi
movq $0x7, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb $0x40, %al
je 0x3c89
movl %esi, %eax
incl %esi
movq $0x8, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb %al, %al
jns 0x3ca1
movl %esi, %eax
incl %esi
movq $0x9, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
movzwl %ax, %ecx
shrl $0x8, %ecx
andw $0xf, %cx
je 0x3cc3
movzwl %cx, %eax
addl $0xa, %eax
movl %esi, %ecx
incl %esi
movq %rax, (%rbx,%rcx,8)
movzwl 0x13c(%r14), %eax
leaq 0x134(%r14), %rdi
andl $0x6, %eax
cmpw $0x4, %ax
jne 0x3cdf
movl %esi, %eax
incl %esi
movq $0x15, (%rbx,%rax,8)
pushq $0x1
popq %rcx
movq %rbx, %rdx
callq 0x3d33
leaq 0x138(%r14), %rdi
movl %eax, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x3d33
movzwl 0x13c(%r14), %ecx
btl $0xc, %ecx
jae 0x3d2b
shrl $0xd, %ecx
andl $0x3, %ecx
cmpl $0x1, %ecx
je 0x3d1f
cmpl $0x2, %ecx
jne 0x3d2b
pushq $0x4a
jmp 0x3d21
pushq $0x49
popq %rcx
movslq %eax, %rdx
incl %eax
movq %rcx, (%rbx,%rdx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/pen.c
// Function: vterm_state_getpen_color
static int vterm_state_getpen_color(const VTermColor *col, int argi, long args[], int fg)
{
    /* Do nothing if the given color is the default color */
    if (( fg && VTERM_COLOR_IS_DEFAULT_FG(col)) ||
        (!fg && VTERM_COLOR_IS_DEFAULT_BG(col))) {
        return argi;
    }

    /* Decide whether to send an indexed color or an RGB color */
    if (VTERM_COLOR_IS_INDEXED(col)) {
        const uint8_t idx = col->indexed.idx;
        if (idx < 8) {
            args[argi++] = (idx + (fg ? 30 : 40));
        }
        else if (idx < 16) {
            args[argi++] = (idx - 8 + (fg ? 90 : 100));
        }
        else {
            args[argi++] = CSI_ARG_FLAG_MORE | (fg ? 38 : 48);
            args[argi++] = CSI_ARG_FLAG_MORE | 5;
            args[argi++] = idx;
        }
    }
    else if (VTERM_COLOR_IS_RGB(col)) {
        args[argi++] = CSI_ARG_FLAG_MORE | (fg ? 38 : 48);
        args[argi++] = CSI_ARG_FLAG_MORE | 2;
        args[argi++] = CSI_ARG_FLAG_MORE | col->rgb.red;
        args[argi++] = CSI_ARG_FLAG_MORE | col->rgb.green;
        args[argi++] = col->rgb.blue;
    }
    return argi;
}

// Assembly:
movl %esi, %eax
movb (%rdi), %sil
testl %ecx, %ecx
je 0x3d43
testb $0x2, %sil
je 0x3d49
retq
testb $0x4, %sil
jne 0x3d42
testb $0x1, %sil
jne 0x3d9e
testl %ecx, %ecx
pushq $0x30
popq %rcx
pushq $0x26
popq %rsi
cmoveq %rcx, %rsi
btsq $0x1f, %rsi
movslq %eax, %rcx
movq %rsi, (%rdx,%rcx,8)
movl $0x80000000, %esi       # imm = 0x80000000
orq $0x2, %rsi
movq %rsi, 0x8(%rdx,%rcx,8)
movzbl 0x1(%rdi), %esi
btsq $0x1f, %rsi
movq %rsi, 0x10(%rdx,%rcx,8)
movzbl 0x2(%rdi), %esi
btsq $0x1f, %rsi
movq %rsi, 0x18(%rdx,%rcx,8)
movzbl 0x3(%rdi), %esi
addl $0x5, %eax
movq %rsi, 0x20(%rdx,%rcx,8)
retq
movzbl 0x1(%rdi), %esi
cmpl $0x7, %esi
ja 0x3daf
leal 0x1e(%rsi), %edi
addl $0x28, %esi
jmp 0x3dbb
cmpb $0xf, %sil
ja 0x3dca
leal 0x52(%rsi), %edi
addl $0x5c, %esi
testl %ecx, %ecx
cmovnel %edi, %esi
movslq %eax, %rcx
incl %eax
movq %rsi, (%rdx,%rcx,8)
retq
testl %ecx, %ecx
pushq $0x30
popq %rcx
pushq $0x26
popq %rdi
cmoveq %rcx, %rdi
btsq $0x1f, %rdi
movslq %eax, %rcx
movq %rdi, (%rdx,%rcx,8)
movl $0x80000000, %eax       # imm = 0x80000000
orq $0x5, %rax
movq %rax, 0x8(%rdx,%rcx,8)
leal 0x3(%rcx), %eax
movq %rsi, 0x10(%rdx,%rcx,8)
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_free
INTERNAL void vterm_screen_free(VTermScreen *screen)
{
  vterm_allocator_free(screen->vt, screen->buffers[BUFIDX_PRIMARY]);
  if(screen->buffers[BUFIDX_ALTSCREEN])
    vterm_allocator_free(screen->vt, screen->buffers[BUFIDX_ALTSCREEN]);

  vterm_allocator_free(screen->vt, screen->sb_buffer);

  vterm_allocator_free(screen->vt, screen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x60(%rbx), %rsi
callq 0x9663
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x3ee1
movq (%rbx), %rdi
callq 0x9663
movq (%rbx), %rdi
movq 0x78(%rbx), %rsi
callq 0x9663
movq (%rbx), %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x9663
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_reset
void vterm_screen_reset(VTermScreen *screen, int hard)
{
  screen->damaged.start_row = -1;
  screen->pending_scrollrect.start_row = -1;
  vterm_state_reset(screen->state, hard);
  vterm_screen_flush_damage(screen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
orl $-0x1, 0x28(%rdi)
orl $-0x1, 0x38(%rdi)
movq 0x8(%rdi), %rdi
callq 0x2100
movq %rbx, %rdi
popq %rbx
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_flush_damage
void vterm_screen_flush_damage(VTermScreen *screen)
{
  if(screen->pending_scrollrect.start_row != -1) {
    vterm_scroll_rect(screen->pending_scrollrect, screen->pending_scroll_downward, screen->pending_scroll_rightward,
        moverect_user, erase_user, screen);

    screen->pending_scrollrect.start_row = -1;
  }

  if(screen->damaged.start_row != -1) {
    if(screen->callbacks && screen->callbacks->damage)
      (*screen->callbacks->damage)(screen->damaged, screen->cbdata);

    screen->damaged.start_row = -1;
  }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $-0x1, 0x38(%rdi)
je 0x3f4e
movl 0x48(%rbx), %edx
movl 0x4c(%rbx), %ecx
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
movq %rbx, (%rsp)
leaq 0x5fc(%rip), %r8        # 0x453a
leaq 0x666(%rip), %r9        # 0x45ab
callq 0x2160
orl $-0x1, 0x38(%rbx)
cmpl $-0x1, 0x28(%rbx)
je 0x3f77
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x3f73
movq (%rax), %rax
testq %rax, %rax
je 0x3f73
movq 0x18(%rbx), %rdx
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq *%rax
orl $-0x1, 0x28(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/screen.c
// Function: getcell
static inline ScreenCell *getcell(const VTermScreen *screen, int row, int col)
{
  if(row < 0 || row >= screen->rows)
    return NULL;
  if(col < 0 || col >= screen->cols)
    return NULL;
  return screen->buffer + (screen->cols * row) + col;
}

// Assembly:
testl %esi, %esi
js 0x42f6
xorl %eax, %eax
testl %edx, %edx
js 0x42f5
cmpl %esi, 0x50(%rdi)
jle 0x42f5
movl 0x54(%rdi), %eax
cmpl %edx, %eax
jle 0x42f6
imull %esi, %eax
imulq $0x24, %rax, %rcx
addq 0x70(%rdi), %rcx
movl %edx, %eax
imulq $0x24, %rax, %rax
addq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_is_eol
int vterm_screen_is_eol(const VTermScreen *screen, VTermPos pos)
{
  /* This cell is EOL if this and every cell to the right is black */
  for(; pos.col < screen->cols; pos.col++) {
    ScreenCell *cell = getcell(screen, pos.row, pos.col);
    if(cell->chars[0] != 0)
      return 0;
  }

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %r15
shrq $0x20, %r15
movl 0x54(%rdi), %r12d
pushq $0x1
popq %rbp
cmpl %r12d, %r15d
jge 0x4331
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0x42cb
incl %r15d
cmpl $0x0, (%rax)
je 0x4315
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/screen.c
// Function: vterm_obtain_screen
VTermScreen *vterm_obtain_screen(VTerm *vt)
{
  if(vt->screen)
    return vt->screen;

  VTermScreen *screen = screen_new(vt);
  vt->screen = screen;

  return screen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x130(%rdi), %r14
testq %r14, %r14
jne 0x441d
movq %rdi, %rbx
callq 0x2140
testq %rax, %rax
je 0x4413
movq %rax, %r15
movl $0x90, %esi
movq %rbx, %rdi
callq 0x95f8
movq %rax, %r14
leaq 0xc(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
movq %rbx, (%r14)
movq %r15, 0x8(%r14)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x24(%r14)
orl $-0x1, 0x38(%r14)
movl (%r12), %esi
movl %esi, 0x50(%r14)
movl (%r13), %edx
movl %edx, 0x54(%r14)
andb $-0x4, 0x58(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movb $0x0, 0x20(%r14)
movq %r14, %rdi
callq 0x4497
movq %rax, 0x60(%r14)
movq %rax, 0x70(%r14)
movq (%r14), %rdi
movslq (%r13), %rax
imulq $0x28, %rax, %rsi
callq 0x95f8
movq %rax, 0x78(%r14)
movq 0x8(%r14), %rdi
leaq 0xad28(%rip), %rsi      # 0xf128
movq %r14, %rdx
callq 0x21b0
movq 0x8(%r14), %rdi
callq 0x2180
jmp 0x4416
xorl %r14d, %r14d
movq %r14, 0x130(%rbx)
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movslq %esi, %r14
movslq %edx, %r12
imulq $0x24, %r12, %r15
movq %r15, %rsi
imulq %r14, %rsi
callq 0x95f8
subq $-0x80, %rbx
xorl %ecx, %ecx
testl %r12d, %r12d
cmovlel %ecx, %r12d
testl %r14d, %r14d
cmovlel %ecx, %r14d
movq %rax, %rdx
addq $0x18, %rdx
imulq $0x24, %r12, %rsi
cmpq %r14, %rcx
je 0x4509
xorl %edi, %edi
cmpq %rdi, %rsi
je 0x4501
andl $0x0, -0x18(%rdx,%rdi)
movq (%rbx), %r8
movq %r8, (%rdx,%rdi)
movl 0x8(%rbx), %r8d
movl %r8d, 0x8(%rdx,%rdi)
addq $0x24, %rdi
jmp 0x44e1
incq %rcx
addq %r15, %rdx
jmp 0x44da
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4590
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x4590
movq %rcx, %r12
movq %rdx, %r13
cmpl $0x3, 0x24(%rbx)
je 0x457a
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 0x459e
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5178
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r13
shrq $0x20, %r13
movq %rdi, 0x10(%rsp)
movl %r15d, %esi
movl %r13d, %edx
callq 0x42cb
movq %rax, %rbp
movl %r15d, (%r14)
leal 0x1(%r15), %eax
movl %eax, 0x4(%r14)
cmpl $0x0, 0x8(%r14)
jns 0x4622
andl $0x0, 0x8(%r14)
cmpl $0x0, 0xc(%r14)
jns 0x4635
movq 0x10(%rsp), %rax
movl 0x54(%rax), %eax
movl %eax, 0xc(%r14)
movl %r13d, %ebx
movl %ebx, %r12d
cmpl 0x8(%r14), %ebx
jle 0x4668
leal -0x1(%r12), %ebx
movq 0x10(%rsp), %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x42cb
movl 0xc(%rsp), %edi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x46b2
testl %eax, %eax
je 0x4638
movl %r12d, 0x8(%r14)
movl %r13d, %ebx
leal 0x1(%rbx), %r13d
cmpl 0xc(%r14), %r13d
jge 0x469c
movq 0x10(%rsp), %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x42cb
movl 0xc(%rsp), %edi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x46b2
testl %eax, %eax
je 0x466c
movl %ebx, 0xc(%r14)
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebp
pushq $0x1
popq %rbx
testb $0x1, %bpl
je 0x46da
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testb $0x1, %al
jne 0x47bf
testb $0x2, %bpl
je 0x46f0
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testb $0x6, %al
jne 0x47bf
testb $0x4, %bpl
je 0x4706
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testb $0x8, %al
jne 0x47bf
testb $0x8, %bpl
je 0x471c
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testb $0x10, %al
jne 0x47bf
testb $0x10, %bpl
je 0x4732
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testb $0x20, %al
jne 0x47bf
btl $0x9, %ebp
jae 0x4744
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testb $0x40, %al
jne 0x47bf
testb $0x20, %bpl
je 0x4754
movb 0x20(%r15), %al
xorb 0x20(%r14), %al
js 0x47bf
testb $0x40, %bpl
je 0x4768
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testw $0xf00, %ax             # imm = 0xF00
jne 0x47bf
testb %bpl, %bpl
jns 0x477e
leaq 0x18(%r14), %rdi
leaq 0x18(%r15), %rsi
callq 0x20b0
testl %eax, %eax
je 0x47bf
btl $0x8, %ebp
jae 0x4795
leaq 0x1c(%r14), %rdi
leaq 0x1c(%r15), %rsi
callq 0x20b0
testl %eax, %eax
je 0x47bf
btl $0xa, %ebp
jae 0x47a9
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
btl $0xc, %eax
jb 0x47bf
btl $0xb, %ebp
jae 0x47bd
movl 0x20(%r15), %eax
xorl 0x20(%r14), %eax
testw $0x6000, %ax            # imm = 0x6000
jne 0x47bf
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x480d
testb $0x2, 0x80(%rbx)
je 0x480d
movl (%r15), %eax
movl %eax, 0x80(%rbx)
andb $-0x7, %al
orb $0x2, %al
movb %al, 0x80(%rbx)
testq %r14, %r14
je 0x482e
testb $0x4, 0x84(%rbx)
je 0x482e
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 0x4853
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x484d
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4853
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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:
xorl %eax, %eax
cmpl 0x50(%rdi), %eax
jge 0x489e
xorl %ecx, %ecx
movl 0x54(%rdi), %edx
cmpl %edx, %ecx
jge 0x489a
imull %eax, %edx
addl %ecx, %edx
movslq %edx, %rdx
imulq $0x24, %rdx, %rdx
addq %rsi, %rdx
addq $0x18, %rdx
testb $0x2, (%rdx)
je 0x4885
movl 0x80(%rdi), %r8d
movl %r8d, (%rdx)
testb $0x4, 0x4(%rdx)
je 0x4896
movl 0x84(%rdi), %r8d
movl %r8d, 0x4(%rdx)
incl %ecx
jmp 0x485c
incl %eax
jmp 0x4855
retq
// File: /workspace/github_c_makefile_star2_O2/neovim[P]libvterm/src/utf8.h
// Function: utf8_seqlen
static inline unsigned int utf8_seqlen(long codepoint)
{
  if(codepoint < 0x0000080) return 1;
  if(codepoint < 0x0000800) return 2;
  if(codepoint < 0x0010000) return 3;
  if(codepoint < 0x0200000) return 4;
  if(codepoint < 0x4000000) return 5;
  return 6;
}

// Assembly:
cmpq $0x80, %rdi
jge 0x48ac
pushq $0x1
jmp 0x48d1
cmpq $0x800, %rdi            # imm = 0x800
jae 0x48b9
pushq $0x2
jmp 0x48d1
cmpq $0x10000, %rdi          # imm = 0x10000
jae 0x48c6
pushq $0x3
jmp 0x48d1
cmpq $0x200000, %rdi         # imm = 0x200000
jae 0x48d3
pushq $0x4
popq %rax
retq
cmpq $0x4000000, %rdi        # imm = 0x4000000
pushq $0x6
popq %rax
sbbl $0x0, %eax
retq