; LLVM IR from interpretml/interpret :: shared/libebm/DataSetBoosting.ll (ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm)

; 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.NAMESPACE_MAIN::DataSetBoosting" = type { i64, i64, ptr, ptr, ptr }
%"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 }

@g_traceLevel = external global i32, align 4
@.str = external hidden unnamed_addr constant [89 x i8], align 1
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage = external hidden constant [38 x i8], align 16
@__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm = external hidden unnamed_addr constant [81 x i8], align 1
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_0 = external hidden constant [82 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [36 x i8], align 1
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_1 = external hidden constant [122 x i8], align 16
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_2 = external hidden constant [59 x i8], align 16
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_3 = external hidden constant [37 x i8], align 16

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

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) #1

; 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: mustprogress uwtable
define dso_local noundef i32 @_ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm(ptr noundef nonnull align 8 dereferenceable(40) %0, i1 noundef zeroext %1, i64 noundef %2) #3 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  %20 = zext i1 %1 to i8
  store i8 %20, ptr %6, align 1, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !11
  %21 = load ptr, ptr %5, align 8
  br label %22

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 3, ptr %8, align 4, !tbaa !13
  %23 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %24 = icmp sle i32 3, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage)
  br label %26

26:                                               ; preds = %25, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %27

27:                                               ; preds = %26
  %28 = load i64, ptr %7, align 8, !tbaa !11
  %29 = icmp ule i64 1, %28
  br i1 %29, label %32, label %30

30:                                               ; preds = %27
  call void @LogAssertFailure(i64 noundef 52, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef @.str.3)
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str, i32 noundef 52, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #7
  unreachable

31:                                               ; No predecessors!
  br label %32

32:                                               ; preds = %31, %27
  %33 = phi i1 [ true, %27 ], [ false, %31 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %34 = load i64, ptr %7, align 8, !tbaa !11
  store i64 %34, ptr %9, align 8, !tbaa !11
  %35 = load i8, ptr %6, align 1, !tbaa !9, !range !15, !noundef !16
  %36 = trunc i8 %35 to i1
  br i1 %36, label %37, label %51

37:                                               ; preds = %32
  %38 = load i64, ptr %9, align 8, !tbaa !11
  %39 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 2, i64 noundef %38) #6
  br i1 %39, label %40, label %48

40:                                               ; preds = %37
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 2, ptr %10, align 4, !tbaa !13
  %42 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %43 = icmp sle i32 2, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_0)
  br label %45

45:                                               ; preds = %44, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %158

48:                                               ; preds = %37
  %49 = load i64, ptr %9, align 8, !tbaa !11
  %50 = shl i64 %49, 1
  store i64 %50, ptr %9, align 8, !tbaa !11
  br label %51

51:                                               ; preds = %48, %32
  %52 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSetBoosting", ptr %21, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %54 = icmp ne ptr null, %53
  br i1 %54, label %57, label %55

55:                                               ; preds = %51
  call void @LogAssertFailure(i64 noundef 63, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef @.str.5)
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str, i32 noundef 63, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #7
  unreachable

56:                                               ; No predecessors!
  br label %57

57:                                               ; preds = %56, %51
  %58 = phi i1 [ true, %51 ], [ false, %56 ]
  %59 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSetBoosting", ptr %21, i32 0, i32 1
  %60 = load i64, ptr %59, align 8, !tbaa !19
  %61 = icmp ule i64 1, %60
  br i1 %61, label %64, label %62

62:                                               ; preds = %57
  call void @LogAssertFailure(i64 noundef 64, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef @.str.7)
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str, i32 noundef 64, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #7
  unreachable

63:                                               ; No predecessors!
  br label %64

64:                                               ; preds = %63, %57
  %65 = phi i1 [ true, %57 ], [ false, %63 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %66 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSetBoosting", ptr %21, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !17
  store ptr %67, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSetBoosting", ptr %21, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !19
  %71 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %68, i64 %70
  store ptr %71, ptr %13, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %145, %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %73, i32 0, i32 0
  %75 = load i64, ptr %74, align 8, !tbaa !20
  store i64 %75, ptr %14, align 8, !tbaa !11
  %76 = load i64, ptr %14, align 8, !tbaa !11
  %77 = icmp ule i64 1, %76
  br i1 %77, label %80, label %78

78:                                               ; preds = %72
  call void @LogAssertFailure(i64 noundef 69, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef @.str.9)
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str, i32 noundef 69, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #7
  unreachable

79:                                               ; No predecessors!
  br label %80

80:                                               ; preds = %79, %72
  %81 = phi i1 [ true, %72 ], [ false, %79 ]
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !22
  %85 = icmp ne ptr null, %84
  br i1 %85, label %88, label %86

86:                                               ; preds = %80
  call void @LogAssertFailure(i64 noundef 71, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef @.str.11)
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str, i32 noundef 71, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #7
  unreachable

87:                                               ; No predecessors!
  br label %88

88:                                               ; preds = %87, %80
  %89 = phi i1 [ true, %80 ], [ false, %87 ]
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !22
  %93 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %92, i32 0, i32 17
  %94 = load i64, ptr %93, align 8, !tbaa !23
  %95 = load i64, ptr %9, align 8, !tbaa !11
  %96 = load i64, ptr %14, align 8, !tbaa !11
  %97 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImJmEEEbT_S1_DpKT0_(i64 noundef %94, i64 noundef %95, i64 noundef %96) #6
  br i1 %97, label %98, label %106

98:                                               ; preds = %88
  br label %99

99:                                               ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 2, ptr %15, align 4, !tbaa !13
  %100 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %101 = icmp sle i32 2, %100
  br i1 %101, label %102, label %103

102:                                              ; preds = %99
  call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_1)
  br label %103

103:                                              ; preds = %102, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %142

106:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !22
  %110 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %109, i32 0, i32 17
  %111 = load i64, ptr %110, align 8, !tbaa !23
  %112 = load i64, ptr %9, align 8, !tbaa !11
  %113 = mul i64 %111, %112
  %114 = load i64, ptr %14, align 8, !tbaa !11
  %115 = mul i64 %113, %114
  store i64 %115, ptr %16, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %106
  %117 = load i64, ptr %16, align 8, !tbaa !11
  %118 = icmp ne i64 0, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  call void @_ZL17StopClangAnalysisv() #6
  br label %120

120:                                              ; preds = %119, %116
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %123 = load i64, ptr %16, align 8, !tbaa !11
  %124 = call ptr @AlignedAlloc(i64 noundef %123)
  store ptr %124, ptr %17, align 8, !tbaa !5
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  %126 = icmp eq ptr null, %125
  br i1 %126, label %127, label %135

127:                                              ; preds = %122
  br label %128

128:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 2, ptr %18, align 4, !tbaa !13
  %129 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %130 = icmp sle i32 2, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %128
  call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_2)
  br label %132

132:                                              ; preds = %131, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %141

135:                                              ; preds = %122
  %136 = load ptr, ptr %17, align 8, !tbaa !5
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  %138 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %137, i32 0, i32 2
  store ptr %136, ptr %138, align 8, !tbaa !26
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %139, i32 1
  store ptr %140, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %141

141:                                              ; preds = %135, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %142

142:                                              ; preds = %141, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %143 = load i32, ptr %11, align 4
  switch i32 %143, label %157 [
    i32 0, label %144
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  %148 = icmp ne ptr %146, %147
  br i1 %148, label %72, label %149, !llvm.loop !27

149:                                              ; preds = %145
  br label %150

150:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 3, ptr %19, align 4, !tbaa !13
  %151 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %152 = icmp sle i32 3, %151
  br i1 %152, label %153, label %154

153:                                              ; preds = %150
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_3)
  br label %154

154:                                              ; preds = %153, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155
  store i32 0, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %157

157:                                              ; preds = %156, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %158

158:                                              ; preds = %157, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %159 = load i32, ptr %4, align 4
  ret i32 %159
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef, i64 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImJmEEEbT_S1_DpKT0_(i64 noundef, i64 noundef, i64 noundef) #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @_ZL17StopClangAnalysisv() #5

declare ptr @AlignedAlloc(i64 noundef) #1

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 = { 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 = { alwaysinline 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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !6, i64 16}
!18 = !{!"_ZTSN14NAMESPACE_MAIN15DataSetBoostingE", !12, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!19 = !{!18, !12, i64 8}
!20 = !{!21, !12, i64 0}
!21 = !{!"_ZTSN14NAMESPACE_MAIN18DataSubsetBoostingE", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!22 = !{!21, !6, i64 8}
!23 = !{!24, !12, i64 128}
!24 = !{!"_ZTS16ObjectiveWrapper", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 36, !14, i64 40, !25, i64 48, !25, i64 56, !25, i64 64, !25, i64 72, !25, i64 80, !25, i64 88, !25, i64 96, !25, i64 104, !14, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !14, i64 144, !6, i64 152}
!25 = !{!"double", !7, i64 0}
!26 = !{!21, !6, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"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"

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

@g_traceLevel = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [89 x i8], align 1
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage = external hidden constant [38 x i8], align 16
@__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm = external hidden unnamed_addr constant [81 x i8], align 1
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_0 = external hidden constant [82 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [36 x i8], align 1
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_1 = external hidden constant [122 x i8], align 16
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_2 = external hidden constant [59 x i8], align 16
@_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_3 = external hidden constant [37 x i8], align 16

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm(ptr nocapture noundef nonnull readonly align 8 dereferenceable(40) %0, i1 noundef zeroext %1, i64 noundef %2) local_unnamed_addr #2 align 2 {
  %4 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 2
  br i1 %5, label %6, label %7

6:                                                ; preds = %3
  tail call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage)
  br label %7

7:                                                ; preds = %6, %3
  %.not = icmp eq i64 %2, 0
  br i1 %.not, label %8, label %9

8:                                                ; preds = %7
  tail call void @LogAssertFailure(i64 noundef 52, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef nonnull @.str.3)
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str, i32 noundef 52, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #5
  unreachable

9:                                                ; preds = %7
  br i1 %1, label %10, label %18

10:                                               ; preds = %9
  %11 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 2, i64 noundef %2) #6
  br i1 %11, label %12, label %16

12:                                               ; preds = %10
  %13 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 1
  br i1 %14, label %15, label %.thread

15:                                               ; preds = %12
  tail call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_0)
  br label %.thread

16:                                               ; preds = %10
  %17 = shl i64 %2, 1
  br label %18

18:                                               ; preds = %16, %9
  %.025 = phi i64 [ %17, %16 ], [ %2, %9 ]
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %.not37 = icmp eq ptr %20, null
  br i1 %.not37, label %21, label %22

21:                                               ; preds = %18
  tail call void @LogAssertFailure(i64 noundef 63, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef nonnull @.str.5)
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 63, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #5
  unreachable

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %.not38 = icmp eq i64 %24, 0
  br i1 %.not38, label %25, label %26

25:                                               ; preds = %22
  tail call void @LogAssertFailure(i64 noundef 64, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef nonnull @.str.7)
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str, i32 noundef 64, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #5
  unreachable

26:                                               ; preds = %22
  %27 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetBoosting", ptr %20, i64 %24
  br label %28

28:                                               ; preds = %57, %26
  %.028 = phi ptr [ %20, %26 ], [ %59, %57 ]
  %29 = load i64, ptr %.028, align 8, !tbaa !14
  %.not39 = icmp eq i64 %29, 0
  br i1 %.not39, label %30, label %31

30:                                               ; preds = %28
  tail call void @LogAssertFailure(i64 noundef 69, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef nonnull @.str.9)
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str, i32 noundef 69, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #5
  unreachable

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %.028, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %.not40 = icmp eq ptr %33, null
  br i1 %.not40, label %34, label %35

34:                                               ; preds = %31
  tail call void @LogAssertFailure(i64 noundef 71, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm, ptr noundef nonnull @.str.11)
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str, i32 noundef 71, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbm) #5
  unreachable

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %33, i64 128
  %37 = load i64, ptr %36, align 8, !tbaa !17
  %38 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImJmEEEbT_S1_DpKT0_(i64 noundef %37, i64 noundef %.025, i64 noundef %29) #6
  br i1 %38, label %39, label %43

39:                                               ; preds = %35
  %40 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 1
  br i1 %41, label %42, label %.thread

42:                                               ; preds = %39
  tail call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_1)
  br label %.thread

43:                                               ; preds = %35
  %44 = load ptr, ptr %32, align 8, !tbaa !16
  %45 = getelementptr inbounds i8, ptr %44, i64 128
  %46 = load i64, ptr %45, align 8, !tbaa !17
  %47 = mul i64 %29, %.025
  %48 = mul i64 %47, %46
  %.not41 = icmp eq i64 %48, 0
  br i1 %.not41, label %49, label %50

49:                                               ; preds = %43
  tail call void @_ZL17StopClangAnalysisv() #6
  br label %50

50:                                               ; preds = %49, %43
  %51 = tail call ptr @AlignedAlloc(i64 noundef %48)
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %57

53:                                               ; preds = %50
  %54 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %55 = icmp sgt i32 %54, 1
  br i1 %55, label %56, label %.thread

56:                                               ; preds = %53
  tail call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_2)
  br label %.thread

57:                                               ; preds = %50
  %58 = getelementptr inbounds i8, ptr %.028, i64 16
  store ptr %51, ptr %58, align 8, !tbaa !20
  %59 = getelementptr inbounds i8, ptr %.028, i64 56
  %.not42 = icmp eq ptr %27, %59
  br i1 %.not42, label %60, label %28, !llvm.loop !21

60:                                               ; preds = %57
  %61 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 2
  br i1 %62, label %63, label %.thread

63:                                               ; preds = %60
  tail call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN15DataSetBoosting12InitGradHessEbmE13LOG__sMessage_3)
  br label %.thread

.thread:                                          ; preds = %53, %56, %39, %42, %63, %60, %12, %15
  %.4 = phi i32 [ -1, %15 ], [ -1, %12 ], [ 0, %63 ], [ 0, %60 ], [ -1, %42 ], [ -1, %39 ], [ -1, %56 ], [ -1, %53 ]
  ret i32 %.4
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImJmEEEbT_S1_DpKT0_(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @_ZL17StopClangAnalysisv() local_unnamed_addr #4

declare ptr @AlignedAlloc(i64 noundef) local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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 = { 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 #4 = { alwaysinline 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 = { noreturn nounwind }
attributes #6 = { nounwind }

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

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


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