anv/query: Add an emit_srm helper