; LLVM IR from bohanwang/libpgo :: src/core/nonlinearOptimization/lineSearch.ll (ZNK10LineSearch12backtrackingEPKdS1_dS1_ddd)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.LineSearch::Result" = type <{ double, double, i32, [4 x i8] }>
%class.LineSearch = type { i32, i32, %"class.std::function", double, double, double, i32, double, i32, %"class.std::vector", i32, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.35 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK10LineSearch3f1DEd(ptr noundef nonnull align 8 dereferenceable(136), double noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10LineSearch6ResultC2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10LineSearch12backtrackingEPKdS1_dS1_ddd(ptr dead_on_unwind noalias writable sret(%"struct.LineSearch::Result") align 8 %0, ptr noundef nonnull align 8 dereferenceable(136) %1, ptr noundef %2, ptr noundef %3, double noundef %4, ptr noundef %5, double noundef %6, double noundef %7, double noundef %8) #1 align 2 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store double %4, ptr %13, align 8, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !5
  store double %6, ptr %15, align 8, !tbaa !9
  store double %7, ptr %16, align 8, !tbaa !9
  store double %8, ptr %17, align 8, !tbaa !9
  %24 = load ptr, ptr %10, align 8
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 11
  store ptr %25, ptr %26, align 8, !tbaa !11
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 12
  store ptr %27, ptr %28, align 8, !tbaa !20
  %29 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 10
  store i32 0, ptr %29, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %30 = load double, ptr %15, align 8, !tbaa !9
  %31 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !22
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = call noundef double @_ZL16vectorDotProductiPKdS0_(i32 noundef %32, ptr noundef %33, ptr noundef %34)
  %36 = fmul double %30, %35
  store double %36, ptr %18, align 8, !tbaa !9
  %37 = load double, ptr %18, align 8, !tbaa !9
  %38 = fcmp ogt double %37, 0.000000e+00
  br i1 %38, label %39, label %49

39:                                               ; preds = %9
  %40 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 8
  %41 = load i32, ptr %40, align 8, !tbaa !23
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %48

43:                                               ; preds = %39
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.35)
  %45 = load double, ptr %18, align 8, !tbaa !9
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %44, double noundef %45)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %48

48:                                               ; preds = %43, %39
  br label %49

49:                                               ; preds = %48, %9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %50 = load double, ptr %17, align 8, !tbaa !9
  store double %50, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %51 = load double, ptr %19, align 8, !tbaa !9
  %52 = call noundef double @_ZNK10LineSearch3f1DEd(ptr noundef nonnull align 8 dereferenceable(136) %24, double noundef %51)
  store double %52, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %53 = load double, ptr %20, align 8, !tbaa !9
  store double %53, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %54 = load double, ptr %17, align 8, !tbaa !9
  store double %54, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !24
  br label %55

55:                                               ; preds = %82, %49
  %56 = load double, ptr %20, align 8, !tbaa !9
  %57 = load double, ptr %13, align 8, !tbaa !9
  %58 = load double, ptr %19, align 8, !tbaa !9
  %59 = load double, ptr %18, align 8, !tbaa !9
  %60 = call double @llvm.fmuladd.f64(double %58, double %59, double %57)
  %61 = fcmp ogt double %56, %60
  br i1 %61, label %62, label %67

62:                                               ; preds = %55
  %63 = load i32, ptr %23, align 4, !tbaa !24
  %64 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 1
  %65 = load i32, ptr %64, align 4, !tbaa !25
  %66 = icmp slt i32 %63, %65
  br label %67

67:                                               ; preds = %62, %55
  %68 = phi i1 [ false, %55 ], [ %66, %62 ]
  br i1 %68, label %69, label %85

69:                                               ; preds = %67
  %70 = load double, ptr %16, align 8, !tbaa !9
  %71 = load double, ptr %19, align 8, !tbaa !9
  %72 = fmul double %71, %70
  store double %72, ptr %19, align 8, !tbaa !9
  %73 = load double, ptr %19, align 8, !tbaa !9
  %74 = call noundef double @_ZNK10LineSearch3f1DEd(ptr noundef nonnull align 8 dereferenceable(136) %24, double noundef %73)
  store double %74, ptr %20, align 8, !tbaa !9
  %75 = load double, ptr %20, align 8, !tbaa !9
  %76 = load double, ptr %21, align 8, !tbaa !9
  %77 = fcmp olt double %75, %76
  br i1 %77, label %78, label %81

78:                                               ; preds = %69
  %79 = load double, ptr %20, align 8, !tbaa !9
  store double %79, ptr %21, align 8, !tbaa !9
  %80 = load double, ptr %19, align 8, !tbaa !9
  store double %80, ptr %22, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %78, %69
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %23, align 4, !tbaa !24
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %23, align 4, !tbaa !24
  br label %55, !llvm.loop !26

85:                                               ; preds = %67
  %86 = load double, ptr %21, align 8, !tbaa !9
  %87 = load double, ptr %13, align 8, !tbaa !9
  %88 = fcmp ogt double %86, %87
  br i1 %88, label %89, label %101

89:                                               ; preds = %85
  %90 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 8
  %91 = load i32, ptr %90, align 8, !tbaa !23
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %101

93:                                               ; preds = %89
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.36)
  %95 = load double, ptr %21, align 8, !tbaa !9
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %94, double noundef %95)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef @.str.37)
  %98 = load double, ptr %13, align 8, !tbaa !9
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %97, double noundef %98)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %101

101:                                              ; preds = %93, %89, %85
  call void @_ZN10LineSearch6ResultC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  %102 = load double, ptr %22, align 8, !tbaa !9
  %103 = getelementptr inbounds %"struct.LineSearch::Result", ptr %0, i32 0, i32 1
  store double %102, ptr %103, align 8, !tbaa !28
  %104 = load double, ptr %21, align 8, !tbaa !9
  %105 = getelementptr inbounds %"struct.LineSearch::Result", ptr %0, i32 0, i32 0
  store double %104, ptr %105, align 8, !tbaa !30
  %106 = getelementptr inbounds %class.LineSearch, ptr %24, i32 0, i32 10
  %107 = load i32, ptr %106, align 8, !tbaa !21
  %108 = getelementptr inbounds %"struct.LineSearch::Result", ptr %0, i32 0, i32 2
  store i32 %107, ptr %108, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef double @_ZL16vectorDotProductiPKdS0_(i32 noundef, ptr noundef, ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 120}
!12 = !{!"_ZTS10LineSearch", !13, i64 0, !13, i64 4, !14, i64 8, !10, i64 40, !10, i64 48, !10, i64 56, !13, i64 64, !10, i64 72, !13, i64 80, !16, i64 88, !13, i64 112, !6, i64 120, !6, i64 128}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt8functionIFiPKdPdS2_EE", !15, i64 0, !6, i64 24}
!15 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!16 = !{!"_ZTSSt6vectorIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!12, !6, i64 128}
!21 = !{!12, !13, i64 112}
!22 = !{!12, !13, i64 0}
!23 = !{!12, !13, i64 80}
!24 = !{!13, !13, i64 0}
!25 = !{!12, !13, i64 4}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!29, !10, i64 8}
!29 = !{!"_ZTSN10LineSearch6ResultE", !10, i64 0, !10, i64 8, !13, i64 16}
!30 = !{!29, !10, i64 0}
!31 = !{!29, !13, i64 16}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.LineSearch::Result" = type <{ double, double, i32, [4 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.35 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK10LineSearch3f1DEd(ptr noundef nonnull align 8 dereferenceable(136), double noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10LineSearch12backtrackingEPKdS1_dS1_ddd(ptr dead_on_unwind noalias writable sret(%"struct.LineSearch::Result") align 8 %0, ptr noundef nonnull align 8 dereferenceable(136) %1, ptr noundef %2, ptr noundef %3, double noundef %4, ptr noundef %5, double noundef %6, double noundef %7, double noundef %8) local_unnamed_addr #0 align 2 {
  %10 = getelementptr inbounds i8, ptr %1, i64 120
  store ptr %2, ptr %10, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 128
  store ptr %3, ptr %11, align 8, !tbaa !18
  %12 = getelementptr inbounds i8, ptr %1, i64 112
  store i32 0, ptr %12, align 8, !tbaa !19
  %13 = load i32, ptr %1, align 8, !tbaa !20
  %14 = tail call noundef double @_ZL16vectorDotProductiPKdS0_(i32 noundef %13, ptr noundef %5, ptr noundef %3)
  %15 = fmul double %14, %6
  %16 = fcmp ule double %15, 0.000000e+00
  %17 = getelementptr inbounds i8, ptr %1, i64 80
  %18 = load i32, ptr %17, align 8
  %.not = icmp eq i32 %18, 0
  %or.cond = select i1 %16, i1 true, i1 %.not
  br i1 %or.cond, label %23, label %19

19:                                               ; preds = %9
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.35)
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %20, double noundef %15)
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %23

23:                                               ; preds = %19, %9
  %24 = tail call noundef double @_ZNK10LineSearch3f1DEd(ptr noundef nonnull align 8 dereferenceable(136) %1, double noundef %8)
  %25 = getelementptr inbounds i8, ptr %1, i64 4
  %26 = tail call double @llvm.fmuladd.f64(double %8, double %15, double %4)
  %27 = fcmp ogt double %24, %26
  %28 = load i32, ptr %25, align 4
  %29 = icmp sgt i32 %28, 0
  %or.cond4245 = select i1 %27, i1 %29, i1 false
  br i1 %or.cond4245, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %23, %.lr.ph
  %.049 = phi i32 [ %33, %.lr.ph ], [ 0, %23 ]
  %.03048 = phi double [ %.1, %.lr.ph ], [ %8, %23 ]
  %.03147 = phi double [ %.132, %.lr.ph ], [ %24, %23 ]
  %.03446 = phi double [ %30, %.lr.ph ], [ %8, %23 ]
  %30 = fmul double %.03446, %7
  %31 = tail call noundef double @_ZNK10LineSearch3f1DEd(ptr noundef nonnull align 8 dereferenceable(136) %1, double noundef %30)
  %32 = fcmp olt double %31, %.03147
  %.132 = select i1 %32, double %31, double %.03147
  %.1 = select i1 %32, double %30, double %.03048
  %33 = add nuw nsw i32 %.049, 1
  %34 = tail call double @llvm.fmuladd.f64(double %30, double %15, double %4)
  %35 = fcmp ogt double %31, %34
  %36 = load i32, ptr %25, align 4
  %37 = icmp slt i32 %33, %36
  %or.cond42 = select i1 %35, i1 %37, i1 false
  br i1 %or.cond42, label %.lr.ph, label %.critedge, !llvm.loop !21

.critedge:                                        ; preds = %.lr.ph, %23
  %.031.lcssa = phi double [ %24, %23 ], [ %.132, %.lr.ph ]
  %.030.lcssa = phi double [ %8, %23 ], [ %.1, %.lr.ph ]
  %38 = fcmp ule double %.031.lcssa, %4
  %39 = load i32, ptr %17, align 8
  %.not38 = icmp eq i32 %39, 0
  %or.cond44 = select i1 %38, i1 true, i1 %.not38
  br i1 %or.cond44, label %46, label %40

40:                                               ; preds = %.critedge
  %41 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.36)
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %41, double noundef %.031.lcssa)
  %43 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @.str.37)
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %43, double noundef %4)
  %45 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %46

46:                                               ; preds = %40, %.critedge
  tail call void @_ZN10LineSearch6ResultC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #4
  %47 = getelementptr inbounds i8, ptr %0, i64 8
  store double %.030.lcssa, ptr %47, align 8, !tbaa !23
  store double %.031.lcssa, ptr %0, align 8, !tbaa !25
  %48 = load i32, ptr %12, align 8, !tbaa !19
  %49 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %48, ptr %49, align 8, !tbaa !26
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef double @_ZL16vectorDotProductiPKdS0_(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !12, i64 120}
!6 = !{!"_ZTS10LineSearch", !7, i64 0, !7, i64 4, !10, i64 8, !13, i64 40, !13, i64 48, !13, i64 56, !7, i64 64, !13, i64 72, !7, i64 80, !14, i64 88, !7, i64 112, !12, i64 120, !12, i64 128}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt8functionIFiPKdPdS2_EE", !11, i64 0, !12, i64 24}
!11 = !{!"_ZTSSt14_Function_base", !8, i64 0, !12, i64 16}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_ZTSSt6vectorIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!18 = !{!6, !12, i64 128}
!19 = !{!6, !7, i64 112}
!20 = !{!6, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !13, i64 8}
!24 = !{!"_ZTSN10LineSearch6ResultE", !13, i64 0, !13, i64 8, !7, i64 16}
!25 = !{!24, !13, i64 0}
!26 = !{!24, !7, i64 16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass