test_cases:
  -
    input:
      bytes: [ 0x00, 0x9c, 0x28, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, z0.b, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0x2f, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.b, z31.b, #7"

  -
    input:
      bytes: [ 0x00, 0x9c, 0x30, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, z0.h, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0x3f, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.h, z31.h, #15"

  -
    input:
      bytes: [ 0x00, 0x9c, 0x60, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, z0.s, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0x7f, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.s, z31.s, #31"

  -
    input:
      bytes: [ 0x00, 0x9c, 0xa0, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.d, z0.d, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0xff, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, z31.d, #63"

  -
    input:
      bytes: [ 0x00, 0x81, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, p0/m, z0.b, #0"

  -
    input:
      bytes: [ 0xff, 0x81, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.b, p0/m, z31.b, #7"

  -
    input:
      bytes: [ 0x00, 0x82, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, p0/m, z0.h, #0"

  -
    input:
      bytes: [ 0xff, 0x83, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.h, p0/m, z31.h, #15"

  -
    input:
      bytes: [ 0x00, 0x80, 0x43, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, #0"

  -
    input:
      bytes: [ 0xff, 0x83, 0x43, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.s, p0/m, z31.s, #31"

  -
    input:
      bytes: [ 0x00, 0x80, 0x83, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.d, p0/m, z0.d, #0"

  -
    input:
      bytes: [ 0xff, 0x83, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, p0/m, z31.d, #63"

  -
    input:
      bytes: [ 0x00, 0x80, 0x13, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, p0/m, z0.b, z0.b"

  -
    input:
      bytes: [ 0x00, 0x80, 0x53, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, p0/m, z0.h, z0.h"

  -
    input:
      bytes: [ 0x00, 0x80, 0x93, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z0.s"

  -
    input:
      bytes: [ 0x00, 0x80, 0xd3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.d, p0/m, z0.d, z0.d"

  -
    input:
      bytes: [ 0x20, 0x80, 0x1b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, p0/m, z0.b, z1.d"

  -
    input:
      bytes: [ 0x20, 0x80, 0x5b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, p0/m, z0.h, z1.d"

  -
    input:
      bytes: [ 0x20, 0x80, 0x9b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z1.d"

  -
    input:
      bytes: [ 0x20, 0x8c, 0x22, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, z1.b, z2.d"

  -
    input:
      bytes: [ 0x20, 0x8c, 0x62, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, z1.h, z2.d"

  -
    input:
      bytes: [ 0x20, 0x8c, 0xa2, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, z1.s, z2.d"

  -
    input:
      bytes: [ 0xdf, 0x20, 0xd0, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "movprfx z31.d, p0/z, z6.d"

  -
    input:
      bytes: [ 0xff, 0x83, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, p0/m, z31.d, #63"

  -
    input:
      bytes: [ 0xdf, 0xbc, 0x20, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "movprfx z31, z6"

  -
    input:
      bytes: [ 0xff, 0x83, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, p0/m, z31.d, #63"

  -
    input:
      bytes: [ 0xe0, 0x20, 0x90, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "movprfx z0.s, p0/z, z7.s"

  -
    input:
      bytes: [ 0x20, 0x80, 0x9b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z1.d"

  -
    input:
      bytes: [ 0xe0, 0xbc, 0x20, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "movprfx z0, z7"

  -
    input:
      bytes: [ 0x20, 0x80, 0x9b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z1.d"

  -
    input:
      bytes: [ 0x00, 0x9c, 0x28, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, z0.b, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0x2f, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.b, z31.b, #7"

  -
    input:
      bytes: [ 0x00, 0x9c, 0x30, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, z0.h, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0x3f, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.h, z31.h, #15"

  -
    input:
      bytes: [ 0x00, 0x9c, 0x60, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, z0.s, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0x7f, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.s, z31.s, #31"

  -
    input:
      bytes: [ 0x00, 0x9c, 0xa0, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.d, z0.d, #0"

  -
    input:
      bytes: [ 0xff, 0x9f, 0xff, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, z31.d, #63"

  -
    input:
      bytes: [ 0x00, 0x81, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, p0/m, z0.b, #0"

  -
    input:
      bytes: [ 0xff, 0x81, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.b, p0/m, z31.b, #7"

  -
    input:
      bytes: [ 0x00, 0x82, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, p0/m, z0.h, #0"

  -
    input:
      bytes: [ 0xff, 0x83, 0x03, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.h, p0/m, z31.h, #15"

  -
    input:
      bytes: [ 0x00, 0x80, 0x43, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, #0"

  -
    input:
      bytes: [ 0xff, 0x83, 0x43, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.s, p0/m, z31.s, #31"

  -
    input:
      bytes: [ 0x00, 0x80, 0x83, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.d, p0/m, z0.d, #0"

  -
    input:
      bytes: [ 0xff, 0x83, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, p0/m, z31.d, #63"

  -
    input:
      bytes: [ 0x00, 0x80, 0x13, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, p0/m, z0.b, z0.b"

  -
    input:
      bytes: [ 0x00, 0x80, 0x53, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, p0/m, z0.h, z0.h"

  -
    input:
      bytes: [ 0x00, 0x80, 0x93, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z0.s"

  -
    input:
      bytes: [ 0x00, 0x80, 0xd3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.d, p0/m, z0.d, z0.d"

  -
    input:
      bytes: [ 0x20, 0x80, 0x1b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, p0/m, z0.b, z1.d"

  -
    input:
      bytes: [ 0x20, 0x80, 0x5b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, p0/m, z0.h, z1.d"

  -
    input:
      bytes: [ 0x20, 0x80, 0x9b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z1.d"

  -
    input:
      bytes: [ 0x20, 0x8c, 0x22, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.b, z1.b, z2.d"

  -
    input:
      bytes: [ 0x20, 0x8c, 0x62, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.h, z1.h, z2.d"

  -
    input:
      bytes: [ 0x20, 0x8c, 0xa2, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, z1.s, z2.d"

  -
    input:
      bytes: [ 0xdf, 0x20, 0xd0, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "movprfx z31.d, p0/z, z6.d"

  -
    input:
      bytes: [ 0xff, 0x83, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, p0/m, z31.d, #63"

  -
    input:
      bytes: [ 0xdf, 0xbc, 0x20, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "movprfx z31, z6"

  -
    input:
      bytes: [ 0xff, 0x83, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z31.d, p0/m, z31.d, #63"

  -
    input:
      bytes: [ 0xe0, 0x20, 0x90, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "movprfx z0.s, p0/z, z7.s"

  -
    input:
      bytes: [ 0x20, 0x80, 0x9b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z1.d"

  -
    input:
      bytes: [ 0xe0, 0xbc, 0x20, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "movprfx z0, z7"

  -
    input:
      bytes: [ 0x20, 0x80, 0x9b, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "lsl z0.s, p0/m, z0.s, z1.d"
