; LLVM IR from buresjan/optim_lbm :: nomad/src/Algos (Projection)

; 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.NOMAD_4_3::Direction" = type { %"class.NOMAD_4_3::ArrayOfDouble" }
%"class.NOMAD_4_3::ArrayOfDouble" = type { ptr, i64, ptr }
%"class.NOMAD_4_3::Double" = type <{ ptr, double, i8, [7 x i8] }>
%"class.NOMAD_4_3::Projection" = type { %"class.NOMAD_4_3::Step.base", %"class.NOMAD_4_3::IterationUtils", %"class.std::set", i32, %"class.std::vector.23", %"class.std::shared_ptr.28", %"class.std::shared_ptr.31", %"class.std::set.34", i64 }
%"class.NOMAD_4_3::Step.base" = type <{ ptr, ptr, i32, [4 x i8], %"class.std::shared_ptr", %"class.std::shared_ptr.3", %"class.std::shared_ptr.6", %"class.NOMAD_4_3::SuccessStats", i32 }>
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.6" = type { %"class.std::__shared_ptr.7" }
%"class.std::__shared_ptr.7" = type { ptr, %"class.std::__shared_count" }
%"class.NOMAD_4_3::SuccessStats" = type { %"class.std::map", i64, i64 }
%"class.std::map" = type { %"class.std::_Rb_tree.9" }
%"class.std::_Rb_tree.9" = type { %"struct.std::_Rb_tree<std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>, std::pair<const std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>, unsigned long>, std::_Select1st<std::pair<const std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>, unsigned long>>, std::less<std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>, std::pair<const std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>, unsigned long>, std::_Select1st<std::pair<const std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>, unsigned long>>, std::less<std::pair<NOMAD_4_3::StepType, NOMAD_4_3::SuccessType>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.NOMAD_4_3::IterationUtils" = type { ptr, %"class.std::set", i64, ptr, ptr, ptr, %"class.NOMAD_4_3::TrialPointStats", i8, i32 }
%"class.NOMAD_4_3::TrialPointStats" = type { ptr, %"class.std::vector", %"class.std::map.17", %"class.std::map.17", %"class.std::map.17", %"class.std::map.17", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<NOMAD_4_3::EvalType, std::allocator<NOMAD_4_3::EvalType>>::_Vector_impl" }
%"struct.std::_Vector_base<NOMAD_4_3::EvalType, std::allocator<NOMAD_4_3::EvalType>>::_Vector_impl" = type { %"struct.std::_Vector_base<NOMAD_4_3::EvalType, std::allocator<NOMAD_4_3::EvalType>>::_Vector_impl_data" }
%"struct.std::_Vector_base<NOMAD_4_3::EvalType, std::allocator<NOMAD_4_3::EvalType>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map.17" = type { %"class.std::_Rb_tree.18" }
%"class.std::_Rb_tree.18" = type { %"struct.std::_Rb_tree<NOMAD_4_3::EvalType, std::pair<const NOMAD_4_3::EvalType, unsigned long>, std::_Select1st<std::pair<const NOMAD_4_3::EvalType, unsigned long>>, std::less<NOMAD_4_3::EvalType>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<NOMAD_4_3::EvalType, std::pair<const NOMAD_4_3::EvalType, unsigned long>, std::_Select1st<std::pair<const NOMAD_4_3::EvalType, unsigned long>>, std::less<NOMAD_4_3::EvalType>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<NOMAD_4_3::EvalPoint, NOMAD_4_3::EvalPoint, std::_Identity<NOMAD_4_3::EvalPoint>, NOMAD_4_3::EvalPointCompare>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<NOMAD_4_3::EvalPoint, NOMAD_4_3::EvalPoint, std::_Identity<NOMAD_4_3::EvalPoint>, NOMAD_4_3::EvalPointCompare>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector.23" = type { %"struct.std::_Vector_base.24" }
%"struct.std::_Vector_base.24" = type { %"struct.std::_Vector_base<NOMAD_4_3::EvalPoint, std::allocator<NOMAD_4_3::EvalPoint>>::_Vector_impl" }
%"struct.std::_Vector_base<NOMAD_4_3::EvalPoint, std::allocator<NOMAD_4_3::EvalPoint>>::_Vector_impl" = type { %"struct.std::_Vector_base<NOMAD_4_3::EvalPoint, std::allocator<NOMAD_4_3::EvalPoint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<NOMAD_4_3::EvalPoint, std::allocator<NOMAD_4_3::EvalPoint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.28" = type { %"class.std::__shared_ptr.29" }
%"class.std::__shared_ptr.29" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.31" = type { %"class.std::__shared_ptr.32" }
%"class.std::__shared_ptr.32" = type { ptr, %"class.std::__shared_count" }
%"class.std::set.34" = type { %"class.std::_Rb_tree.35" }
%"class.std::_Rb_tree.35" = type { %"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9NOMAD_4_310Projection19computePerturbationERKNS_9EvalPointEm(ptr dead_on_unwind noalias writable sret(%"class.NOMAD_4_3::Direction") align 8 %0, ptr noundef nonnull align 8 dereferenceable(640) %1, ptr noundef nonnull align 8 dereferenceable(160) %2, i64 noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i1, align 1
  %10 = alloca %"class.NOMAD_4_3::Double", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca %"class.NOMAD_4_3::Double", align 8
  %15 = alloca %"class.NOMAD_4_3::Double", align 8
  %16 = alloca double, align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !9
  %17 = load ptr, ptr %6, align 8
  store i1 false, ptr %9, align 1
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = call noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %10)
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %19, ptr noundef nonnull align 8 dereferenceable(17) %10)
          to label %20 unwind label %28

20:                                               ; preds = %4
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %72, %20
  %22 = load i64, ptr %13, align 8, !tbaa !9
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = invoke noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %25 unwind label %32

25:                                               ; preds = %21
  %26 = icmp ult i64 %22, %24
  br i1 %26, label %36, label %27

27:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %82

28:                                               ; preds = %4
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %11, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %12, align 4
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %86

32:                                               ; preds = %21
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %11, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %12, align 4
  br label %81

36:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %37 = getelementptr inbounds %"class.NOMAD_4_3::Projection", ptr %17, i32 0, i32 5
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %37) #5
  %39 = load i64, ptr %13, align 8, !tbaa !9
  %40 = load ptr, ptr %38, align 8, !tbaa !11
  %41 = getelementptr inbounds ptr, ptr %40, i64 11
  %42 = load ptr, ptr %41, align 8
  invoke void %42(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::Double") align 8 %14, ptr noundef nonnull align 8 dereferenceable(257) %38, i64 noundef %39)
          to label %43 unwind label %51

43:                                               ; preds = %36
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = and i64 %44, 1
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %64

47:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store double -1.000000e+00, ptr %16, align 8, !tbaa !13
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %48 unwind label %55

48:                                               ; preds = %47
  %49 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublemLERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %14, ptr noundef nonnull align 8 dereferenceable(17) %15)
          to label %50 unwind label %59

50:                                               ; preds = %48
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %64

51:                                               ; preds = %36
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %11, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %12, align 4
  br label %80

55:                                               ; preds = %47
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %11, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %12, align 4
  br label %63

59:                                               ; preds = %48
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %11, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %12, align 4
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %15) #5
  br label %63

63:                                               ; preds = %59, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %79

64:                                               ; preds = %50, %43
  %65 = load i64, ptr %13, align 8, !tbaa !9
  %66 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %65)
          to label %67 unwind label %75

67:                                               ; preds = %64
  %68 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoubleaSERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %66, ptr noundef nonnull align 8 dereferenceable(17) %14)
          to label %69 unwind label %75

69:                                               ; preds = %67
  %70 = load i64, ptr %8, align 8, !tbaa !9
  %71 = lshr i64 %70, 1
  store i64 %71, ptr %8, align 8, !tbaa !9
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %72

72:                                               ; preds = %69
  %73 = load i64, ptr %13, align 8, !tbaa !9
  %74 = add i64 %73, 1
  store i64 %74, ptr %13, align 8, !tbaa !9
  br label %21, !llvm.loop !15

75:                                               ; preds = %67, %64
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  br label %79

79:                                               ; preds = %75, %63
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %14) #5
  br label %80

80:                                               ; preds = %79, %51
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %81

81:                                               ; preds = %80, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %86

82:                                               ; preds = %27
  store i1 true, ptr %9, align 1
  %83 = load i1, ptr %9, align 1
  br i1 %83, label %85, label %84

84:                                               ; preds = %82
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %85

85:                                               ; preds = %84, %82
  ret void

86:                                               ; preds = %81, %28
  %87 = load ptr, ptr %11, align 8
  %88 = load i32, ptr %12, align 4
  %89 = insertvalue { ptr, i32 } poison, ptr %87, 0
  %90 = insertvalue { ptr, i32 } %89, i32 %88, 1
  resume { ptr, i32 } %90
}

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

; Function Attrs: nounwind
declare void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #3

declare void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublemLERKS0_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) #4

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoubleaSERKS0_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.NOMAD_4_3::Direction" = type { %"class.NOMAD_4_3::ArrayOfDouble" }
%"class.NOMAD_4_3::ArrayOfDouble" = type { ptr, i64, ptr }
%"class.NOMAD_4_3::Double" = type <{ ptr, double, i8, [7 x i8] }>

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9NOMAD_4_310Projection19computePerturbationERKNS_9EvalPointEm(ptr dead_on_unwind noalias writable sret(%"class.NOMAD_4_3::Direction") align 8 %0, ptr noundef nonnull align 8 dereferenceable(640) %1, ptr noundef nonnull align 8 dereferenceable(160) %2, i64 noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.NOMAD_4_3::Double", align 8
  %6 = alloca %"class.NOMAD_4_3::Double", align 8
  %7 = alloca %"class.NOMAD_4_3::Double", align 8
  %8 = alloca double, align 8
  %9 = tail call noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %5)
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %9, ptr noundef nonnull align 8 dereferenceable(17) %5)
          to label %10 unwind label %13

10:                                               ; preds = %4
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  %11 = call noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not24 = icmp eq i64 %11, 0
  br i1 %.not24, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10
  %12 = getelementptr inbounds i8, ptr %1, i64 552
  br label %15

13:                                               ; preds = %4
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %46

15:                                               ; preds = %.lr.ph, %37
  %.023 = phi i64 [ 0, %.lr.ph ], [ %39, %37 ]
  %.01622 = phi i64 [ %3, %.lr.ph ], [ %38, %37 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %16 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %12) #5
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 88
  %19 = load ptr, ptr %18, align 8
  invoke void %19(ptr dead_on_unwind nonnull writable sret(%"class.NOMAD_4_3::Double") align 8 %6, ptr noundef nonnull align 8 dereferenceable(257) %16, i64 noundef %.023)
          to label %20 unwind label %26

20:                                               ; preds = %15
  %21 = and i64 %.01622, 1
  %.not = icmp eq i64 %21, 0
  br i1 %.not, label %33, label %22

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store double -1.000000e+00, ptr %8, align 8, !tbaa !8
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %23 unwind label %28

23:                                               ; preds = %22
  %24 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublemLERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %6, ptr noundef nonnull align 8 dereferenceable(17) %7)
          to label %25 unwind label %30

25:                                               ; preds = %23
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %33

26:                                               ; preds = %15
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %45

28:                                               ; preds = %22
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %32

30:                                               ; preds = %23
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %7) #5
  br label %32

32:                                               ; preds = %30, %28
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %44

33:                                               ; preds = %25, %20
  %34 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.023)
          to label %35 unwind label %42

35:                                               ; preds = %33
  %36 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoubleaSERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %34, ptr noundef nonnull align 8 dereferenceable(17) %6)
          to label %37 unwind label %42

37:                                               ; preds = %35
  %38 = lshr i64 %.01622, 1
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %39 = add nuw i64 %.023, 1
  %40 = call noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %41 = icmp ult i64 %39, %40
  br i1 %41, label %15, label %._crit_edge, !llvm.loop !11

42:                                               ; preds = %35, %33
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %44

44:                                               ; preds = %42, %32
  %.pn18 = phi { ptr, i32 } [ %43, %42 ], [ %.pn, %32 ]
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %6) #5
  br label %45

45:                                               ; preds = %44, %26
  %.pn18.pn = phi { ptr, i32 } [ %.pn18, %44 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %46

._crit_edge:                                      ; preds = %37, %10
  ret void

46:                                               ; preds = %45, %13
  %.pn18.pn.pn = phi { ptr, i32 } [ %.pn18.pn, %45 ], [ %14, %13 ]
  resume { ptr, i32 } %.pn18.pn.pn
}

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

; Function Attrs: nounwind
declare void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #3

declare void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublemLERKS0_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoubleaSERKS0_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass