; LLVM IR from lzyrapx/Competitive-Programming :: ACdream (1092（概率dp）)

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

@a = external dso_local global [1009 x %struct.node], align 16
@dp = external dso_local global [1009 x double], 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 [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp4nodeS_(ptr noundef byval(%struct.node) align 8, ptr noundef byval(%struct.node) align 8) #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 i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %12

12:                                               ; preds = %166, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %2, align 4, !tbaa !5
  %15 = icmp ne i32 %13, 0
  br i1 %15, label %16, label %169

16:                                               ; preds = %12
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %41, %16
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %44

23:                                               ; preds = %18
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.node, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %29
  %31 = getelementptr inbounds %struct.node, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %33
  %35 = getelementptr inbounds %struct.node, ptr %34, i32 0, i32 2
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.node, ptr %38, i32 0, i32 3
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %27, ptr noundef %31, ptr noundef %35, ptr noundef %39)
  br label %41

41:                                               ; preds = %23
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %5, align 4, !tbaa !5
  br label %18, !llvm.loop !9

44:                                               ; preds = %22
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.node, ptr @a, i64 %46
  call void @_ZSt4sortIP4nodePFiS0_S0_EEvT_S4_T0_(ptr noundef @a, ptr noundef %47, ptr noundef @_Z3cmp4nodeS_)
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 0, i64 8072, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  store double 0.000000e+00, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %163, %44
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %166

53:                                               ; preds = %48
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %55
  %57 = getelementptr inbounds %struct.node, ptr %56, i32 0, i32 3
  %58 = load double, ptr %57, align 8, !tbaa !13
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1009 x double], ptr @dp, i64 0, i64 %60
  store double %58, ptr %61, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %154, %53
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %157

67:                                               ; preds = %62
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %70
  %72 = getelementptr inbounds %struct.node, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 8, !tbaa !15
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.node, ptr %76, i32 0, i32 2
  %78 = load i32, ptr %77, align 8, !tbaa !15
  %79 = sub nsw i32 %73, %78
  %80 = mul nsw i32 %68, %79
  %81 = sitofp i32 %80 to double
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.node, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 8, !tbaa !16
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.node, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !16
  %92 = sub nsw i32 %86, %91
  %93 = sitofp i32 %92 to double
  %94 = fmul double 1.000000e+00, %93
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.node, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !16
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %101
  %103 = getelementptr inbounds %struct.node, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !16
  %105 = sub nsw i32 %99, %104
  %106 = sitofp i32 %105 to double
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %108
  %110 = getelementptr inbounds %struct.node, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !17
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %113
  %115 = getelementptr inbounds %struct.node, ptr %114, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !17
  %117 = sub nsw i32 %111, %116
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.node, ptr %120, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !17
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %124
  %126 = getelementptr inbounds %struct.node, ptr %125, i32 0, i32 1
  %127 = load i32, ptr %126, align 4, !tbaa !17
  %128 = sub nsw i32 %122, %127
  %129 = mul nsw i32 %117, %128
  %130 = sitofp i32 %129 to double
  %131 = call double @llvm.fmuladd.f64(double %94, double %106, double %130)
  %132 = call double @sqrt(double noundef %131) #9
  %133 = fcmp oge double %81, %132
  br i1 %133, label %134, label %153

134:                                              ; preds = %67
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1009 x double], ptr @dp, i64 0, i64 %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1009 x double], ptr @dp, i64 0, i64 %139
  %141 = load double, ptr %140, align 8, !tbaa !11
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.node, ptr %144, i32 0, i32 3
  %146 = load double, ptr %145, align 8, !tbaa !13
  %147 = fadd double %141, %146
  store double %147, ptr %10, align 8, !tbaa !11
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %149 = load double, ptr %148, align 8, !tbaa !11
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1009 x double], ptr @dp, i64 0, i64 %151
  store double %149, ptr %152, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %153

153:                                              ; preds = %134, %67
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %9, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %9, align 4, !tbaa !5
  br label %62, !llvm.loop !18

157:                                              ; preds = %66
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1009 x double], ptr @dp, i64 0, i64 %159
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %160, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %162 = load double, ptr %161, align 8, !tbaa !11
  store double %162, ptr %6, align 8, !tbaa !11
  br label %163

163:                                              ; preds = %157
  %164 = load i32, ptr %7, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %7, align 4, !tbaa !5
  br label %48, !llvm.loop !19

166:                                              ; preds = %52
  %167 = load double, ptr %6, align 8, !tbaa !11
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %167)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %12, !llvm.loop !20

169:                                              ; preds = %12
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %170 = load i32, ptr %1, align 4
  ret i32 %170
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4nodePFiS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #8

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 #4 = { inlinehint 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = { 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 #9 = { 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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"_ZTS4node", !6, i64 0, !6, i64 4, !6, i64 8, !12, i64 16}
!15 = !{!14, !6, i64 8}
!16 = !{!14, !6, i64 0}
!17 = !{!14, !6, i64 4}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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"

%struct.node = type { i32, i32, i32, double }

@a = external dso_local global [1009 x %struct.node], align 16
@dp = external dso_local global [1009 x double], 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 [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp4nodeS_(ptr noundef byval(%struct.node) align 8, ptr noundef byval(%struct.node) align 8) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #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
  %.not41 = icmp eq i32 %7, 0
  br i1 %.not41, label %._crit_edge44, label %.lr.ph43

.lr.ph43:                                         ; preds = %0, %._crit_edge40
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.lr.ph43.._crit_edge_crit_edge

.lr.ph43.._crit_edge_crit_edge:                   ; preds = %.lr.ph43
  %.pre = sext i32 %10 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph43.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph43.._crit_edge_crit_edge ], [ %21, %.lr.ph ]
  %12 = getelementptr inbounds %struct.node, ptr @a, i64 %.pre-phi
  call void @_ZSt4sortIP4nodePFiS0_S0_EEvT_S4_T0_(ptr noundef nonnull @a, ptr noundef nonnull %12, ptr noundef nonnull @_Z3cmp4nodeS_)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8072) @dp, i8 0, i64 8072, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store double 0.000000e+00, ptr %4, align 8, !tbaa !9
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph39, label %._crit_edge40

.lr.ph:                                           ; preds = %.lr.ph43, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph43 ]
  %15 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %indvars.iv
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  %17 = getelementptr inbounds i8, ptr %15, i64 8
  %18 = getelementptr inbounds i8, ptr %15, i64 16
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %15, ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge40:                                    ; preds = %._crit_edge36, %._crit_edge
  %23 = phi double [ 0.000000e+00, %._crit_edge ], [ %34, %._crit_edge36 ]
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %._crit_edge44, label %.lr.ph43, !llvm.loop !13

.lr.ph39:                                         ; preds = %._crit_edge, %._crit_edge36
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %._crit_edge36 ], [ 0, %._crit_edge ]
  %27 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %indvars.iv51
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %29 = load double, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds [1009 x double], ptr @dp, i64 0, i64 %indvars.iv51
  store double %29, ptr %30, align 8, !tbaa !9
  %.not45 = icmp eq i64 %indvars.iv51, 0
  br i1 %.not45, label %._crit_edge36, label %.lr.ph35

.lr.ph35:                                         ; preds = %.lr.ph39
  %31 = getelementptr inbounds i8, ptr %27, i64 8
  %32 = getelementptr inbounds i8, ptr %27, i64 4
  br label %38

._crit_edge36:                                    ; preds = %66, %.lr.ph39
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %34 = load double, ptr %33, align 8, !tbaa !9
  store double %34, ptr %4, align 8, !tbaa !9
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next52, %36
  br i1 %37, label %.lr.ph39, label %._crit_edge40, !llvm.loop !16

38:                                               ; preds = %.lr.ph35, %66
  %indvars.iv48 = phi i64 [ 0, %.lr.ph35 ], [ %indvars.iv.next49, %66 ]
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = load i32, ptr %31, align 8, !tbaa !17
  %41 = getelementptr inbounds [1009 x %struct.node], ptr @a, i64 0, i64 %indvars.iv48
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i32, ptr %42, align 8, !tbaa !17
  %44 = sub nsw i32 %40, %43
  %45 = mul nsw i32 %44, %39
  %46 = sitofp i32 %45 to double
  %47 = load i32, ptr %27, align 8, !tbaa !18
  %48 = load i32, ptr %41, align 8, !tbaa !18
  %49 = sub nsw i32 %47, %48
  %50 = sitofp i32 %49 to double
  %51 = load i32, ptr %32, align 4, !tbaa !19
  %52 = getelementptr inbounds i8, ptr %41, i64 4
  %53 = load i32, ptr %52, align 4, !tbaa !19
  %54 = sub nsw i32 %51, %53
  %55 = mul nsw i32 %54, %54
  %56 = uitofp nneg i32 %55 to double
  %57 = call double @llvm.fmuladd.f64(double %50, double %50, double %56)
  %sqrt = call double @llvm.sqrt.f64(double %57)
  %58 = fcmp ugt double %sqrt, %46
  br i1 %58, label %66, label %59

59:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %60 = getelementptr inbounds [1009 x double], ptr @dp, i64 0, i64 %indvars.iv48
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = load double, ptr %28, align 8, !tbaa !14
  %63 = fadd double %61, %62
  store double %63, ptr %5, align 8, !tbaa !9
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %65 = load double, ptr %64, align 8, !tbaa !9
  store double %65, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  br label %66

66:                                               ; preds = %38, %59
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next49, %indvars.iv51
  br i1 %exitcond.not, label %._crit_edge36, label %38, !llvm.loop !20

._crit_edge44:                                    ; preds = %._crit_edge40, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4nodePFiS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #7

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!15, !10, i64 16}
!15 = !{!"_ZTS4node", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16}
!16 = distinct !{!16, !12}
!17 = !{!15, !6, i64 8}
!18 = !{!15, !6, i64 0}
!19 = !{!15, !6, i64 4}
!20 = distinct !{!20, !12}


; Effective O3 passes: AggressiveInstCombinePass,BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass