test_cases:
  -
    input:
      bytes: [ 0xe0, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECIDR_EL2"

  -
    input:
      bytes: [ 0x00, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_P0_EL2"

  -
    input:
      bytes: [ 0x20, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_A0_EL2"

  -
    input:
      bytes: [ 0x40, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_P1_EL2"

  -
    input:
      bytes: [ 0x60, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_A1_EL2"

  -
    input:
      bytes: [ 0x00, 0xa9, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, VMECID_P_EL2"

  -
    input:
      bytes: [ 0x20, 0xa9, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, VMECID_A_EL2"

  -
    input:
      bytes: [ 0x20, 0xaa, 0x3e, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_RL_A_EL3"

  -
    input:
      bytes: [ 0x00, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_P0_EL2, x0"

  -
    input:
      bytes: [ 0x20, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_A0_EL2, x0"

  -
    input:
      bytes: [ 0x40, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_P1_EL2, x0"

  -
    input:
      bytes: [ 0x60, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_A1_EL2, x0"

  -
    input:
      bytes: [ 0x00, 0xa9, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "msr VMECID_P_EL2, x0"

  -
    input:
      bytes: [ 0x20, 0xa9, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "msr VMECID_A_EL2, x0"

  -
    input:
      bytes: [ 0x20, 0xaa, 0x1e, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_RL_A_EL3, x0"

  -
    input:
      bytes: [ 0xe0, 0x7e, 0x0c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "dc cigdpae, x0"

  -
    input:
      bytes: [ 0x00, 0x7e, 0x0c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "mec" ]
    expected:
      insns:
        -
          asm_text: "dc cipae, x0"

  -
    input:
      bytes: [ 0xe0, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECIDR_EL2"

  -
    input:
      bytes: [ 0x00, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_P0_EL2"

  -
    input:
      bytes: [ 0x20, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_A0_EL2"

  -
    input:
      bytes: [ 0x40, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_P1_EL2"

  -
    input:
      bytes: [ 0x60, 0xa8, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_A1_EL2"

  -
    input:
      bytes: [ 0x00, 0xa9, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, VMECID_P_EL2"

  -
    input:
      bytes: [ 0x20, 0xa9, 0x3c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, VMECID_A_EL2"

  -
    input:
      bytes: [ 0x20, 0xaa, 0x3e, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "mrs x0, MECID_RL_A_EL3"

  -
    input:
      bytes: [ 0x00, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_P0_EL2, x0"

  -
    input:
      bytes: [ 0x20, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_A0_EL2, x0"

  -
    input:
      bytes: [ 0x40, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_P1_EL2, x0"

  -
    input:
      bytes: [ 0x60, 0xa8, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_A1_EL2, x0"

  -
    input:
      bytes: [ 0x00, 0xa9, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "msr VMECID_P_EL2, x0"

  -
    input:
      bytes: [ 0x20, 0xa9, 0x1c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "msr VMECID_A_EL2, x0"

  -
    input:
      bytes: [ 0x20, 0xaa, 0x1e, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "msr MECID_RL_A_EL3, x0"

  -
    input:
      bytes: [ 0xe0, 0x7e, 0x0c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "dc cigdpae, x0"

  -
    input:
      bytes: [ 0x00, 0x7e, 0x0c, 0xd5 ]
      arch: "CS_ARCH_AARCH64"
      options: [ "CS_OPT_ONLY_OFFSET_BRANCH", "aarch64-none-linux-gnu", "v9a" ]
    expected:
      insns:
        -
          asm_text: "dc cipae, x0"
