| Hard CPU goalie reads a real approaching cross-ice pass; desired X only.
| Original desired depth, speed, reach, animations and save traits retained.
 .ifndef PASS_MIX
 .equ PASS_MIX,1
 .endif
 .text
 .globl _start
_start:
 link.w %a6,#-12
 movem.l %d1-%d7/%a0-%a5,-(%sp)
 move.l %d0,-8(%a6)
 move.w %d0,-4(%a6)
 move.w %d2,-2(%a6)
 cmpi.w #1,0xFFFFF07A
 bne.w done
 tst.w 0x34(%a3)
 bne.w done
 btst #3,0x62(%a3)
 bne.w done
 btst #5,0x62(%a3)
 bne.w done
 btst #2,0x63(%a3)
 bne.w done
 btst #0,0xFFFFC2EA
 bne.w done
 btst #4,0xFFFFC2EA
 bne.w done
 btst #7,0xFFFFC2EC
 bne.w done
 btst #2,0xFFFFC2F2
 bne.w done
 move.b 0xFFFFC2FA,%d0
 andi.w #5,%d0
 bne.w done
 tst.w 0xFFFFB7AA
 bpl.w done
 | Stay with native emergency return if already outside the ordinary mouth.
 move.w (%a3),%d0
 cmpi.w #-40,%d0
 blt.w done
 cmpi.w #40,%d0
 bgt.w done
 move.w 0x14(%a3),%d0
 bpl.s own_depth
 neg.w %d0
own_depth:
 cmpi.w #232,%d0
 blt.w done
 cmpi.w #264,%d0
 bgt.w done
 jsr 0x2DD680                 | actual approaching pass receiver or -1
 cmpi.w #11,%d2
 bhi.w done
 move.w %d2,%d0
 move.w 0x52(%a3),%d1
 subq.w #6,%d0
 subq.w #6,%d1
 eor.w %d1,%d0
 bpl.w done                   | never anticipate our own outlet
 lsl.w #7,%d2
 lea 0xFFFFB04A,%a0
 adda.w %d2,%a0
 move.w (%a0),%d0
 move.w 0xFFFFBEDA,%d1
 lsl.w #7,%d1
 lea 0xFFFFB04A,%a1
 adda.w %d1,%a1
 sub.w (%a1),%d0
 bpl.s lateral
 neg.w %d0
lateral:
 cmpi.w #64,%d0
 blt.w done
 move.w 0x14(%a0),%d3
 tst.w 0x14(%a3)
 bpl.s receiver_depth
 neg.w %d3
receiver_depth:
 cmpi.w #160,%d3
 blt.w done
 cmpi.w #252,%d3
 bgt.w done
 move.w #264,%d4
 sub.w %d3,%d4              | >=12, so no division by zero
 move.w -2(%a6),%d5
 bpl.s target_depth
 neg.w %d5
target_depth:
 cmpi.w #232,%d5
 blt.w done
 cmpi.w #256,%d5
 bgt.w done
 move.w #264,%d3
 sub.w %d5,%d3
 move.w (%a0),%d0
 muls.w %d3,%d0
 divs.w %d4,%d0
 cmpi.w #24,%d0
 ble.s target_min
 moveq #24,%d0
target_min:
 cmpi.w #-24,%d0
 bge.s blend
 moveq #-24,%d0
blend:
 .if PASS_MIX==1
 add.w -4(%a6),%d0
 asr.w #1,%d0
 .endif
 move.w %d0,-4(%a6)
done:
 movem.l (%sp)+,%d1-%d7/%a0-%a5
 move.l -8(%a6),%d0
 move.w -4(%a6),%d0
 unlk %a6
 move.w %d2,%d1
 movem.w %d0-%d1,-(%sp)
 jmp 0xDA5E
