; LLVM IR from buresjan/optim_lbm :: nomad/examples/advanced/library/Restart_VNS (restart_vns)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.60" = type { %"class.std::__shared_ptr.61" }
%"class.std::__shared_ptr.61" = type { ptr, %"class.std::__shared_count" }
%"class.NOMAD_4_3::ArrayOfDouble" = type { ptr, i64, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.NOMAD_4_3::Double" = type <{ ptr, double, i8, [7 x i8] }>

@mesh = external dso_local global { ptr, %"class.std::__shared_count" }, align 8
@compteur = external dso_local global i32, align 4
@stopConsFailures = external dso_local global i32, align 4
@stopMeshIndex = external dso_local global i32, align 4
@stopCondition = external dso_local global i8, align 1
@i = external dso_local global i32, align 4
@nbIteration = external dso_local global i32, align 4
@iterationSucess = external dso_local global i8, align 1
@_ZTIN9NOMAD_4_34StepE = external constant ptr
@_ZTIN9NOMAD_4_317MadsMegaIterationE = external constant ptr

; 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 void @_ZNSt12__shared_ptrIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 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: nounwind
declare void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22userMegaIterationStartRKN9NOMAD_4_34StepERb(ptr noundef nonnull align 8 dereferenceable(140) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::shared_ptr.60", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %12 = alloca %"class.std::shared_ptr", align 8
  %13 = alloca %"class.std::shared_ptr", align 8
  %14 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %15 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %16 = alloca %"class.NOMAD_4_3::Double", align 8
  %17 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %22, label %20

20:                                               ; preds = %2
  %21 = call ptr @__dynamic_cast(ptr %18, ptr @_ZTIN9NOMAD_4_34StepE, ptr @_ZTIN9NOMAD_4_317MadsMegaIterationE, i64 0) #6
  br label %23

22:                                               ; preds = %2
  br label %23

23:                                               ; preds = %22, %20
  %24 = phi ptr [ %21, %20 ], [ null, %22 ]
  store ptr %24, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @_ZN9NOMAD_4_312EvcInterface19getEvaluatorControlEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.60") align 8 %7)
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_316EvaluatorControlELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  %26 = invoke noundef i64 @_ZNK9NOMAD_4_316EvaluatorControl9getBbEvalEv(ptr noundef nonnull align 8 dereferenceable(352) %25)
          to label %27 unwind label %43

27:                                               ; preds = %23
  call void @_ZNSt12__shared_ptrIN9NOMAD_4_316EvaluatorControlELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  store i64 %26, ptr %6, align 8, !tbaa !9
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 0, ptr %28, align 1, !tbaa !11
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = icmp ne ptr null, %29
  br i1 %30, label %31, label %124

31:                                               ; preds = %27
  %32 = load i32, ptr @nbIteration, align 4, !tbaa !13
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @nbIteration, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9NOMAD_4_34Step14getSuccessTypeEv(ptr noundef nonnull align 8 dereferenceable(140) %34)
  %36 = load i32, ptr %35, align 4, !tbaa !15
  store i32 %36, ptr %10, align 4, !tbaa !15
  %37 = load i32, ptr %10, align 4, !tbaa !15
  %38 = icmp eq i32 4, %37
  br i1 %38, label %42, label %39

39:                                               ; preds = %31
  %40 = load i32, ptr %10, align 4, !tbaa !15
  %41 = icmp eq i32 3, %40
  br i1 %41, label %42, label %47

42:                                               ; preds = %39, %31
  store i32 0, ptr @compteur, align 4, !tbaa !13
  store i8 1, ptr @iterationSucess, align 1, !tbaa !11
  br label %55

43:                                               ; preds = %23
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %8, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN9NOMAD_4_316EvaluatorControlELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %125

47:                                               ; preds = %39
  %48 = load i32, ptr %10, align 4, !tbaa !15
  %49 = icmp eq i32 0, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  br label %54

51:                                               ; preds = %47
  %52 = load i32, ptr @compteur, align 4, !tbaa !13
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @compteur, align 4, !tbaa !13
  br label %54

54:                                               ; preds = %51, %50
  br label %55

55:                                               ; preds = %54, %42
  %56 = load i32, ptr @i, align 4, !tbaa !13
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %83

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  %59 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @mesh) #6
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = getelementptr inbounds ptr, ptr %60, i64 9
  %62 = load ptr, ptr %61, align 8
  call void %62(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::ArrayOfDouble") align 8 %11, ptr noundef nonnull align 8 dereferenceable(257) %59)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load ptr, ptr %63, align 8, !tbaa !17
  %65 = getelementptr inbounds ptr, ptr %64, i64 10
  %66 = load ptr, ptr %65, align 8
  invoke void %66(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %12, ptr noundef nonnull align 8 dereferenceable(200) %63)
          to label %67 unwind label %74

67:                                               ; preds = %58
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN9NOMAD_4_38MeshBaseEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) @mesh, ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @_ZNSt12__shared_ptrIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  %69 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @mesh) #6
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = getelementptr inbounds ptr, ptr %70, i64 10
  %72 = load ptr, ptr %71, align 8
  invoke void %72(ptr noundef nonnull align 8 dereferenceable(257) %69, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %73 unwind label %78

73:                                               ; preds = %67
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  br label %89

74:                                               ; preds = %58
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %8, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %82

78:                                               ; preds = %67
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %8, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %9, align 4
  br label %82

82:                                               ; preds = %78, %74
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  br label %123

83:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = load ptr, ptr %84, align 8, !tbaa !17
  %86 = getelementptr inbounds ptr, ptr %85, i64 10
  %87 = load ptr, ptr %86, align 8
  call void %87(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %13, ptr noundef nonnull align 8 dereferenceable(200) %84)
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN9NOMAD_4_38MeshBaseEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) @mesh, ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @_ZNSt12__shared_ptrIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  br label %89

89:                                               ; preds = %83, %73
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  %90 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @mesh) #6
  %91 = load ptr, ptr %90, align 8, !tbaa !17
  %92 = getelementptr inbounds ptr, ptr %91, i64 9
  %93 = load ptr, ptr %92, align 8
  call void %93(ptr dead_on_unwind writable sret(%"class.NOMAD_4_3::ArrayOfDouble") align 8 %14, ptr noundef nonnull align 8 dereferenceable(257) %90)
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  %94 = invoke noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %95 unwind label %108

95:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %96 = load i32, ptr @stopMeshIndex, align 4, !tbaa !13
  %97 = sitofp i32 %96 to double
  store double %97, ptr %17, align 8, !tbaa !19
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %98 unwind label %112

98:                                               ; preds = %95
  invoke void @_ZN9NOMAD_4_313ArrayOfDoubleC1EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %94, ptr noundef nonnull align 8 dereferenceable(17) %16)
          to label %99 unwind label %116

99:                                               ; preds = %98
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  store i8 0, ptr @iterationSucess, align 1, !tbaa !11
  %100 = load i32, ptr @compteur, align 4, !tbaa !13
  %101 = load i32, ptr @stopConsFailures, align 4, !tbaa !13
  %102 = icmp sge i32 %100, %101
  %103 = zext i1 %102 to i8
  store i8 %103, ptr @stopCondition, align 1, !tbaa !11
  %104 = load i8, ptr @stopCondition, align 1, !tbaa !11, !range !21, !noundef !22
  %105 = trunc i8 %104 to i1
  br i1 %105, label %106, label %121

106:                                              ; preds = %99
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 1, ptr %107, align 1, !tbaa !11
  br label %121

108:                                              ; preds = %89
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %8, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %9, align 4
  br label %122

112:                                              ; preds = %95
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %8, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %9, align 4
  br label %120

116:                                              ; preds = %98
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %8, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %9, align 4
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %16) #6
  br label %120

120:                                              ; preds = %116, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  br label %122

121:                                              ; preds = %106, %99
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %124

122:                                              ; preds = %120, %108
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  br label %123

123:                                              ; preds = %122, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %125

124:                                              ; preds = %121, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

125:                                              ; preds = %123, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %8, align 8
  %128 = load i32, ptr %9, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130
}

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NOMAD_4_312EvcInterface19getEvaluatorControlEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.60") align 8) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN9NOMAD_4_316EvaluatorControlELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN9NOMAD_4_38MeshBaseEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

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

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

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 = { "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 = { 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 = { nounwind willreturn memory(read) }
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 = !{!"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 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTSN9NOMAD_4_311SuccessTypeE", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}


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

%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.60" = type { %"class.std::__shared_ptr.61" }
%"class.std::__shared_ptr.61" = type { ptr, %"class.std::__shared_count" }
%"class.NOMAD_4_3::ArrayOfDouble" = type { ptr, i64, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.NOMAD_4_3::Double" = type <{ ptr, double, i8, [7 x i8] }>

@mesh = external dso_local global { ptr, %"class.std::__shared_count" }, align 8
@compteur = external dso_local local_unnamed_addr global i32, align 4
@stopConsFailures = external dso_local local_unnamed_addr global i32, align 4
@stopMeshIndex = external dso_local local_unnamed_addr global i32, align 4
@stopCondition = external dso_local local_unnamed_addr global i8, align 1
@i = external dso_local local_unnamed_addr global i32, align 4
@nbIteration = external dso_local local_unnamed_addr global i32, align 4
@iterationSucess = external dso_local local_unnamed_addr global i8, align 1
@_ZTIN9NOMAD_4_34StepE = external constant ptr
@_ZTIN9NOMAD_4_317MadsMegaIterationE = external constant 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 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: nounwind
declare void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22userMegaIterationStartRKN9NOMAD_4_34StepERb(ptr noundef nonnull align 8 dereferenceable(140) %0, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %1) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::shared_ptr.60", align 8
  %4 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %5 = alloca %"class.std::shared_ptr", align 8
  %6 = alloca %"class.std::shared_ptr", align 8
  %7 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %8 = alloca %"class.NOMAD_4_3::ArrayOfDouble", align 8
  %9 = alloca %"class.NOMAD_4_3::Double", align 8
  %10 = alloca double, align 8
  %11 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN9NOMAD_4_34StepE, ptr nonnull @_ZTIN9NOMAD_4_317MadsMegaIterationE, i64 0) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  call void @_ZN9NOMAD_4_312EvcInterface19getEvaluatorControlEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.60") align 8 %3)
  %12 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_316EvaluatorControlELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %13 = call noundef i64 @_ZNK9NOMAD_4_316EvaluatorControl9getBbEvalEv(ptr noundef nonnull align 8 dereferenceable(352) %12)
  call void @_ZNSt12__shared_ptrIN9NOMAD_4_316EvaluatorControlELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  store i8 0, ptr %1, align 1, !tbaa !5
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %76, label %14

14:                                               ; preds = %2
  %15 = load i32, ptr @nbIteration, align 4, !tbaa !9
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr @nbIteration, align 4, !tbaa !9
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9NOMAD_4_34Step14getSuccessTypeEv(ptr noundef nonnull align 8 dereferenceable(140) %11)
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = add i32 %18, -3
  %or.cond = icmp ult i32 %19, 2
  br i1 %or.cond, label %20, label %21

20:                                               ; preds = %14
  store i32 0, ptr @compteur, align 4, !tbaa !9
  store i8 1, ptr @iterationSucess, align 1, !tbaa !5
  br label %26

21:                                               ; preds = %14
  %22 = icmp eq i32 %18, 0
  br i1 %22, label %26, label %23

23:                                               ; preds = %21
  %24 = load i32, ptr @compteur, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @compteur, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %23, %21, %20
  %27 = load i32, ptr @i, align 4, !tbaa !9
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %49

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @mesh) #6
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = getelementptr inbounds i8, ptr %31, i64 72
  %33 = load ptr, ptr %32, align 8
  call void %33(ptr dead_on_unwind nonnull writable sret(%"class.NOMAD_4_3::ArrayOfDouble") align 8 %4, ptr noundef nonnull align 8 dereferenceable(257) %30)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %34 = load ptr, ptr %11, align 8, !tbaa !13
  %35 = getelementptr inbounds i8, ptr %34, i64 80
  %36 = load ptr, ptr %35, align 8
  invoke void %36(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %5, ptr noundef nonnull align 8 dereferenceable(200) %11)
          to label %37 unwind label %44

37:                                               ; preds = %29
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN9NOMAD_4_38MeshBaseEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) @mesh, ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @_ZNSt12__shared_ptrIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  %39 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @mesh) #6
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds i8, ptr %40, i64 80
  %42 = load ptr, ptr %41, align 8
  invoke void %42(ptr noundef nonnull align 8 dereferenceable(257) %39, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %43 unwind label %46

43:                                               ; preds = %37
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %54

44:                                               ; preds = %29
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  br label %48

46:                                               ; preds = %37
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %48

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

49:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %50 = load ptr, ptr %11, align 8, !tbaa !13
  %51 = getelementptr inbounds i8, ptr %50, i64 80
  %52 = load ptr, ptr %51, align 8
  call void %52(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(200) %11)
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN9NOMAD_4_38MeshBaseEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) @mesh, ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @_ZNSt12__shared_ptrIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %54

54:                                               ; preds = %49, %43
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %55 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN9NOMAD_4_38MeshBaseELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @mesh) #6
  %56 = load ptr, ptr %55, align 8, !tbaa !13
  %57 = getelementptr inbounds i8, ptr %56, i64 72
  %58 = load ptr, ptr %57, align 8
  call void %58(ptr dead_on_unwind nonnull writable sret(%"class.NOMAD_4_3::ArrayOfDouble") align 8 %7, ptr noundef nonnull align 8 dereferenceable(257) %55)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %59 = call noundef i64 @_ZNK9NOMAD_4_313ArrayOfDouble4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %60 = load i32, ptr @stopMeshIndex, align 4, !tbaa !9
  %61 = sitofp i32 %60 to double
  store double %61, ptr %10, align 8, !tbaa !15
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %62 unwind label %69

62:                                               ; preds = %54
  invoke void @_ZN9NOMAD_4_313ArrayOfDoubleC1EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %59, ptr noundef nonnull align 8 dereferenceable(17) %9)
          to label %63 unwind label %71

63:                                               ; preds = %62
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  store i8 0, ptr @iterationSucess, align 1, !tbaa !5
  %64 = load i32, ptr @compteur, align 4, !tbaa !9
  %65 = load i32, ptr @stopConsFailures, align 4, !tbaa !9
  %66 = icmp sge i32 %64, %65
  %67 = zext i1 %66 to i8
  store i8 %67, ptr @stopCondition, align 1, !tbaa !5
  br i1 %66, label %68, label %74

68:                                               ; preds = %63
  store i8 1, ptr %1, align 1, !tbaa !5
  br label %74

69:                                               ; preds = %54
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %62
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %9) #6
  br label %73

73:                                               ; preds = %71, %69
  %.pn18 = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %75

74:                                               ; preds = %68, %63
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %76

75:                                               ; preds = %73, %48
  %.pn18.pn = phi { ptr, i32 } [ %.pn18, %73 ], [ %.pn, %48 ]
  resume { ptr, i32 } %.pn18.pn

76:                                               ; preds = %74, %2
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NOMAD_4_312EvcInterface19getEvaluatorControlEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.60") align 8) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN9NOMAD_4_316EvaluatorControlELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN9NOMAD_4_38MeshBaseEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

; 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

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

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 = { "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 = { 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 = { mustprogress nofree nounwind willreturn memory(read) }
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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN9NOMAD_4_311SuccessTypeE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass