; LLVM IR from ShahjalalShohag/code-library :: Dynamic Programming Optimizations/DP on Convex Hulls.ll (Z2yod)

; 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.PT = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@p = external dso_local global [205 x %struct.PT], align 16
@dp = external dso_local global [205 x [205 x double]], align 16
@v = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z2yod(double noundef %0) #0 {
  %2 = alloca i1, align 1
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca %struct.PT, align 4
  %15 = alloca %struct.PT, align 4
  %16 = alloca %struct.PT, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  store double %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %42, %1
  %21 = load i32, ptr %4, align 4, !tbaa !9
  %22 = load i32, ptr @n, align 4, !tbaa !9
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %45

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %38, %25
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = load i32, ptr @n, align 4, !tbaa !9
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %41

31:                                               ; preds = %26
  %32 = load i32, ptr %4, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %33
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [205 x double], ptr %34, i64 0, i64 %36
  store double -1.000000e+09, ptr %37, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %31
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %6, align 4, !tbaa !9
  br label %26, !llvm.loop !11

41:                                               ; preds = %30
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %4, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %4, align 4, !tbaa !9
  br label %20, !llvm.loop !13

45:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr @v, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %46 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %46, ptr %47, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %48 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  br label %50

50:                                               ; preds = %125, %45
  %51 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %51, label %53, label %52

52:                                               ; preds = %50
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %127

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %54 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %54, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %10) #6
  store ptr %55, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %10) #6
  store ptr %56, ptr %12, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %57 = load ptr, ptr %11, align 8, !tbaa !14
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %59
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %60)
  %61 = load ptr, ptr %12, align 8, !tbaa !14
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %63
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %64)
  %65 = call noundef i32 @_Z5cross2PTS_(ptr noundef %14, ptr noundef %15)
  %66 = sitofp i32 %65 to double
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %67 = load ptr, ptr %12, align 8, !tbaa !14
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %69
  %71 = load ptr, ptr %11, align 8, !tbaa !14
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %73
  call void @_ZNK2PTmiERKS_(ptr dead_on_unwind writable sret(%struct.PT) align 4 %16, ptr noundef nonnull align 4 dereferenceable(8) %70, ptr noundef nonnull align 4 dereferenceable(8) %74)
  %75 = call noundef i32 @_ZN2PT5norm2Ev(ptr noundef nonnull align 4 dereferenceable(8) %16)
  %76 = sitofp i32 %75 to double
  %77 = load double, ptr %3, align 8, !tbaa !5
  %78 = fmul double %76, %77
  %79 = fneg double %78
  %80 = call double @llvm.fmuladd.f64(double %66, double 5.000000e-01, double %79)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  store double %80, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %121, %53
  %82 = load i32, ptr %17, align 4, !tbaa !9
  %83 = load i32, ptr @n, align 4, !tbaa !9
  %84 = icmp sle i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %124

86:                                               ; preds = %81
  %87 = load i32, ptr %17, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %88
  %90 = load ptr, ptr %12, align 8, !tbaa !14
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [205 x double], ptr %89, i64 0, i64 %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = load ptr, ptr %11, align 8, !tbaa !14
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = icmp eq i32 %94, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %86
  br label %108

99:                                               ; preds = %86
  %100 = load i32, ptr %17, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %101
  %103 = load ptr, ptr %11, align 8, !tbaa !14
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [205 x double], ptr %102, i64 0, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !5
  br label %108

108:                                              ; preds = %99, %98
  %109 = phi double [ 0.000000e+00, %98 ], [ %107, %99 ]
  %110 = load double, ptr %13, align 8, !tbaa !5
  %111 = fadd double %109, %110
  store double %111, ptr %18, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %113 = load double, ptr %112, align 8, !tbaa !5
  %114 = load i32, ptr %17, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %115
  %117 = load ptr, ptr %12, align 8, !tbaa !14
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [205 x double], ptr %116, i64 0, i64 %119
  store double %113, ptr %120, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %121

121:                                              ; preds = %108
  %122 = load i32, ptr %17, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %17, align 4, !tbaa !9
  br label %81, !llvm.loop !16

124:                                              ; preds = %85
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %125

125:                                              ; preds = %124
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br label %50

127:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1, ptr %19, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %144, %127
  %129 = load i32, ptr %19, align 4, !tbaa !9
  %130 = load i32, ptr @n, align 4, !tbaa !9
  %131 = icmp sle i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 13, ptr %5, align 4
  br label %147

133:                                              ; preds = %128
  %134 = load i32, ptr %19, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %135
  %137 = load i32, ptr %19, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [205 x double], ptr %136, i64 0, i64 %138
  %140 = load double, ptr %139, align 8, !tbaa !5
  %141 = fcmp oge double %140, 0.000000e+00
  br i1 %141, label %142, label %143

142:                                              ; preds = %133
  store i1 true, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %147

143:                                              ; preds = %133
  br label %144

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

147:                                              ; preds = %142, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %148 = load i32, ptr %5, align 4
  switch i32 %148, label %152 [
    i32 13, label %149
    i32 1, label %150
  ]

149:                                              ; preds = %147
  store i1 false, ptr %2, align 1
  br label %150

150:                                              ; preds = %149, %147
  %151 = load i1, ptr %2, align 1
  ret i1 %151

152:                                              ; preds = %147
  unreachable
}

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5cross2PTS_(ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.PT) align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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

%struct.PT = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local global [205 x %struct.PT], align 16
@dp = external dso_local global [205 x [205 x double]], align 16
@v = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z2yod(double noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %struct.PT, align 4
  %6 = alloca %struct.PT, align 4
  %7 = alloca %struct.PT, align 4
  %8 = alloca double, align 8
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %.not38 = icmp slt i32 %9, 1
  br i1 %.not38, label %._crit_edge40, label %.preheader.preheader

.preheader.preheader:                             ; preds = %1
  %10 = add nuw i32 %9, 1
  %wide.trip.count60 = zext i32 %10 to i64
  %11 = zext nneg i32 %9 to i64
  %min.iters.check = icmp ult i32 %9, 4
  %n.vec = and i64 %11, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %n.vec, %11
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv57 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next58, %._crit_edge ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader
  %indvars.iv.ph = phi i64 [ 1, %.preheader ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader ]
  %offset.idx = or disjoint i64 %index, 1
  %12 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %indvars.iv57, i64 %offset.idx
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  store <2 x double> <double -1.000000e+09, double -1.000000e+09>, ptr %12, align 8, !tbaa !9
  store <2 x double> <double -1.000000e+09, double -1.000000e+09>, ptr %13, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge40:                                    ; preds = %._crit_edge, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %15 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #5
  store ptr %15, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %16 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #5
  store ptr %16, ptr %3, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %17, label %.lr.ph46, label %._crit_edge47

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %._crit_edge40, label %.preheader, !llvm.loop !15

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %18 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %indvars.iv57, i64 %indvars.iv
  store double -1.000000e+09, ptr %18, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count60
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !16

._crit_edge47:                                    ; preds = %._crit_edge44, %._crit_edge40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %.not3348 = icmp sgt i32 %19, 0
  br i1 %.not3348, label %.lr.ph52.preheader, label %._crit_edge53

.lr.ph52.preheader:                               ; preds = %._crit_edge47
  %20 = zext nneg i32 %19 to i64
  %21 = add nuw i32 %19, 1
  %wide.trip.count67 = zext i32 %21 to i64
  %22 = load double, ptr getelementptr inbounds (i8, ptr @dp, i64 1648), align 16, !tbaa !9
  %23 = fcmp ult double %22, 0.000000e+00
  br i1 %23, label %.lr.ph70, label %._crit_edge53

.lr.ph46:                                         ; preds = %._crit_edge40, %._crit_edge44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %25 = load i64, ptr %24, align 4
  store i64 %25, ptr %4, align 8
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %4) #5
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %4) #5
  %28 = load i32, ptr %26, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %29
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %30)
  %31 = load i32, ptr %27, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %32
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %33)
  %34 = call noundef i32 @_Z5cross2PTS_(ptr noundef nonnull %5, ptr noundef nonnull %6)
  %35 = sitofp i32 %34 to double
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %36 = load i32, ptr %27, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %37
  %39 = load i32, ptr %26, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [205 x %struct.PT], ptr @p, i64 0, i64 %40
  call void @_ZNK2PTmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 4 %7, ptr noundef nonnull align 4 dereferenceable(8) %38, ptr noundef nonnull align 4 dereferenceable(8) %41)
  %42 = call noundef i32 @_ZN2PT5norm2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %43 = sitofp i32 %42 to double
  %44 = fneg double %43
  %45 = fmul double %44, %0
  %46 = call double @llvm.fmuladd.f64(double %35, double 5.000000e-01, double %45)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %.not3441 = icmp slt i32 %47, 1
  br i1 %.not3441, label %._crit_edge44, label %.lr.ph

._crit_edge44:                                    ; preds = %60, %.lr.ph46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %49 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %49, label %.lr.ph46, label %._crit_edge47

.lr.ph:                                           ; preds = %.lr.ph46, %60
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %60 ], [ 1, %.lr.ph46 ]
  %50 = load i32, ptr %27, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %indvars.iv62, i64 %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %53 = load i32, ptr %26, align 4, !tbaa !5
  %54 = zext i32 %53 to i64
  %55 = icmp eq i64 %indvars.iv62, %54
  br i1 %55, label %60, label %56

56:                                               ; preds = %.lr.ph
  %57 = sext i32 %53 to i64
  %58 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %indvars.iv62, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %.lr.ph, %56
  %61 = phi double [ %59, %56 ], [ 0.000000e+00, %.lr.ph ]
  %62 = fadd double %46, %61
  store double %62, ptr %8, align 8, !tbaa !9
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %64 = load double, ptr %63, align 8, !tbaa !9
  %65 = load i32, ptr %27, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %indvars.iv62, i64 %66
  store double %64, ptr %67, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %.not34.not = icmp slt i64 %indvars.iv62, %69
  br i1 %.not34.not, label %.lr.ph, label %._crit_edge44, !llvm.loop !17

.lr.ph70:                                         ; preds = %.lr.ph52.preheader, %.lr.ph52
  %indvars.iv6569 = phi i64 [ %indvars.iv.next66, %.lr.ph52 ], [ 1, %.lr.ph52.preheader ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv6569, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count67
  br i1 %exitcond68.not, label %._crit_edge53.loopexit, label %.lr.ph52, !llvm.loop !18

.lr.ph52:                                         ; preds = %.lr.ph70
  %70 = getelementptr inbounds [205 x [205 x double]], ptr @dp, i64 0, i64 %indvars.iv.next66, i64 %indvars.iv.next66
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = fcmp ult double %71, 0.000000e+00
  br i1 %72, label %.lr.ph70, label %._crit_edge53.loopexit, !llvm.loop !18

._crit_edge53.loopexit:                           ; preds = %.lr.ph70, %.lr.ph52
  %.not33.le = icmp ult i64 %indvars.iv6569, %20
  br label %._crit_edge53

._crit_edge53:                                    ; preds = %._crit_edge53.loopexit, %.lr.ph52.preheader, %._crit_edge47
  %.not33.lcssa = phi i1 [ false, %._crit_edge47 ], [ true, %.lr.ph52.preheader ], [ %.not33.le, %._crit_edge53.loopexit ]
  ret i1 %.not33.lcssa
}

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5cross2PTS_(ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.PT) align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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