; LLVM IR from tangjz/acm-icpc :: hdu (4304)

; 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"

%struct.FactExp = type { i32, [12 x i32] }

@lnk = external dso_local global [960991 x i32], align 16
@sz = external dso_local global [4358 x i32], align 16
@f = external dso_local global [4358 x [40 x i64]], align 16
@tot = external dso_local global i32, align 4
@prime = external dso_local global [125000 x i32], align 16
@vis = external dso_local global [1000004 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfs7FactExp(ptr noundef byval(%struct.FactExp) align 8) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8getNewIDxRi(i64 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10getFactExpx(ptr dead_on_unwind noalias writable sret(%struct.FactExp) align 4, i64 noundef) #4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %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
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.FactExp, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %68, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 1000004
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %71

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [1000004 x i8], ptr @vis, i64 0, i64 %18
  %20 = load i8, ptr %19, align 1, !tbaa !9, !range !11, !noundef !12
  %21 = trunc i8 %20 to i1
  br i1 %21, label %28, label %22

22:                                               ; preds = %16
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr @tot, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @tot, align 4, !tbaa !5
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [125000 x i32], ptr @prime, i64 0, i64 %26
  store i32 %23, ptr %27, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %22, %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sdiv i32 1000003, %29
  store i32 %30, ptr %5, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %63, %28
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr @tot, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %35, label %42

35:                                               ; preds = %31
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [125000 x i32], ptr @prime, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br label %42

42:                                               ; preds = %35, %31
  %43 = phi i1 [ false, %31 ], [ %41, %35 ]
  br i1 %43, label %45, label %44

44:                                               ; preds = %42
  store i32 5, ptr %3, align 4
  br label %66

45:                                               ; preds = %42
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [125000 x i32], ptr @prime, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = mul nsw i32 %46, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1000004 x i8], ptr @vis, i64 0, i64 %52
  store i8 1, ptr %53, align 1, !tbaa !9
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [125000 x i32], ptr @prime, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = srem i32 %54, %58
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %45
  store i32 5, ptr %3, align 4
  br label %66

62:                                               ; preds = %45
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %4, align 4, !tbaa !5
  br label %31, !llvm.loop !13

66:                                               ; preds = %61, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !15

71:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.memset.p0.i64(ptr align 16 @lnk, i8 -1, i64 3843964, i1 false)
  %72 = call noundef zeroext i1 @_Z8getNewIDxRi(i64 noundef 0, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 1, ptr @sz, align 16, !tbaa !5
  store i64 1, ptr @f, align 16, !tbaa !16
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
  br label %74

74:                                               ; preds = %131, %129, %71
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = add nsw i32 %75, -1
  store i32 %76, ptr %6, align 4, !tbaa !5
  %77 = icmp ne i32 %75, 0
  br i1 %77, label %78, label %132

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !16
  %79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %8)
  %80 = load i64, ptr %8, align 8, !tbaa !16
  %81 = icmp eq i64 %80, 1
  br i1 %81, label %82, label %84

82:                                               ; preds = %78
  %83 = call i32 @puts(ptr noundef @.str.2)
  store i32 8, ptr %3, align 4
  br label %129, !llvm.loop !18

84:                                               ; preds = %78
  %85 = load i64, ptr %8, align 8, !tbaa !16
  call void @_Z10getFactExpx(ptr dead_on_unwind writable sret(%struct.FactExp) align 4 %10, i64 noundef %85)
  %86 = call noundef i32 @_Z3dfs7FactExp(ptr noundef byval(%struct.FactExp) align 8 %10)
  store i32 %86, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %122, %84
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [4358 x i32], ptr @sz, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp slt i32 %88, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %87
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %125

95:                                               ; preds = %87
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [4358 x [40 x i64]], ptr @f, i64 0, i64 %97
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [40 x i64], ptr %98, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !16
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [4358 x [40 x i64]], ptr @f, i64 0, i64 %104
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [40 x i64], ptr %105, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !16
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [4358 x [40 x i64]], ptr @f, i64 0, i64 %112
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [40 x i64], ptr %113, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !16
  %118 = add nsw i64 %110, %117
  %119 = mul nsw i64 %102, %118
  %120 = load i64, ptr %9, align 8, !tbaa !16
  %121 = add nsw i64 %120, %119
  store i64 %121, ptr %9, align 8, !tbaa !16
  br label %122

122:                                              ; preds = %95
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %11, align 4, !tbaa !5
  br label %87, !llvm.loop !19

125:                                              ; preds = %94
  %126 = load i64, ptr %9, align 8, !tbaa !16
  %127 = shl i64 %126, 1
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %127)
  store i32 0, ptr %3, align 4
  br label %129

129:                                              ; preds = %125, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %130 = load i32, ptr %3, align 4
  switch i32 %130, label %134 [
    i32 0, label %131
    i32 8, label %74
  ]

131:                                              ; preds = %129
  br label %74, !llvm.loop !18

132:                                              ; preds = %74
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %133 = load i32, ptr %1, align 4
  ret i32 %133

134:                                              ; preds = %129
  unreachable
}

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

declare i32 @puts(ptr noundef) #6

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

attributes #0 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress 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 #5 = { 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 #6 = { "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 #7 = { 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


; 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"

%struct.FactExp = type { i32, [12 x i32] }

@lnk = external dso_local local_unnamed_addr global [960991 x i32], align 16
@sz = external dso_local local_unnamed_addr global [4358 x i32], align 16
@f = external dso_local local_unnamed_addr global [4358 x [40 x i64]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@prime = external dso_local local_unnamed_addr global [125000 x i32], align 16
@vis = external dso_local local_unnamed_addr global [1000004 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfs7FactExp(ptr noundef byval(%struct.FactExp) align 8) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8getNewIDxRi(i64 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10getFactExpx(ptr dead_on_unwind noalias writable sret(%struct.FactExp) align 4, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %struct.FactExp, align 8
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %9

4:                                                ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3843964) @lnk, i8 -1, i64 3843964, i1 false)
  %5 = call noundef zeroext i1 @_Z8getNewIDxRi(i64 noundef 0, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i32 1, ptr @sz, align 16, !tbaa !5
  store i64 1, ptr @f, align 16, !tbaa !9
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr %1, align 4, !tbaa !5
  %.not38 = icmp eq i32 %7, 0
  br i1 %.not38, label %._crit_edge41, label %.lr.ph40

9:                                                ; preds = %0, %.critedge
  %indvars.iv43 = phi i64 [ 2, %0 ], [ %indvars.iv.next44, %.critedge ]
  %10 = phi i32 [ %tot.promoted, %0 ], [ %20, %.critedge ]
  %11 = getelementptr inbounds [1000004 x i8], ptr @vis, i64 0, i64 %indvars.iv43
  %12 = load i8, ptr %11, align 1, !tbaa !11, !range !13, !noundef !14
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %._crit_edge50, label %14

._crit_edge50:                                    ; preds = %9
  %.pre51 = trunc nuw nsw i64 %indvars.iv43 to i32
  br label %19

14:                                               ; preds = %9
  %15 = add nsw i32 %10, 1
  store i32 %15, ptr @tot, align 4, !tbaa !5
  %16 = sext i32 %10 to i64
  %17 = getelementptr inbounds [125000 x i32], ptr @prime, i64 0, i64 %16
  %18 = trunc nuw nsw i64 %indvars.iv43 to i32
  store i32 %18, ptr %17, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %._crit_edge50, %14
  %.pre-phi = phi i32 [ %.pre51, %._crit_edge50 ], [ %18, %14 ]
  %20 = phi i32 [ %10, %._crit_edge50 ], [ %15, %14 ]
  %21 = udiv i32 1000003, %.pre-phi
  %22 = icmp sgt i32 %20, 0
  br i1 %22, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %19
  %23 = zext nneg i32 %20 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %26
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %26 ]
  %24 = getelementptr inbounds [125000 x i32], ptr @prime, i64 0, i64 %indvars.iv
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %.not30 = icmp sgt i32 %25, %21
  br i1 %.not30, label %.critedge, label %26

26:                                               ; preds = %.lr.ph
  %27 = mul nsw i32 %25, %.pre-phi
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1000004 x i8], ptr @vis, i64 0, i64 %28
  store i8 1, ptr %29, align 1, !tbaa !11
  %30 = srem i32 %.pre-phi, %25
  %31 = icmp ne i32 %30, 0
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = icmp ult i64 %indvars.iv.next, %23
  %or.cond = select i1 %31, i1 %32, i1 false
  br i1 %or.cond, label %.lr.ph, label %.critedge, !llvm.loop !15

.critedge:                                        ; preds = %.lr.ph, %26, %19
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next44, 1000004
  br i1 %exitcond.not, label %4, label %9, !llvm.loop !17

.lr.ph40:                                         ; preds = %4, %65
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %34 = load i64, ptr %2, align 8, !tbaa !9
  %35 = icmp eq i64 %34, 1
  br i1 %35, label %36, label %38

36:                                               ; preds = %.lr.ph40
  %37 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %65, !llvm.loop !18

38:                                               ; preds = %.lr.ph40
  call void @_Z10getFactExpx(ptr dead_on_unwind nonnull writable sret(%struct.FactExp) align 4 %3, i64 noundef %34)
  %39 = call noundef i32 @_Z3dfs7FactExp(ptr noundef nonnull byval(%struct.FactExp) align 8 %3)
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [4358 x i32], ptr @sz, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 1
  br i1 %43, label %.lr.ph37.preheader, label %._crit_edge

.lr.ph37.preheader:                               ; preds = %38
  %wide.trip.count = zext nneg i32 %42 to i64
  %.phi.trans.insert = getelementptr inbounds [4358 x [40 x i64]], ptr @f, i64 0, i64 %40, i64 0
  %.pre = load i64, ptr %.phi.trans.insert, align 16, !tbaa !9
  %44 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %42, 5
  br i1 %min.iters.check, label %.lr.ph37.preheader54, label %vector.ph

.lr.ph37.preheader54:                             ; preds = %middle.block, %.lr.ph37.preheader
  %.ph = phi i64 [ %.pre, %.lr.ph37.preheader ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv46.ph = phi i64 [ 1, %.lr.ph37.preheader ], [ %ind.end, %middle.block ]
  %.02535.ph = phi i64 [ 0, %.lr.ph37.preheader ], [ %56, %middle.block ]
  br label %.lr.ph37

vector.ph:                                        ; preds = %.lr.ph37.preheader
  %n.vec = and i64 %44, -4
  %ind.end = or disjoint i64 %n.vec, 1
  %vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load53, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %53, %vector.body ]
  %vec.phi52 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %54, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %45 = getelementptr inbounds [4358 x [40 x i64]], ptr @f, i64 0, i64 %40, i64 %offset.idx
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %wide.load = load <2 x i64>, ptr %45, align 8, !tbaa !9
  %wide.load53 = load <2 x i64>, ptr %46, align 8, !tbaa !9
  %47 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
  %48 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load53, <2 x i32> <i32 1, i32 2>
  %49 = add nsw <2 x i64> %47, %wide.load
  %50 = add nsw <2 x i64> %48, %wide.load53
  %51 = mul nsw <2 x i64> %49, %wide.load
  %52 = mul nsw <2 x i64> %50, %wide.load53
  %53 = add <2 x i64> %51, %vec.phi
  %54 = add <2 x i64> %52, %vec.phi52
  %index.next = add nuw i64 %index, 4
  %55 = icmp eq i64 %index.next, %n.vec
  br i1 %55, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %54, %53
  %56 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %vector.recur.extract = extractelement <2 x i64> %wide.load53, i64 1
  %cmp.n = icmp eq i64 %44, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph37.preheader54

._crit_edge:                                      ; preds = %.lr.ph37, %middle.block, %38
  %.025.lcssa = phi i64 [ 0, %38 ], [ %56, %middle.block ], [ %64, %.lr.ph37 ]
  %57 = shl i64 %.025.lcssa, 1
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %57)
  br label %65

.lr.ph37:                                         ; preds = %.lr.ph37.preheader54, %.lr.ph37
  %59 = phi i64 [ %61, %.lr.ph37 ], [ %.ph, %.lr.ph37.preheader54 ]
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %.lr.ph37 ], [ %indvars.iv46.ph, %.lr.ph37.preheader54 ]
  %.02535 = phi i64 [ %64, %.lr.ph37 ], [ %.02535.ph, %.lr.ph37.preheader54 ]
  %60 = getelementptr inbounds [4358 x [40 x i64]], ptr @f, i64 0, i64 %40, i64 %indvars.iv46
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = add nsw i64 %59, %61
  %63 = mul nsw i64 %62, %61
  %64 = add nsw i64 %63, %.02535
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond49.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count
  br i1 %exitcond49.not, label %._crit_edge, label %.lr.ph37, !llvm.loop !22

65:                                               ; preds = %._crit_edge, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %66, 0
  br i1 %.not, label %._crit_edge41, label %.lr.ph40

._crit_edge41:                                    ; preds = %65, %4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress 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 #5 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !16, !21, !20}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass