def big.last
import bend-osdev-bpf@0.1.0.0/check.bend as Checkimport Base
import bend-osdev-bpf@0.1.0.0/insn.bend as I
96# A full-size program, as a regression test for long inputs: 4096
97# instructions (BPF_MAXINSNS), stored as Octets, read back, prepared and run
98# on 64 KB of pseudo-random bytes (a linear congruential generator). Block j
99# of eight: ld [4j mod 65532]; add #j; st M[j mod 16]; ldx M[j mod 16];
100# ldx #(7j mod 65000); ldb [x + 3]; jeq #j, 0, 0; ja 0 (ret a in the last).
101def big.last(last: Bool) -> I.BpfRaw:
102 match last:
103 case True{}:
104 I.bpf_stmt(22, 0)
105 case False{}:
106 I.bpf_stmt(5, 0)