; LLVM IR from buresjan/optim_lbm :: nomad/src/Math/ArrayOfDouble.ll (ZN9NOMAD_4_313ArrayOfDouble6resizeEmRKNS_6DoubleE)

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

; 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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK9NOMAD_4_36Double9isDefinedEv(ptr noundef nonnull align 8 dereferenceable(17)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPN9NOMAD_4_36DoubleES1_EvT_S3_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(17)) #7

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9NOMAD_4_313ArrayOfDouble6resizeEmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(17) %2) #8 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  %15 = load i64, ptr %5, align 8, !tbaa !9
  %16 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 1
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = icmp eq i64 %15, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %3
  br label %140

20:                                               ; preds = %3
  %21 = load i64, ptr %5, align 8, !tbaa !9
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %42

23:                                               ; preds = %20
  %24 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 1
  store i64 0, ptr %24, align 8, !tbaa !11
  %25 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  %27 = icmp eq ptr %26, null
  br i1 %27, label %40, label %28

28:                                               ; preds = %23
  %29 = getelementptr inbounds i8, ptr %26, i64 -8
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %26, i64 %30
  %32 = icmp eq ptr %26, %31
  br i1 %32, label %37, label %33

33:                                               ; preds = %33, %28
  %34 = phi ptr [ %31, %28 ], [ %35, %33 ]
  %35 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %34, i64 -1
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %35) #9
  %36 = icmp eq ptr %35, %26
  br i1 %36, label %37, label %33

37:                                               ; preds = %33, %28
  %38 = mul i64 24, %30
  %39 = add i64 %38, 8
  call void @_ZdaPvm(ptr noundef %29, i64 noundef %39) #10
  br label %40

40:                                               ; preds = %37, %23
  %41 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 2
  store ptr null, ptr %41, align 8, !tbaa !13
  br label %140

42:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %43 = load i64, ptr %5, align 8, !tbaa !9
  %44 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %43, i64 24)
  %45 = extractvalue { i64, i1 } %44, 1
  %46 = extractvalue { i64, i1 } %44, 0
  %47 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %46, i64 8)
  %48 = extractvalue { i64, i1 } %47, 1
  %49 = or i1 %45, %48
  %50 = extractvalue { i64, i1 } %47, 0
  %51 = select i1 %49, i64 -1, i64 %50
  %52 = call noalias noundef nonnull ptr @_Znam(i64 noundef %51) #11
  store i64 %43, ptr %52, align 16
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  %54 = icmp eq i64 %43, 0
  br i1 %54, label %62, label %55

55:                                               ; preds = %42
  %56 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %53, i64 %43
  br label %57

57:                                               ; preds = %59, %55
  %58 = phi ptr [ %53, %55 ], [ %60, %59 ]
  invoke void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %58)
          to label %59 unwind label %86

59:                                               ; preds = %57
  %60 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %58, i64 1
  %61 = icmp eq ptr %60, %56
  br i1 %61, label %62, label %57

62:                                               ; preds = %59, %42
  store ptr %53, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %135

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %67 = load i64, ptr %5, align 8, !tbaa !9
  %68 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !11
  %70 = icmp ult i64 %67, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %66
  %72 = load i64, ptr %5, align 8, !tbaa !9
  br label %76

73:                                               ; preds = %66
  %74 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 1
  %75 = load i64, ptr %74, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %73, %71
  %77 = phi i64 [ %72, %71 ], [ %75, %73 ]
  store i64 %77, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %78, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %79 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !13
  store ptr %80, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %100, %76
  %82 = load i64, ptr %13, align 8, !tbaa !9
  %83 = load i64, ptr %10, align 8, !tbaa !9
  %84 = icmp ult i64 %82, %83
  br i1 %84, label %96, label %85

85:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %107

86:                                               ; preds = %57
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %8, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %9, align 4
  %90 = icmp eq ptr %53, %58
  br i1 %90, label %95, label %91

91:                                               ; preds = %91, %86
  %92 = phi ptr [ %58, %86 ], [ %93, %91 ]
  %93 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %92, i64 -1
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %93) #9
  %94 = icmp eq ptr %93, %53
  br i1 %94, label %95, label %91

95:                                               ; preds = %91, %86
  call void @_ZdaPvm(ptr noundef %52, i64 noundef %51) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  br label %141

96:                                               ; preds = %81
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoubleaSERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %98, ptr noundef nonnull align 8 dereferenceable(17) %97)
  br label %100

100:                                              ; preds = %96
  %101 = load i64, ptr %13, align 8, !tbaa !9
  %102 = add i64 %101, 1
  store i64 %102, ptr %13, align 8, !tbaa !9
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %103, i32 1
  store ptr %104, ptr %11, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %105, i32 1
  store ptr %106, ptr %12, align 8, !tbaa !5
  br label %81, !llvm.loop !14

107:                                              ; preds = %85
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = call noundef zeroext i1 @_ZNK9NOMAD_4_36Double9isDefinedEv(ptr noundef nonnull align 8 dereferenceable(17) %108)
  br i1 %109, label %110, label %118

110:                                              ; preds = %107
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = load i64, ptr %10, align 8, !tbaa !9
  %113 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %111, i64 %112
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load i64, ptr %5, align 8, !tbaa !9
  %116 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %114, i64 %115
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZSt4fillIPN9NOMAD_4_36DoubleES1_EvT_S3_RKT0_(ptr noundef %113, ptr noundef %116, ptr noundef nonnull align 8 dereferenceable(17) %117)
  br label %118

118:                                              ; preds = %110, %107
  %119 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !13
  %121 = icmp eq ptr %120, null
  br i1 %121, label %134, label %122

122:                                              ; preds = %118
  %123 = getelementptr inbounds i8, ptr %120, i64 -8
  %124 = load i64, ptr %123, align 8
  %125 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %120, i64 %124
  %126 = icmp eq ptr %120, %125
  br i1 %126, label %131, label %127

127:                                              ; preds = %127, %122
  %128 = phi ptr [ %125, %122 ], [ %129, %127 ]
  %129 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %128, i64 -1
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %129) #9
  %130 = icmp eq ptr %129, %120
  br i1 %130, label %131, label %127

131:                                              ; preds = %127, %122
  %132 = mul i64 24, %124
  %133 = add i64 %132, 8
  call void @_ZdaPvm(ptr noundef %123, i64 noundef %133) #10
  br label %134

134:                                              ; preds = %131, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %135

135:                                              ; preds = %134, %62
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 2
  store ptr %136, ptr %137, align 8, !tbaa !13
  %138 = load i64, ptr %5, align 8, !tbaa !9
  %139 = getelementptr inbounds %"class.NOMAD_4_3::ArrayOfDouble", ptr %14, i32 0, i32 1
  store i64 %138, ptr %139, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  br label %140

140:                                              ; preds = %135, %40, %19
  ret void

141:                                              ; preds = %95
  %142 = load ptr, ptr %8, align 8
  %143 = load i32, ptr %9, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(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 = { nobuiltin 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 #6 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin nounwind }
attributes #11 = { builtin allocsize(0) }

!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, !10, i64 8}
!12 = !{!"_ZTSN9NOMAD_4_313ArrayOfDoubleE", !10, i64 8, !6, i64 16}
!13 = !{!12, !6, i64 16}
!14 = distinct !{!14, !15}
!15 = !{!"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] }>

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK9NOMAD_4_36Double9isDefinedEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPN9NOMAD_4_36DoubleES1_EvT_S3_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9NOMAD_4_313ArrayOfDouble6resizeEmRKNS_6DoubleE(ptr nocapture noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(17) %2) local_unnamed_addr #7 align 2 personality ptr @__gxx_personality_v0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i64 %5, %1
  br i1 %6, label %68, label %7

7:                                                ; preds = %3
  %8 = icmp eq i64 %1, 0
  br i1 %8, label %9, label %24

9:                                                ; preds = %7
  store i64 0, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = icmp eq ptr %11, null
  br i1 %12, label %23, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %11, i64 -8
  %15 = load i64, ptr %14, align 8
  %16 = icmp eq i64 %15, 0
  br i1 %16, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %13
  %17 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %11, i64 %15
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %18 = phi ptr [ %19, %.preheader ], [ %17, %.preheader.preheader ]
  %19 = getelementptr inbounds i8, ptr %18, i64 -24
  tail call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %19) #9
  %20 = icmp eq ptr %19, %11
  br i1 %20, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %13
  %21 = mul i64 %15, 24
  %22 = add i64 %21, 8
  tail call void @_ZdaPvm(ptr noundef nonnull %14, i64 noundef %22) #10
  br label %23

23:                                               ; preds = %.loopexit, %9
  store ptr null, ptr %10, align 8, !tbaa !11
  br label %68

24:                                               ; preds = %7
  %25 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 24)
  %26 = extractvalue { i64, i1 } %25, 1
  %27 = extractvalue { i64, i1 } %25, 0
  %28 = tail call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %27, i64 8)
  %29 = extractvalue { i64, i1 } %28, 1
  %30 = or i1 %26, %29
  %31 = extractvalue { i64, i1 } %28, 0
  %32 = select i1 %30, i64 -1, i64 %31
  %33 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %32) #11
  store i64 %1, ptr %33, align 16
  %.ptr35 = getelementptr inbounds i8, ptr %33, i64 8
  %34 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %.ptr35, i64 %1
  br label %35

35:                                               ; preds = %36, %24
  %.idx = phi i64 [ 8, %24 ], [ %.add, %36 ]
  %.ptr.ptr = getelementptr inbounds i8, ptr %33, i64 %.idx
  invoke void @_ZN9NOMAD_4_36DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %.ptr.ptr)
          to label %36 unwind label %44

36:                                               ; preds = %35
  %.add = add nuw nsw i64 %.idx, 24
  %.ptr34 = getelementptr inbounds i8, ptr %33, i64 %.add
  %37 = icmp eq ptr %.ptr34, %34
  br i1 %37, label %38, label %35

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %0, i64 16
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %.not = icmp eq ptr %40, null
  br i1 %.not, label %67, label %41

41:                                               ; preds = %38
  %42 = load i64, ptr %4, align 8, !tbaa !5
  %. = tail call i64 @llvm.umin.i64(i64 %42, i64 %1)
  %.not50 = icmp eq i64 %42, 0
  br i1 %.not50, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %41
  %43 = tail call noundef zeroext i1 @_ZNK9NOMAD_4_36Double9isDefinedEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %43, label %52, label %54

44:                                               ; preds = %35
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = icmp eq i64 %.idx, 8
  br i1 %46, label %.loopexit45, label %.preheader44

.preheader44:                                     ; preds = %44, %.preheader44
  %.idx36 = phi i64 [ %.add37, %.preheader44 ], [ %.idx, %44 ]
  %.add37 = add nsw i64 %.idx36, -24
  %.ptr39 = getelementptr inbounds i8, ptr %33, i64 %.add37
  tail call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %.ptr39) #9
  %47 = icmp eq i64 %.add37, 8
  br i1 %47, label %.loopexit45, label %.preheader44

.loopexit45:                                      ; preds = %.preheader44, %44
  tail call void @_ZdaPvm(ptr noundef nonnull %33, i64 noundef %32) #10
  resume { ptr, i32 } %45

.lr.ph:                                           ; preds = %41, %.lr.ph
  %.049 = phi i64 [ %49, %.lr.ph ], [ 0, %41 ]
  %.02348 = phi ptr [ %51, %.lr.ph ], [ %40, %41 ]
  %.02447 = phi ptr [ %50, %.lr.ph ], [ %.ptr35, %41 ]
  %48 = tail call noundef nonnull align 8 dereferenceable(17) ptr @_ZN9NOMAD_4_36DoubleaSERKS0_(ptr noundef nonnull align 8 dereferenceable(17) %.02447, ptr noundef nonnull align 8 dereferenceable(17) %.02348)
  %49 = add nuw i64 %.049, 1
  %50 = getelementptr inbounds i8, ptr %.02447, i64 24
  %51 = getelementptr inbounds i8, ptr %.02348, i64 24
  %exitcond.not = icmp eq i64 %49, %.
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

52:                                               ; preds = %._crit_edge
  %53 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %.ptr35, i64 %.
  tail call void @_ZSt4fillIPN9NOMAD_4_36DoubleES1_EvT_S3_RKT0_(ptr noundef nonnull %53, ptr noundef nonnull %34, ptr noundef nonnull align 8 dereferenceable(17) %2)
  br label %54

54:                                               ; preds = %52, %._crit_edge
  %55 = load ptr, ptr %39, align 8, !tbaa !11
  %56 = icmp eq ptr %55, null
  br i1 %56, label %67, label %57

57:                                               ; preds = %54
  %58 = getelementptr inbounds i8, ptr %55, i64 -8
  %59 = load i64, ptr %58, align 8
  %60 = icmp eq i64 %59, 0
  br i1 %60, label %.loopexit43, label %.preheader42.preheader

.preheader42.preheader:                           ; preds = %57
  %61 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %55, i64 %59
  br label %.preheader42

.preheader42:                                     ; preds = %.preheader42.preheader, %.preheader42
  %62 = phi ptr [ %63, %.preheader42 ], [ %61, %.preheader42.preheader ]
  %63 = getelementptr inbounds i8, ptr %62, i64 -24
  tail call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %63) #9
  %64 = icmp eq ptr %63, %55
  br i1 %64, label %.loopexit43, label %.preheader42

.loopexit43:                                      ; preds = %.preheader42, %57
  %65 = mul i64 %59, 24
  %66 = add i64 %65, 8
  tail call void @_ZdaPvm(ptr noundef nonnull %58, i64 noundef %66) #10
  br label %67

67:                                               ; preds = %54, %.loopexit43, %38
  store ptr %.ptr35, ptr %39, align 8, !tbaa !11
  store i64 %1, ptr %4, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %3, %67, %23
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #8

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nobuiltin allocsize(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 = { nobuiltin 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 #5 = { 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 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { builtin nounwind }
attributes #11 = { builtin allocsize(0) }

!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, !7, i64 8}
!6 = !{!"_ZTSN9NOMAD_4_313ArrayOfDoubleE", !7, i64 8, !10, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass