// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/src/pen.c
// Function: vterm_state_setpen
INTERNAL void vterm_state_setpen(VTermState *state, const long args[], int argcount)
{
  // SGR - ECMA-48 8.3.117

  int argi = 0;
  int value;

  while(argi < argcount) {
    // This logic is easier to do 'done' backwards; set it true, and make it
    // false again in the 'default' case
    int done = 1;

    long arg;
    switch(arg = CSI_ARG(args[argi])) {
    case CSI_ARG_MISSING:
    case 0: // Reset
      vterm_state_resetpen(state);
      break;

    case 1: { // Bold on
      const VTermColor *fg = &state->pen.fg;
      state->pen.bold = 1;
      setpenattr_bool(state, VTERM_ATTR_BOLD, 1);
      if(!VTERM_COLOR_IS_DEFAULT_FG(fg) && VTERM_COLOR_IS_INDEXED(fg) && fg->indexed.idx < 8 && state->bold_is_highbright)
        set_pen_col_ansi(state, VTERM_ATTR_FOREGROUND, fg->indexed.idx + (state->pen.bold ? 8 : 0));
      break;
    }

    case 3: // Italic on
      state->pen.italic = 1;
      setpenattr_bool(state, VTERM_ATTR_ITALIC, 1);
      break;

    case 4: // Underline
      state->pen.underline = VTERM_UNDERLINE_SINGLE;
      if(CSI_ARG_HAS_MORE(args[argi])) {
        argi++;
        switch(CSI_ARG(args[argi])) {
          case 0:
            state->pen.underline = 0;
            break;
          case 1:
            state->pen.underline = VTERM_UNDERLINE_SINGLE;
            break;
          case 2:
            state->pen.underline = VTERM_UNDERLINE_DOUBLE;
            break;
          case 3:
            state->pen.underline = VTERM_UNDERLINE_CURLY;
            break;
        }
      }
      setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
      break;

    case 5: // Blink
      state->pen.blink = 1;
      setpenattr_bool(state, VTERM_ATTR_BLINK, 1);
      break;

    case 7: // Reverse on
      state->pen.reverse = 1;
      setpenattr_bool(state, VTERM_ATTR_REVERSE, 1);
      break;

    case 8: // Conceal on
      state->pen.conceal = 1;
      setpenattr_bool(state, VTERM_ATTR_CONCEAL, 1);
      break;

    case 9: // Strikethrough on
      state->pen.strike = 1;
      setpenattr_bool(state, VTERM_ATTR_STRIKE, 1);
      break;

    case 10: case 11: case 12: case 13: case 14:
    case 15: case 16: case 17: case 18: case 19: // Select font
      state->pen.font = CSI_ARG(args[argi]) - 10;
      setpenattr_int(state, VTERM_ATTR_FONT, state->pen.font);
      break;

    case 21: // Underline double
      state->pen.underline = VTERM_UNDERLINE_DOUBLE;
      setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
      break;

    case 22: // Bold off
      state->pen.bold = 0;
      setpenattr_bool(state, VTERM_ATTR_BOLD, 0);
      break;

    case 23: // Italic and Gothic (currently unsupported) off
      state->pen.italic = 0;
      setpenattr_bool(state, VTERM_ATTR_ITALIC, 0);
      break;

    case 24: // Underline off
      state->pen.underline = 0;
      setpenattr_int(state, VTERM_ATTR_UNDERLINE, 0);
      break;

    case 25: // Blink off
      state->pen.blink = 0;
      setpenattr_bool(state, VTERM_ATTR_BLINK, 0);
      break;

    case 27: // Reverse off
      state->pen.reverse = 0;
      setpenattr_bool(state, VTERM_ATTR_REVERSE, 0);
      break;

    case 28: // Conceal off (Reveal)
      state->pen.conceal = 0;
      setpenattr_bool(state, VTERM_ATTR_CONCEAL, 0);
      break;

    case 29: // Strikethrough off
      state->pen.strike = 0;
      setpenattr_bool(state, VTERM_ATTR_STRIKE, 0);
      break;

    case 30: case 31: case 32: case 33:
    case 34: case 35: case 36: case 37: // Foreground colour palette
      value = CSI_ARG(args[argi]) - 30;
      if(state->pen.bold && state->bold_is_highbright)
        value += 8;
      set_pen_col_ansi(state, VTERM_ATTR_FOREGROUND, value);
      break;

    case 38: // Foreground colour alternative palette
      if(argcount - argi < 1)
        return;
      argi += 1 + lookup_colour(state, CSI_ARG(args[argi+1]), args+argi+2, argcount-argi-2, &state->pen.fg);
      setpenattr_col(state, VTERM_ATTR_FOREGROUND, state->pen.fg);
      break;

    case 39: // Foreground colour default
      state->pen.fg = state->default_fg;
      setpenattr_col(state, VTERM_ATTR_FOREGROUND, state->pen.fg);
      break;

    case 40: case 41: case 42: case 43:
    case 44: case 45: case 46: case 47: // Background colour palette
      value = CSI_ARG(args[argi]) - 40;
      set_pen_col_ansi(state, VTERM_ATTR_BACKGROUND, value);
      break;

    case 48: // Background colour alternative palette
      if(argcount - argi < 1)
        return;
      argi += 1 + lookup_colour(state, CSI_ARG(args[argi+1]), args+argi+2, argcount-argi-2, &state->pen.bg);
      setpenattr_col(state, VTERM_ATTR_BACKGROUND, state->pen.bg);
      break;

    case 49: // Default background
      state->pen.bg = state->default_bg;
      setpenattr_col(state, VTERM_ATTR_BACKGROUND, state->pen.bg);
      break;

    case 73: // Superscript
    case 74: // Subscript
    case 75: // Superscript/subscript off
      state->pen.small = (arg != 75);
      state->pen.baseline =
        (arg == 73) ? VTERM_BASELINE_RAISE :
        (arg == 74) ? VTERM_BASELINE_LOWER :
                      VTERM_BASELINE_NORMAL;
      setpenattr_bool(state, VTERM_ATTR_SMALL,    state->pen.small);
      setpenattr_int (state, VTERM_ATTR_BASELINE, state->pen.baseline);
      break;

    case 90: case 91: case 92: case 93:
    case 94: case 95: case 96: case 97: // Foreground colour high-intensity palette
      value = CSI_ARG(args[argi]) - 90 + 8;
      set_pen_col_ansi(state, VTERM_ATTR_FOREGROUND, value);
      break;

    case 100: case 101: case 102: case 103:
    case 104: case 105: case 106: case 107: // Background colour high-intensity palette
      value = CSI_ARG(args[argi]) - 100 + 8;
      set_pen_col_ansi(state, VTERM_ATTR_BACKGROUND, value);
      break;

    default:
      done = 0;
      break;
    }

    if(!done)
      DEBUG_LOG("libvterm: Unhandled CSI SGR %ld\n", arg);

    while(CSI_ARG_HAS_MORE(args[argi++]));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x590c
movl $0x1, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x38(%rbp)
movq %rax, -0x28(%rbp)
je 0x50f9
jmp 0x4f3f
movq -0x38(%rbp), %rax
subq $0x1, %rax
je 0x5107
jmp 0x4f4f
movq -0x38(%rbp), %rax
subq $0x3, %rax
je 0x51b6
jmp 0x4f5f
movq -0x38(%rbp), %rax
subq $0x4, %rax
je 0x51e8
jmp 0x4f6f
movq -0x38(%rbp), %rax
subq $0x5, %rax
je 0x52f5
jmp 0x4f7f
movq -0x38(%rbp), %rax
subq $0x7, %rax
je 0x5327
jmp 0x4f8f
movq -0x38(%rbp), %rax
subq $0x8, %rax
je 0x5359
jmp 0x4f9f
movq -0x38(%rbp), %rax
subq $0x9, %rax
je 0x538b
jmp 0x4faf
movq -0x38(%rbp), %rax
addq $-0xa, %rax
subq $0xa, %rax
jb 0x53bf
jmp 0x4fc3
movq -0x38(%rbp), %rax
subq $0x15, %rax
je 0x5425
jmp 0x4fd3
movq -0x38(%rbp), %rax
subq $0x16, %rax
je 0x5467
jmp 0x4fe3
movq -0x38(%rbp), %rax
subq $0x17, %rax
je 0x5496
jmp 0x4ff3
movq -0x38(%rbp), %rax
subq $0x18, %rax
je 0x54c5
jmp 0x5003
movq -0x38(%rbp), %rax
subq $0x19, %rax
je 0x54f4
jmp 0x5013
movq -0x38(%rbp), %rax
subq $0x1b, %rax
je 0x5523
jmp 0x5023
movq -0x38(%rbp), %rax
subq $0x1c, %rax
je 0x5552
jmp 0x5033
movq -0x38(%rbp), %rax
subq $0x1d, %rax
je 0x5581
jmp 0x5043
movq -0x38(%rbp), %rax
addq $-0x1e, %rax
subq $0x8, %rax
jb 0x55b1
jmp 0x5057
movq -0x38(%rbp), %rax
subq $0x26, %rax
je 0x560e
jmp 0x5067
movq -0x38(%rbp), %rax
subq $0x27, %rax
je 0x568d
jmp 0x5077
movq -0x38(%rbp), %rax
addq $-0x28, %rax
subq $0x8, %rax
jb 0x56be
jmp 0x508b
movq -0x38(%rbp), %rax
subq $0x30, %rax
je 0x56ee
jmp 0x509b
movq -0x38(%rbp), %rax
subq $0x31, %rax
je 0x5771
jmp 0x50ab
movq -0x38(%rbp), %rax
addq $-0x49, %rax
subq $0x3, %rax
jb 0x57a2
jmp 0x50bf
movq -0x38(%rbp), %rax
addq $-0x5a, %rax
subq $0x8, %rax
jb 0x586c
jmp 0x50d3
movq -0x38(%rbp), %rax
addq $-0x64, %rax
subq $0x8, %rax
jb 0x589d
jmp 0x50e7
movq -0x38(%rbp), %rax
subq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jne 0x58ce
jmp 0x50f9
movq -0x8(%rbp), %rdi
callq 0x46b0
jmp 0x58d5
movq -0x8(%rbp), %rax
addq $0x134, %rax            # imm = 0x134
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x2, %cx
orw $0x1, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x48d0
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x51b1
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x51b1
movq -0x30(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x8, %eax
jge 0x51b1
movq -0x8(%rbp), %rax
cmpl $0x0, 0x188(%rax)
je 0x51b1
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x1(%rax), %eax
movq -0x8(%rbp), %rcx
movw 0x13c(%rcx), %cx
andw $0x1, %cx
movzwl %cx, %esi
xorl %ecx, %ecx
movl $0x8, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
addl %ecx, %eax
movslq %eax, %rdx
movl $0x9, %esi
callq 0x5920
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x9, %cx
orw $0x8, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x7, %cx
orw $0x2, %cx
movw %cx, 0x13c(%rax)
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movabsq $0x80000000, %rax       # imm = 0x80000000
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
je 0x52cd
movl -0x18(%rbp), %eax
incl %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x40(%rbp)
subq $0x3, %rax
ja 0x52cb
movq -0x40(%rbp), %rax
leaq 0xe04c(%rip), %rcx      # 0x132a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x7, %cx
orw $0x0, %cx
movw %cx, 0x13c(%rax)
jmp 0x52cb
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x7, %cx
orw $0x2, %cx
movw %cx, 0x13c(%rax)
jmp 0x52cb
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x7, %cx
orw $0x4, %cx
movw %cx, 0x13c(%rax)
jmp 0x52cb
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x7, %cx
orw $0x6, %cx
movw %cx, 0x13c(%rax)
jmp 0x52cd
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw %ax
andw $0x3, %ax
movzwl %ax, %edx
movl $0x2, %esi
callq 0x4910
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x11, %cx
orw $0x10, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x21, %cx
orw $0x20, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x41, %cx
orw $0x40, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x6, %esi
movl $0x1, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $0xff7f, %cx            # imm = 0xFF7F
orw $0x80, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x7, %esi
movl $0x1, %edx
callq 0x48d0
jmp 0x58d5
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
subq $0xa, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movw %cx, %dx
movw 0x13c(%rax), %cx
andw $0xf, %dx
shlw $0x8, %dx
andw $0xf0ff, %cx            # imm = 0xF0FF
orw %dx, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x8, %ax
andw $0xf, %ax
movzwl %ax, %edx
movl $0x8, %esi
callq 0x4910
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x7, %cx
orw $0x4, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw %ax
andw $0x3, %ax
movzwl %ax, %edx
movl $0x2, %esi
callq 0x4910
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x2, %cx
orw $0x0, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x9, %cx
orw $0x0, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x7, %cx
orw $0x0, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x4910
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x11, %cx
orw $0x0, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x21, %cx
orw $0x0, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
xorl %edx, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $-0x41, %cx
orw $0x0, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x6, %esi
xorl %edx, %edx
callq 0x48d0
jmp 0x58d5
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %cx
andw $0xff7f, %cx            # imm = 0xFF7F
orw $0x0, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movl $0x7, %esi
xorl %edx, %edx
callq 0x48d0
jmp 0x58d5
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
subq $0x1e, %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x55f7
movq -0x8(%rbp), %rax
cmpl $0x0, 0x188(%rax)
je 0x55f7
movl -0x1c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rdx
movl $0x9, %esi
callq 0x5920
jmp 0x58d5
movl -0x14(%rbp), %eax
subl -0x18(%rbp), %eax
cmpl $0x1, %eax
jge 0x561e
jmp 0x590c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %esi
movq -0x10(%rbp), %rdx
movslq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
addq $0x10, %rdx
movl -0x14(%rbp), %ecx
subl -0x18(%rbp), %ecx
subl $0x2, %ecx
movq -0x8(%rbp), %r8
addq $0x134, %r8             # imm = 0x134
callq 0x5990
addl $0x1, %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x134(%rax), %edx
movl $0x9, %esi
callq 0x4950
jmp 0x58d5
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x140(%rcx), %ecx
movl %ecx, 0x134(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x134(%rax), %edx
movl $0x9, %esi
callq 0x4950
jmp 0x58d5
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
subq $0x28, %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rdx
movl $0xa, %esi
callq 0x5920
jmp 0x58d5
movl -0x14(%rbp), %eax
subl -0x18(%rbp), %eax
cmpl $0x1, %eax
jge 0x56fe
jmp 0x590c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %esi
movq -0x10(%rbp), %rdx
movslq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
addq $0x10, %rdx
movl -0x14(%rbp), %ecx
subl -0x18(%rbp), %ecx
subl $0x2, %ecx
movq -0x8(%rbp), %r8
addq $0x134, %r8             # imm = 0x134
addq $0x4, %r8
callq 0x5990
addl $0x1, %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x138(%rax), %edx
movl $0xa, %esi
callq 0x4950
jmp 0x58d5
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x144(%rcx), %ecx
movl %ecx, 0x138(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x138(%rax), %edx
movl $0xa, %esi
callq 0x4950
jmp 0x58d5
cmpq $0x4b, -0x28(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x8(%rbp), %rax
movw %cx, %dx
movw 0x13c(%rax), %cx
andw $0x1, %dx
shlw $0xc, %dx
andw $0xefff, %cx            # imm = 0xEFFF
orw %dx, %cx
movw %cx, 0x13c(%rax)
cmpq $0x49, -0x28(%rbp)
jne 0x57e5
movl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x57fa
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl $0x2, %ecx
cmpq $0x4a, %rdx
cmovel %ecx, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %ecx
movq -0x8(%rbp), %rax
movw %cx, %dx
movw 0x13c(%rax), %cx
andw $0x3, %dx
shlw $0xd, %dx
andw $0x9fff, %cx            # imm = 0x9FFF
orw %dx, %cx
movw %cx, 0x13c(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0xc, %ax
andw $0x1, %ax
movzwl %ax, %edx
movl $0xb, %esi
callq 0x48d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0xd, %ax
andw $0x3, %ax
movzwl %ax, %edx
movl $0xc, %esi
callq 0x4910
jmp 0x58d5
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
subq $0x5a, %rax
addq $0x8, %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rdx
movl $0x9, %esi
callq 0x5920
jmp 0x58d5
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
subq $0x64, %rax
addq $0x8, %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rdx
movl $0xa, %esi
callq 0x5920
jmp 0x58d5
movl $0x0, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x58dd
jmp 0x58dd
jmp 0x58df
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %eax, %rdx
movabsq $0x80000000, %rax       # imm = 0x80000000
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
je 0x5907
jmp 0x58df
jmp 0x4f0a
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)