from qiskit import QuantumCircuit

# OpAfterMeas inside a loop: the loop body applies a gate to q0 after the
# measurement, reachable on every iteration. The detector must traverse the
# back-edge and flag the in-loop gate.
qc = QuantumCircuit(1, 1)
qc.reset(0)
qc.h(0)
qc.measure(0, 0)
for _ in range(10):
    qc.h(0)      # BUG: gate on q0 after measure, inside loop body
