; LLVM IR from DionysiosB/CodeForces :: 1886B-FearOfTheDark (main)

; 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.std::pair" = type { double, double }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z4distSt4pairIddES0_(double, double, double, double) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca double, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca double, align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca double, align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca double, align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca %"struct.std::pair", align 8
  %22 = alloca double, align 8
  %23 = alloca %"struct.std::pair", align 8
  %24 = alloca %"struct.std::pair", align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %28

28:                                               ; preds = %168, %0
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = add nsw i64 %29, -1
  store i64 %30, ptr %2, align 8, !tbaa !5
  %31 = icmp ne i64 %29, 0
  br i1 %31, label %32, label %172

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #5
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  %33 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %33, ptr noundef %34)
  %36 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 0
  %37 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 1
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %36, ptr noundef %37)
  %39 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %40 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 1
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %39, ptr noundef %40)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %4, i64 16, i1 false)
  %42 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  %43 = load double, ptr %42, align 8
  %44 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  %45 = load double, ptr %44, align 8
  %46 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %47 = load double, ptr %46, align 8
  %48 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %49 = load double, ptr %48, align 8
  %50 = call noundef double @_Z4distSt4pairIddES0_(double %43, double %45, double %47, double %49)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  store double %50, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store double 0.000000e+00, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %5, i64 16, i1 false)
  %51 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %52 = load double, ptr %51, align 8
  %53 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %54 = load double, ptr %53, align 8
  %55 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %56 = load double, ptr %55, align 8
  %57 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %58 = load double, ptr %57, align 8
  %59 = call noundef double @_Z4distSt4pairIddES0_(double %52, double %54, double %56, double %58)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  store double %59, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %3, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %4, i64 16, i1 false)
  %60 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %61 = load double, ptr %60, align 8
  %62 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %63 = load double, ptr %62, align 8
  %64 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %65 = load double, ptr %64, align 8
  %66 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %67 = load double, ptr %66, align 8
  %68 = call noundef double @_Z4distSt4pairIddES0_(double %61, double %63, double %65, double %67)
  store double %68, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %3, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %5, i64 16, i1 false)
  %69 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %70 = load double, ptr %69, align 8
  %71 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %72 = load double, ptr %71, align 8
  %73 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %74 = load double, ptr %73, align 8
  %75 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %76 = load double, ptr %75, align 8
  %77 = call noundef double @_Z4distSt4pairIddES0_(double %70, double %72, double %74, double %76)
  store double %77, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %4, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %5, i64 16, i1 false)
  %78 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %79 = load double, ptr %78, align 8
  %80 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %81 = load double, ptr %80, align 8
  %82 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %83 = load double, ptr %82, align 8
  %84 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %85 = load double, ptr %84, align 8
  %86 = call noundef double @_Z4distSt4pairIddES0_(double %79, double %81, double %83, double %85)
  store double %86, ptr %22, align 8, !tbaa !9
  %87 = load double, ptr %22, align 8, !tbaa !9
  %88 = fdiv double %87, 2.000000e+00
  store double %88, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %89 = load double, ptr %6, align 8, !tbaa !9
  %90 = load double, ptr %16, align 8, !tbaa !9
  %91 = fcmp ogt double %89, %90
  br i1 %91, label %92, label %94

92:                                               ; preds = %32
  %93 = load double, ptr %6, align 8, !tbaa !9
  br label %96

94:                                               ; preds = %32
  %95 = load double, ptr %16, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %94, %92
  %97 = phi double [ %93, %92 ], [ %95, %94 ]
  store double %97, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %98 = load double, ptr %11, align 8, !tbaa !9
  %99 = load double, ptr %19, align 8, !tbaa !9
  %100 = fcmp ogt double %98, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %96
  %102 = load double, ptr %11, align 8, !tbaa !9
  br label %105

103:                                              ; preds = %96
  %104 = load double, ptr %19, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %103, %101
  %106 = phi double [ %102, %101 ], [ %104, %103 ]
  store double %106, ptr %26, align 8, !tbaa !9
  %107 = load double, ptr %25, align 8, !tbaa !9
  %108 = load double, ptr %26, align 8, !tbaa !9
  %109 = fcmp olt double %107, %108
  br i1 %109, label %110, label %112

110:                                              ; preds = %105
  %111 = load double, ptr %25, align 8, !tbaa !9
  br label %114

112:                                              ; preds = %105
  %113 = load double, ptr %26, align 8, !tbaa !9
  br label %114

114:                                              ; preds = %112, %110
  %115 = phi double [ %111, %110 ], [ %113, %112 ]
  store double %115, ptr %25, align 8, !tbaa !9
  %116 = load double, ptr %6, align 8, !tbaa !9
  %117 = load double, ptr %22, align 8, !tbaa !9
  %118 = fcmp ogt double %116, %117
  br i1 %118, label %119, label %121

119:                                              ; preds = %114
  %120 = load double, ptr %6, align 8, !tbaa !9
  br label %123

121:                                              ; preds = %114
  %122 = load double, ptr %22, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %121, %119
  %124 = phi double [ %120, %119 ], [ %122, %121 ]
  store double %124, ptr %26, align 8, !tbaa !9
  %125 = load double, ptr %26, align 8, !tbaa !9
  %126 = load double, ptr %19, align 8, !tbaa !9
  %127 = fcmp ogt double %125, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %123
  %129 = load double, ptr %26, align 8, !tbaa !9
  br label %132

130:                                              ; preds = %123
  %131 = load double, ptr %19, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %130, %128
  %133 = phi double [ %129, %128 ], [ %131, %130 ]
  store double %133, ptr %26, align 8, !tbaa !9
  %134 = load double, ptr %26, align 8, !tbaa !9
  %135 = load double, ptr %25, align 8, !tbaa !9
  %136 = fcmp olt double %134, %135
  br i1 %136, label %137, label %139

137:                                              ; preds = %132
  %138 = load double, ptr %26, align 8, !tbaa !9
  br label %141

139:                                              ; preds = %132
  %140 = load double, ptr %25, align 8, !tbaa !9
  br label %141

141:                                              ; preds = %139, %137
  %142 = phi double [ %138, %137 ], [ %140, %139 ]
  store double %142, ptr %25, align 8, !tbaa !9
  %143 = load double, ptr %11, align 8, !tbaa !9
  %144 = load double, ptr %22, align 8, !tbaa !9
  %145 = fcmp ogt double %143, %144
  br i1 %145, label %146, label %148

146:                                              ; preds = %141
  %147 = load double, ptr %11, align 8, !tbaa !9
  br label %150

148:                                              ; preds = %141
  %149 = load double, ptr %22, align 8, !tbaa !9
  br label %150

150:                                              ; preds = %148, %146
  %151 = phi double [ %147, %146 ], [ %149, %148 ]
  store double %151, ptr %26, align 8, !tbaa !9
  %152 = load double, ptr %26, align 8, !tbaa !9
  %153 = load double, ptr %16, align 8, !tbaa !9
  %154 = fcmp ogt double %152, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %150
  %156 = load double, ptr %26, align 8, !tbaa !9
  br label %159

157:                                              ; preds = %150
  %158 = load double, ptr %16, align 8, !tbaa !9
  br label %159

159:                                              ; preds = %157, %155
  %160 = phi double [ %156, %155 ], [ %158, %157 ]
  store double %160, ptr %26, align 8, !tbaa !9
  %161 = load double, ptr %26, align 8, !tbaa !9
  %162 = load double, ptr %25, align 8, !tbaa !9
  %163 = fcmp olt double %161, %162
  br i1 %163, label %164, label %166

164:                                              ; preds = %159
  %165 = load double, ptr %26, align 8, !tbaa !9
  br label %168

166:                                              ; preds = %159
  %167 = load double, ptr %25, align 8, !tbaa !9
  br label %168

168:                                              ; preds = %166, %164
  %169 = phi double [ %165, %164 ], [ %167, %166 ]
  store double %169, ptr %25, align 8, !tbaa !9
  %170 = load double, ptr %25, align 8, !tbaa !9
  %171 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %170)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  br label %28, !llvm.loop !11

172:                                              ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %173 = load i32, ptr %1, align 4
  ret i32 %173
}

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !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"}


; 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.std::pair" = type { double, double }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z4distSt4pairIddES0_(double, double, double, double) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %12 = load i64, ptr %1, align 8, !tbaa !5
  %13 = add nsw i64 %12, -1
  store i64 %13, ptr %1, align 8, !tbaa !5
  %.not52 = icmp eq i64 %12, 0
  br i1 %.not52, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  %16 = getelementptr inbounds i8, ptr %4, i64 8
  %17 = getelementptr inbounds i8, ptr %5, i64 8
  %18 = getelementptr inbounds i8, ptr %8, i64 8
  br label %19

19:                                               ; preds = %.lr.ph, %19
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %14)
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %15)
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %4, ptr noundef nonnull %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store double 0.000000e+00, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  store double 0.000000e+00, ptr %7, align 8, !tbaa !9
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %.sroa.046.0.copyload = load double, ptr %3, align 8
  %.sroa.247.0.copyload = load double, ptr %15, align 8
  %23 = load double, ptr %5, align 8
  %24 = load double, ptr %17, align 8
  %25 = call noundef double @_Z4distSt4pairIddES0_(double %23, double %24, double %.sroa.046.0.copyload, double %.sroa.247.0.copyload)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  store double 0.000000e+00, ptr %10, align 8, !tbaa !9
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %.sroa.040.0.copyload = load double, ptr %4, align 8
  %.sroa.241.0.copyload = load double, ptr %16, align 8
  %26 = load double, ptr %8, align 8
  %27 = load double, ptr %18, align 8
  %28 = call noundef double @_Z4distSt4pairIddES0_(double %26, double %27, double %.sroa.040.0.copyload, double %.sroa.241.0.copyload)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %.sroa.034.0.copyload = load double, ptr %2, align 8
  %.sroa.235.0.copyload = load double, ptr %14, align 8
  %.sroa.032.0.copyload = load double, ptr %3, align 8
  %.sroa.233.0.copyload = load double, ptr %15, align 8
  %29 = call noundef double @_Z4distSt4pairIddES0_(double %.sroa.034.0.copyload, double %.sroa.235.0.copyload, double %.sroa.032.0.copyload, double %.sroa.233.0.copyload)
  %.sroa.026.0.copyload = load double, ptr %2, align 8
  %.sroa.227.0.copyload = load double, ptr %14, align 8
  %.sroa.024.0.copyload = load double, ptr %4, align 8
  %.sroa.225.0.copyload = load double, ptr %16, align 8
  %30 = call noundef double @_Z4distSt4pairIddES0_(double %.sroa.026.0.copyload, double %.sroa.227.0.copyload, double %.sroa.024.0.copyload, double %.sroa.225.0.copyload)
  %.sroa.017.0.copyload = load double, ptr %3, align 8
  %.sroa.218.0.copyload = load double, ptr %15, align 8
  %.sroa.0.0.copyload = load double, ptr %4, align 8
  %.sroa.2.0.copyload = load double, ptr %16, align 8
  %31 = call noundef double @_Z4distSt4pairIddES0_(double %.sroa.017.0.copyload, double %.sroa.218.0.copyload, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %32 = fmul double %31, 5.000000e-01
  %33 = fcmp ogt double %25, %29
  %34 = select i1 %33, double %25, double %29
  %35 = fcmp ogt double %28, %30
  %36 = select i1 %35, double %28, double %30
  %37 = fcmp olt double %34, %36
  %38 = select i1 %37, double %34, double %36
  %39 = fcmp ogt double %25, %32
  %40 = select i1 %39, double %25, double %32
  %41 = fcmp ogt double %40, %30
  %42 = select i1 %41, double %40, double %30
  %43 = fcmp olt double %42, %38
  %44 = select i1 %43, double %42, double %38
  %45 = fcmp ogt double %28, %32
  %46 = select i1 %45, double %28, double %32
  %47 = fcmp ogt double %46, %29
  %48 = select i1 %47, double %46, double %29
  %49 = fcmp olt double %48, %44
  %50 = select i1 %49, double %48, double %44
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %50)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  %52 = load i64, ptr %1, align 8, !tbaa !5
  %53 = add nsw i64 %52, -1
  store i64 %53, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %52, 0
  br i1 %.not, label %._crit_edge, label %19, !llvm.loop !11

._crit_edge:                                      ; preds = %19, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  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 nounwind uwtable
declare dso_local void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 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 = { 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 = { 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 = !{!"long", !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"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass