test_cases:
  -
    input:
      bytes: [ 0x73, 0x23, 0x00, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sstatus, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x00, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sstatus, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x40, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sie, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x40, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sie, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x50, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, stvec, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x50, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, stvec, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x60, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, scounteren, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x60, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, scounteren, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0xd0, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, stimecmp, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xd0, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, stimecmp, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0xa0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, senvcfg, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xa0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, senvcfg, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x00, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sscratch, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x00, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sscratch, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x10, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sepc, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x10, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sepc, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x20, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, scause, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x20, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, scause, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x30, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, stval, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x30, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, stval, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x40, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sip, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x40, 0x14 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sip, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x00, 0x18 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, satp, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x00, 0x18 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, satp, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x80, 0x5a ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, scontext, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x80, 0x5a ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, scontext, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x00, 0xda ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, scountovf, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x00, 0xda ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, scountovf, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0xc0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sstateen0, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xc0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sstateen0, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0xd0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sstateen1, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xd0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sstateen1, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0xe0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sstateen2, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xe0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sstateen2, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0xf0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sstateen3, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xf0, 0x10 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sstateen3, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x00, 0x15 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, siselect, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x00, 0x15 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, siselect, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x10, 0x15 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, sireg, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x10, 0x15 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, sireg, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0xc0, 0x15 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, stopei, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xc0, 0x15 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, stopei, zero"

  -
    input:
      bytes: [ 0x73, 0x23, 0x00, 0xdb ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, stopi, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x00, 0xdb ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, stopi, zero"
