; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/ASC/1/Problem F/test.ll (Z5solvev)

; 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.Point = type { double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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 }

@a = external dso_local global [333 x %struct.Point], align 16
@r = external dso_local global [333 x double], align 16
@g = external dso_local global [333 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@par = external dso_local global [333 x i32], align 16
@sz = external dso_local global [333 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN5PointmiES_(ptr noundef nonnull align 8 dereferenceable(16), double, double) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6getPari(i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7getPathii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6insidev() #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5solvev() #1 {
  %1 = alloca i1, align 1
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca %struct.Point, align 8
  %8 = alloca %struct.Point, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

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

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

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [333 x i32], ptr @par, i64 0, i64 %19
  store i32 -1, ptr %20, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %22
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %17
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

27:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %145, %27
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 5, ptr %4, align 4
  br label %148

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %5, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %139, %33
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 8, ptr %4, align 4
  br label %142

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [333 x %struct.Point], ptr @a, i64 0, i64 %43
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [333 x %struct.Point], ptr @a, i64 0, i64 %46
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 16 %47, i64 16, i1 false), !tbaa.struct !11
  %48 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %49 = load double, ptr %48, align 8
  %50 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %51 = load double, ptr %50, align 8
  %52 = call { double, double } @_ZN5PointmiES_(ptr noundef nonnull align 8 dereferenceable(16) %44, double %49, double %51)
  %53 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  %54 = extractvalue { double, double } %52, 0
  store double %54, ptr %53, align 8
  %55 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  %56 = extractvalue { double, double } %52, 1
  store double %56, ptr %55, align 8
  %57 = call noundef double @_ZN5Point5sqLenEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  store double %57, ptr %6, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [333 x double], ptr @r, i64 0, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !12
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [333 x double], ptr @r, i64 0, i64 %63
  %65 = load double, ptr %64, align 8, !tbaa !12
  %66 = fadd double %61, %65
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [333 x double], ptr @r, i64 0, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !12
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [333 x double], ptr @r, i64 0, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !12
  %75 = fadd double %70, %74
  %76 = fmul double %66, %75
  store double %76, ptr %9, align 8, !tbaa !12
  %77 = load double, ptr %9, align 8, !tbaa !12
  %78 = load double, ptr %6, align 8, !tbaa !12
  %79 = fadd double %78, 1.000000e-08
  %80 = fcmp ole double %77, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %41
  store i32 10, ptr %4, align 4
  br label %136

82:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = call noundef i32 @_Z6getPari(i32 noundef %83)
  store i32 %84, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = call noundef i32 @_Z6getPari(i32 noundef %85)
  store i32 %86, ptr %11, align 4, !tbaa !5
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = icmp ne i32 %87, %88
  br i1 %89, label %90, label %129

90:                                               ; preds = %82
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %91)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %92, i8 noundef signext 32)
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %93, i32 noundef %94)
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [333 x %"class.std::vector"], ptr @g, i64 0, i64 %98
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [333 x %"class.std::vector"], ptr @g, i64 0, i64 %101
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %103 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %103, ptr %3, align 4, !tbaa !5
  %104 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %104, ptr %5, align 4, !tbaa !5
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = icmp slt i32 %108, %112
  br i1 %113, label %114, label %115

114:                                              ; preds = %90
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5) #7
  br label %115

115:                                              ; preds = %114, %90
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [333 x i32], ptr @par, i64 0, i64 %118
  store i32 %116, ptr %119, align 4, !tbaa !5
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = add nsw i32 %127, %123
  store i32 %128, ptr %126, align 4, !tbaa !5
  store i32 10, ptr %4, align 4
  br label %135

129:                                              ; preds = %82
  %130 = load i32, ptr %3, align 4, !tbaa !5
  %131 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z7getPathii(i32 noundef %130, i32 noundef %131)
  %132 = call noundef zeroext i1 @_Z6insidev()
  br i1 %132, label %133, label %134

133:                                              ; preds = %129
  store i1 false, ptr %1, align 1
  store i32 1, ptr %4, align 4
  br label %135

134:                                              ; preds = %129
  store i32 0, ptr %4, align 4
  br label %135

135:                                              ; preds = %134, %133, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %136

136:                                              ; preds = %135, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %137 = load i32, ptr %4, align 4
  switch i32 %137, label %142 [
    i32 0, label %138
    i32 10, label %139
  ]

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138, %136
  %140 = load i32, ptr %5, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !14

142:                                              ; preds = %136, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  %143 = load i32, ptr %4, align 4
  switch i32 %143, label %148 [
    i32 8, label %144
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %3, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %3, align 4, !tbaa !5
  br label %28, !llvm.loop !15

148:                                              ; preds = %142, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %149 = load i32, ptr %4, align 4
  switch i32 %149, label %153 [
    i32 5, label %150
    i32 1, label %151
  ]

150:                                              ; preds = %148
  store i1 true, ptr %1, align 1
  br label %151

151:                                              ; preds = %150, %148
  %152 = load i1, ptr %1, align 1
  ret i1 %152

153:                                              ; preds = %148
  unreachable
}

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { "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 = { 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 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Point = type { double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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 }

@a = external dso_local global [333 x %struct.Point], align 16
@r = external dso_local local_unnamed_addr global [333 x double], align 16
@g = external dso_local global [333 x %"class.std::vector"], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@par = external dso_local local_unnamed_addr global [333 x i32], align 16
@sz = external dso_local local_unnamed_addr global [333 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN5PointmiES_(ptr noundef nonnull align 8 dereferenceable(16), double, double) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6getPari(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7getPathii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6insidev() local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5solvev() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Point, align 8
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  br label %.loopexit

.lr.ph.preheader:                                 ; preds = %0
  %6 = zext nneg i32 %4 to i64
  %7 = shl nuw nsw i64 %6, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @par, i8 -1, i64 %7, i1 false), !tbaa !5
  %min.iters.check = icmp ult i32 %4, 8
  br i1 %min.iters.check, label %.lr.ph.preheader52, label %vector.ph

.lr.ph.preheader52:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %6, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %8 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %index
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %9, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %10 = icmp eq i64 %index.next, %n.vec
  br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %6
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader52

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  br label %13

.lr.ph:                                           ; preds = %.lr.ph.preheader52, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader52 ]
  %12 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %indvars.iv
  store i32 1, ptr %12, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %6
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

13:                                               ; preds = %._crit_edge, %._crit_edge32
  %14 = phi i32 [ %4, %._crit_edge ], [ %77, %._crit_edge32 ]
  %storemerge20.in27 = phi i32 [ 0, %._crit_edge ], [ %.pre-phi, %._crit_edge32 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %storemerge2028 = add nsw i32 %storemerge20.in27, 1
  store i32 %storemerge2028, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %storemerge2028, %14
  br i1 %15, label %.lr.ph31, label %._crit_edge32

.lr.ph31:                                         ; preds = %13, %73
  %storemerge2029 = phi i32 [ %storemerge20, %73 ], [ %storemerge2028, %13 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [333 x %struct.Point], ptr @a, i64 0, i64 %17
  %19 = sext i32 %storemerge2029 to i64
  %20 = getelementptr inbounds [333 x %struct.Point], ptr @a, i64 0, i64 %19
  %.sroa.0.0.copyload = load double, ptr %20, align 16, !tbaa !14
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !14
  %21 = call { double, double } @_ZN5PointmiES_(ptr noundef nonnull align 8 dereferenceable(16) %18, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %22 = extractvalue { double, double } %21, 0
  store double %22, ptr %3, align 8
  %23 = extractvalue { double, double } %21, 1
  store double %23, ptr %11, align 8
  %24 = call noundef double @_ZN5Point5sqLenEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [333 x double], ptr @r, i64 0, i64 %26
  %28 = load double, ptr %27, align 8, !tbaa !14
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [333 x double], ptr @r, i64 0, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !14
  %33 = fadd double %28, %32
  %34 = fmul double %33, %33
  %35 = fadd double %24, 1.000000e-08
  %36 = fcmp ugt double %34, %35
  br i1 %36, label %37, label %73

37:                                               ; preds = %.lr.ph31
  %38 = call noundef i32 @_Z6getPari(i32 noundef %25)
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = call noundef i32 @_Z6getPari(i32 noundef %39)
  %.not = icmp eq i32 %38, %40
  %41 = load i32, ptr %1, align 4, !tbaa !5
  br i1 %.not, label %70, label %42

42:                                               ; preds = %37
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %41)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %43, i8 noundef signext 32)
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %44, i32 noundef %45)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [333 x %"class.std::vector"], ptr @g, i64 0, i64 %49
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [333 x %"class.std::vector"], ptr @g, i64 0, i64 %52
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %53, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i32 %38, ptr %1, align 4, !tbaa !5
  store i32 %40, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %38 to i64
  %55 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %40 to i64
  %58 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = icmp slt i32 %56, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %42
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #7
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.pre39 = load i32, ptr %2, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre39 to i64
  %.phi.trans.insert40 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %.phi.trans.insert
  %.pre41 = load i32, ptr %.phi.trans.insert40, align 4, !tbaa !5
  %.phi.trans.insert42 = sext i32 %.pre to i64
  %.phi.trans.insert43 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %.phi.trans.insert42
  %.pre44 = load i32, ptr %.phi.trans.insert43, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %61, %42
  %.pre-phi50 = phi i64 [ %.phi.trans.insert42, %61 ], [ %54, %42 ]
  %.pre-phi49 = phi i64 [ %.phi.trans.insert, %61 ], [ %57, %42 ]
  %63 = phi i32 [ %.pre44, %61 ], [ %56, %42 ]
  %64 = phi i32 [ %.pre41, %61 ], [ %59, %42 ]
  %65 = phi i32 [ %.pre39, %61 ], [ %40, %42 ]
  %66 = phi i32 [ %.pre, %61 ], [ %38, %42 ]
  %67 = getelementptr inbounds [333 x i32], ptr @par, i64 0, i64 %.pre-phi49
  store i32 %66, ptr %67, align 4, !tbaa !5
  %68 = getelementptr inbounds [333 x i32], ptr @sz, i64 0, i64 %.pre-phi50
  %69 = add nsw i32 %63, %64
  store i32 %69, ptr %68, align 4, !tbaa !5
  br label %73

70:                                               ; preds = %37
  %71 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z7getPathii(i32 noundef %41, i32 noundef %71)
  %72 = call noundef zeroext i1 @_Z6insidev()
  br i1 %72, label %76, label %._crit_edge45

._crit_edge45:                                    ; preds = %70
  %storemerge20.in.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %._crit_edge45, %.lr.ph31, %62
  %storemerge20.in = phi i32 [ %storemerge20.in.pre, %._crit_edge45 ], [ %29, %.lr.ph31 ], [ %65, %62 ]
  %storemerge20 = add nsw i32 %storemerge20.in, 1
  store i32 %storemerge20, ptr %2, align 4, !tbaa !5
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = icmp slt i32 %storemerge20, %74
  br i1 %75, label %.lr.ph31, label %._crit_edge32.loopexit, !llvm.loop !16

76:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %.loopexit

._crit_edge32.loopexit:                           ; preds = %73
  %.pre47 = load i32, ptr %1, align 4, !tbaa !5
  %.pre48 = add nsw i32 %.pre47, 1
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit, %13
  %.pre-phi = phi i32 [ %.pre48, %._crit_edge32.loopexit ], [ %storemerge2028, %13 ]
  %77 = phi i32 [ %74, %._crit_edge32.loopexit ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  store i32 %.pre-phi, ptr %1, align 4, !tbaa !5
  %.not51 = icmp slt i32 %.pre-phi, %77
  br i1 %.not51, label %13, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %._crit_edge32, %._crit_edge.thread, %76
  %78 = phi i1 [ false, %76 ], [ true, %._crit_edge.thread ], [ true, %._crit_edge32 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i1 %78
}

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { "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 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass