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

; 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::Double" = type <{ ptr, double, i8, [7 x i8] }>
%"class.NOMAD_4_3::ArrayOfDouble" = type { ptr, i64, ptr }
%"class.NOMAD_4_3::SgtelibModel" = type { %"class.NOMAD_4_3::Algorithm.base", %"class.std::shared_ptr.36", %"class.std::shared_ptr.39", %"class.std::shared_ptr.42", i64, i8, i8, %"class.NOMAD_4_3::ArrayOfDouble", %"class.NOMAD_4_3::ArrayOfDouble", %"class.std::shared_ptr.45" }
%"class.NOMAD_4_3::Algorithm.base" = type <{ %"class.NOMAD_4_3::Step.base", i8, [3 x i8], %"class.std::unique_ptr", %"class.std::unique_ptr.16", %"class.std::shared_ptr.24", i8, i8, [6 x i8], %"class.NOMAD_4_3::TrialPointStats", i8 }>
%"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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.15" }
%"struct.std::_Head_base.15" = type { ptr }
%"class.std::unique_ptr.16" = type { %"struct.std::__uniq_ptr_data.17" }
%"struct.std::__uniq_ptr_data.17" = type { %"class.std::__uniq_ptr_impl.18" }
%"class.std::__uniq_ptr_impl.18" = type { %"class.std::tuple.19" }
%"class.std::tuple.19" = type { %"struct.std::_Tuple_impl.20" }
%"struct.std::_Tuple_impl.20" = type { %"struct.std::_Head_base.23" }
%"struct.std::_Head_base.23" = type { ptr }
%"class.std::shared_ptr.24" = type { %"class.std::__shared_ptr.25" }
%"class.std::__shared_ptr.25" = type { ptr, %"class.std::__shared_count" }
%"class.NOMAD_4_3::TrialPointStats" = type { ptr, %"class.std::vector", %"class.std::map.30", %"class.std::map.30", %"class.std::map.30", %"class.std::map.30", 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.30" = type { %"class.std::_Rb_tree.31" }
%"class.std::_Rb_tree.31" = 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::shared_ptr.36" = type { %"class.std::__shared_ptr.37" }
%"class.std::__shared_ptr.37" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.39" = type { %"class.std::__shared_ptr.40" }
%"class.std::__shared_ptr.40" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.42" = type { %"class.std::__shared_ptr.43" }
%"class.std::__shared_ptr.43" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.45" = type { %"class.std::__shared_ptr.46" }
%"class.std::__shared_ptr.46" = type { ptr, %"class.std::__shared_count" }

; 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: nounwind
declare void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

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

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

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

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)) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9NOMAD_4_312SgtelibModel13getDeltaMNormEv(ptr dead_on_unwind noalias writable sret(%"class.NOMAD_4_3::Double") align 8 %0, ptr noundef nonnull align 8 dereferenceable(552) %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.NOMAD_4_3::Double", align 8
  %10 = alloca double, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.NOMAD_4_3::Double", align 8
  %13 = alloca %"class.NOMAD_4_3::Double", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  call void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %15 = getelementptr inbounds %"class.NOMAD_4_3::SgtelibModel", ptr %14, i32 0, i32 9
  %16 = call noundef zeroext i1 @_ZStneIN9NOMAD_4_38MeshBaseEEbDnRKSt10shared_ptrIT_E(ptr null, ptr noundef nonnull align 8 dereferenceable(16) %15) #7
  br i1 %16, label %17, label %82

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  %18 = getelementptr inbounds %"class.NOMAD_4_3::SgtelibModel", ptr %14, i32 0, i32 9
  %19 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i64 12
  %22 = load ptr, ptr %21, align 8
  invoke void %22(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::ArrayOfDouble") align 8 %6, ptr noundef nonnull align 8 dereferenceable(257) %19)
          to label %23 unwind label %31

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store double 0.000000e+00, ptr %10, align 8, !tbaa !11
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %24 unwind label %35

24:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !13
  br label %25

25:                                               ; preds = %53, %24
  %26 = load i64, ptr %11, align 8, !tbaa !13
  %27 = invoke noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %28 unwind label %39

28:                                               ; preds = %25
  %29 = icmp ult i64 %26, %27
  br i1 %29, label %43, label %30

30:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %66

31:                                               ; preds = %17
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %7, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %8, align 4
  br label %81

35:                                               ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %7, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %80

39:                                               ; preds = %25
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %7, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %8, align 4
  br label %65

43:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  %44 = load i64, ptr %11, align 8, !tbaa !13
  %45 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %44)
          to label %46 unwind label %56

46:                                               ; preds = %43
  %47 = load i64, ptr %11, align 8, !tbaa !13
  %48 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %47)
          to label %49 unwind label %56

49:                                               ; preds = %46
  invoke void @_ZN9NOMAD_4_3mlERKNS_6DoubleES2_(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::Double") align 8 %12, ptr noundef nonnull align 8 dereferenceable(17) %45, ptr noundef nonnull align 8 dereferenceable(17) %48)
          to label %50 unwind label %56

50:                                               ; preds = %49
  %51 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublepLERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %9, ptr noundef nonnull align 8 dereferenceable(17) %12)
          to label %52 unwind label %60

52:                                               ; preds = %50
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  br label %53

53:                                               ; preds = %52
  %54 = load i64, ptr %11, align 8, !tbaa !13
  %55 = add i64 %54, 1
  store i64 %55, ptr %11, align 8, !tbaa !13
  br label %25, !llvm.loop !15

56:                                               ; preds = %49, %46, %43
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %7, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %8, align 4
  br label %64

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

64:                                               ; preds = %60, %56
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  br label %65

65:                                               ; preds = %64, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %79

66:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  invoke void @_ZNK9NOMAD_4_36Double4sqrtEv(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::Double") align 8 %13, ptr noundef nonnull align 8 dereferenceable(17) %9)
          to label %67 unwind label %70

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

69:                                               ; preds = %67
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  br label %82

70:                                               ; preds = %66
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %8, align 4
  br label %78

74:                                               ; preds = %67
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %7, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %8, align 4
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %13) #7
  br label %78

78:                                               ; preds = %74, %70
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  br label %79

79:                                               ; preds = %78, %65
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %9) #7
  br label %80

80:                                               ; preds = %79, %35
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  br label %81

81:                                               ; preds = %80, %31
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %0) #7
  br label %86

82:                                               ; preds = %69, %2
  store i1 true, ptr %5, align 1
  %83 = load i1, ptr %5, align 1
  br i1 %83, label %85, label %84

84:                                               ; preds = %82
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %0) #7
  br label %85

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9NOMAD_4_3mlERKNS_6DoubleES2_(ptr dead_on_unwind noalias writable sret(%"class.NOMAD_4_3::Double") align 8, ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) #6

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublepLERKS0_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) #2

declare void @_ZNK9NOMAD_4_36Double4sqrtEv(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::Double") align 8, ptr noundef nonnull align 8 dereferenceable(17)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !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::Double" = type <{ ptr, double, i8, [7 x i8] }>
%"class.NOMAD_4_3::ArrayOfDouble" = type { ptr, i64, ptr }

; 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: nounwind
declare void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

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

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

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

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 #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9NOMAD_4_312SgtelibModel13getDeltaMNormEv(ptr dead_on_unwind noalias nonnull writable sret(%"class.NOMAD_4_3::Double") align 8 %0, ptr noundef nonnull align 8 dereferenceable(552) %1) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %4 = alloca %"class.NOMAD_4_3::Double", align 8
  %5 = alloca double, align 8
  %6 = alloca %"class.NOMAD_4_3::Double", align 8
  %7 = alloca %"class.NOMAD_4_3::Double", align 8
  tail call void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %8 = getelementptr inbounds i8, ptr %1, i64 536
  %9 = tail call noundef zeroext i1 @_ZStneIN9NOMAD_4_38MeshBaseEEbDnRKSt10shared_ptrIT_E(ptr null, ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  br i1 %9, label %10, label %48

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %11 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 96
  %14 = load ptr, ptr %13, align 8
  invoke void %14(ptr dead_on_unwind nonnull writable sret(%"class.NOMAD_4_3::ArrayOfDouble") align 8 %3, ptr noundef nonnull align 8 dereferenceable(257) %11)
          to label %15 unwind label %18

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

16:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %17 = call noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %.not = icmp eq i64 %17, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %28, %16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  invoke void @_ZNK9NOMAD_4_36Double4sqrtEv(ptr dead_on_unwind nonnull writable sret(%"class.NOMAD_4_3::Double") align 8 %7, ptr noundef nonnull align 8 dereferenceable(17) %4)
          to label %37 unwind label %40

18:                                               ; preds = %10
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %47

20:                                               ; preds = %15
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %46

.lr.ph:                                           ; preds = %16, %28
  %.019 = phi i64 [ %29, %28 ], [ 0, %16 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  %22 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.019)
          to label %23 unwind label %32

23:                                               ; preds = %.lr.ph
  %24 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZNK9NOMAD_4_313ArrayOfDoubleixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.019)
          to label %25 unwind label %32

25:                                               ; preds = %23
  invoke void @_ZN9NOMAD_4_3mlERKNS_6DoubleES2_(ptr dead_on_unwind nonnull writable sret(%"class.NOMAD_4_3::Double") align 8 %6, ptr noundef nonnull align 8 dereferenceable(17) %22, ptr noundef nonnull align 8 dereferenceable(17) %24)
          to label %26 unwind label %32

26:                                               ; preds = %25
  %27 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublepLERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %4, ptr noundef nonnull align 8 dereferenceable(17) %6)
          to label %28 unwind label %34

28:                                               ; preds = %26
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  %29 = add nuw i64 %.019, 1
  %30 = call noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %31 = icmp ult i64 %29, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !11

32:                                               ; preds = %25, %23, %.lr.ph
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %36

34:                                               ; preds = %26
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %6) #7
  br label %36

36:                                               ; preds = %34, %32
  %.pn14 = phi { ptr, i32 } [ %35, %34 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %45

37:                                               ; preds = %._crit_edge
  %38 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoubleaSERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(17) %7)
          to label %39 unwind label %42

39:                                               ; preds = %37
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %48

40:                                               ; preds = %._crit_edge
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

42:                                               ; preds = %37
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %7) #7
  br label %44

44:                                               ; preds = %42, %40
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %45

45:                                               ; preds = %44, %36
  %.pn14.pn = phi { ptr, i32 } [ %.pn14, %36 ], [ %.pn, %44 ]
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %4) #7
  br label %46

46:                                               ; preds = %45, %20
  %.pn14.pn.pn = phi { ptr, i32 } [ %.pn14.pn, %45 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %47

47:                                               ; preds = %46, %18
  %.pn14.pn.pn.pn = phi { ptr, i32 } [ %.pn14.pn.pn, %46 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %0) #7
  resume { ptr, i32 } %.pn14.pn.pn.pn

48:                                               ; preds = %2, %39
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9NOMAD_4_3mlERKNS_6DoubleES2_(ptr dead_on_unwind noalias writable sret(%"class.NOMAD_4_3::Double") align 8, ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #6

declare noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoublepLERKS0_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #2

declare void @_ZNK9NOMAD_4_36Double4sqrtEv(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::Double") align 8, ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass