;; Replaces sequence:
;;  ld a, (ix|iy +|- NNN)
;;  inc|dec|cp a
;;  ld (ix|iy +|- NNN), a
;; with
;;  inc|dec|cp (ix|iy +|- NNN)

OLEVEL: 1
OFLAG: 6

REPLACE {{
 ld a, $1
 $2 a
 ld $1, a
}}

IF {{
  (IS_INDIR($1) || ($1 == "(hl)")) && (($2 == cp) || ($2 == inc) || ($2 == dec))
}}

WITH {{
 $2 $1
}}
