// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/src/state.c
// Function: vterm_state_set_termprop
int vterm_state_set_termprop(VTermState *state, VTermProp prop, VTermValue *val)
{
  /* Only store the new value of the property if usercode said it was happy.
   * This is especially important for altscreen switching */
  if(state->callbacks && state->callbacks->settermprop)
    if(!(*state->callbacks->settermprop)(prop, val, state->cbdata))
      return 0;

  switch(prop) {
  case VTERM_PROP_TITLE:
  case VTERM_PROP_ICONNAME:
    // we don't store these, just transparently pass through
    return 1;
  case VTERM_PROP_CURSORVISIBLE:
    state->mode.cursor_visible = val->boolean;
    return 1;
  case VTERM_PROP_CURSORBLINK:
    state->mode.cursor_blink = val->boolean;
    return 1;
  case VTERM_PROP_CURSORSHAPE:
    state->mode.cursor_shape = val->number;
    return 1;
  case VTERM_PROP_REVERSE:
    state->mode.screen = val->boolean;
    return 1;
  case VTERM_PROP_ALTSCREEN:
    state->mode.alt_screen = val->boolean;
    state->lineinfo = state->lineinfos[state->mode.alt_screen ? BUFIDX_ALTSCREEN : BUFIDX_PRIMARY];
    if(state->mode.alt_screen) {
      VTermRect rect = {
        .start_row = 0,
        .start_col = 0,
        .end_row = state->rows,
        .end_col = state->cols,
      };
      erase(state, rect, 0);
    }
    return 1;
  case VTERM_PROP_MOUSE:
    state->mouse_flags = 0;
    if(val->number)
      state->mouse_flags |= MOUSE_WANT_CLICK;
    if(val->number == VTERM_PROP_MOUSE_DRAG)
      state->mouse_flags |= MOUSE_WANT_DRAG;
    if(val->number == VTERM_PROP_MOUSE_MOVE)
      state->mouse_flags |= MOUSE_WANT_MOVE;
    return 1;
  case VTERM_PROP_FOCUSREPORT:
    state->mode.report_focus = val->boolean;
    return 1;

  case VTERM_N_PROPS:
    return 0;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xa70d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x38(%rax)
je 0xa70d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
movl -0x14(%rbp), %edi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rdx
callq *%rax
cmpl $0x0, %eax
jne 0xa70b
movl $0x0, -0x4(%rbp)
jmp 0xa988
jmp 0xa70d
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x9, %eax
ja 0xa981
movq -0x38(%rbp), %rax
leaq 0x8c78(%rip), %rcx      # 0x133a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, -0x4(%rbp)
jmp 0xa988
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw 0xac(%rax), %cx
andw $0x1, %dx
shlw $0x5, %dx
andw $-0x21, %cx
orw %dx, %cx
movw %cx, 0xac(%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa988
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw 0xac(%rax), %cx
andw $0x1, %dx
shlw $0x6, %dx
andw $-0x41, %cx
orw %dx, %cx
movw %cx, 0xac(%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa988
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw 0xac(%rax), %cx
andw $0x3, %dx
shlw $0x7, %dx
andw $0xfe7f, %cx            # imm = 0xFE7F
orw %dx, %cx
movw %cx, 0xac(%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa988
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw 0xac(%rax), %cx
andw $0x1, %dx
shlw $0xb, %dx
andw $0xf7ff, %cx            # imm = 0xF7FF
orw %dx, %cx
movw %cx, 0xac(%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa988
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw 0xac(%rax), %cx
andw $0x1, %dx
shlw $0x9, %dx
andw $0xfdff, %cx            # imm = 0xFDFF
orw %dx, %cx
movw %cx, 0xac(%rax)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movw 0xac(%rcx), %cx
shrw $0x9, %cx
andw $0x1, %cx
movzwl %cx, %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
movslq %ecx, %rcx
movq 0x60(%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
movw 0xac(%rax), %ax
shrw $0x9, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xa8cd
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0xa480
movl $0x1, -0x4(%rbp)
jmp 0xa988
movq -0x10(%rbp), %rax
movl $0x0, 0x84(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0xa903
movq -0x10(%rbp), %rax
movl 0x84(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x84(%rax)
movq -0x20(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xa91f
movq -0x10(%rbp), %rax
movl 0x84(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x84(%rax)
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
jne 0xa93b
movq -0x10(%rbp), %rax
movl 0x84(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x84(%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa988
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movw %cx, %dx
movw 0xac(%rax), %cx
andw $0x1, %dx
shlw $0xe, %dx
andw $0xbfff, %cx            # imm = 0xBFFF
orw %dx, %cx
movw %cx, 0xac(%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa988
movl $0x0, -0x4(%rbp)
jmp 0xa988
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)