define i64 @count(i64 %N) {
entry:
  br label %test
test:
  %i = phi i64 [ 0, %entry ], [ %next_i, %body ]
  %c = phi i64 [ 0, %entry ], [ %next_c, %body ]
  %ok = icmp slt i64 %i, %N
  br i1 %ok, label %body, label %done
body:
  %next_c = add i64 %c, 1
  %next_i = add i64 %i, 1
  br label %test
done:
  ret i64 %c
}
