// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/src/state.c
// Function: vterm_state_new
static VTermState *vterm_state_new(VTerm *vt)
{
  VTermState *state = vterm_allocator_malloc(vt, sizeof(VTermState));

  state->vt = vt;

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

  state->mouse_col     = 0;
  state->mouse_row     = 0;
  state->mouse_buttons = 0;

  state->mouse_protocol = MOUSE_X10;

  state->callbacks = NULL;
  state->cbdata    = NULL;
  state->callbacks_has_premove = false;

  state->selection.callbacks = NULL;
  state->selection.user      = NULL;
  state->selection.buffer    = NULL;

  vterm_state_newpen(state);

  state->bold_is_highbright = 0;

  state->combine_chars_size = 16;
  state->combine_chars = vterm_allocator_malloc(state->vt, state->combine_chars_size * sizeof(state->combine_chars[0]));

  state->tabstops = vterm_allocator_malloc(state->vt, (state->cols + 7) / 8);

  state->lineinfos[BUFIDX_PRIMARY]   = vterm_allocator_malloc(state->vt, state->rows * sizeof(VTermLineInfo));
  /* TODO: Make an 'enable' function */
  state->lineinfos[BUFIDX_ALTSCREEN] = vterm_allocator_malloc(state->vt, state->rows * sizeof(VTermLineInfo));
  state->lineinfo = state->lineinfos[BUFIDX_PRIMARY];

  state->encoding_utf8.enc = vterm_lookup_encoding(ENC_UTF8, 'u');
  if(*state->encoding_utf8.enc->init)
    (*state->encoding_utf8.enc->init)(state->encoding_utf8.enc, state->encoding_utf8.data);

  return state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1d8, %esi            # imm = 0x1D8
callq 0x11a20
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x78(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x7c(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x80(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x88(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1b8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1c0(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1c8(%rax)
movq -0x10(%rbp), %rdi
callq 0x44e0
movq -0x10(%rbp), %rax
movl $0x0, 0x188(%rax)
movq -0x10(%rbp), %rax
movq $0x10, 0x98(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rsi
shlq $0x2, %rsi
callq 0x11a20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x34(%rax), %eax
addl $0x7, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movslq %eax, %rsi
callq 0x11a20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x30(%rax), %rsi
shlq $0x2, %rsi
callq 0x11a20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x30(%rax), %rsi
shlq $0x2, %rsi
callq 0x11a20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
xorl %edi, %edi
movl $0x75, %esi
callq 0x2140
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x110(%rax)
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rax
cmpq $0x0, (%rax)
je 0x9eea
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x110(%rcx), %rdi
movq -0x10(%rbp), %rsi
addq $0x110, %rsi            # imm = 0x110
addq $0x8, %rsi
callq *%rax
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)