; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-04-04 (F - Marching Course - lzy)

; 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.Edge = type { i32, i32, i32, ptr }

@E = external dso_local global [40009 x %struct.Edge], align 16
@e = external dso_local global ptr, align 8
@lnk = external dso_local global [209 x ptr], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@P = external dso_local global i32, align 4
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@f = external dso_local global [1009 x [209 x double]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  store i32 0, ptr %1, align 4
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @P)
  store ptr @E, ptr @e, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %12, %0
  %9 = load i32, ptr @m, align 4, !tbaa !9
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @m, align 4, !tbaa !9
  %11 = icmp ne i32 %9, 0
  br i1 %11, label %12, label %22

12:                                               ; preds = %8
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @u, ptr noundef @v, ptr noundef @d, ptr noundef @s)
  %14 = load i32, ptr @u, align 4, !tbaa !9
  %15 = load i32, ptr @v, align 4, !tbaa !9
  %16 = load i32, ptr @d, align 4, !tbaa !9
  %17 = load i32, ptr @s, align 4, !tbaa !9
  call void @_Z3addiiii(i32 noundef %14, i32 noundef %15, i32 noundef %16, i32 noundef %17)
  %18 = load i32, ptr @v, align 4, !tbaa !9
  %19 = load i32, ptr @u, align 4, !tbaa !9
  %20 = load i32, ptr @d, align 4, !tbaa !9
  %21 = load i32, ptr @s, align 4, !tbaa !9
  call void @_Z3addiiii(i32 noundef %18, i32 noundef %19, i32 noundef %20, i32 noundef %21)
  br label %8, !llvm.loop !11

22:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %44, %22
  %24 = load i32, ptr %2, align 4, !tbaa !9
  %25 = load i32, ptr @P, align 4, !tbaa !9
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  store i32 1, ptr @u, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %40, %28
  %30 = load i32, ptr @u, align 4, !tbaa !9
  %31 = load i32, ptr @n, align 4, !tbaa !9
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %33, label %43

33:                                               ; preds = %29
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %35
  %37 = load i32, ptr @u, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [209 x double], ptr %36, i64 0, i64 %38
  store double -1.000000e+09, ptr %39, align 8, !tbaa !13
  br label %40

40:                                               ; preds = %33
  %41 = load i32, ptr @u, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr @u, align 4, !tbaa !9
  br label %29, !llvm.loop !15

43:                                               ; preds = %29
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %2, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %2, align 4, !tbaa !9
  br label %23, !llvm.loop !16

47:                                               ; preds = %27
  store double 0.000000e+00, ptr getelementptr inbounds ([209 x double], ptr @f, i64 0, i64 1), align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %144, %47
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = load i32, ptr @P, align 4, !tbaa !9
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %147

53:                                               ; preds = %48
  store i32 1, ptr @u, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %140, %53
  %55 = load i32, ptr @u, align 4, !tbaa !9
  %56 = load i32, ptr @n, align 4, !tbaa !9
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %58, label %143

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %59 = load i32, ptr @u, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [209 x ptr], ptr @lnk, i64 0, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  store ptr %62, ptr %5, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %135, %58
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %67, label %66

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

67:                                               ; preds = %63
  %68 = load i32, ptr %3, align 4, !tbaa !9
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Edge, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !17
  %72 = mul nsw i32 2, %71
  %73 = add nsw i32 %68, %72
  %74 = load i32, ptr @P, align 4, !tbaa !9
  %75 = icmp sle i32 %73, %74
  br i1 %75, label %76, label %103

76:                                               ; preds = %67
  %77 = load i32, ptr %3, align 4, !tbaa !9
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Edge, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !17
  %81 = mul nsw i32 2, %80
  %82 = add nsw i32 %77, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %83
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Edge, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !19
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [209 x double], ptr %84, i64 0, i64 %88
  %90 = load i32, ptr %3, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %91
  %93 = load i32, ptr @u, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [209 x double], ptr %92, i64 0, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !13
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.Edge, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 8, !tbaa !20
  %100 = mul nsw i32 2, %99
  %101 = sitofp i32 %100 to double
  %102 = fadd double %96, %101
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %89, double noundef %102)
  br label %134

103:                                              ; preds = %67
  %104 = load i32, ptr @P, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %105
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Edge, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 8, !tbaa !19
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [209 x double], ptr %106, i64 0, i64 %110
  %112 = load i32, ptr %3, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr @u, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [209 x double], ptr %114, i64 0, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !13
  %119 = load i32, ptr @P, align 4, !tbaa !9
  %120 = load i32, ptr %3, align 4, !tbaa !9
  %121 = sub nsw i32 %119, %120
  %122 = sitofp i32 %121 to double
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.Edge, ptr %123, i32 0, i32 2
  %125 = load i32, ptr %124, align 8, !tbaa !20
  %126 = sitofp i32 %125 to double
  %127 = fmul double %122, %126
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.Edge, ptr %128, i32 0, i32 1
  %130 = load i32, ptr %129, align 4, !tbaa !17
  %131 = sitofp i32 %130 to double
  %132 = fdiv double %127, %131
  %133 = fadd double %118, %132
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %111, double noundef %133)
  br label %134

134:                                              ; preds = %103, %76
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.Edge, ptr %136, i32 0, i32 3
  %138 = load ptr, ptr %137, align 8, !tbaa !21
  store ptr %138, ptr %5, align 8, !tbaa !5
  br label %63, !llvm.loop !22

139:                                              ; preds = %66
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr @u, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @u, align 4, !tbaa !9
  br label %54, !llvm.loop !23

143:                                              ; preds = %54
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %3, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %3, align 4, !tbaa !9
  br label %48, !llvm.loop !24

147:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store double 0.000000e+00, ptr %6, align 8, !tbaa !13
  store i32 1, ptr @u, align 4, !tbaa !9
  br label %148

148:                                              ; preds = %160, %147
  %149 = load i32, ptr @u, align 4, !tbaa !9
  %150 = load i32, ptr @n, align 4, !tbaa !9
  %151 = icmp sle i32 %149, %150
  br i1 %151, label %152, label %163

152:                                              ; preds = %148
  %153 = load i32, ptr @P, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %154
  %156 = load i32, ptr @u, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [209 x double], ptr %155, i64 0, i64 %157
  %159 = load double, ptr %158, align 8, !tbaa !13
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %6, double noundef %159)
  br label %160

160:                                              ; preds = %152
  %161 = load i32, ptr @u, align 4, !tbaa !9
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr @u, align 4, !tbaa !9
  br label %148, !llvm.loop !25

163:                                              ; preds = %148
  %164 = load double, ptr %6, align 8, !tbaa !13
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %164)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %166 = load i32, ptr %1, align 4
  ret i32 %166
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #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, ...) #2

attributes #0 = { 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 #1 = { 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 #2 = { "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 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !10, i64 4}
!18 = !{!"_ZTS4Edge", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16}
!19 = !{!18, !10, i64 0}
!20 = !{!18, !10, i64 8}
!21 = !{!18, !6, i64 16}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !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"

%struct.Edge = type { i32, i32, i32, ptr }

@E = external dso_local global [40009 x %struct.Edge], align 16
@e = external dso_local local_unnamed_addr global ptr, align 8
@lnk = external dso_local local_unnamed_addr global [209 x ptr], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@P = external dso_local global i32, align 4
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@f = external dso_local global [1009 x [209 x double]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca double, align 8
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @P)
  store ptr @E, ptr @e, align 8, !tbaa !5
  %3 = load i32, ptr @m, align 4, !tbaa !9
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr @m, align 4, !tbaa !9
  %.not36 = icmp eq i32 %3, 0
  br i1 %.not36, label %.preheader35, label %.lr.ph

.preheader35:                                     ; preds = %.lr.ph, %0
  %5 = load i32, ptr @P, align 4, !tbaa !9
  %.not2640 = icmp slt i32 %5, 0
  %.pre73.pre = load i32, ptr @n, align 4, !tbaa !9
  br i1 %.not2640, label %.thread, label %.preheader34.lr.ph

.thread:                                          ; preds = %.preheader35
  store double 0.000000e+00, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !11
  br label %._crit_edge54

.preheader34.lr.ph:                               ; preds = %.preheader35
  %.not3337 = icmp slt i32 %.pre73.pre, 1
  br i1 %.not3337, label %.loopexit, label %.preheader34.preheader

.preheader34.preheader:                           ; preds = %.preheader34.lr.ph
  %6 = add nuw i32 %.pre73.pre, 1
  %7 = add nuw i32 %5, 1
  %wide.trip.count66 = zext i32 %7 to i64
  %wide.trip.count = zext i32 %6 to i64
  %8 = zext nneg i32 %.pre73.pre to i64
  %min.iters.check = icmp ult i32 %.pre73.pre, 4
  %n.vec = and i64 %8, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %n.vec, %8
  br label %.preheader34

.lr.ph:                                           ; preds = %0, %.lr.ph
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @u, ptr noundef nonnull @v, ptr noundef nonnull @d, ptr noundef nonnull @s)
  %10 = load i32, ptr @u, align 4, !tbaa !9
  %11 = load i32, ptr @v, align 4, !tbaa !9
  %12 = load i32, ptr @d, align 4, !tbaa !9
  %13 = load i32, ptr @s, align 4, !tbaa !9
  tail call void @_Z3addiiii(i32 noundef %10, i32 noundef %11, i32 noundef %12, i32 noundef %13)
  %14 = load i32, ptr @v, align 4, !tbaa !9
  %15 = load i32, ptr @u, align 4, !tbaa !9
  %16 = load i32, ptr @d, align 4, !tbaa !9
  %17 = load i32, ptr @s, align 4, !tbaa !9
  tail call void @_Z3addiiii(i32 noundef %14, i32 noundef %15, i32 noundef %16, i32 noundef %17)
  %18 = load i32, ptr @m, align 4, !tbaa !9
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr @m, align 4, !tbaa !9
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %.preheader35, label %.lr.ph, !llvm.loop !13

.preheader34:                                     ; preds = %.preheader34.preheader, %._crit_edge
  %indvars.iv63 = phi i64 [ 0, %.preheader34.preheader ], [ %indvars.iv.next64, %._crit_edge ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader34
  %indvars.iv.ph = phi i64 [ 1, %.preheader34 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader34, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader34 ]
  %offset.idx = or disjoint i64 %index, 1
  %20 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %indvars.iv63, i64 %offset.idx
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <2 x double> <double -1.000000e+09, double -1.000000e+09>, ptr %20, align 8, !tbaa !11
  store <2 x double> <double -1.000000e+09, double -1.000000e+09>, ptr %21, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

.loopexit:                                        ; preds = %._crit_edge, %.preheader34.lr.ph
  store double 0.000000e+00, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !11
  %.not79 = icmp eq i32 %5, 0
  br i1 %.not79, label %._crit_edge54, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.loopexit
  %23 = icmp slt i32 %.pre73.pre, 1
  br i1 %23, label %._crit_edge54.thread, label %.preheader

._crit_edge54.thread:                             ; preds = %.preheader.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  store double 0.000000e+00, ptr %1, align 8, !tbaa !11
  store i32 1, ptr @u, align 4, !tbaa !9
  br label %._crit_edge59

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %24 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %indvars.iv63, i64 %indvars.iv
  store double -1.000000e+09, ptr %24, align 8, !tbaa !11
  %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 %scalar.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66
  br i1 %exitcond67.not, label %.loopexit, label %.preheader34, !llvm.loop !19

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge52
  %25 = phi i32 [ %65, %._crit_edge52 ], [ %5, %.preheader.lr.ph ]
  %26 = phi i32 [ %66, %._crit_edge52 ], [ %.pre73.pre, %.preheader.lr.ph ]
  %27 = phi i32 [ %67, %._crit_edge52 ], [ %.pre73.pre, %.preheader.lr.ph ]
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %._crit_edge52 ], [ 0, %.preheader.lr.ph ]
  store i32 1, ptr @u, align 4, !tbaa !9
  %.not2949 = icmp slt i32 %27, 1
  br i1 %.not2949, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader
  %28 = trunc nuw nsw i64 %indvars.iv68 to i32
  br label %30

._crit_edge54:                                    ; preds = %._crit_edge52, %.thread, %.loopexit
  %29 = phi i32 [ %.pre73.pre, %.loopexit ], [ %.pre73.pre, %.thread ], [ %66, %._crit_edge52 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  store double 0.000000e+00, ptr %1, align 8, !tbaa !11
  store i32 1, ptr @u, align 4, !tbaa !9
  %.not2755 = icmp slt i32 %29, 1
  br i1 %.not2755, label %._crit_edge59, label %.lr.ph58

30:                                               ; preds = %.lr.ph51, %._crit_edge48
  %31 = phi i32 [ %26, %.lr.ph51 ], [ %34, %._crit_edge48 ]
  %storemerge2850 = phi i32 [ 1, %.lr.ph51 ], [ %36, %._crit_edge48 ]
  %32 = sext i32 %storemerge2850 to i64
  %33 = getelementptr inbounds [209 x ptr], ptr @lnk, i64 0, i64 %32
  %.043 = load ptr, ptr %33, align 8, !tbaa !5
  %.not3044 = icmp eq ptr %.043, null
  br i1 %.not3044, label %._crit_edge48, label %.lr.ph47

._crit_edge48.loopexit:                           ; preds = %62
  %.pre = load i32, ptr @u, align 4, !tbaa !9
  %.pre71 = load i32, ptr @n, align 4, !tbaa !9
  br label %._crit_edge48

._crit_edge48:                                    ; preds = %._crit_edge48.loopexit, %30
  %34 = phi i32 [ %.pre71, %._crit_edge48.loopexit ], [ %31, %30 ]
  %35 = phi i32 [ %.pre, %._crit_edge48.loopexit ], [ %storemerge2850, %30 ]
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @u, align 4, !tbaa !9
  %.not29.not = icmp slt i32 %35, %34
  br i1 %.not29.not, label %30, label %._crit_edge52.loopexit, !llvm.loop !20

.lr.ph47:                                         ; preds = %30, %62
  %.045 = phi ptr [ %.0, %62 ], [ %.043, %30 ]
  %37 = getelementptr inbounds i8, ptr %.045, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !21
  %39 = shl nsw i32 %38, 1
  %40 = add nsw i32 %39, %28
  %41 = load i32, ptr @P, align 4, !tbaa !9
  %.not31 = icmp sgt i32 %40, %41
  %42 = load i32, ptr %.045, align 8, !tbaa !23
  %43 = sext i32 %42 to i64
  %44 = load i32, ptr @u, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %indvars.iv68, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !11
  br i1 %.not31, label %53, label %48

48:                                               ; preds = %.lr.ph47
  %49 = getelementptr inbounds i8, ptr %.045, i64 8
  %50 = load i32, ptr %49, align 8, !tbaa !24
  %51 = shl nsw i32 %50, 1
  %52 = sitofp i32 %51 to double
  br label %62

53:                                               ; preds = %.lr.ph47
  %54 = sub nsw i32 %41, %28
  %55 = sitofp i32 %54 to double
  %56 = getelementptr inbounds i8, ptr %.045, i64 8
  %57 = load i32, ptr %56, align 8, !tbaa !24
  %58 = sitofp i32 %57 to double
  %59 = fmul double %55, %58
  %60 = sitofp i32 %38 to double
  %61 = fdiv double %59, %60
  br label %62

62:                                               ; preds = %48, %53
  %.sink78 = phi double [ %52, %48 ], [ %61, %53 ]
  %.pn.in = phi i32 [ %40, %48 ], [ %41, %53 ]
  %.pn = sext i32 %.pn.in to i64
  %.sink = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %.pn, i64 %43
  %63 = fadd double %47, %.sink78
  tail call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %.sink, double noundef %63)
  %64 = getelementptr inbounds i8, ptr %.045, i64 16
  %.0 = load ptr, ptr %64, align 8, !tbaa !5
  %.not30 = icmp eq ptr %.0, null
  br i1 %.not30, label %._crit_edge48.loopexit, label %.lr.ph47, !llvm.loop !25

._crit_edge52.loopexit:                           ; preds = %._crit_edge48
  %.pre72 = load i32, ptr @P, align 4, !tbaa !9
  br label %._crit_edge52

._crit_edge52:                                    ; preds = %._crit_edge52.loopexit, %.preheader
  %65 = phi i32 [ %.pre72, %._crit_edge52.loopexit ], [ %25, %.preheader ]
  %66 = phi i32 [ %34, %._crit_edge52.loopexit ], [ %26, %.preheader ]
  %67 = phi i32 [ %34, %._crit_edge52.loopexit ], [ %27, %.preheader ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %68 = sext i32 %65 to i64
  %69 = icmp slt i64 %indvars.iv.next69, %68
  br i1 %69, label %.preheader, label %._crit_edge54, !llvm.loop !26

.lr.ph58:                                         ; preds = %._crit_edge54, %.lr.ph58
  %storemerge56 = phi i32 [ %76, %.lr.ph58 ], [ 1, %._crit_edge54 ]
  %70 = load i32, ptr @P, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = sext i32 %storemerge56 to i64
  %73 = getelementptr inbounds [1009 x [209 x double]], ptr @f, i64 0, i64 %71, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !11
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %1, double noundef %74)
  %75 = load i32, ptr @u, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @u, align 4, !tbaa !9
  %77 = load i32, ptr @n, align 4, !tbaa !9
  %.not27.not = icmp slt i32 %75, %77
  br i1 %.not27.not, label %.lr.ph58, label %._crit_edge59.loopexit, !llvm.loop !28

._crit_edge59.loopexit:                           ; preds = %.lr.ph58
  %.pre74 = load double, ptr %1, align 8, !tbaa !11
  br label %._crit_edge59

._crit_edge59:                                    ; preds = %._crit_edge54.thread, %._crit_edge59.loopexit, %._crit_edge54
  %78 = phi double [ %.pre74, %._crit_edge59.loopexit ], [ 0.000000e+00, %._crit_edge54 ], [ 0.000000e+00, %._crit_edge54.thread ]
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %78)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret i32 0
}

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress 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 #2 = { 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 #3 = { mustprogress 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !14, !17, !16}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = !{!22, !10, i64 4}
!22 = !{!"_ZTS4Edge", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16}
!23 = !{!22, !10, i64 0}
!24 = !{!22, !10, i64 8}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14, !27}
!27 = !{!"llvm.loop.unswitch.partial.disable"}
!28 = distinct !{!28, !14}


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