test_cases:
  -
    input:
      bytes: [ 0x03, 0xe0, 0x40, 0x00 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "lwu zero, 4(ra)"

  -
    input:
      bytes: [ 0x03, 0xe1, 0x41, 0x00 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "lwu sp, 4(gp)"

  -
    input:
      bytes: [ 0x03, 0xe2, 0x02, 0x80 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "lwu tp, -2048(t0)"

  -
    input:
      bytes: [ 0x03, 0xe3, 0x03, 0x80 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "lwu t1, -2048(t2)"

  -
    input:
      bytes: [ 0x03, 0xe4, 0xf4, 0x7f ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "lwu s0, 2047(s1)"

  -
    input:
      bytes: [ 0x03, 0xb5, 0x05, 0x80 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "ld a0, -2048(a1)"

  -
    input:
      bytes: [ 0x03, 0xb6, 0x06, 0x80 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "ld a2, -2048(a3)"

  -
    input:
      bytes: [ 0x03, 0xb7, 0xf7, 0x7f ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "ld a4, 2047(a5)"

  -
    input:
      bytes: [ 0x23, 0xb0, 0x08, 0x81 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "sd a6, -2048(a7)"

  -
    input:
      bytes: [ 0x23, 0xb0, 0x29, 0x81 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "sd s2, -2048(s3)"

  -
    input:
      bytes: [ 0xa3, 0xbf, 0x4a, 0x7f ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "sd s4, 2047(s5)"

  -
    input:
      bytes: [ 0x13, 0x9b, 0xdb, 0x02 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "slli s6, s7, 45"

  -
    input:
      bytes: [ 0x13, 0xdc, 0x0c, 0x00 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "srli s8, s9, 0"

  -
    input:
      bytes: [ 0x13, 0xdd, 0xfd, 0x41 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "srai s10, s11, 31"

  -
    input:
      bytes: [ 0x1b, 0x8e, 0x0e, 0x80 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "addiw t3, t4, -2048"

  -
    input:
      bytes: [ 0x1b, 0x8f, 0xff, 0x7f ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "addiw t5, t6, 2047"

  -
    input:
      bytes: [ 0x1b, 0x90, 0x00, 0x00 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "slliw zero, ra, 0"

  -
    input:
      bytes: [ 0x1b, 0x91, 0xf1, 0x01 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "slliw sp, gp, 31"

  -
    input:
      bytes: [ 0x1b, 0xd2, 0x02, 0x00 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "srliw tp, t0, 0"

  -
    input:
      bytes: [ 0x1b, 0xd3, 0xf3, 0x01 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "srliw t1, t2, 31"

  -
    input:
      bytes: [ 0x1b, 0xd4, 0x04, 0x40 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "sraiw s0, s1, 0"

  -
    input:
      bytes: [ 0x1b, 0xd5, 0xf5, 0x41 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "sraiw a0, a1, 31"

  -
    input:
      bytes: [ 0x3b, 0x86, 0xe6, 0x00 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "addw a2, a3, a4"

  -
    input:
      bytes: [ 0xbb, 0x07, 0x18, 0x01 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "addw a5, a6, a7"

  -
    input:
      bytes: [ 0x3b, 0x89, 0x49, 0x41 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "subw s2, s3, s4"

  -
    input:
      bytes: [ 0xbb, 0x0a, 0x7b, 0x41 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "subw s5, s6, s7"

  -
    input:
      bytes: [ 0x3b, 0x9c, 0xac, 0x01 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "sllw s8, s9, s10"

  -
    input:
      bytes: [ 0xbb, 0x5d, 0xde, 0x01 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "srlw s11, t3, t4"

  -
    input:
      bytes: [ 0x3b, 0xdf, 0x0f, 0x40 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV64", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "sraw t5, t6, zero"
