test_cases:
  -
    input:
      bytes: [ 0x00, 0x40, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s, z1.s }, pn8/z, [x0, x0, lsl #2]"

  -
    input:
      bytes: [ 0x54, 0x55, 0x15, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s, z21.s }, pn13/z, [x10, x21, lsl #2]"

  -
    input:
      bytes: [ 0xb6, 0x4d, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z22.s, z23.s }, pn11/z, [x13, x8, lsl #2]"

  -
    input:
      bytes: [ 0xfe, 0x5f, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z30.s, z31.s }, pn15/z, [sp, xzr, lsl #2]"

  -
    input:
      bytes: [ 0x00, 0x40, 0x40, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s, z1.s }, pn8/z, [x0]"

  -
    input:
      bytes: [ 0x54, 0x55, 0x45, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s, z21.s }, pn13/z, [x10, #10, mul vl]"

  -
    input:
      bytes: [ 0xb6, 0x4d, 0x48, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z22.s, z23.s }, pn11/z, [x13, #-16, mul vl]"

  -
    input:
      bytes: [ 0xfe, 0x5f, 0x4f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z30.s, z31.s }, pn15/z, [sp, #-2, mul vl]"

  -
    input:
      bytes: [ 0x00, 0xc0, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s - z3.s }, pn8/z, [x0, x0, lsl #2]"

  -
    input:
      bytes: [ 0x54, 0xd5, 0x15, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn13/z, [x10, x21, lsl #2]"

  -
    input:
      bytes: [ 0xb4, 0xcd, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn11/z, [x13, x8, lsl #2]"

  -
    input:
      bytes: [ 0xfc, 0xdf, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z28.s - z31.s }, pn15/z, [sp, xzr, lsl #2]"

  -
    input:
      bytes: [ 0x00, 0xc0, 0x40, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s - z3.s }, pn8/z, [x0]"

  -
    input:
      bytes: [ 0x54, 0xd5, 0x45, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn13/z, [x10, #20, mul vl]"

  -
    input:
      bytes: [ 0xb4, 0xcd, 0x48, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn11/z, [x13, #-32, mul vl]"

  -
    input:
      bytes: [ 0xfc, 0xdf, 0x4f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z28.s - z31.s }, pn15/z, [sp, #-4, mul vl]"

  -
    input:
      bytes: [ 0x00, 0x40, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s, z1.s }, pn8/z, [x0, x0, lsl #2]"

  -
    input:
      bytes: [ 0x54, 0x55, 0x15, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s, z21.s }, pn13/z, [x10, x21, lsl #2]"

  -
    input:
      bytes: [ 0xb6, 0x4d, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z22.s, z23.s }, pn11/z, [x13, x8, lsl #2]"

  -
    input:
      bytes: [ 0xfe, 0x5f, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z30.s, z31.s }, pn15/z, [sp, xzr, lsl #2]"

  -
    input:
      bytes: [ 0x00, 0x40, 0x40, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s, z1.s }, pn8/z, [x0]"

  -
    input:
      bytes: [ 0x54, 0x55, 0x45, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s, z21.s }, pn13/z, [x10, #10, mul vl]"

  -
    input:
      bytes: [ 0xb6, 0x4d, 0x48, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z22.s, z23.s }, pn11/z, [x13, #-16, mul vl]"

  -
    input:
      bytes: [ 0xfe, 0x5f, 0x4f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z30.s, z31.s }, pn15/z, [sp, #-2, mul vl]"

  -
    input:
      bytes: [ 0x00, 0xc0, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s - z3.s }, pn8/z, [x0, x0, lsl #2]"

  -
    input:
      bytes: [ 0x54, 0xd5, 0x15, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn13/z, [x10, x21, lsl #2]"

  -
    input:
      bytes: [ 0xb4, 0xcd, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn11/z, [x13, x8, lsl #2]"

  -
    input:
      bytes: [ 0xfc, 0xdf, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z28.s - z31.s }, pn15/z, [sp, xzr, lsl #2]"

  -
    input:
      bytes: [ 0x00, 0xc0, 0x40, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z0.s - z3.s }, pn8/z, [x0]"

  -
    input:
      bytes: [ 0x54, 0xd5, 0x45, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn13/z, [x10, #20, mul vl]"

  -
    input:
      bytes: [ 0xb4, 0xcd, 0x48, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z20.s - z23.s }, pn11/z, [x13, #-32, mul vl]"

  -
    input:
      bytes: [ 0xfc, 0xdf, 0x4f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ld1w { z28.s - z31.s }, pn15/z, [sp, #-4, mul vl]"
