; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/339 Division 1/Problem A (A)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { double, double }
%"struct.std::pair.0" = type { i32, i32 }

@n = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@p = external dso_local global %"class.std::vector", align 8
@mx = external dso_local global double, align 8
@mn = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z4distdddd(double noundef, double noundef, double noundef, double noundef) #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 double, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair.0", align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca double, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca double, align 8
  store i32 0, ptr %1, align 4
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @a, ptr noundef @b)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %20 = call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 0)
  %21 = fmul double %20, 2.000000e+00
  store double %21, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %36, %0
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = load i32, ptr @n, align 4, !tbaa !9
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %39

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = load i32, ptr @a, align 4, !tbaa !9
  %31 = sub nsw i32 %29, %30
  store i32 %31, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = load i32, ptr @b, align 4, !tbaa !9
  %34 = sub nsw i32 %32, %33
  store i32 %34, ptr %9, align 4, !tbaa !9
  %35 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %35, ptr %7, align 4
  call void @_ZNSt4pairIddEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @p, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %36

36:                                               ; preds = %27
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !9
  br label %22, !llvm.loop !11

39:                                               ; preds = %26
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef 0) #6
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) @p, ptr noundef nonnull align 8 dereferenceable(16) %40)
  store double 0.000000e+00, ptr @mx, align 8, !tbaa !5
  store double 1.000000e+18, ptr @mn, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %107, %39
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = load i32, ptr @n, align 4, !tbaa !9
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %110

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %48) #6
  %50 = getelementptr inbounds %"struct.std::pair", ptr %49, i32 0, i32 0
  %51 = load double, ptr %50, align 8, !tbaa !13
  %52 = fptosi double %51 to i64
  store i64 %52, ptr %11, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %54) #6
  %56 = getelementptr inbounds %"struct.std::pair", ptr %55, i32 0, i32 1
  %57 = load double, ptr %56, align 8, !tbaa !17
  %58 = fptosi double %57 to i64
  store i64 %58, ptr %12, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = sub nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %61) #6
  %63 = getelementptr inbounds %"struct.std::pair", ptr %62, i32 0, i32 0
  %64 = load double, ptr %63, align 8, !tbaa !13
  %65 = fptosi double %64 to i64
  store i64 %65, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %68) #6
  %70 = getelementptr inbounds %"struct.std::pair", ptr %69, i32 0, i32 1
  %71 = load double, ptr %70, align 8, !tbaa !17
  %72 = fptosi double %71 to i64
  store i64 %72, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %73 = load double, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %74 = load i64, ptr %11, align 8, !tbaa !15
  %75 = load i64, ptr %11, align 8, !tbaa !15
  %76 = mul nsw i64 %74, %75
  %77 = load i64, ptr %12, align 8, !tbaa !15
  %78 = load i64, ptr %12, align 8, !tbaa !15
  %79 = mul nsw i64 %77, %78
  %80 = add nsw i64 %76, %79
  store i64 %80, ptr %16, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %81 = load i64, ptr %13, align 8, !tbaa !15
  %82 = load i64, ptr %13, align 8, !tbaa !15
  %83 = mul nsw i64 %81, %82
  %84 = load i64, ptr %14, align 8, !tbaa !15
  %85 = load i64, ptr %14, align 8, !tbaa !15
  %86 = mul nsw i64 %84, %85
  %87 = add nsw i64 %83, %86
  store i64 %87, ptr %17, align 8, !tbaa !15
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %89 = load i64, ptr %88, align 8, !tbaa !15
  %90 = sitofp i64 %89 to double
  %91 = fmul double %73, %90
  store double %91, ptr %15, align 8, !tbaa !5
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mx, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %93 = load double, ptr %92, align 8, !tbaa !5
  store double %93, ptr @mx, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %94 = load double, ptr %2, align 8, !tbaa !5
  %95 = load i64, ptr %13, align 8, !tbaa !15
  %96 = sitofp i64 %95 to double
  %97 = load i64, ptr %14, align 8, !tbaa !15
  %98 = sitofp i64 %97 to double
  %99 = load i64, ptr %11, align 8, !tbaa !15
  %100 = sitofp i64 %99 to double
  %101 = load i64, ptr %12, align 8, !tbaa !15
  %102 = sitofp i64 %101 to double
  %103 = call noundef double @_Z4distdddd(double noundef %96, double noundef %98, double noundef %100, double noundef %102)
  %104 = fmul double %94, %103
  store double %104, ptr %18, align 8, !tbaa !5
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mn, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %106 = load double, ptr %105, align 8, !tbaa !5
  store double %106, ptr @mn, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %107

107:                                              ; preds = %46
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %10, align 4, !tbaa !9
  br label %41, !llvm.loop !18

110:                                              ; preds = %45
  %111 = load double, ptr @mx, align 8, !tbaa !5
  %112 = load double, ptr @mn, align 8, !tbaa !5
  %113 = fsub double %111, %112
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %113)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

; 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)) #4

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

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

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 = { 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 #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 = { 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 = !{!"double", !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, !6, i64 0}
!14 = !{!"_ZTSSt4pairIddE", !6, i64 0, !6, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!14, !6, i64 8}
!18 = distinct !{!18, !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { double, double }
%"struct.std::pair.0" = type { i32, i32 }

@n = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@p = external dso_local global %"class.std::vector", align 8
@mx = external dso_local global double, align 8
@mn = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z4distdddd(double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #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 %"struct.std::pair.0", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca double, align 8
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @a, ptr noundef nonnull @b)
  %12 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 0)
  %13 = fmul double %12, 2.000000e+00
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef 0) #6
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) @p, ptr noundef nonnull align 8 dereferenceable(16) %16)
  store double 0.000000e+00, ptr @mx, align 8, !tbaa !9
  store double 1.000000e+18, ptr @mn, align 8, !tbaa !9
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %.not23 = icmp slt i32 %17, 1
  br i1 %.not23, label %._crit_edge27, label %.lr.ph26

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.022 = phi i32 [ %26, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = load i32, ptr @a, align 4, !tbaa !5
  %21 = sub nsw i32 %19, %20
  store i32 %21, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @b, align 4, !tbaa !5
  %24 = sub nsw i32 %22, %23
  store i32 %24, ptr %6, align 4, !tbaa !5
  %25 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %25, ptr %4, align 8
  call void @_ZNSt4pairIddEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @p, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %26 = add nuw nsw i32 %.022, 1
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge27.loopexit:                           ; preds = %.lr.ph26
  %.pre = load double, ptr @mx, align 8, !tbaa !9
  %29 = fsub double %.pre, %66
  br label %._crit_edge27

._crit_edge27:                                    ; preds = %._crit_edge27.loopexit, %._crit_edge
  %30 = phi double [ %29, %._crit_edge27.loopexit ], [ -1.000000e+18, %._crit_edge ]
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %30)
  ret i32 0

.lr.ph26:                                         ; preds = %._crit_edge, %.lr.ph26
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph26 ], [ 1, %._crit_edge ]
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %indvars.iv) #6
  %33 = load double, ptr %32, align 8, !tbaa !13
  %34 = fptosi double %33 to i64
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %indvars.iv) #6
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load double, ptr %36, align 8, !tbaa !15
  %38 = fptosi double %37 to i64
  %39 = add nsw i64 %indvars.iv, -1
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %39) #6
  %41 = load double, ptr %40, align 8, !tbaa !13
  %42 = fptosi double %41 to i64
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %39) #6
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load double, ptr %44, align 8, !tbaa !15
  %46 = fptosi double %45 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %47 = mul nsw i64 %34, %34
  %48 = mul nsw i64 %38, %38
  %49 = add nuw nsw i64 %48, %47
  store i64 %49, ptr %8, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %50 = mul nsw i64 %42, %42
  %51 = mul nsw i64 %46, %46
  %52 = add nuw nsw i64 %51, %50
  store i64 %52, ptr %9, align 8, !tbaa !16
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %54 = load i64, ptr %53, align 8, !tbaa !16
  %55 = sitofp i64 %54 to double
  %56 = fmul double %13, %55
  store double %56, ptr %7, align 8, !tbaa !9
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mx, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %58 = load double, ptr %57, align 8, !tbaa !9
  store double %58, ptr @mx, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %59 = sitofp i64 %42 to double
  %60 = sitofp i64 %46 to double
  %61 = sitofp i64 %34 to double
  %62 = sitofp i64 %38 to double
  %63 = call noundef double @_Z4distdddd(double noundef %59, double noundef %60, double noundef %61, double noundef %62)
  %64 = fmul double %13, %63
  store double %64, ptr %10, align 8, !tbaa !9
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mn, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %66 = load double, ptr %65, align 8, !tbaa !9
  store double %66, ptr @mn, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %.not.not = icmp slt i64 %indvars.iv, %68
  br i1 %.not.not, label %.lr.ph26, label %._crit_edge27.loopexit, !llvm.loop !18
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

; 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 #4

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

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

; 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 = { 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 #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 = { 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 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !12}


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