test_cases:
  -
    input:
      bytes: [ 0x2f, 0x27, 0x14, 0x08 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoswap.w a4, ra, (s0)"

  -
    input:
      bytes: [ 0xaf, 0xa5, 0xc6, 0x00 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoadd.w a1, a2, (a3)"

  -
    input:
      bytes: [ 0x2f, 0x26, 0xd7, 0x20 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoxor.w a2, a3, (a4)"

  -
    input:
      bytes: [ 0xaf, 0xa6, 0xe7, 0x60 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoand.w a3, a4, (a5)"

  -
    input:
      bytes: [ 0x2f, 0x27, 0xf8, 0x40 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoor.w a4, a5, (a6)"

  -
    input:
      bytes: [ 0xaf, 0xa7, 0x08, 0x81 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomin.w a5, a6, (a7)"

  -
    input:
      bytes: [ 0xaf, 0xab, 0x6a, 0xa1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomax.w s7, s6, (s5)"

  -
    input:
      bytes: [ 0x2f, 0x2b, 0x5a, 0xc1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amominu.w s6, s5, (s4)"

  -
    input:
      bytes: [ 0xaf, 0xaa, 0x49, 0xe1 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomaxu.w s5, s4, (s3)"

  -
    input:
      bytes: [ 0x2f, 0x27, 0x14, 0x0c ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoswap.w.aq a4, ra, (s0)"

  -
    input:
      bytes: [ 0xaf, 0xa5, 0xc6, 0x04 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoadd.w.aq a1, a2, (a3)"

  -
    input:
      bytes: [ 0x2f, 0x26, 0xd7, 0x24 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoxor.w.aq a2, a3, (a4)"

  -
    input:
      bytes: [ 0xaf, 0xa6, 0xe7, 0x64 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoand.w.aq a3, a4, (a5)"

  -
    input:
      bytes: [ 0x2f, 0x27, 0xf8, 0x44 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoor.w.aq a4, a5, (a6)"

  -
    input:
      bytes: [ 0xaf, 0xa7, 0x08, 0x85 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomin.w.aq a5, a6, (a7)"

  -
    input:
      bytes: [ 0xaf, 0xab, 0x6a, 0xa5 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomax.w.aq s7, s6, (s5)"

  -
    input:
      bytes: [ 0x2f, 0x2b, 0x5a, 0xc5 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amominu.w.aq s6, s5, (s4)"

  -
    input:
      bytes: [ 0xaf, 0xaa, 0x49, 0xe5 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomaxu.w.aq s5, s4, (s3)"

  -
    input:
      bytes: [ 0x2f, 0x27, 0x14, 0x0a ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoswap.w.rl a4, ra, (s0)"

  -
    input:
      bytes: [ 0xaf, 0xa5, 0xc6, 0x02 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoadd.w.rl a1, a2, (a3)"

  -
    input:
      bytes: [ 0x2f, 0x26, 0xd7, 0x22 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoxor.w.rl a2, a3, (a4)"

  -
    input:
      bytes: [ 0xaf, 0xa6, 0xe7, 0x62 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoand.w.rl a3, a4, (a5)"

  -
    input:
      bytes: [ 0x2f, 0x27, 0xf8, 0x42 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoor.w.rl a4, a5, (a6)"

  -
    input:
      bytes: [ 0xaf, 0xa7, 0x08, 0x83 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomin.w.rl a5, a6, (a7)"

  -
    input:
      bytes: [ 0xaf, 0xab, 0x6a, 0xa3 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomax.w.rl s7, s6, (s5)"

  -
    input:
      bytes: [ 0x2f, 0x2b, 0x5a, 0xc3 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amominu.w.rl s6, s5, (s4)"

  -
    input:
      bytes: [ 0xaf, 0xaa, 0x49, 0xe3 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomaxu.w.rl s5, s4, (s3)"

  -
    input:
      bytes: [ 0x2f, 0x27, 0x14, 0x0e ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoswap.w.aqrl a4, ra, (s0)"

  -
    input:
      bytes: [ 0xaf, 0xa5, 0xc6, 0x06 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoadd.w.aqrl a1, a2, (a3)"

  -
    input:
      bytes: [ 0x2f, 0x26, 0xd7, 0x26 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoxor.w.aqrl a2, a3, (a4)"

  -
    input:
      bytes: [ 0xaf, 0xa6, 0xe7, 0x66 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoand.w.aqrl a3, a4, (a5)"

  -
    input:
      bytes: [ 0x2f, 0x27, 0xf8, 0x46 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amoor.w.aqrl a4, a5, (a6)"

  -
    input:
      bytes: [ 0xaf, 0xa7, 0x08, 0x87 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomin.w.aqrl a5, a6, (a7)"

  -
    input:
      bytes: [ 0xaf, 0xab, 0x6a, 0xa7 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomax.w.aqrl s7, s6, (s5)"

  -
    input:
      bytes: [ 0x2f, 0x2b, 0x5a, 0xc7 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amominu.w.aqrl s6, s5, (s4)"

  -
    input:
      bytes: [ 0xaf, 0xaa, 0x49, 0xe7 ]
      arch: "CS_ARCH_RISCV"
      options: [ "CS_MODE_RISCV32", "CS_MODE_RISCV_A", "CS_OPT_SYNTAX_NO_ALIAS_TEXT" ]
    expected:
      insns:
        -
          asm_text: "amomaxu.w.aqrl s5, s4, (s3)"
