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

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

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

; 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 uwtable
define dso_local void @_ZNK9NOMAD_4_314PollMethodBase20generate2NDirectionsERNSt7__cxx114listINS_9DirectionESaIS3_EEEm(ptr noundef nonnull align 8 dereferenceable(490) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.NOMAD_4_3::Direction", align 8
  %8 = alloca %"class.NOMAD_4_3::Double", align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"class.NOMAD_4_3::Direction", align 8
  %15 = alloca %"class.NOMAD_4_3::Double", align 8
  %16 = alloca double, align 8
  %17 = alloca %"class.NOMAD_4_3::Direction", align 8
  %18 = alloca %"class.NOMAD_4_3::Double", align 8
  %19 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #8
  %21 = load i64, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store double 0.000000e+00, ptr %9, align 8, !tbaa !11
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %21, ptr noundef nonnull align 8 dereferenceable(17) %8)
          to label %22 unwind label %37

22:                                               ; preds = %3
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #8
  invoke void @_ZN9NOMAD_4_39Direction22computeDirOnUnitSphereERS0_(ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %23 unwind label %41

23:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %24 = load i64, ptr %6, align 8, !tbaa !9
  %25 = mul i64 2, %24
  %26 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %25, i64 8)
  %27 = extractvalue { i64, i1 } %26, 1
  %28 = extractvalue { i64, i1 } %26, 0
  %29 = select i1 %27, i64 -1, i64 %28
  %30 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %29) #9
          to label %31 unwind label %45

31:                                               ; preds = %23
  store ptr %30, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %72, %31
  %33 = load i64, ptr %13, align 8, !tbaa !9
  %34 = load i64, ptr %6, align 8, !tbaa !9
  %35 = icmp ult i64 %33, %34
  br i1 %35, label %49, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %104

37:                                               ; preds = %3
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %10, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %11, align 4
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #8
  br label %113

41:                                               ; preds = %22
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %10, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %11, align 4
  br label %112

45:                                               ; preds = %104, %23
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %10, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %11, align 4
  br label %111

49:                                               ; preds = %32
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #8
  %51 = load i64, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store double 0.000000e+00, ptr %16, align 8, !tbaa !11
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %52 unwind label %75

52:                                               ; preds = %49
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %51, ptr noundef nonnull align 8 dereferenceable(17) %15)
          to label %53 unwind label %79

53:                                               ; preds = %52
  invoke void @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %54 unwind label %83

54:                                               ; preds = %53
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #8
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #8
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #8
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = load i64, ptr %13, align 8, !tbaa !9
  %59 = getelementptr inbounds ptr, ptr %57, i64 %58
  store ptr %56, ptr %59, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #8
  %61 = load i64, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store double 0.000000e+00, ptr %19, align 8, !tbaa !11
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %62 unwind label %89

62:                                               ; preds = %54
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %61, ptr noundef nonnull align 8 dereferenceable(17) %18)
          to label %63 unwind label %93

63:                                               ; preds = %62
  invoke void @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %64 unwind label %97

64:                                               ; preds = %63
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %65) #8
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = load i64, ptr %13, align 8, !tbaa !9
  %69 = load i64, ptr %6, align 8, !tbaa !9
  %70 = add i64 %68, %69
  %71 = getelementptr inbounds ptr, ptr %67, i64 %70
  store ptr %66, ptr %71, align 8, !tbaa !5
  br label %72

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

75:                                               ; preds = %49
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %10, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %11, align 4
  br label %88

79:                                               ; preds = %52
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %10, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %11, align 4
  br label %87

83:                                               ; preds = %53
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %10, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %11, align 4
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #8
  br label %87

87:                                               ; preds = %83, %79
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %15) #8
  br label %88

88:                                               ; preds = %87, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #8
  br label %103

89:                                               ; preds = %54
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %10, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %11, align 4
  br label %102

93:                                               ; preds = %62
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %10, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %11, align 4
  br label %101

97:                                               ; preds = %63
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %10, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %11, align 4
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  br label %101

101:                                              ; preds = %97, %93
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %18) #8
  br label %102

102:                                              ; preds = %101, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  br label %103

103:                                              ; preds = %102, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %111

104:                                              ; preds = %36
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN9NOMAD_4_39Direction11householderERKS0_bPPS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i1 noundef zeroext true, ptr noundef %105)
          to label %106 unwind label %45

106:                                              ; preds = %104
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = icmp eq ptr %107, null
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  call void @_ZdaPv(ptr noundef %107) #10
  br label %110

110:                                              ; preds = %109, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  ret void

111:                                              ; preds = %103, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %112

112:                                              ; preds = %111, %41
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  br label %113

113:                                              ; preds = %112, %37
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %10, align 8
  %116 = load i32, ptr %11, align 4
  %117 = insertvalue { ptr, i32 } poison, ptr %115, 0
  %118 = insertvalue { ptr, i32 } %117, i32 %116, 1
  resume { ptr, i32 } %118
}

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 uwtable
declare dso_local void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #1 align 2

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

declare void @_ZN9NOMAD_4_39Direction22computeDirOnUnitSphereERS0_(ptr noundef nonnull align 8 dereferenceable(24)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

declare void @_ZN9NOMAD_4_39Direction11householderERKS0_bPPS0_(ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext, ptr noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #7

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9NOMAD_4_314PollMethodBase20generate2NDirectionsERNSt7__cxx114listINS_9DirectionESaIS3_EEEm(ptr nocapture noundef nonnull readnone align 8 dereferenceable(490) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.NOMAD_4_3::Direction", align 8
  %5 = alloca %"class.NOMAD_4_3::Double", align 8
  %6 = alloca double, align 8
  %7 = alloca %"class.NOMAD_4_3::Direction", align 8
  %8 = alloca %"class.NOMAD_4_3::Double", align 8
  %9 = alloca double, align 8
  %10 = alloca %"class.NOMAD_4_3::Direction", align 8
  %11 = alloca %"class.NOMAD_4_3::Double", align 8
  %12 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  store double 0.000000e+00, ptr %6, align 8, !tbaa !5
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(17) %5)
          to label %13 unwind label %19

13:                                               ; preds = %3
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  invoke void @_ZN9NOMAD_4_39Direction22computeDirOnUnitSphereERS0_(ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %14 unwind label %21

14:                                               ; preds = %13
  %15 = and i64 %2, 8070450532247928832
  %.not = icmp eq i64 %15, 0
  %16 = shl i64 %2, 4
  %17 = select i1 %.not, i64 %16, i64 -1
  %18 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %17) #8
          to label %.preheader unwind label %23

.preheader:                                       ; preds = %14
  %.not40 = icmp eq i64 %2, 0
  br i1 %.not40, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %32, %.preheader
  invoke void @_ZN9NOMAD_4_39Direction11householderERKS0_bPPS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i1 noundef zeroext true, ptr noundef nonnull %18)
          to label %52 unwind label %23

19:                                               ; preds = %3
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %54

21:                                               ; preds = %13
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %53

23:                                               ; preds = %._crit_edge, %14
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %53

.lr.ph:                                           ; preds = %.preheader, %32
  %.039 = phi i64 [ %35, %32 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store double 0.000000e+00, ptr %9, align 8, !tbaa !5
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %25 unwind label %36

25:                                               ; preds = %.lr.ph
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(17) %8)
          to label %26 unwind label %38

26:                                               ; preds = %25
  invoke void @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %27 unwind label %40

27:                                               ; preds = %26
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %29 = getelementptr inbounds ptr, ptr %18, i64 %.039
  store ptr %28, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  store double 0.000000e+00, ptr %12, align 8, !tbaa !5
  invoke void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %30 unwind label %44

30:                                               ; preds = %27
  invoke void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(17) %11)
          to label %31 unwind label %46

31:                                               ; preds = %30
  invoke void @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %32 unwind label %48

32:                                               ; preds = %31
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %34 = getelementptr ptr, ptr %29, i64 %2
  store ptr %33, ptr %34, align 8, !tbaa !9
  %35 = add nuw i64 %.039, 1
  %exitcond.not = icmp eq i64 %35, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

36:                                               ; preds = %.lr.ph
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %43

38:                                               ; preds = %25
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %26
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %8) #7
  br label %43

43:                                               ; preds = %42, %36
  %.pn.pn = phi { ptr, i32 } [ %.pn, %42 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %53

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

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

48:                                               ; preds = %31
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  br label %50

50:                                               ; preds = %48, %46
  %.pn32 = phi { ptr, i32 } [ %49, %48 ], [ %47, %46 ]
  call void @_ZN9NOMAD_4_36DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %11) #7
  br label %51

51:                                               ; preds = %50, %44
  %.pn32.pn = phi { ptr, i32 } [ %.pn32, %50 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  br label %53

52:                                               ; preds = %._crit_edge
  call void @_ZdaPv(ptr noundef nonnull %18) #9
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  ret void

53:                                               ; preds = %23, %51, %43, %21
  %.pn32.pn.pn.pn.pn = phi { ptr, i32 } [ %22, %21 ], [ %24, %23 ], [ %.pn32.pn, %51 ], [ %.pn.pn, %43 ]
  call void @_ZN9NOMAD_4_313ArrayOfDoubleD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %54

54:                                               ; preds = %53, %19
  %.pn32.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn32.pn.pn.pn.pn, %53 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn32.pn.pn.pn.pn.pn
}

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 uwtable
declare dso_local void @_ZN9NOMAD_4_39DirectionC2EmRKNS_6DoubleE(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #1 align 2

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

declare void @_ZN9NOMAD_4_39Direction22computeDirOnUnitSphereERS0_(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listIN9NOMAD_4_39DirectionESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

declare void @_ZN9NOMAD_4_39Direction11householderERKS0_bPPS0_(ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext, ptr noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #6

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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