; LLVM IR from tangjz/acm-icpc :: lydsy (5166)

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

@n = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@seg = external dso_local global [101 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKSt4pairIddES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @r)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %47, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %50

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %20 = load i32, ptr @r, align 4, !tbaa !5
  %21 = load i32, ptr @r, align 4, !tbaa !5
  %22 = mul nsw i32 %20, %21
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = mul nsw i32 %23, %24
  %26 = sub nsw i32 %22, %25
  %27 = sitofp i32 %26 to x86_fp80
  %28 = call x86_fp80 @sqrtl(x86_fp80 noundef %27) #7
  %29 = fptrunc x86_fp80 %28 to double
  store double %29, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sitofp i32 %30 to double
  %32 = load double, ptr %5, align 8, !tbaa !9
  %33 = fsub double %31, %32
  store double %33, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sitofp i32 %34 to double
  %36 = load double, ptr %5, align 8, !tbaa !9
  %37 = fadd double %35, %36
  store double %37, ptr %8, align 8, !tbaa !9
  %38 = call { double, double } @_ZSt9make_pairIddESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %39 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  %40 = extractvalue { double, double } %38, 0
  store double %40, ptr %39, align 8
  %41 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  %42 = extractvalue { double, double } %38, 1
  store double %42, ptr %41, align 8
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIddEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %47

47:                                               ; preds = %18
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

50:                                               ; preds = %17
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds %"struct.std::pair", ptr @seg, i64 %52
  call void @_ZSt4sortIPSt4pairIddEPFbRKS1_S4_EEvT_S7_T0_(ptr noundef @seg, ptr noundef %53, ptr noundef @_Z3cmpRKSt4pairIddES2_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %54 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %54, ptr %9, align 4, !tbaa !5
  store i32 0, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %103, %50
  %56 = load i32, ptr %10, align 4, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %106

60:                                               ; preds = %55
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %93

63:                                               ; preds = %60
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %66
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 0
  %69 = load double, ptr %68, align 16, !tbaa !13
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %71
  %73 = getelementptr inbounds %"struct.std::pair", ptr %72, i32 0, i32 0
  %74 = load double, ptr %73, align 16, !tbaa !13
  %75 = fsub double %69, %74
  %76 = call noundef i32 @_Z3sgnd(double noundef %75)
  %77 = icmp sge i32 %76, 0
  br i1 %77, label %78, label %93

78:                                               ; preds = %63
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %81
  %83 = getelementptr inbounds %"struct.std::pair", ptr %82, i32 0, i32 1
  %84 = load double, ptr %83, align 8, !tbaa !15
  %85 = load i32, ptr %10, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %86
  %88 = getelementptr inbounds %"struct.std::pair", ptr %87, i32 0, i32 1
  %89 = load double, ptr %88, align 8, !tbaa !15
  %90 = fsub double %84, %89
  %91 = call noundef i32 @_Z3sgnd(double noundef %90)
  %92 = icmp sle i32 %91, 0
  br i1 %92, label %102, label %93

93:                                               ; preds = %78, %63, %60
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %95
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr @n, align 4, !tbaa !5
  %99 = sext i32 %97 to i64
  %100 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %99
  %101 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIddEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %100, ptr noundef nonnull align 8 dereferenceable(16) %96)
  br label %102

102:                                              ; preds = %93, %78
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %10, align 4, !tbaa !5
  br label %55, !llvm.loop !16

106:                                              ; preds = %59
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %"struct.std::pair", ptr @seg, i64 %108
  call void @_ZSt4sortIPSt4pairIddEEvT_S3_(ptr noundef @seg, ptr noundef %109)
  %110 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %110, ptr %9, align 4, !tbaa !5
  store i32 0, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %144, %106
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %147

116:                                              ; preds = %111
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %134

119:                                              ; preds = %116
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %122
  %124 = getelementptr inbounds %"struct.std::pair", ptr %123, i32 0, i32 1
  %125 = load double, ptr %124, align 8, !tbaa !15
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %127
  %129 = getelementptr inbounds %"struct.std::pair", ptr %128, i32 0, i32 0
  %130 = load double, ptr %129, align 16, !tbaa !13
  %131 = fsub double %125, %130
  %132 = call noundef i32 @_Z3sgnd(double noundef %131)
  %133 = icmp sge i32 %132, 0
  br i1 %133, label %143, label %134

134:                                              ; preds = %119, %116
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %136
  %138 = load i32, ptr @n, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr @n, align 4, !tbaa !5
  %140 = sext i32 %138 to i64
  %141 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %140
  %142 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIddEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %141, ptr noundef nonnull align 8 dereferenceable(16) %137)
  br label %143

143:                                              ; preds = %134, %119
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !5
  br label %111, !llvm.loop !17

147:                                              ; preds = %115
  %148 = load i32, ptr @n, align 4, !tbaa !5
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %148)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret i32 0
}

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

; Function Attrs: nounwind
declare x86_fp80 @sqrtl(x86_fp80 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZSt9make_pairIddESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSSt4pairIddE", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!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"

%"struct.std::pair" = type { double, double }

@n = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@seg = external dso_local global [101 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKSt4pairIddES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @r)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre46 = sext i32 %7 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %0
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  br label %13

._crit_edge:                                      ; preds = %13, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre46, %.._crit_edge_crit_edge ], [ %31, %13 ]
  %10 = getelementptr inbounds %"struct.std::pair", ptr @seg, i64 %.pre-phi
  call void @_ZSt4sortIPSt4pairIddEPFbRKS1_S4_EEvT_S7_T0_(ptr noundef nonnull @seg, ptr noundef nonnull %10, ptr noundef nonnull @_Z3cmpRKSt4pairIddES2_)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  store i32 0, ptr @n, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph24.preheader, label %._crit_edge25

.lr.ph24.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %11 to i64
  br label %.lr.ph24

13:                                               ; preds = %.lr.ph, %13
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %13 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %15 = load i32, ptr @r, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %add = add nsw i32 %16, %15
  %sub = sub nsw i32 %15, %16
  %17 = mul nsw i32 %add, %sub
  %18 = sitofp i32 %17 to x86_fp80
  %19 = call x86_fp80 @sqrtl(x86_fp80 noundef %18) #7
  %20 = fptrunc x86_fp80 %19 to double
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sitofp i32 %21 to double
  %23 = fsub double %22, %20
  store double %23, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %24 = fadd double %20, %22
  store double %24, ptr %5, align 8, !tbaa !9
  %25 = call { double, double } @_ZSt9make_pairIddESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %26 = extractvalue { double, double } %25, 0
  store double %26, ptr %3, align 8
  %27 = extractvalue { double, double } %25, 1
  store double %27, ptr %9, align 8
  %28 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %indvars.iv
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIddEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = icmp slt i64 %indvars.iv.next, %31
  br i1 %32, label %13, label %._crit_edge, !llvm.loop !11

._crit_edge25.loopexit:                           ; preds = %66
  %33 = sext i32 %.pre42 to i64
  br label %._crit_edge25

._crit_edge25:                                    ; preds = %._crit_edge25.loopexit, %._crit_edge
  %34 = phi i64 [ %33, %._crit_edge25.loopexit ], [ 0, %._crit_edge ]
  %35 = getelementptr inbounds %"struct.std::pair", ptr @seg, i64 %34
  call void @_ZSt4sortIPSt4pairIddEEvT_S3_(ptr noundef nonnull @seg, ptr noundef nonnull %35)
  %36 = load i32, ptr @n, align 4, !tbaa !5
  store i32 0, ptr @n, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph28.preheader, label %._crit_edge29

.lr.ph28.preheader:                               ; preds = %._crit_edge25
  %wide.trip.count38 = zext nneg i32 %36 to i64
  br label %.lr.ph28

.lr.ph24:                                         ; preds = %66, %.lr.ph24.preheader
  %38 = phi i32 [ 0, %.lr.ph24.preheader ], [ %.pre42, %66 ]
  %indvars.iv32 = phi i64 [ 0, %.lr.ph24.preheader ], [ %indvars.iv.next33, %66 ]
  %.not20 = icmp eq i32 %38, 0
  br i1 %.not20, label %59, label %39

39:                                               ; preds = %.lr.ph24
  %40 = add nsw i32 %38, -1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %41
  %43 = load double, ptr %42, align 16, !tbaa !13
  %44 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %indvars.iv32
  %45 = load double, ptr %44, align 16, !tbaa !13
  %46 = fsub double %43, %45
  %47 = call noundef i32 @_Z3sgnd(double noundef %46)
  %48 = icmp sgt i32 %47, -1
  %.pre41 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %48, label %49, label %59

49:                                               ; preds = %39
  %50 = add nsw i32 %.pre41, -1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %51, i32 1
  %53 = load double, ptr %52, align 8, !tbaa !15
  %54 = getelementptr inbounds i8, ptr %44, i64 8
  %55 = load double, ptr %54, align 8, !tbaa !15
  %56 = fsub double %53, %55
  %57 = call noundef i32 @_Z3sgnd(double noundef %56)
  %58 = icmp slt i32 %57, 1
  br i1 %58, label %66, label %._crit_edge40

._crit_edge40:                                    ; preds = %49
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %._crit_edge40, %39, %.lr.ph24
  %60 = phi i32 [ %.pre, %._crit_edge40 ], [ %.pre41, %39 ], [ 0, %.lr.ph24 ]
  %61 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %indvars.iv32
  %62 = add nsw i32 %60, 1
  store i32 %62, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %60 to i64
  %64 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %63
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIddEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 8 dereferenceable(16) %61)
  br label %66

66:                                               ; preds = %49, %59
  %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next33, %wide.trip.count
  %.pre42 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %exitcond.not, label %._crit_edge25.loopexit, label %.lr.ph24, !llvm.loop !16

._crit_edge29:                                    ; preds = %87, %._crit_edge25
  %67 = phi i32 [ 0, %._crit_edge25 ], [ %.pre45, %87 ]
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %67)
  ret i32 0

.lr.ph28:                                         ; preds = %87, %.lr.ph28.preheader
  %69 = phi i32 [ 0, %.lr.ph28.preheader ], [ %.pre45, %87 ]
  %indvars.iv35 = phi i64 [ 0, %.lr.ph28.preheader ], [ %indvars.iv.next36, %87 ]
  %.not = icmp eq i32 %69, 0
  br i1 %.not, label %80, label %70

70:                                               ; preds = %.lr.ph28
  %71 = add nsw i32 %69, -1
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %72, i32 1
  %74 = load double, ptr %73, align 8, !tbaa !15
  %75 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %indvars.iv35
  %76 = load double, ptr %75, align 16, !tbaa !13
  %77 = fsub double %74, %76
  %78 = call noundef i32 @_Z3sgnd(double noundef %77)
  %79 = icmp sgt i32 %78, -1
  br i1 %79, label %87, label %._crit_edge43

._crit_edge43:                                    ; preds = %70
  %.pre44 = load i32, ptr @n, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %._crit_edge43, %.lr.ph28
  %81 = phi i32 [ %.pre44, %._crit_edge43 ], [ 0, %.lr.ph28 ]
  %82 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %indvars.iv35
  %83 = add nsw i32 %81, 1
  store i32 %83, ptr @n, align 4, !tbaa !5
  %84 = sext i32 %81 to i64
  %85 = getelementptr inbounds [101 x %"struct.std::pair"], ptr @seg, i64 0, i64 %84
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIddEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %85, ptr noundef nonnull align 8 dereferenceable(16) %82)
  br label %87

87:                                               ; preds = %70, %80
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %exitcond39.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count38
  %.pre45 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %exitcond39.not, label %._crit_edge29, label %.lr.ph28, !llvm.loop !17
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare x86_fp80 @sqrtl(x86_fp80 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZSt9make_pairIddESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

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

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress nofree nounwind willreturn memory(write) "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSSt4pairIddE", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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