def gn_sum
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
1882# acc + the segments of the block's remaining `left` rows, each one row (c cells) below the last, in order
1883def gn_sum(left: Nat, +off: U32, +c: U32, +cg: Nat, q: AS) -> AS:
1884 match left q:
1885 case 0n r:
1886 r
1887 case 1n+l AS{a, +s}:
1888 gn_sum(l, (off + c : U32), c, cg, asum(Nat.sub(cg, 1n), (off + c : U32), s, Array.get(F32, a, (off + c : U32))))