test_cases:
  -
    input:
      bytes: [ 0x00, 0x00, 0x20, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b, z1.b }, pn8, [x0, x0]"

  -
    input:
      bytes: [ 0x54, 0x15, 0x35, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b, z21.b }, pn13, [x10, x21]"

  -
    input:
      bytes: [ 0xb6, 0x0d, 0x28, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z22.b, z23.b }, pn11, [x13, x8]"

  -
    input:
      bytes: [ 0xfe, 0x1f, 0x3f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z30.b, z31.b }, pn15, [sp, xzr]"

  -
    input:
      bytes: [ 0x00, 0x00, 0x60, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b, z1.b }, pn8, [x0]"

  -
    input:
      bytes: [ 0x54, 0x15, 0x65, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b, z21.b }, pn13, [x10, #10, mul vl]"

  -
    input:
      bytes: [ 0xb6, 0x0d, 0x68, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z22.b, z23.b }, pn11, [x13, #-16, mul vl]"

  -
    input:
      bytes: [ 0xfe, 0x1f, 0x6f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z30.b, z31.b }, pn15, [sp, #-2, mul vl]"

  -
    input:
      bytes: [ 0x00, 0x80, 0x20, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b - z3.b }, pn8, [x0, x0]"

  -
    input:
      bytes: [ 0x54, 0x95, 0x35, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn13, [x10, x21]"

  -
    input:
      bytes: [ 0xb4, 0x8d, 0x28, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn11, [x13, x8]"

  -
    input:
      bytes: [ 0xfc, 0x9f, 0x3f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z28.b - z31.b }, pn15, [sp, xzr]"

  -
    input:
      bytes: [ 0x00, 0x80, 0x60, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b - z3.b }, pn8, [x0]"

  -
    input:
      bytes: [ 0x54, 0x95, 0x65, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn13, [x10, #20, mul vl]"

  -
    input:
      bytes: [ 0xb4, 0x8d, 0x68, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn11, [x13, #-32, mul vl]"

  -
    input:
      bytes: [ 0xfc, 0x9f, 0x6f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "st1b { z28.b - z31.b }, pn15, [sp, #-4, mul vl]"

  -
    input:
      bytes: [ 0x00, 0x00, 0x20, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b, z1.b }, pn8, [x0, x0]"

  -
    input:
      bytes: [ 0x54, 0x15, 0x35, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b, z21.b }, pn13, [x10, x21]"

  -
    input:
      bytes: [ 0xb6, 0x0d, 0x28, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z22.b, z23.b }, pn11, [x13, x8]"

  -
    input:
      bytes: [ 0xfe, 0x1f, 0x3f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z30.b, z31.b }, pn15, [sp, xzr]"

  -
    input:
      bytes: [ 0x00, 0x00, 0x60, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b, z1.b }, pn8, [x0]"

  -
    input:
      bytes: [ 0x54, 0x15, 0x65, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b, z21.b }, pn13, [x10, #10, mul vl]"

  -
    input:
      bytes: [ 0xb6, 0x0d, 0x68, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z22.b, z23.b }, pn11, [x13, #-16, mul vl]"

  -
    input:
      bytes: [ 0xfe, 0x1f, 0x6f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z30.b, z31.b }, pn15, [sp, #-2, mul vl]"

  -
    input:
      bytes: [ 0x00, 0x80, 0x20, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b - z3.b }, pn8, [x0, x0]"

  -
    input:
      bytes: [ 0x54, 0x95, 0x35, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn13, [x10, x21]"

  -
    input:
      bytes: [ 0xb4, 0x8d, 0x28, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn11, [x13, x8]"

  -
    input:
      bytes: [ 0xfc, 0x9f, 0x3f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z28.b - z31.b }, pn15, [sp, xzr]"

  -
    input:
      bytes: [ 0x00, 0x80, 0x60, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z0.b - z3.b }, pn8, [x0]"

  -
    input:
      bytes: [ 0x54, 0x95, 0x65, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn13, [x10, #20, mul vl]"

  -
    input:
      bytes: [ 0xb4, 0x8d, 0x68, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z20.b - z23.b }, pn11, [x13, #-32, mul vl]"

  -
    input:
      bytes: [ 0xfc, 0x9f, 0x6f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "st1b { z28.b - z31.b }, pn15, [sp, #-4, mul vl]"
