; LLVM IR from tangjz/acm-icpc :: self_training/2015-03-03 (O)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k1 = external dso_local global i32, align 4
@k2 = external dso_local global i32, align 4
@k3 = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@p = external dso_local global [21 x double], align 16
@f = external dso_local global [501 x double], align 16
@g = external dso_local global [501 x double], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 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
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %9

9:                                                ; preds = %143, %0
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %12 = icmp ne i32 %10, 0
  br i1 %12, label %13, label %149

13:                                               ; preds = %9
  call void @llvm.memset.p0.i64(ptr align 16 @p, i8 0, i64 168, i1 false)
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @k1, ptr noundef @k2, ptr noundef @k3, ptr noundef @a, ptr noundef @b, ptr noundef @c)
  %15 = load i32, ptr @k1, align 4, !tbaa !5
  %16 = load i32, ptr @k2, align 4, !tbaa !5
  %17 = mul nsw i32 %15, %16
  %18 = load i32, ptr @k3, align 4, !tbaa !5
  %19 = mul nsw i32 %17, %18
  %20 = sitofp i32 %19 to double
  %21 = fdiv double 1.000000e+00, %20
  store double %21, ptr @p, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %71, %13
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr @k1, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %74

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

28:                                               ; preds = %67, %27
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr @k2, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %70

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

34:                                               ; preds = %63, %33
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = load i32, ptr @k3, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %66

39:                                               ; preds = %34
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = load i32, ptr @a, align 4, !tbaa !5
  %42 = icmp ne i32 %40, %41
  br i1 %42, label %51, label %43

43:                                               ; preds = %39
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = load i32, ptr @b, align 4, !tbaa !5
  %46 = icmp ne i32 %44, %45
  br i1 %46, label %51, label %47

47:                                               ; preds = %43
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = load i32, ptr @c, align 4, !tbaa !5
  %50 = icmp ne i32 %48, %49
  br i1 %50, label %51, label %62

51:                                               ; preds = %47, %43, %39
  %52 = load double, ptr @p, align 16, !tbaa !9
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = add nsw i32 %53, %54
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = add nsw i32 %55, %56
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %58
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = fadd double %60, %52
  store double %61, ptr %59, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %51, %47
  br label %63

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

66:                                               ; preds = %38
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %4, align 4, !tbaa !5
  br label %28, !llvm.loop !13

70:                                               ; preds = %32
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !14

74:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %75 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %75, ptr %6, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %140, %74
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = icmp sge i32 %77, 0
  br i1 %78, label %80, label %79

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

80:                                               ; preds = %76
  %81 = load double, ptr @p, align 16, !tbaa !9
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [501 x double], ptr @f, i64 0, i64 %83
  store double %81, ptr %84, align 8, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [501 x double], ptr @g, i64 0, i64 %86
  store double 1.000000e+00, ptr %87, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 3, ptr %7, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %136, %80
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = load i32, ptr @k1, align 4, !tbaa !5
  %91 = load i32, ptr @k2, align 4, !tbaa !5
  %92 = add nsw i32 %90, %91
  %93 = load i32, ptr @k3, align 4, !tbaa !5
  %94 = add nsw i32 %92, %93
  %95 = icmp sle i32 %89, %94
  br i1 %95, label %96, label %102

96:                                               ; preds = %88
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = add nsw i32 %97, %98
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = icmp sle i32 %99, %100
  br label %102

102:                                              ; preds = %96, %88
  %103 = phi i1 [ false, %88 ], [ %101, %96 ]
  br i1 %103, label %105, label %104

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

105:                                              ; preds = %102
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = add nsw i32 %106, %107
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [501 x double], ptr @f, i64 0, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !9
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [501 x double], ptr @f, i64 0, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !9
  %120 = call double @llvm.fmuladd.f64(double %111, double %115, double %119)
  store double %120, ptr %118, align 8, !tbaa !9
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = add nsw i32 %121, %122
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [501 x double], ptr @g, i64 0, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !9
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !9
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [501 x double], ptr @g, i64 0, i64 %132
  %134 = load double, ptr %133, align 8, !tbaa !9
  %135 = call double @llvm.fmuladd.f64(double %126, double %130, double %134)
  store double %135, ptr %133, align 8, !tbaa !9
  br label %136

136:                                              ; preds = %105
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %7, align 4, !tbaa !5
  br label %88, !llvm.loop !15

139:                                              ; preds = %104
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = add nsw i32 %141, -1
  store i32 %142, ptr %6, align 4, !tbaa !5
  br label %76, !llvm.loop !16

143:                                              ; preds = %79
  %144 = load double, ptr @g, align 16, !tbaa !9
  %145 = load double, ptr @f, align 16, !tbaa !9
  %146 = fsub double 1.000000e+00, %145
  %147 = fdiv double %144, %146
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %147)
  br label %9, !llvm.loop !17

149:                                              ; preds = %9
  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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k1 = external dso_local global i32, align 4
@k2 = external dso_local global i32, align 4
@k3 = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@p = external dso_local local_unnamed_addr global [21 x double], align 16
@f = external dso_local local_unnamed_addr global [501 x double], align 16
@g = external dso_local local_unnamed_addr global [501 x double], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 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 @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not63 = icmp eq i32 %2, 0
  br i1 %.not63, label %._crit_edge66, label %.lr.ph65

.lr.ph65:                                         ; preds = %0, %._crit_edge62
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(168) @p, i8 0, i64 168, i1 false)
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @k1, ptr noundef nonnull @k2, ptr noundef nonnull @k3, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c)
  %5 = load i32, ptr @k1, align 4, !tbaa !5
  %6 = load i32, ptr @k2, align 4, !tbaa !5
  %7 = mul nsw i32 %6, %5
  %8 = load i32, ptr @k3, align 4, !tbaa !5
  %9 = mul nsw i32 %7, %8
  %10 = sitofp i32 %9 to double
  %11 = fdiv double 1.000000e+00, %10
  store double %11, ptr @p, align 16, !tbaa !9
  %.not3348 = icmp slt i32 %5, 1
  br i1 %.not3348, label %._crit_edge51, label %.preheader42.lr.ph

.preheader42.lr.ph:                               ; preds = %.lr.ph65
  %.not3645 = icmp slt i32 %6, 1
  %.not3743 = icmp slt i32 %8, 1
  %or.cond100 = select i1 %.not3645, i1 true, i1 %.not3743
  br i1 %or.cond100, label %._crit_edge51, label %.preheader42.preheader

.preheader42.preheader:                           ; preds = %.preheader42.lr.ph
  %12 = load i32, ptr @c, align 4
  %13 = load i32, ptr @b, align 4
  %14 = load i32, ptr @a, align 4
  %15 = add nuw i32 %8, 1
  %16 = zext i32 %12 to i64
  %17 = zext i32 %13 to i64
  %18 = add nuw i32 %6, 1
  %19 = zext i32 %14 to i64
  %20 = add nuw i32 %5, 1
  %wide.trip.count85 = zext i32 %20 to i64
  %wide.trip.count80 = zext i32 %18 to i64
  %wide.trip.count = zext i32 %15 to i64
  %21 = zext nneg i32 %8 to i64
  %22 = zext nneg i32 %8 to i64
  %min.iters.check107 = icmp ult i32 %8, 4
  %n.vec110 = and i64 %21, 2147483644
  %ind.end111 = or disjoint i64 %n.vec110, 1
  %broadcast.splatinsert117 = insertelement <2 x double> poison, double %11, i64 0
  %broadcast.splat118 = shufflevector <2 x double> %broadcast.splatinsert117, <2 x double> poison, <2 x i32> zeroinitializer
  %cmp.n120 = icmp eq i64 %n.vec110, %21
  %xtraiter = and i64 %22, 1
  %23 = icmp eq i32 %15, 2
  %unroll_iter = and i64 %22, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader42

.preheader42:                                     ; preds = %.preheader42.preheader, %._crit_edge47.split
  %indvars.iv82 = phi i64 [ 1, %.preheader42.preheader ], [ %indvars.iv.next83, %._crit_edge47.split ]
  %.not38 = icmp eq i64 %indvars.iv82, %19
  br label %.preheader

._crit_edge51:                                    ; preds = %._crit_edge47.split, %.preheader42.lr.ph, %.lr.ph65
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, -1
  br i1 %25, label %.lr.ph61, label %._crit_edge62

.lr.ph61:                                         ; preds = %._crit_edge51
  %26 = add nsw i32 %6, %5
  %27 = add nsw i32 %26, %8
  %.not3455 = icmp slt i32 %27, 3
  br i1 %.not3455, label %.critedge.us.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph61
  %28 = add i32 %8, 1
  %29 = add i32 %28, %6
  %30 = add i32 %29, %5
  %31 = zext nneg i32 %24 to i64
  %wide.trip.count90 = zext i32 %30 to i64
  br label %.lr.ph

.critedge.us.preheader:                           ; preds = %.lr.ph61
  %32 = zext nneg i32 %24 to i64
  %33 = add nuw nsw i64 %32, 1
  %min.iters.check = icmp ult i32 %24, 3
  br i1 %min.iters.check, label %.critedge.us.preheader123, label %vector.ph

vector.ph:                                        ; preds = %.critedge.us.preheader
  %n.vec = and i64 %33, 4294967292
  %ind.end = sub nsw i64 %32, %n.vec
  %broadcast.splatinsert = insertelement <2 x double> poison, double %11, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %32, %index
  %34 = getelementptr inbounds [501 x double], ptr @f, i64 0, i64 %offset.idx
  %35 = getelementptr inbounds i8, ptr %34, i64 -8
  %36 = getelementptr inbounds i8, ptr %34, i64 -24
  store <2 x double> %broadcast.splat, ptr %35, align 8, !tbaa !9
  store <2 x double> %broadcast.splat, ptr %36, align 8, !tbaa !9
  %37 = getelementptr inbounds [501 x double], ptr @g, i64 0, i64 %offset.idx
  %38 = getelementptr inbounds i8, ptr %37, i64 -8
  %39 = getelementptr inbounds i8, ptr %37, i64 -24
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %38, align 8, !tbaa !9
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %39, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %33, %n.vec
  br i1 %cmp.n, label %._crit_edge62, label %.critedge.us.preheader123

.critedge.us.preheader123:                        ; preds = %middle.block, %.critedge.us.preheader
  %indvars.iv95.ph = phi i64 [ %32, %.critedge.us.preheader ], [ %ind.end, %middle.block ]
  br label %.critedge.us

.critedge.us:                                     ; preds = %.critedge.us.preheader123, %.critedge.us
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %.critedge.us ], [ %indvars.iv95.ph, %.critedge.us.preheader123 ]
  %41 = getelementptr inbounds [501 x double], ptr @f, i64 0, i64 %indvars.iv95
  store double %11, ptr %41, align 8, !tbaa !9
  %42 = getelementptr inbounds [501 x double], ptr @g, i64 0, i64 %indvars.iv95
  store double 1.000000e+00, ptr %42, align 8, !tbaa !9
  %indvars.iv.next96 = add nsw i64 %indvars.iv95, -1
  %.not101 = icmp eq i64 %indvars.iv95, 0
  br i1 %.not101, label %._crit_edge62, label %.critedge.us, !llvm.loop !15

.preheader:                                       ; preds = %.preheader42, %._crit_edge
  %indvars.iv77 = phi i64 [ 1, %.preheader42 ], [ %indvars.iv.next78, %._crit_edge ]
  %.not39 = icmp eq i64 %indvars.iv77, %17
  %or.cond = select i1 %.not38, i1 %.not39, i1 false
  %43 = add nuw nsw i64 %indvars.iv77, %indvars.iv82
  %or.cond.fr = freeze i1 %or.cond
  br i1 %or.cond.fr, label %.lr.ph.split.preheader, label %.lr.ph.split.us.preheader

.lr.ph.split.preheader:                           ; preds = %.preheader
  br i1 %23, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %.preheader
  br i1 %min.iters.check107, label %.lr.ph.split.us.preheader121, label %vector.body113

vector.body113:                                   ; preds = %.lr.ph.split.us.preheader, %vector.body113
  %index114 = phi i64 [ %index.next119, %vector.body113 ], [ 0, %.lr.ph.split.us.preheader ]
  %offset.idx115 = or disjoint i64 %index114, 1
  %44 = add nuw nsw i64 %43, %offset.idx115
  %45 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %44
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %wide.load = load <2 x double>, ptr %45, align 8, !tbaa !9
  %wide.load116 = load <2 x double>, ptr %46, align 8, !tbaa !9
  %47 = fadd <2 x double> %broadcast.splat118, %wide.load
  %48 = fadd <2 x double> %broadcast.splat118, %wide.load116
  store <2 x double> %47, ptr %45, align 8, !tbaa !9
  store <2 x double> %48, ptr %46, align 8, !tbaa !9
  %index.next119 = add nuw i64 %index114, 4
  %49 = icmp eq i64 %index.next119, %n.vec110
  br i1 %49, label %middle.block105, label %vector.body113, !llvm.loop !16

middle.block105:                                  ; preds = %vector.body113
  br i1 %cmp.n120, label %._crit_edge, label %.lr.ph.split.us.preheader121

.lr.ph.split.us.preheader121:                     ; preds = %middle.block105, %.lr.ph.split.us.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.split.us.preheader ], [ %ind.end111, %middle.block105 ]
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader121, %.lr.ph.split.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.split.us ], [ %indvars.iv.ph, %.lr.ph.split.us.preheader121 ]
  %50 = add nuw nsw i64 %43, %indvars.iv
  %51 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %50
  %52 = load double, ptr %51, align 8, !tbaa !9
  %53 = fadd double %11, %52
  store double %53, ptr %51, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !17

._crit_edge47.split:                              ; preds = %._crit_edge
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
  br i1 %exitcond86.not, label %._crit_edge51, label %.preheader42, !llvm.loop !18

._crit_edge.loopexit.unr-lcssa:                   ; preds = %69, %.lr.ph.split.preheader
  %indvars.iv72.unr = phi i64 [ 1, %.lr.ph.split.preheader ], [ %indvars.iv.next73.1, %69 ]
  %.not40.epil = icmp eq i64 %indvars.iv72.unr, %16
  %or.cond125 = select i1 %lcmp.mod.not, i1 true, i1 %.not40.epil
  br i1 %or.cond125, label %._crit_edge, label %54

54:                                               ; preds = %._crit_edge.loopexit.unr-lcssa
  %55 = add nuw nsw i64 %43, %indvars.iv72.unr
  %56 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = fadd double %11, %57
  store double %58, ptr %56, align 8, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.split.us, %._crit_edge.loopexit.unr-lcssa, %54, %middle.block105
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count80
  br i1 %exitcond81.not, label %._crit_edge47.split, label %.preheader, !llvm.loop !19

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader, %69
  %indvars.iv72 = phi i64 [ %indvars.iv.next73.1, %69 ], [ 1, %.lr.ph.split.preheader ]
  %niter = phi i64 [ %niter.next.1, %69 ], [ 0, %.lr.ph.split.preheader ]
  %.not40 = icmp eq i64 %indvars.iv72, %16
  br i1 %.not40, label %.lr.ph.split.1, label %59

59:                                               ; preds = %.lr.ph.split
  %60 = add nuw nsw i64 %43, %indvars.iv72
  %61 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %60
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = fadd double %11, %62
  store double %63, ptr %61, align 8, !tbaa !9
  br label %.lr.ph.split.1

.lr.ph.split.1:                                   ; preds = %.lr.ph.split, %59
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %.not40.1 = icmp eq i64 %indvars.iv.next73, %16
  br i1 %.not40.1, label %69, label %64

64:                                               ; preds = %.lr.ph.split.1
  %65 = add nuw nsw i64 %43, %indvars.iv.next73
  %66 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %65
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = fadd double %11, %67
  store double %68, ptr %66, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %64, %.lr.ph.split.1
  %indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 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_edge.loopexit.unr-lcssa, label %.lr.ph.split, !llvm.loop !20

._crit_edge62:                                    ; preds = %.critedge, %.critedge.us, %middle.block, %._crit_edge51
  %70 = load double, ptr @g, align 16, !tbaa !9
  %71 = load double, ptr @f, align 16, !tbaa !9
  %72 = fsub double 1.000000e+00, %71
  %73 = fdiv double %70, %72
  %74 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %73)
  %75 = load i32, ptr @t, align 4, !tbaa !5
  %76 = add nsw i32 %75, -1
  store i32 %76, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %75, 0
  br i1 %.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !21

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.critedge
  %indvars.iv92 = phi i64 [ %31, %.lr.ph.preheader ], [ %indvars.iv.next93, %.critedge ]
  %77 = getelementptr inbounds [501 x double], ptr @f, i64 0, i64 %indvars.iv92
  store double %11, ptr %77, align 8, !tbaa !9
  %78 = getelementptr inbounds [501 x double], ptr @g, i64 0, i64 %indvars.iv92
  store double 1.000000e+00, ptr %78, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %.lr.ph, %85
  %80 = phi double [ 1.000000e+00, %.lr.ph ], [ %93, %85 ]
  %81 = phi double [ %11, %.lr.ph ], [ %90, %85 ]
  %indvars.iv87 = phi i64 [ 3, %.lr.ph ], [ %indvars.iv.next88, %85 ]
  %82 = add nuw nsw i64 %indvars.iv87, %indvars.iv92
  %83 = trunc nuw i64 %82 to i32
  %.not35 = icmp slt i32 %24, %83
  br i1 %.not35, label %.critedge, label %85

.critedge:                                        ; preds = %79, %85
  %indvars.iv.next93 = add nsw i64 %indvars.iv92, -1
  %84 = icmp sgt i64 %indvars.iv92, 0
  br i1 %84, label %.lr.ph, label %._crit_edge62, !llvm.loop !22

85:                                               ; preds = %79
  %86 = getelementptr inbounds [501 x double], ptr @f, i64 0, i64 %82
  %87 = load double, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %indvars.iv87
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = tail call double @llvm.fmuladd.f64(double %87, double %89, double %81)
  store double %90, ptr %77, align 8, !tbaa !9
  %91 = getelementptr inbounds [501 x double], ptr @g, i64 0, i64 %82
  %92 = load double, ptr %91, align 8, !tbaa !9
  %93 = tail call double @llvm.fmuladd.f64(double %92, double %89, double %80)
  store double %93, ptr %78, align 8, !tbaa !9
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90
  br i1 %exitcond91.not, label %.critedge, label %79, !llvm.loop !23

._crit_edge66:                                    ; preds = %._crit_edge62, %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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; 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) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12, !13, !14}
!17 = distinct !{!17, !12, !14, !13}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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