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

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

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

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

  -
    input:
      bytes: [ 0x00, 0xc0, 0x23, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z0.b, z0.b, #0"

  -
    input:
      bytes: [ 0xff, 0xdf, 0x23, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.b, z31.b, #255"

  -
    input:
      bytes: [ 0x00, 0xc0, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z0.h, z0.h, #0"

  -
    input:
      bytes: [ 0x00, 0xe0, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z0.h, z0.h, #0, lsl #8"

  -
    input:
      bytes: [ 0xff, 0xff, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.h, z31.h, #65280"

  -
    input:
      bytes: [ 0xff, 0xff, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.h, z31.h, #65280"

  -
    input:
      bytes: [ 0x00, 0xc0, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z0.s, z0.s, #0"

  -
    input:
      bytes: [ 0x00, 0xe0, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z0.s, z0.s, #0, lsl #8"

  -
    input:
      bytes: [ 0xff, 0xff, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.s, z31.s, #65280"

  -
    input:
      bytes: [ 0xff, 0xff, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.s, z31.s, #65280"

  -
    input:
      bytes: [ 0x00, 0xc0, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z0.d, z0.d, #0"

  -
    input:
      bytes: [ 0x00, 0xe0, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z0.d, z0.d, #0, lsl #8"

  -
    input:
      bytes: [ 0xff, 0xff, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.d, z31.d, #65280"

  -
    input:
      bytes: [ 0xff, 0xff, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.d, z31.d, #65280"

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

  -
    input:
      bytes: [ 0x05, 0x00, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z5.d, p0/m, z5.d, z0.d"

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

  -
    input:
      bytes: [ 0x05, 0x00, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z5.d, p0/m, z5.d, z0.d"

  -
    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, 0xff, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sve" ]
    expected:
      insns:
        -
          asm_text: "subr z31.d, z31.d, #65280"

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

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

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

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

  -
    input:
      bytes: [ 0x00, 0xc0, 0x23, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z0.b, z0.b, #0"

  -
    input:
      bytes: [ 0xff, 0xdf, 0x23, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.b, z31.b, #255"

  -
    input:
      bytes: [ 0x00, 0xc0, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z0.h, z0.h, #0"

  -
    input:
      bytes: [ 0x00, 0xe0, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z0.h, z0.h, #0, lsl #8"

  -
    input:
      bytes: [ 0xff, 0xff, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.h, z31.h, #65280"

  -
    input:
      bytes: [ 0xff, 0xff, 0x63, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.h, z31.h, #65280"

  -
    input:
      bytes: [ 0x00, 0xc0, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z0.s, z0.s, #0"

  -
    input:
      bytes: [ 0x00, 0xe0, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z0.s, z0.s, #0, lsl #8"

  -
    input:
      bytes: [ 0xff, 0xff, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.s, z31.s, #65280"

  -
    input:
      bytes: [ 0xff, 0xff, 0xa3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.s, z31.s, #65280"

  -
    input:
      bytes: [ 0x00, 0xc0, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z0.d, z0.d, #0"

  -
    input:
      bytes: [ 0x00, 0xe0, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z0.d, z0.d, #0, lsl #8"

  -
    input:
      bytes: [ 0xff, 0xff, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.d, z31.d, #65280"

  -
    input:
      bytes: [ 0xff, 0xff, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.d, z31.d, #65280"

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

  -
    input:
      bytes: [ 0x05, 0x00, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z5.d, p0/m, z5.d, z0.d"

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

  -
    input:
      bytes: [ 0x05, 0x00, 0xc3, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z5.d, p0/m, z5.d, z0.d"

  -
    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, 0xff, 0xe3, 0x25 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64", "sme" ]
    expected:
      insns:
        -
          asm_text: "subr z31.d, z31.d, #65280"
