; LLVM IR from interpretml/interpret :: shared/libebm (BoosterCore)

; 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"

%struct.ApplyUpdateBridge = type { i64, i32, i32, i32, i32, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, double }
%"struct.NAMESPACE_MAIN::DataSubsetBoosting" = type { i64, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ObjectiveWrapper = type { ptr, ptr, ptr, ptr, i32, i32, i32, double, double, double, double, double, double, double, double, i32, i64, i64, i64, i32, ptr }

@.str = external hidden unnamed_addr constant [85 x i8], align 1
@__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd = external hidden unnamed_addr constant [38 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd = external hidden unnamed_addr constant [108 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [71 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN14NAMESPACE_MAIN11BoosterCore9IsHessianEv(ptr noundef nonnull align 8 dereferenceable(520)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN11BoosterCore14GetTrainingSetEv(ptr noundef nonnull align 8 dereferenceable(520)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN15DataSetBoosting10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd(ptr noundef nonnull align 8 dereferenceable(520) %0, ptr noundef %1, ptr noundef %2) #5 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.ApplyUpdateBridge, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %17 = call noundef ptr @_ZN14NAMESPACE_MAIN11BoosterCore14GetTrainingSetEv(ptr noundef nonnull align 8 dereferenceable(520) %16)
  store ptr %17, ptr %8, align 8, !tbaa !5
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = call noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  %20 = icmp ne i64 0, %19
  br i1 %20, label %21, label %127

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %22 = call noundef i64 @_ZNK14NAMESPACE_MAIN11BoosterCore14GetCountScoresEv(ptr noundef nonnull align 8 dereferenceable(520) %16)
  store i64 %22, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %38, %21
  %24 = load i64, ptr %10, align 8, !tbaa !9
  %25 = load i64, ptr %9, align 8, !tbaa !9
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %41

28:                                               ; preds = %23
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load i64, ptr %10, align 8, !tbaa !9
  %31 = getelementptr inbounds double, ptr %29, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !11
  %33 = fcmp oeq double 0.000000e+00, %32
  br i1 %33, label %36, label %34

34:                                               ; preds = %28
  call void @LogAssertFailure(i64 noundef 917, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef @.str.45)
  call void @__assert_fail(ptr noundef @.str.46, ptr noundef @.str, i32 noundef 917, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #7
  unreachable

35:                                               ; No predecessors!
  br label %36

36:                                               ; preds = %35, %28
  %37 = phi i1 [ true, %28 ], [ false, %35 ]
  br label %38

38:                                               ; preds = %36
  %39 = load i64, ptr %10, align 8, !tbaa !9
  %40 = add i64 %39, 1
  store i64 %40, ptr %10, align 8, !tbaa !9
  br label %23, !llvm.loop !13

41:                                               ; preds = %27
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = call noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40) %42)
  %44 = icmp ule i64 1, %43
  br i1 %44, label %47, label %45

45:                                               ; preds = %41
  call void @LogAssertFailure(i64 noundef 921, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef @.str.47)
  call void @__assert_fail(ptr noundef @.str.48, ptr noundef @.str, i32 noundef 921, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #7
  unreachable

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %41
  %48 = phi i1 [ true, %41 ], [ false, %46 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = call noundef ptr @_ZN14NAMESPACE_MAIN15DataSetBoosting10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40) %49)
  store ptr %50, ptr %11, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = icmp ne ptr null, %51
  br i1 %52, label %55, label %53

53:                                               ; preds = %47
  call void @LogAssertFailure(i64 noundef 924, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef @.str.49)
  call void @__assert_fail(ptr noundef @.str.50, ptr noundef @.str, i32 noundef 924, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #7
  unreachable

54:                                               ; No predecessors!
  br label %55

55:                                               ; preds = %54, %47
  %56 = phi i1 [ true, %47 ], [ false, %54 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = call noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40) %58)
  %60 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %57, i64 %59
  store ptr %60, ptr %12, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %119, %55
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(56) %62)
  %64 = icmp ule i64 1, %63
  br i1 %64, label %67, label %65

65:                                               ; preds = %61
  call void @LogAssertFailure(i64 noundef 927, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef @.str.51)
  call void @__assert_fail(ptr noundef @.str.52, ptr noundef @.str, i32 noundef 927, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #7
  unreachable

66:                                               ; No predecessors!
  br label %67

67:                                               ; preds = %66, %61
  %68 = phi i1 [ true, %61 ], [ false, %66 ]
  call void @llvm.lifetime.start.p0(i64 96, ptr %13) #6
  %69 = load i64, ptr %9, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 0
  store i64 %69, ptr %70, align 8, !tbaa !15
  %71 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 1
  store i32 0, ptr %71, align 8, !tbaa !18
  %72 = call noundef zeroext i1 @_ZN14NAMESPACE_MAIN11BoosterCore9IsHessianEv(ptr noundef nonnull align 8 dereferenceable(520) %16)
  %73 = zext i1 %72 to i64
  %74 = select i1 %72, i32 1, i32 0
  %75 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 2
  store i32 %74, ptr %75, align 4, !tbaa !19
  %76 = call noundef i32 @_ZNK14NAMESPACE_MAIN11BoosterCore11IsUseApproxEv(ptr noundef nonnull align 8 dereferenceable(520) %16)
  %77 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 4
  store i32 %76, ptr %77, align 4, !tbaa !20
  %78 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 3
  store i32 0, ptr %78, align 8, !tbaa !21
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 5
  store ptr %79, ptr %80, align 8, !tbaa !22
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = call noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(56) %81)
  %83 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %82, i32 0, i32 17
  %84 = load i64, ptr %83, align 8, !tbaa !23
  %85 = icmp ule i64 %84, 8
  br i1 %85, label %88, label %86

86:                                               ; preds = %67
  call void @LogAssertFailure(i64 noundef 939, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef @.str.53)
  call void @__assert_fail(ptr noundef @.str.54, ptr noundef @.str, i32 noundef 939, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #7
  unreachable

87:                                               ; No predecessors!
  br label %88

88:                                               ; preds = %87, %67
  %89 = phi i1 [ true, %67 ], [ false, %87 ]
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 6
  store ptr %90, ptr %91, align 8, !tbaa !25
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(56) %92)
  %94 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 7
  store i64 %93, ptr %94, align 8, !tbaa !26
  %95 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 8
  store ptr null, ptr %95, align 8, !tbaa !27
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = call noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting13GetTargetDataEv(ptr noundef nonnull align 8 dereferenceable(56) %96)
  %98 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 9
  store ptr %97, ptr %98, align 8, !tbaa !28
  %99 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 10
  store ptr null, ptr %99, align 8, !tbaa !29
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = call noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting15GetSampleScoresEv(ptr noundef nonnull align 8 dereferenceable(56) %100)
  %102 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 11
  store ptr %101, ptr %102, align 8, !tbaa !30
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = call noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting11GetGradHessEv(ptr noundef nonnull align 8 dereferenceable(56) %103)
  %105 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 12
  store ptr %104, ptr %105, align 8, !tbaa !31
  %106 = getelementptr inbounds %struct.ApplyUpdateBridge, ptr %13, i32 0, i32 13
  store double 0.000000e+00, ptr %106, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = call noundef i32 @_ZN14NAMESPACE_MAIN18DataSubsetBoosting20ObjectiveApplyUpdateEP17ApplyUpdateBridge(ptr noundef nonnull align 8 dereferenceable(56) %107, ptr noundef %13)
  store i32 %108, ptr %14, align 4, !tbaa !33
  %109 = load i32, ptr %14, align 4, !tbaa !33
  %110 = icmp ne i32 0, %109
  br i1 %110, label %111, label %113

111:                                              ; preds = %88
  %112 = load i32, ptr %14, align 4, !tbaa !33
  store i32 %112, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %116

113:                                              ; preds = %88
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %114, i32 1
  store ptr %115, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %15, align 4
  br label %116

116:                                              ; preds = %113, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %13) #6
  %117 = load i32, ptr %15, align 4
  switch i32 %117, label %124 [
    i32 0, label %118
  ]

118:                                              ; preds = %116
  br label %119

119:                                              ; preds = %118
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = icmp ne ptr %120, %121
  br i1 %122, label %61, label %123, !llvm.loop !34

123:                                              ; preds = %119
  store i32 0, ptr %15, align 4
  br label %124

124:                                              ; preds = %123, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %125 = load i32, ptr %15, align 4
  switch i32 %125, label %128 [
    i32 0, label %126
  ]

126:                                              ; preds = %124
  br label %127

127:                                              ; preds = %126, %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %128

128:                                              ; preds = %127, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %129 = load i32, ptr %4, align 4
  ret i32 %129
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN11BoosterCore14GetCountScoresEv(ptr noundef nonnull align 8 dereferenceable(520)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK14NAMESPACE_MAIN11BoosterCore11IsUseApproxEv(ptr noundef nonnull align 8 dereferenceable(520)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting13GetTargetDataEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting15GetSampleScoresEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting11GetGradHessEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN14NAMESPACE_MAIN18DataSubsetBoosting20ObjectiveApplyUpdateEP17ApplyUpdateBridge(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #3 align 2

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 = { noreturn 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 = { 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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"}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTS17ApplyUpdateBridge", !10, i64 0, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !6, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88}
!17 = !{!"int", !7, i64 0}
!18 = !{!16, !17, i64 8}
!19 = !{!16, !17, i64 12}
!20 = !{!16, !17, i64 20}
!21 = !{!16, !17, i64 16}
!22 = !{!16, !6, i64 24}
!23 = !{!24, !10, i64 128}
!24 = !{!"_ZTS16ObjectiveWrapper", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32, !17, i64 36, !17, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !17, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !17, i64 144, !6, i64 152}
!25 = !{!16, !6, i64 32}
!26 = !{!16, !10, i64 40}
!27 = !{!16, !6, i64 48}
!28 = !{!16, !6, i64 56}
!29 = !{!16, !6, i64 64}
!30 = !{!16, !6, i64 72}
!31 = !{!16, !6, i64 80}
!32 = !{!16, !12, i64 88}
!33 = !{!17, !17, i64 0}
!34 = distinct !{!34, !14}


; 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"

%struct.ApplyUpdateBridge = type { i64, i32, i32, i32, i32, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, double }
%"struct.NAMESPACE_MAIN::DataSubsetBoosting" = type { i64, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [85 x i8], align 1
@__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd = external hidden unnamed_addr constant [38 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd = external hidden unnamed_addr constant [108 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [71 x i8], align 1

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

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

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN14NAMESPACE_MAIN11BoosterCore9IsHessianEv(ptr noundef nonnull align 8 dereferenceable(520)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN11BoosterCore14GetTrainingSetEv(ptr noundef nonnull align 8 dereferenceable(520)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN15DataSetBoosting10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd(ptr noundef nonnull align 8 dereferenceable(520) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #5 align 2 {
  %4 = alloca %struct.ApplyUpdateBridge, align 8
  %5 = tail call noundef ptr @_ZN14NAMESPACE_MAIN11BoosterCore14GetTrainingSetEv(ptr noundef nonnull align 8 dereferenceable(520) %0)
  %6 = tail call noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %.critedge, label %7

7:                                                ; preds = %3
  %8 = tail call noundef i64 @_ZNK14NAMESPACE_MAIN11BoosterCore14GetCountScoresEv(ptr noundef nonnull align 8 dereferenceable(520) %0)
  %.not44 = icmp eq i64 %8, 0
  br i1 %.not44, label %._crit_edge, label %.lr.ph

9:                                                ; preds = %.lr.ph
  %10 = add nuw i64 %.03243, 1
  %exitcond.not = icmp eq i64 %10, %8
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

._crit_edge:                                      ; preds = %9, %7
  %11 = tail call noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  %.not38 = icmp eq i64 %11, 0
  br i1 %.not38, label %16, label %17

.lr.ph:                                           ; preds = %7, %9
  %.03243 = phi i64 [ %10, %9 ], [ 0, %7 ]
  %12 = getelementptr inbounds double, ptr %2, i64 %.03243
  %13 = load double, ptr %12, align 8, !tbaa !7
  %14 = fcmp oeq double %13, 0.000000e+00
  br i1 %14, label %9, label %15

15:                                               ; preds = %.lr.ph
  tail call void @LogAssertFailure(i64 noundef 917, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef nonnull @.str.45)
  tail call void @__assert_fail(ptr noundef nonnull @.str.46, ptr noundef nonnull @.str, i32 noundef 917, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #6
  unreachable

16:                                               ; preds = %._crit_edge
  tail call void @LogAssertFailure(i64 noundef 921, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef nonnull @.str.47)
  tail call void @__assert_fail(ptr noundef nonnull @.str.48, ptr noundef nonnull @.str, i32 noundef 921, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #6
  unreachable

17:                                               ; preds = %._crit_edge
  %18 = tail call noundef ptr @_ZN14NAMESPACE_MAIN15DataSetBoosting10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  %.not39 = icmp eq ptr %18, null
  br i1 %.not39, label %19, label %20

19:                                               ; preds = %17
  tail call void @LogAssertFailure(i64 noundef 924, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef nonnull @.str.49)
  tail call void @__assert_fail(ptr noundef nonnull @.str.50, ptr noundef nonnull @.str, i32 noundef 924, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #6
  unreachable

20:                                               ; preds = %17
  %21 = tail call noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  %22 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %18, i64 %21
  %23 = getelementptr inbounds i8, ptr %4, i64 8
  %24 = getelementptr inbounds i8, ptr %4, i64 12
  %25 = getelementptr inbounds i8, ptr %4, i64 20
  %26 = getelementptr inbounds i8, ptr %4, i64 16
  %27 = getelementptr inbounds i8, ptr %4, i64 24
  %28 = getelementptr inbounds i8, ptr %4, i64 32
  %29 = getelementptr inbounds i8, ptr %4, i64 40
  %30 = getelementptr inbounds i8, ptr %4, i64 48
  %31 = getelementptr inbounds i8, ptr %4, i64 56
  %32 = getelementptr inbounds i8, ptr %4, i64 64
  %33 = getelementptr inbounds i8, ptr %4, i64 72
  %34 = getelementptr inbounds i8, ptr %4, i64 80
  %35 = getelementptr inbounds i8, ptr %4, i64 88
  br label %36

36:                                               ; preds = %54, %20
  %.033 = phi ptr [ %18, %20 ], [ %55, %54 ]
  %37 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(56) %.033)
  %.not40 = icmp eq i64 %37, 0
  br i1 %.not40, label %38, label %39

38:                                               ; preds = %36
  call void @LogAssertFailure(i64 noundef 927, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef nonnull @.str.51)
  call void @__assert_fail(ptr noundef nonnull @.str.52, ptr noundef nonnull @.str, i32 noundef 927, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #6
  unreachable

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %4) #7
  store i64 %8, ptr %4, align 8, !tbaa !11
  store i32 0, ptr %23, align 8, !tbaa !16
  %40 = call noundef zeroext i1 @_ZN14NAMESPACE_MAIN11BoosterCore9IsHessianEv(ptr noundef nonnull align 8 dereferenceable(520) %0)
  %41 = zext i1 %40 to i32
  store i32 %41, ptr %24, align 4, !tbaa !17
  %42 = call noundef i32 @_ZNK14NAMESPACE_MAIN11BoosterCore11IsUseApproxEv(ptr noundef nonnull align 8 dereferenceable(520) %0)
  store i32 %42, ptr %25, align 4, !tbaa !18
  store i32 0, ptr %26, align 8, !tbaa !19
  store ptr %1, ptr %27, align 8, !tbaa !20
  %43 = call noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(56) %.033)
  %44 = getelementptr inbounds i8, ptr %43, i64 128
  %45 = load i64, ptr %44, align 8, !tbaa !21
  %46 = icmp ult i64 %45, 9
  br i1 %46, label %48, label %47

47:                                               ; preds = %39
  call void @LogAssertFailure(i64 noundef 939, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd, ptr noundef nonnull @.str.53)
  call void @__assert_fail(ptr noundef nonnull @.str.54, ptr noundef nonnull @.str, i32 noundef 939, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN11BoosterCore37InitializeBoosterGradientsAndHessiansEPvPd) #6
  unreachable

48:                                               ; preds = %39
  store ptr %2, ptr %28, align 8, !tbaa !23
  %49 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(56) %.033)
  store i64 %49, ptr %29, align 8, !tbaa !24
  store ptr null, ptr %30, align 8, !tbaa !25
  %50 = call noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting13GetTargetDataEv(ptr noundef nonnull align 8 dereferenceable(56) %.033)
  store ptr %50, ptr %31, align 8, !tbaa !26
  store ptr null, ptr %32, align 8, !tbaa !27
  %51 = call noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting15GetSampleScoresEv(ptr noundef nonnull align 8 dereferenceable(56) %.033)
  store ptr %51, ptr %33, align 8, !tbaa !28
  %52 = call noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting11GetGradHessEv(ptr noundef nonnull align 8 dereferenceable(56) %.033)
  store ptr %52, ptr %34, align 8, !tbaa !29
  store double 0.000000e+00, ptr %35, align 8, !tbaa !30
  %53 = call noundef i32 @_ZN14NAMESPACE_MAIN18DataSubsetBoosting20ObjectiveApplyUpdateEP17ApplyUpdateBridge(ptr noundef nonnull align 8 dereferenceable(56) %.033, ptr noundef nonnull %4)
  %.not41 = icmp eq i32 %53, 0
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #7
  br i1 %.not41, label %54, label %.critedge

54:                                               ; preds = %48
  %55 = getelementptr inbounds i8, ptr %.033, i64 56
  %.not42 = icmp eq ptr %22, %55
  br i1 %.not42, label %.critedge, label %36, !llvm.loop !31

.critedge:                                        ; preds = %54, %48, %3
  %.2 = phi i32 [ 0, %3 ], [ 0, %54 ], [ %53, %48 ]
  ret i32 %.2
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN15DataSetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN11BoosterCore14GetCountScoresEv(ptr noundef nonnull align 8 dereferenceable(520)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK14NAMESPACE_MAIN11BoosterCore11IsUseApproxEv(ptr noundef nonnull align 8 dereferenceable(520)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN18DataSubsetBoosting13GetTargetDataEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting15GetSampleScoresEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN18DataSubsetBoosting11GetGradHessEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN14NAMESPACE_MAIN18DataSubsetBoosting20ObjectiveApplyUpdateEP17ApplyUpdateBridge(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress 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 = { noreturn 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 = { 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 = { 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 #5 = { 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 #6 = { noreturn nounwind }
attributes #7 = { nounwind }

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

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


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