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

; 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::DataSetInteraction" = type { i64, i64, ptr, double }
%"struct.NAMESPACE_MAIN::DataSubsetInteraction" = type { i64, 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 [92 x i8], align 1
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage = external hidden constant [41 x i8], align 16
@__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm = 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_MAIN18DataSetInteraction12InitGradHessEbm = external hidden unnamed_addr constant [84 x i8], align 1
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_0 = external hidden constant [85 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [36 x i8], align 1
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_1 = external hidden constant [125 x i8], align 16
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_2 = external hidden constant [62 x i8], align 16
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_3 = external hidden constant [40 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_MAIN18DataSetInteraction12InitGradHessEbm(ptr noundef nonnull align 8 dereferenceable(32) %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_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__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 46, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm, ptr noundef @.str.3)
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str, i32 noundef 46, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm) #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_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__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 %144

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
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %52 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSetInteraction", ptr %21, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  store ptr %53, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSetInteraction", ptr %21, i32 0, i32 1
  %56 = load i64, ptr %55, align 8, !tbaa !20
  %57 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %54, i64 %56
  store ptr %57, ptr %13, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %131, %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %59, i32 0, i32 0
  %61 = load i64, ptr %60, align 8, !tbaa !21
  store i64 %61, ptr %14, align 8, !tbaa !11
  %62 = load i64, ptr %14, align 8, !tbaa !11
  %63 = icmp ule i64 1, %62
  br i1 %63, label %66, label %64

64:                                               ; preds = %58
  call void @LogAssertFailure(i64 noundef 61, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm, ptr noundef @.str.5)
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str, i32 noundef 61, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm) #7
  unreachable

65:                                               ; No predecessors!
  br label %66

66:                                               ; preds = %65, %58
  %67 = phi i1 [ true, %58 ], [ false, %65 ]
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  %71 = icmp ne ptr null, %70
  br i1 %71, label %74, label %72

72:                                               ; preds = %66
  call void @LogAssertFailure(i64 noundef 63, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm, ptr noundef @.str.7)
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str, i32 noundef 63, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm) #7
  unreachable

73:                                               ; No predecessors!
  br label %74

74:                                               ; preds = %73, %66
  %75 = phi i1 [ true, %66 ], [ false, %73 ]
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !23
  %79 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %78, i32 0, i32 17
  %80 = load i64, ptr %79, align 8, !tbaa !24
  %81 = load i64, ptr %9, align 8, !tbaa !11
  %82 = load i64, ptr %14, align 8, !tbaa !11
  %83 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImJmEEEbT_S1_DpKT0_(i64 noundef %80, i64 noundef %81, i64 noundef %82) #6
  br i1 %83, label %84, label %92

84:                                               ; preds = %74
  br label %85

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 2, ptr %15, align 4, !tbaa !13
  %86 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %87 = icmp sle i32 2, %86
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_1)
  br label %89

89:                                               ; preds = %88, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %128

92:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !23
  %96 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %95, i32 0, i32 17
  %97 = load i64, ptr %96, align 8, !tbaa !24
  %98 = load i64, ptr %9, align 8, !tbaa !11
  %99 = mul i64 %97, %98
  %100 = load i64, ptr %14, align 8, !tbaa !11
  %101 = mul i64 %99, %100
  store i64 %101, ptr %16, align 8, !tbaa !11
  br label %102

102:                                              ; preds = %92
  %103 = load i64, ptr %16, align 8, !tbaa !11
  %104 = icmp ne i64 0, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  call void @_ZL17StopClangAnalysisv() #6
  br label %106

106:                                              ; preds = %105, %102
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %109 = load i64, ptr %16, align 8, !tbaa !11
  %110 = call ptr @AlignedAlloc(i64 noundef %109)
  store ptr %110, ptr %17, align 8, !tbaa !5
  %111 = load ptr, ptr %17, align 8, !tbaa !5
  %112 = icmp eq ptr null, %111
  br i1 %112, label %113, label %121

113:                                              ; preds = %108
  br label %114

114:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 2, ptr %18, align 4, !tbaa !13
  %115 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %116 = icmp sle i32 2, %115
  br i1 %116, label %117, label %118

117:                                              ; preds = %114
  call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_2)
  br label %118

118:                                              ; preds = %117, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %127

121:                                              ; preds = %108
  %122 = load ptr, ptr %17, align 8, !tbaa !5
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %123, i32 0, i32 2
  store ptr %122, ptr %124, align 8, !tbaa !26
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %125, i32 1
  store ptr %126, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %127

127:                                              ; preds = %121, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %128

128:                                              ; preds = %127, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %129 = load i32, ptr %11, align 4
  switch i32 %129, label %143 [
    i32 0, label %130
  ]

130:                                              ; preds = %128
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = icmp ne ptr %132, %133
  br i1 %134, label %58, label %135, !llvm.loop !27

135:                                              ; preds = %131
  br label %136

136:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 3, ptr %19, align 4, !tbaa !13
  %137 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %138 = icmp sle i32 3, %137
  br i1 %138, label %139, label %140

139:                                              ; preds = %136
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_3)
  br label %140

140:                                              ; preds = %139, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  store i32 0, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %143

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

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

; 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_MAIN18DataSetInteractionE", !12, i64 0, !12, i64 8, !6, i64 16, !19, i64 24}
!19 = !{!"double", !7, i64 0}
!20 = !{!18, !12, i64 8}
!21 = !{!22, !12, i64 0}
!22 = !{!"_ZTSN14NAMESPACE_MAIN21DataSubsetInteractionE", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!22, !6, i64 8}
!24 = !{!25, !12, i64 128}
!25 = !{!"_ZTS16ObjectiveWrapper", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 36, !14, 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, !14, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !14, i64 144, !6, i64 152}
!26 = !{!22, !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::DataSubsetInteraction" = type { i64, ptr, ptr, ptr, ptr }

@g_traceLevel = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [92 x i8], align 1
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage = external hidden constant [41 x i8], align 16
@__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm = 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_MAIN18DataSetInteraction12InitGradHessEbm = external hidden unnamed_addr constant [84 x i8], align 1
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_0 = external hidden constant [85 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [36 x i8], align 1
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_1 = external hidden constant [125 x i8], align 16
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_2 = external hidden constant [62 x i8], align 16
@_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_3 = external hidden constant [40 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_MAIN18DataSetInteraction12InitGradHessEbm(ptr nocapture noundef nonnull readonly align 8 dereferenceable(32) %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_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__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 46, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm, ptr noundef nonnull @.str.3)
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str, i32 noundef 46, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm) #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_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__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
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = load i64, ptr %21, align 8, !tbaa !14
  %23 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %20, i64 %22
  br label %24

24:                                               ; preds = %53, %18
  %.028 = phi ptr [ %20, %18 ], [ %55, %53 ]
  %25 = load i64, ptr %.028, align 8, !tbaa !15
  %.not35 = icmp eq i64 %25, 0
  br i1 %.not35, label %26, label %27

26:                                               ; preds = %24
  tail call void @LogAssertFailure(i64 noundef 61, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm, ptr noundef nonnull @.str.5)
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 61, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm) #5
  unreachable

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %.028, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %.not36 = icmp eq ptr %29, null
  br i1 %.not36, label %30, label %31

30:                                               ; preds = %27
  tail call void @LogAssertFailure(i64 noundef 63, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm, ptr noundef nonnull @.str.7)
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str, i32 noundef 63, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbm) #5
  unreachable

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %29, i64 128
  %33 = load i64, ptr %32, align 8, !tbaa !18
  %34 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImJmEEEbT_S1_DpKT0_(i64 noundef %33, i64 noundef %.025, i64 noundef %25) #6
  br i1 %34, label %35, label %39

35:                                               ; preds = %31
  %36 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 1
  br i1 %37, label %38, label %.thread

38:                                               ; preds = %35
  tail call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_1)
  br label %.thread

39:                                               ; preds = %31
  %40 = load ptr, ptr %28, align 8, !tbaa !17
  %41 = getelementptr inbounds i8, ptr %40, i64 128
  %42 = load i64, ptr %41, align 8, !tbaa !18
  %43 = mul i64 %25, %.025
  %44 = mul i64 %43, %42
  %.not37 = icmp eq i64 %44, 0
  br i1 %.not37, label %45, label %46

45:                                               ; preds = %39
  tail call void @_ZL17StopClangAnalysisv() #6
  br label %46

46:                                               ; preds = %45, %39
  %47 = tail call ptr @AlignedAlloc(i64 noundef %44)
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %53

49:                                               ; preds = %46
  %50 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 1
  br i1 %51, label %52, label %.thread

52:                                               ; preds = %49
  tail call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_2)
  br label %.thread

53:                                               ; preds = %46
  %54 = getelementptr inbounds i8, ptr %.028, i64 16
  store ptr %47, ptr %54, align 8, !tbaa !20
  %55 = getelementptr inbounds i8, ptr %.028, i64 40
  %.not38 = icmp eq ptr %23, %55
  br i1 %.not38, label %56, label %24, !llvm.loop !21

56:                                               ; preds = %53
  %57 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 2
  br i1 %58, label %59, label %.thread

59:                                               ; preds = %56
  tail call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN18DataSetInteraction12InitGradHessEbmE13LOG__sMessage_3)
  br label %.thread

.thread:                                          ; preds = %49, %52, %35, %38, %59, %56, %12, %15
  %.4 = phi i32 [ -1, %15 ], [ -1, %12 ], [ 0, %59 ], [ 0, %56 ], [ -1, %38 ], [ -1, %35 ], [ -1, %52 ], [ -1, %49 ]
  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_MAIN18DataSetInteractionE", !11, i64 0, !11, i64 8, !12, i64 16, !13, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!10, !11, i64 8}
!15 = !{!16, !11, i64 0}
!16 = !{!"_ZTSN14NAMESPACE_MAIN21DataSubsetInteractionE", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!17 = !{!16, !12, i64 8}
!18 = !{!19, !11, i64 128}
!19 = !{!"_ZTS16ObjectiveWrapper", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !6, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !6, i64 144, !12, i64 152}
!20 = !{!16, !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