test_cases:
  -
    input:
      bytes: [ 0x01, 0x20, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z0.h, z1.h }, pn8/z, [x0, x0, lsl #1]"

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

  -
    input:
      bytes: [ 0xb7, 0x2d, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z22.h, z23.h }, pn11/z, [x13, x8, lsl #1]"

  -
    input:
      bytes: [ 0xff, 0x3f, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z30.h, z31.h }, pn15/z, [sp, xzr, lsl #1]"

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

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

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

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

  -
    input:
      bytes: [ 0x01, 0xa0, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z0.h - z3.h }, pn8/z, [x0, x0, lsl #1]"

  -
    input:
      bytes: [ 0x55, 0xb5, 0x15, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z20.h - z23.h }, pn13/z, [x10, x21, lsl #1]"

  -
    input:
      bytes: [ 0xb5, 0xad, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z20.h - z23.h }, pn11/z, [x13, x8, lsl #1]"

  -
    input:
      bytes: [ 0xfd, 0xbf, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sme2" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z28.h - z31.h }, pn15/z, [sp, xzr, lsl #1]"

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

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

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

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

  -
    input:
      bytes: [ 0x01, 0x20, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z0.h, z1.h }, pn8/z, [x0, x0, lsl #1]"

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

  -
    input:
      bytes: [ 0xb7, 0x2d, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z22.h, z23.h }, pn11/z, [x13, x8, lsl #1]"

  -
    input:
      bytes: [ 0xff, 0x3f, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z30.h, z31.h }, pn15/z, [sp, xzr, lsl #1]"

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

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

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

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

  -
    input:
      bytes: [ 0x01, 0xa0, 0x00, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z0.h - z3.h }, pn8/z, [x0, x0, lsl #1]"

  -
    input:
      bytes: [ 0x55, 0xb5, 0x15, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z20.h - z23.h }, pn13/z, [x10, x21, lsl #1]"

  -
    input:
      bytes: [ 0xb5, 0xad, 0x08, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z20.h - z23.h }, pn11/z, [x13, x8, lsl #1]"

  -
    input:
      bytes: [ 0xfd, 0xbf, 0x1f, 0xa0 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2p1" ]
    expected:
      insns:
        -
          asm_text: "ldnt1h { z28.h - z31.h }, pn15/z, [sp, xzr, lsl #1]"

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

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

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

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