; LLVM IR from brpapa/algorithms :: solutions/uva (10034)

; 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<Tedge, std::allocator<Tedge>>::_Vector_impl" }
%"struct.std::_Vector_base<Tedge, std::allocator<Tedge>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tedge, std::allocator<Tedge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tedge, std::allocator<Tedge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { double, double }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.Tedge = type { i32, i32, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@edgeList = external dso_local global %"class.std::vector", align 8
@points = external dso_local global [110 x %"struct.std::pair"], align 16
@p = external dso_local global [110 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7findSeti(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z13distEuclidianSt4pairIddES0_(double, double, double, double) #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 double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %struct.Tedge, align 8
  %14 = alloca double, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %struct.Tedge, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %24

24:                                               ; preds = %121, %0
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %3, align 4, !tbaa !5
  %27 = icmp ne i32 %25, 0
  br i1 %27, label %28, label %128

28:                                               ; preds = %24
  call void @_ZNSt6vectorI5TedgeSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %79, %28
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %82

35:                                               ; preds = %30
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #8
  %38 = call { double, double } @_ZSt9make_pairIRdS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %39 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %40 = extractvalue { double, double } %38, 0
  store double %40, ptr %39, align 8
  %41 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %42 = extractvalue { double, double } %38, 1
  store double %42, ptr %41, align 8
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [110 x %"struct.std::pair"], ptr @points, 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) %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #8
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [110 x i32], ptr @p, i64 0, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %75, %35
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %78

56:                                               ; preds = %51
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [110 x %"struct.std::pair"], ptr @points, i64 0, i64 %58
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 16 %59, i64 16, i1 false)
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [110 x %"struct.std::pair"], ptr @points, i64 0, i64 %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 16 %62, i64 16, i1 false)
  %63 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %64 = load double, ptr %63, align 8
  %65 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %66 = load double, ptr %65, align 8
  %67 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %68 = load double, ptr %67, align 8
  %69 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %70 = load double, ptr %69, align 8
  %71 = call noundef double @_Z13distEuclidianSt4pairIddES0_(double %64, double %66, double %68, double %70)
  store double %71, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load double, ptr %6, align 8, !tbaa !9
  call void @_ZN5TedgeC2Eiid(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %72, i32 noundef %73, double noundef %74)
  call void @_ZNSt6vectorI5TedgeSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @edgeList, ptr noundef nonnull align 8 dereferenceable(16) %13)
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  br label %75

75:                                               ; preds = %56
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %10, align 4, !tbaa !5
  br label %51, !llvm.loop !11

78:                                               ; preds = %55
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %7, align 4, !tbaa !5
  br label %30, !llvm.loop !13

82:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  %83 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  %84 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %83, ptr %84, align 8
  %85 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  %89 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP5TedgeSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %88, ptr %90)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store ptr @edgeList, ptr %17, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %91 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  %92 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %91, ptr %92, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %93 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  br label %95

95:                                               ; preds = %119, %82
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP5TedgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  br i1 %96, label %98, label %97

97:                                               ; preds = %95
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %121

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #8
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP5TedgeSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %99, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %100 = getelementptr inbounds %struct.Tedge, ptr %20, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !17
  %102 = call noundef i32 @_Z7findSeti(i32 noundef %101)
  store i32 %102, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %103 = getelementptr inbounds %struct.Tedge, ptr %20, i32 0, i32 1
  %104 = load i32, ptr %103, align 4, !tbaa !19
  %105 = call noundef i32 @_Z7findSeti(i32 noundef %104)
  store i32 %105, ptr %22, align 4, !tbaa !5
  %106 = load i32, ptr %21, align 4, !tbaa !5
  %107 = load i32, ptr %22, align 4, !tbaa !5
  %108 = icmp ne i32 %106, %107
  br i1 %108, label %109, label %118

109:                                              ; preds = %98
  %110 = load i32, ptr %22, align 4, !tbaa !5
  %111 = load i32, ptr %21, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [110 x i32], ptr @p, i64 0, i64 %112
  store i32 %110, ptr %113, align 4, !tbaa !5
  %114 = getelementptr inbounds %struct.Tedge, ptr %20, i32 0, i32 2
  %115 = load double, ptr %114, align 8, !tbaa !20
  %116 = load double, ptr %14, align 8, !tbaa !9
  %117 = fadd double %116, %115
  store double %117, ptr %14, align 8, !tbaa !9
  br label %118

118:                                              ; preds = %109, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  br label %119

119:                                              ; preds = %118
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP5TedgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br label %95

121:                                              ; preds = %97
  %122 = load double, ptr %14, align 8, !tbaa !9
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = icmp eq i32 %123, 0
  %125 = zext i1 %124 to i64
  %126 = select i1 %124, ptr @.str.2, ptr @.str.3
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %122, ptr noundef %126)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %24, !llvm.loop !21

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI5TedgeSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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) #5

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI5TedgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI5TedgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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

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

attributes #0 = { 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 #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 8, !9}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTS5Tedge", !6, i64 0, !6, i64 4, !10, i64 8}
!19 = !{!18, !6, i64 4}
!20 = !{!18, !10, i64 8}
!21 = distinct !{!21, !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<Tedge, std::allocator<Tedge>>::_Vector_impl" }
%"struct.std::_Vector_base<Tedge, std::allocator<Tedge>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tedge, std::allocator<Tedge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tedge, std::allocator<Tedge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { double, double }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.Tedge = type { i32, i32, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@edgeList = external dso_local global %"class.std::vector", align 8
@points = external dso_local global [110 x %"struct.std::pair"], align 16
@p = external dso_local local_unnamed_addr global [110 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z13distEuclidianSt4pairIddES0_(double, double, double, double) local_unnamed_addr #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 double, align 8
  %4 = alloca double, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %struct.Tedge, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr %2, align 4, !tbaa !5
  %.not38 = icmp eq i32 %10, 0
  br i1 %.not38, label %._crit_edge41, label %.lr.ph40

.lr.ph40:                                         ; preds = %0
  %12 = getelementptr inbounds i8, ptr %5, i64 8
  br label %13

13:                                               ; preds = %.lr.ph40, %._crit_edge37
  call void @_ZNSt6vectorI5TedgeSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph32, label %._crit_edge33

._crit_edge33:                                    ; preds = %._crit_edge, %13
  %17 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  %18 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP5TedgeSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %17, ptr %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %19 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  store ptr %19, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %20 = call ptr @_ZNSt6vectorI5TedgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @edgeList) #8
  store ptr %20, ptr %8, align 8
  %21 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP5TedgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  br i1 %21, label %.lr.ph36, label %._crit_edge37

.lr.ph32:                                         ; preds = %13, %._crit_edge
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %._crit_edge ], [ 0, %13 ]
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %24 = call { double, double } @_ZSt9make_pairIRdS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %25 = extractvalue { double, double } %24, 0
  store double %25, ptr %5, align 8
  %26 = extractvalue { double, double } %24, 1
  store double %26, ptr %12, align 8
  %27 = getelementptr inbounds [110 x %"struct.std::pair"], ptr @points, i64 0, i64 %indvars.iv44
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIddEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  %29 = getelementptr inbounds [110 x i32], ptr @p, i64 0, i64 %indvars.iv44
  %30 = trunc nuw nsw i64 %indvars.iv44 to i32
  store i32 %30, ptr %29, align 4, !tbaa !5
  %.not42 = icmp eq i64 %indvars.iv44, 0
  br i1 %.not42, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph32
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %27, i64 8
  br label %34

._crit_edge:                                      ; preds = %34, %.lr.ph32
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next45, %32
  br i1 %33, label %.lr.ph32, label %._crit_edge33, !llvm.loop !9

34:                                               ; preds = %.lr.ph, %34
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %34 ]
  %35 = getelementptr inbounds [110 x %"struct.std::pair"], ptr @points, i64 0, i64 %indvars.iv
  %.sroa.08.0.copyload = load double, ptr %35, align 16
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  %.sroa.29.0.copyload = load double, ptr %.sroa.29.0..sroa_idx, align 8
  %.sroa.07.0.copyload = load double, ptr %27, align 16
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8
  %36 = call noundef double @_Z13distEuclidianSt4pairIddES0_(double %.sroa.08.0.copyload, double %.sroa.29.0.copyload, double %.sroa.07.0.copyload, double %.sroa.2.0.copyload)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_ZN5TedgeC2Eiid(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %37, i32 noundef %30, double noundef %36)
  call void @_ZNSt6vectorI5TedgeSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @edgeList, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv44
  br i1 %exitcond.not, label %._crit_edge, label %34, !llvm.loop !11

._crit_edge37:                                    ; preds = %51, %._crit_edge33
  %.025.lcssa = phi double [ 0.000000e+00, %._crit_edge33 ], [ %.1, %51 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 0
  %40 = select i1 %39, ptr @.str.2, ptr @.str.3
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %.025.lcssa, ptr noundef nonnull %40)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %42, 0
  br i1 %.not, label %._crit_edge41, label %13, !llvm.loop !12

.lr.ph36:                                         ; preds = %._crit_edge33, %51
  %.02534 = phi double [ %.1, %51 ], [ 0.000000e+00, %._crit_edge33 ]
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP5TedgeSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %.sroa.0.0.copyload = load i32, ptr %44, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  %.sroa.5.0.copyload = load double, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !13
  %45 = call noundef i32 @_Z7findSeti(i32 noundef %.sroa.0.0.copyload)
  %46 = call noundef i32 @_Z7findSeti(i32 noundef %.sroa.4.0.copyload)
  %.not28 = icmp eq i32 %45, %46
  br i1 %.not28, label %51, label %47

47:                                               ; preds = %.lr.ph36
  %48 = sext i32 %45 to i64
  %49 = getelementptr inbounds [110 x i32], ptr @p, i64 0, i64 %48
  store i32 %46, ptr %49, align 4, !tbaa !5
  %50 = fadd double %.02534, %.sroa.5.0.copyload
  br label %51

51:                                               ; preds = %47, %.lr.ph36
  %.1 = phi double [ %50, %47 ], [ %.02534, %.lr.ph36 ]
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP5TedgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %53 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP5TedgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  br i1 %53, label %.lr.ph36, label %._crit_edge37

._crit_edge41:                                    ; preds = %._crit_edge37, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI5TedgeSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

; 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 #4 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: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI5TedgeSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP5TedgeSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr, ptr) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI5TedgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI5TedgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP5TedgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

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

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

attributes #0 = { 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 #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 = { "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 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 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}


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