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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  -
    input:
      bytes: [ 0x73, 0x23, 0x70, 0xc1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, hpmcounter23, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x70, 0xc1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, hpmcounter23, zero"

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

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

  -
    input:
      bytes: [ 0x73, 0x23, 0x90, 0xc1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, hpmcounter25, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0x90, 0xc1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, hpmcounter25, zero"

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

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

  -
    input:
      bytes: [ 0x73, 0x23, 0xb0, 0xc1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t1, hpmcounter27, zero"

  -
    input:
      bytes: [ 0xf3, 0x23, 0xb0, 0xc1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "csrrs t2, hpmcounter27, zero"

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

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

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

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

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

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

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

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