; LLVM IR from tangjz/acm-icpc :: poj (1742)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@n = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@c = external dso_local global [101 x i32], align 16
@w = external dso_local global [101 x i32], align 16
@f = external dso_local global [100001 x i32], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %8

8:                                                ; preds = %132, %0
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @v)
  %10 = icmp eq i32 %9, 2
  br i1 %10, label %11, label %16

11:                                               ; preds = %8
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = load i32, ptr @v, align 4, !tbaa !5
  %14 = add nsw i32 %12, %13
  %15 = icmp ne i32 %14, 0
  br label %16

16:                                               ; preds = %11, %8
  %17 = phi i1 [ false, %8 ], [ %15, %11 ]
  br i1 %17, label %18, label %135

18:                                               ; preds = %16
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 -1, i64 400004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %29, %18
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %32

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr @c, i64 %26
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %27)
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %43, %32
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %46

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr @w, i64 %40
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %41)
  br label %43

43:                                               ; preds = %38
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %3, align 4, !tbaa !5
  br label %33, !llvm.loop !11

46:                                               ; preds = %37
  store i32 0, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %110, %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %113

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %106, %52
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = load i32, ptr @v, align 4, !tbaa !5
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %109

58:                                               ; preds = %53
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp sge i32 %62, 0
  br i1 %63, label %64, label %72

64:                                               ; preds = %58
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %70
  store i32 %68, ptr %71, align 4, !tbaa !5
  br label %105

72:                                               ; preds = %58
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp sge i32 %73, %77
  br i1 %78, label %79, label %104

79:                                               ; preds = %72
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sub nsw i32 %80, %84
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %104

90:                                               ; preds = %79
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = sub nsw i32 %91, %95
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %102
  store i32 %100, ptr %103, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %90, %79, %72
  br label %105

105:                                              ; preds = %104, %64
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %6, align 4, !tbaa !5
  br label %53, !llvm.loop !12

109:                                              ; preds = %57
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %4, align 4, !tbaa !5
  br label %47, !llvm.loop !13

113:                                              ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %129, %113
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = load i32, ptr @v, align 4, !tbaa !5
  %117 = icmp sle i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %132

119:                                              ; preds = %114
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp sge i32 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %119
  %126 = load i32, ptr @ans, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr @ans, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %125, %119
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %7, align 4, !tbaa !5
  br label %114, !llvm.loop !14

132:                                              ; preds = %118
  %133 = load i32, ptr @ans, align 4, !tbaa !5
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %133)
  br label %8, !llvm.loop !15

135:                                              ; preds = %16
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

declare i32 @printf(ptr noundef, ...) #1

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@n = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@c = external dso_local global [101 x i32], align 16
@w = external dso_local global [101 x i32], align 16
@f = external dso_local local_unnamed_addr global [100001 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @v)
  %2 = icmp eq i32 %1, 2
  %3 = load i32, ptr @n, align 4
  %4 = load i32, ptr @v, align 4
  %5 = sub i32 0, %4
  %6 = icmp ne i32 %3, %5
  %7 = select i1 %2, i1 %6, i1 false
  br i1 %7, label %.lr.ph46, label %._crit_edge47

.lr.ph46:                                         ; preds = %0, %._crit_edge44
  %8 = phi i32 [ %55, %._crit_edge44 ], [ %3, %0 ]
  store i32 0, ptr @ans, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @f, i8 -1, i64 400004, i1 false)
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge.thread

.preheader32:                                     ; preds = %.lr.ph
  %10 = icmp sgt i32 %13, 0
  br i1 %10, label %.lr.ph35, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.lr.ph46, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph46 ]
  %11 = getelementptr inbounds i32, ptr @c, i64 %indvars.iv
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %.preheader32, !llvm.loop !9

._crit_edge.thread:                               ; preds = %.preheader32, %.lr.ph46
  store i32 0, ptr @f, align 16, !tbaa !5
  %.pre68 = load i32, ptr @v, align 4, !tbaa !5
  br label %.preheader31

._crit_edge:                                      ; preds = %.lr.ph35
  store i32 0, ptr @f, align 16, !tbaa !5
  %16 = icmp sgt i32 %20, 0
  %.pre = load i32, ptr @v, align 4, !tbaa !5
  br i1 %16, label %.preheader.lr.ph, label %.preheader31

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %.not2936 = icmp slt i32 %.pre, 0
  br i1 %.not2936, label %.preheader31.thread, label %.preheader.preheader

.preheader31.thread:                              ; preds = %.preheader.lr.ph
  %ans.promoted71 = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge44

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %17 = add nuw i32 %.pre, 1
  %wide.trip.count60 = zext nneg i32 %20 to i64
  %wide.trip.count = zext i32 %17 to i64
  br label %.preheader

.lr.ph35:                                         ; preds = %.preheader32, %.lr.ph35
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph35 ], [ 0, %.preheader32 ]
  %18 = getelementptr inbounds i32, ptr @w, i64 %indvars.iv51
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %18)
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next52, %21
  br i1 %22, label %.lr.ph35, label %._crit_edge, !llvm.loop !11

.preheader31:                                     ; preds = %._crit_edge39, %._crit_edge.thread, %._crit_edge
  %.pre69 = phi i32 [ %.pre68, %._crit_edge.thread ], [ %.pre, %._crit_edge ], [ %.pre, %._crit_edge39 ]
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %.not41 = icmp slt i32 %.pre69, 1
  br i1 %.not41, label %._crit_edge44, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %.preheader31
  %23 = zext nneg i32 %.pre69 to i64
  %xtraiter = and i64 %23, 1
  %24 = icmp eq i32 %.pre69, 1
  br i1 %24, label %._crit_edge44.loopexit.unr-lcssa, label %.lr.ph43.preheader.new

.lr.ph43.preheader.new:                           ; preds = %.lr.ph43.preheader
  %unroll_iter = and i64 %23, 2147483646
  br label %.lr.ph43

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge39
  %indvars.iv57 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next58, %._crit_edge39 ]
  %25 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv57
  %26 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %indvars.iv57
  br label %27

._crit_edge39:                                    ; preds = %45
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %.preheader31, label %.preheader, !llvm.loop !12

27:                                               ; preds = %.preheader, %45
  %indvars.iv54 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next55, %45 ]
  %28 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv54
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, -1
  br i1 %30, label %31, label %33

31:                                               ; preds = %27
  %32 = load i32, ptr %26, align 4, !tbaa !5
  br label %.sink.split

33:                                               ; preds = %27
  %34 = load i32, ptr %25, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %.not30 = icmp slt i64 %indvars.iv54, %35
  br i1 %.not30, label %45, label %36

36:                                               ; preds = %33
  %37 = trunc nuw nsw i64 %indvars.iv54 to i32
  %38 = sub nsw i32 %37, %34
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %45

43:                                               ; preds = %36
  %44 = add nsw i32 %41, -1
  br label %.sink.split

.sink.split:                                      ; preds = %43, %31
  %.sink = phi i32 [ %32, %31 ], [ %44, %43 ]
  store i32 %.sink, ptr %28, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %.sink.split, %36, %33
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge39, label %27, !llvm.loop !13

._crit_edge44.loopexit.unr-lcssa:                 ; preds = %72, %.lr.ph43.preheader
  %.lcssa78.ph = phi i32 [ poison, %.lr.ph43.preheader ], [ %73, %72 ]
  %indvars.iv62.unr = phi i64 [ 1, %.lr.ph43.preheader ], [ %indvars.iv.next63.1, %72 ]
  %.unr = phi i32 [ %ans.promoted, %.lr.ph43.preheader ], [ %73, %72 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge44, label %.lr.ph43.epil

.lr.ph43.epil:                                    ; preds = %._crit_edge44.loopexit.unr-lcssa
  %46 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv62.unr
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp sgt i32 %47, -1
  br i1 %48, label %49, label %._crit_edge44

49:                                               ; preds = %.lr.ph43.epil
  %50 = add nsw i32 %.unr, 1
  store i32 %50, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %._crit_edge44.loopexit.unr-lcssa, %49, %.lr.ph43.epil, %.preheader31.thread, %.preheader31
  %51 = phi i32 [ %ans.promoted, %.preheader31 ], [ %ans.promoted71, %.preheader31.thread ], [ %.lcssa78.ph, %._crit_edge44.loopexit.unr-lcssa ], [ %.unr, %.lr.ph43.epil ], [ %50, %49 ]
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %51)
  %53 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @v)
  %54 = icmp eq i32 %53, 2
  %55 = load i32, ptr @n, align 4
  %56 = load i32, ptr @v, align 4
  %57 = sub i32 0, %56
  %58 = icmp ne i32 %55, %57
  %59 = select i1 %54, i1 %58, i1 false
  br i1 %59, label %.lr.ph46, label %._crit_edge47, !llvm.loop !14

.lr.ph43:                                         ; preds = %72, %.lr.ph43.preheader.new
  %indvars.iv62 = phi i64 [ 1, %.lr.ph43.preheader.new ], [ %indvars.iv.next63.1, %72 ]
  %60 = phi i32 [ %ans.promoted, %.lr.ph43.preheader.new ], [ %73, %72 ]
  %niter = phi i64 [ 0, %.lr.ph43.preheader.new ], [ %niter.next.1, %72 ]
  %61 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv62
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, -1
  br i1 %63, label %64, label %.lr.ph43.1

64:                                               ; preds = %.lr.ph43
  %65 = add nsw i32 %60, 1
  store i32 %65, ptr @ans, align 4, !tbaa !5
  br label %.lr.ph43.1

.lr.ph43.1:                                       ; preds = %.lr.ph43, %64
  %66 = phi i32 [ %60, %.lr.ph43 ], [ %65, %64 ]
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %67 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv.next63
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, -1
  br i1 %69, label %70, label %72

70:                                               ; preds = %.lr.ph43.1
  %71 = add nsw i32 %66, 1
  store i32 %71, ptr @ans, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %70, %.lr.ph43.1
  %73 = phi i32 [ %66, %.lr.ph43.1 ], [ %71, %70 ]
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge44.loopexit.unr-lcssa, label %.lr.ph43, !llvm.loop !15

._crit_edge47:                                    ; preds = %._crit_edge44, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

attributes #0 = { mustprogress nofree norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass