IRLabel bodyLabel = factory.newLabel();
IRLabel nextLabel = factory.newLabel();
IRLabel exitLabel = factory.newLabel();
// initialize the counter
factory.addStatement(new Assignment(counter, new Constant(0)));
factory.addStatement(new Assignment(length,
new Length((Expression)vector)));
// check the counter and potentially loop
factory.addLabel(counterLabel);