test_cases:
  -
    input:
      bytes: [ 0xf7, 0xbf, 0x20, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "movprfx z23, z31"

  -
    input:
      bytes: [ 0xb7, 0x09, 0x68, 0x64 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z23.h, z13.h, z0.h[5]"

  -
    input:
      bytes: [ 0x00, 0x08, 0x20, 0x64 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z0.h, z0.h, z0.h[0]"

  -
    input:
      bytes: [ 0x55, 0x09, 0x75, 0x64 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z21.h, z10.h, z5.h[6]"

  -
    input:
      bytes: [ 0xb7, 0x09, 0x68, 0x64 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z23.h, z13.h, z0.h[5]"

  -
    input:
      bytes: [ 0xff, 0x0b, 0x7f, 0x64 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z31.h, z31.h, z7.h[7]"

  -
    input:
      bytes: [ 0xf7, 0x2f, 0x51, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "movprfx z23.h, p3/m, z31.h"

  -
    input:
      bytes: [ 0xb7, 0x0d, 0x28, 0x65 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z23.h, p3/m, z13.h, z8.h"

  -
    input:
      bytes: [ 0xf7, 0xbf, 0x20, 0x04 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "movprfx z23, z31"

  -
    input:
      bytes: [ 0xb7, 0x0d, 0x28, 0x65 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z23.h, p3/m, z13.h, z8.h"

  -
    input:
      bytes: [ 0x00, 0x00, 0x20, 0x65 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z0.h, p0/m, z0.h, z0.h"

  -
    input:
      bytes: [ 0x55, 0x15, 0x35, 0x65 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z21.h, p5/m, z10.h, z21.h"

  -
    input:
      bytes: [ 0xb7, 0x0d, 0x28, 0x65 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z23.h, p3/m, z13.h, z8.h"

  -
    input:
      bytes: [ 0xff, 0x1f, 0x3f, 0x65 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_NO_BRANCH_OFFSET", "aarch64", "sve2", "+b16b16" ]
    expected:
      insns:
        -
          asm_text: "bfmla z31.h, p7/m, z31.h, z31.h"
