test_cases:
  -
    input:
      bytes: [ 0xfd, 0x1d, 0x68, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.b $xr29, $xr15, $xr7"
  -
    input:
      bytes: [ 0x40, 0xbf, 0x68, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.h $xr0, $xr26, $xr15"
  -
    input:
      bytes: [ 0x17, 0x00, 0x69, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.w $xr23, $xr0, $xr0"
  -
    input:
      bytes: [ 0xfd, 0x82, 0x69, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.d $xr29, $xr23, $xr0"
  -
    input:
      bytes: [ 0x56, 0x64, 0x6a, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.bu $xr22, $xr2, $xr25"
  -
    input:
      bytes: [ 0x59, 0xd5, 0x6a, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.hu $xr25, $xr10, $xr21"
  -
    input:
      bytes: [ 0xd1, 0x0d, 0x6b, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.wu $xr17, $xr14, $xr3"
  -
    input:
      bytes: [ 0x62, 0xb5, 0x6b, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavgr.du $xr2, $xr11, $xr13"
