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

; 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::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 [104 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.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 [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [20 x i8], align 1
@_ZZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionEE13LOG__sMessage = external hidden constant [54 x i8], align 16
@__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE = external hidden unnamed_addr constant [46 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE = external hidden unnamed_addr constant [192 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [116 x i8], align 1
@_ZZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionEE13LOG__sMessage_0 = external hidden constant [53 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

declare noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedTargetEPKhmPl(ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN14NAMESPACE_MAINL9IndexByteIvEEPT_S2_m(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE(ptr noundef %0, i64 noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #4 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i8, align 1
  %22 = alloca double, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 3, ptr %13, align 4, !tbaa !13
  %31 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %32 = icmp sle i32 3, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionEE13LOG__sMessage)
  br label %34

34:                                               ; preds = %33, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = icmp ne ptr null, %36
  br i1 %37, label %40, label %38

38:                                               ; preds = %35
  call void @LogAssertFailure(i64 noundef 148, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.1)
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str, i32 noundef 148, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %35
  %41 = phi i1 [ true, %35 ], [ false, %39 ]
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = icmp ne ptr null, %42
  br i1 %43, label %46, label %44

44:                                               ; preds = %40
  call void @LogAssertFailure(i64 noundef 149, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.5)
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str, i32 noundef 149, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

45:                                               ; No predecessors!
  br label %46

46:                                               ; preds = %45, %40
  %47 = phi i1 [ true, %40 ], [ false, %45 ]
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(32) %48)
  %50 = icmp ne i64 0, %49
  br i1 %50, label %51, label %257

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = call noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedTargetEPKhmPl(ptr noundef %52, i64 noundef 0, ptr noundef %14)
  store ptr %53, ptr %15, align 8, !tbaa !5
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = icmp ne ptr null, %54
  br i1 %55, label %58, label %56

56:                                               ; preds = %51
  call void @LogAssertFailure(i64 noundef 155, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.7)
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str, i32 noundef 155, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57, %51
  %59 = phi i1 [ true, %51 ], [ false, %57 ]
  %60 = load i64, ptr %14, align 8, !tbaa !9
  %61 = icmp eq i64 -2, %60
  br i1 %61, label %64, label %62

62:                                               ; preds = %58
  call void @LogAssertFailure(i64 noundef 156, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.9)
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str, i32 noundef 156, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

63:                                               ; No predecessors!
  br label %64

64:                                               ; preds = %63, %58
  %65 = phi i1 [ true, %58 ], [ false, %63 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = call noundef ptr @_ZN14NAMESPACE_MAIN18DataSetInteraction10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32) %66)
  store ptr %67, ptr %16, align 8, !tbaa !5
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = icmp ne ptr null, %68
  br i1 %69, label %72, label %70

70:                                               ; preds = %64
  call void @LogAssertFailure(i64 noundef 159, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.15)
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str, i32 noundef 159, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

71:                                               ; No predecessors!
  br label %72

72:                                               ; preds = %71, %64
  %73 = phi i1 [ true, %64 ], [ false, %71 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store ptr null, ptr %17, align 8, !tbaa !5
  %74 = load i64, ptr %8, align 8, !tbaa !9
  %75 = icmp ne i64 0, %74
  br i1 %75, label %76, label %85

76:                                               ; preds = %72
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = call noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedWeightEPKhm(ptr noundef %77, i64 noundef 0)
  store ptr %78, ptr %17, align 8, !tbaa !5
  %79 = load ptr, ptr %17, align 8, !tbaa !5
  %80 = icmp ne ptr null, %79
  br i1 %80, label %83, label %81

81:                                               ; preds = %76
  call void @LogAssertFailure(i64 noundef 164, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.25)
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str, i32 noundef 164, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

82:                                               ; No predecessors!
  br label %83

83:                                               ; preds = %82, %76
  %84 = phi i1 [ true, %76 ], [ false, %82 ]
  br label %85

85:                                               ; preds = %83, %72
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32) %86)
  %88 = icmp ule i64 1, %87
  br i1 %88, label %91, label %89

89:                                               ; preds = %85
  call void @LogAssertFailure(i64 noundef 167, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.13)
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str, i32 noundef 167, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

90:                                               ; No predecessors!
  br label %91

91:                                               ; preds = %90, %85
  %92 = phi i1 [ true, %85 ], [ false, %90 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32) %94)
  %96 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %93, i64 %95
  store ptr %96, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %97, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %98, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #6
  store i8 0, ptr %21, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  br label %99

99:                                               ; preds = %245, %91
  %100 = load ptr, ptr %16, align 8, !tbaa !5
  %101 = call noundef i64 @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40) %100)
  %102 = icmp ule i64 1, %101
  br i1 %102, label %105, label %103

103:                                              ; preds = %99
  call void @LogAssertFailure(i64 noundef 176, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.17)
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str, i32 noundef 176, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

104:                                              ; No predecessors!
  br label %105

105:                                              ; preds = %104, %99
  %106 = phi i1 [ true, %99 ], [ false, %104 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %107 = load ptr, ptr %16, align 8, !tbaa !5
  %108 = call noundef ptr @_ZN14NAMESPACE_MAIN21DataSubsetInteraction11GetGradHessEv(ptr noundef nonnull align 8 dereferenceable(40) %107)
  store ptr %108, ptr %23, align 8, !tbaa !5
  %109 = load ptr, ptr %23, align 8, !tbaa !5
  %110 = icmp ne ptr null, %109
  br i1 %110, label %113, label %111

111:                                              ; preds = %105
  call void @LogAssertFailure(i64 noundef 178, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.19)
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str, i32 noundef 178, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

112:                                              ; No predecessors!
  br label %113

113:                                              ; preds = %112, %105
  %114 = phi i1 [ true, %105 ], [ false, %112 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %115 = load ptr, ptr %23, align 8, !tbaa !5
  %116 = load ptr, ptr %16, align 8, !tbaa !5
  %117 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %116)
  %118 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %117, i32 0, i32 17
  %119 = load i64, ptr %118, align 8, !tbaa !16
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = call noundef i64 @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40) %120)
  %122 = mul i64 %119, %121
  %123 = call noundef ptr @_ZN14NAMESPACE_MAINL9IndexByteIvEEPT_S2_m(ptr noundef %115, i64 noundef %122) #6
  store ptr %123, ptr %24, align 8, !tbaa !5
  %124 = load ptr, ptr %17, align 8, !tbaa !5
  %125 = icmp eq ptr null, %124
  br i1 %125, label %126, label %130

126:                                              ; preds = %113
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction10GetWeightsEv(ptr noundef nonnull align 8 dereferenceable(40) %127)
  %129 = icmp eq ptr null, %128
  br i1 %129, label %139, label %130

130:                                              ; preds = %126, %113
  %131 = load ptr, ptr %17, align 8, !tbaa !5
  %132 = icmp ne ptr null, %131
  br i1 %132, label %133, label %137

133:                                              ; preds = %130
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction10GetWeightsEv(ptr noundef nonnull align 8 dereferenceable(40) %134)
  %136 = icmp ne ptr null, %135
  br i1 %136, label %139, label %137

137:                                              ; preds = %133, %130
  call void @LogAssertFailure(i64 noundef 183, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.27)
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str, i32 noundef 183, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

138:                                              ; No predecessors!
  br label %139

139:                                              ; preds = %138, %133, %126
  %140 = phi i1 [ true, %133 ], [ true, %126 ], [ false, %138 ]
  br label %141

141:                                              ; preds = %238, %139
  %142 = load i8, ptr %21, align 1, !tbaa !15
  %143 = sext i8 %142 to i32
  %144 = icmp eq i32 0, %143
  br i1 %144, label %145, label %207

145:                                              ; preds = %141
  store i8 1, ptr %21, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store i64 1, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store i64 1, ptr %26, align 8, !tbaa !9
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = icmp ne ptr null, %146
  br i1 %147, label %148, label %172

148:                                              ; preds = %145
  store i64 0, ptr %25, align 8, !tbaa !9
  store i64 0, ptr %26, align 8, !tbaa !9
  br label %149

149:                                              ; preds = %164, %148
  br label %150

150:                                              ; preds = %157, %149
  %151 = load ptr, ptr %19, align 8, !tbaa !5
  %152 = load i64, ptr %26, align 8, !tbaa !9
  %153 = getelementptr inbounds i8, ptr %151, i64 %152
  %154 = load i8, ptr %153, align 1, !tbaa !15
  store i8 %154, ptr %21, align 1, !tbaa !15
  %155 = load i64, ptr %26, align 8, !tbaa !9
  %156 = add i64 %155, 1
  store i64 %156, ptr %26, align 8, !tbaa !9
  br label %157

157:                                              ; preds = %150
  %158 = load i8, ptr %21, align 1, !tbaa !15
  %159 = sext i8 %158 to i32
  %160 = icmp eq i32 0, %159
  br i1 %160, label %150, label %161, !llvm.loop !18

161:                                              ; preds = %157
  %162 = load i64, ptr %25, align 8, !tbaa !9
  %163 = add i64 %162, 1
  store i64 %163, ptr %25, align 8, !tbaa !9
  br label %164

164:                                              ; preds = %161
  %165 = load i8, ptr %21, align 1, !tbaa !15
  %166 = sext i8 %165 to i32
  %167 = icmp slt i32 %166, 0
  br i1 %167, label %149, label %168, !llvm.loop !20

168:                                              ; preds = %164
  %169 = load i64, ptr %26, align 8, !tbaa !9
  %170 = load ptr, ptr %19, align 8, !tbaa !5
  %171 = getelementptr inbounds i8, ptr %170, i64 %169
  store ptr %171, ptr %19, align 8, !tbaa !5
  br label %172

172:                                              ; preds = %168, %145
  %173 = load i64, ptr %26, align 8, !tbaa !9
  %174 = load ptr, ptr %15, align 8, !tbaa !5
  %175 = getelementptr inbounds double, ptr %174, i64 %173
  store ptr %175, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %176 = load ptr, ptr %15, align 8, !tbaa !5
  %177 = getelementptr inbounds double, ptr %176, i64 -1
  %178 = load double, ptr %177, align 8, !tbaa !11
  store double %178, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %179 = load double, ptr %9, align 8, !tbaa !11
  store double %179, ptr %28, align 8, !tbaa !11
  %180 = load ptr, ptr %20, align 8, !tbaa !5
  %181 = icmp ne ptr null, %180
  br i1 %181, label %182, label %191

182:                                              ; preds = %172
  %183 = load i64, ptr %25, align 8, !tbaa !9
  %184 = load ptr, ptr %20, align 8, !tbaa !5
  %185 = getelementptr inbounds double, ptr %184, i64 %183
  store ptr %185, ptr %20, align 8, !tbaa !5
  %186 = load ptr, ptr %20, align 8, !tbaa !5
  %187 = getelementptr inbounds double, ptr %186, i64 -1
  %188 = load double, ptr %187, align 8, !tbaa !11
  %189 = load double, ptr %28, align 8, !tbaa !11
  %190 = fadd double %189, %188
  store double %190, ptr %28, align 8, !tbaa !11
  br label %191

191:                                              ; preds = %182, %172
  %192 = load double, ptr %28, align 8, !tbaa !11
  %193 = load double, ptr %27, align 8, !tbaa !11
  %194 = fsub double %192, %193
  store double %194, ptr %22, align 8, !tbaa !11
  %195 = load ptr, ptr %17, align 8, !tbaa !5
  %196 = icmp ne ptr null, %195
  br i1 %196, label %197, label %206

197:                                              ; preds = %191
  %198 = load i64, ptr %26, align 8, !tbaa !9
  %199 = load ptr, ptr %17, align 8, !tbaa !5
  %200 = getelementptr inbounds double, ptr %199, i64 %198
  store ptr %200, ptr %17, align 8, !tbaa !5
  %201 = load ptr, ptr %17, align 8, !tbaa !5
  %202 = getelementptr inbounds double, ptr %201, i64 -1
  %203 = load double, ptr %202, align 8, !tbaa !11
  %204 = load double, ptr %22, align 8, !tbaa !11
  %205 = fmul double %204, %203
  store double %205, ptr %22, align 8, !tbaa !11
  br label %206

206:                                              ; preds = %197, %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %207

207:                                              ; preds = %206, %141
  %208 = load ptr, ptr %16, align 8, !tbaa !5
  %209 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %208)
  %210 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %209, i32 0, i32 17
  %211 = load i64, ptr %210, align 8, !tbaa !16
  %212 = icmp eq i64 8, %211
  br i1 %212, label %213, label %216

213:                                              ; preds = %207
  %214 = load double, ptr %22, align 8, !tbaa !11
  %215 = load ptr, ptr %23, align 8, !tbaa !5
  store double %214, ptr %215, align 8, !tbaa !11
  br label %229

216:                                              ; preds = %207
  %217 = load ptr, ptr %16, align 8, !tbaa !5
  %218 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %217)
  %219 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %218, i32 0, i32 17
  %220 = load i64, ptr %219, align 8, !tbaa !16
  %221 = icmp eq i64 4, %220
  br i1 %221, label %224, label %222

222:                                              ; preds = %216
  call void @LogAssertFailure(i64 noundef 241, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.21)
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str, i32 noundef 241, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

223:                                              ; No predecessors!
  br label %224

224:                                              ; preds = %223, %216
  %225 = phi i1 [ true, %216 ], [ false, %223 ]
  %226 = load double, ptr %22, align 8, !tbaa !11
  %227 = fptrunc double %226 to float
  %228 = load ptr, ptr %23, align 8, !tbaa !5
  store float %227, ptr %228, align 4, !tbaa !21
  br label %229

229:                                              ; preds = %224, %213
  %230 = load ptr, ptr %23, align 8, !tbaa !5
  %231 = load ptr, ptr %16, align 8, !tbaa !5
  %232 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %231)
  %233 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %232, i32 0, i32 17
  %234 = load i64, ptr %233, align 8, !tbaa !16
  %235 = call noundef ptr @_ZN14NAMESPACE_MAINL9IndexByteIvEEPT_S2_m(ptr noundef %230, i64 noundef %234) #6
  store ptr %235, ptr %23, align 8, !tbaa !5
  %236 = load i8, ptr %21, align 1, !tbaa !15
  %237 = add i8 %236, -1
  store i8 %237, ptr %21, align 1, !tbaa !15
  br label %238

238:                                              ; preds = %229
  %239 = load ptr, ptr %24, align 8, !tbaa !5
  %240 = load ptr, ptr %23, align 8, !tbaa !5
  %241 = icmp ne ptr %239, %240
  br i1 %241, label %141, label %242, !llvm.loop !23

242:                                              ; preds = %238
  %243 = load ptr, ptr %16, align 8, !tbaa !5
  %244 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %243, i32 1
  store ptr %244, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %245

245:                                              ; preds = %242
  %246 = load ptr, ptr %18, align 8, !tbaa !5
  %247 = load ptr, ptr %16, align 8, !tbaa !5
  %248 = icmp ne ptr %246, %247
  br i1 %248, label %99, label %249, !llvm.loop !24

249:                                              ; preds = %245
  %250 = load i8, ptr %21, align 1, !tbaa !15
  %251 = sext i8 %250 to i32
  %252 = icmp eq i32 0, %251
  br i1 %252, label %255, label %253

253:                                              ; preds = %249
  call void @LogAssertFailure(i64 noundef 251, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef @.str.23)
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str, i32 noundef 251, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #7
  unreachable

254:                                              ; No predecessors!
  br label %255

255:                                              ; preds = %254, %249
  %256 = phi i1 [ true, %249 ], [ false, %254 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %257

257:                                              ; preds = %255, %46
  br label %258

258:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 3, ptr %29, align 4, !tbaa !13
  %259 = load i32, ptr @g_traceLevel, align 4, !tbaa !13
  %260 = icmp sle i32 3, %259
  br i1 %260, label %261, label %262

261:                                              ; preds = %258
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionEE13LOG__sMessage_0)
  br label %262

262:                                              ; preds = %261, %258
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %263

263:                                              ; preds = %262
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN18DataSetInteraction10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

declare noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedWeightEPKhm(ptr noundef, i64 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction10GetWeightsEv(ptr noundef nonnull align 8 dereferenceable(40)) #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 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 = { 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 #5 = { 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 #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 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !10, i64 128}
!17 = !{!"_ZTS16ObjectiveWrapper", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 36, !14, 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, !14, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !14, i64 144, !6, i64 152}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!22, !22, i64 0}
!22 = !{!"float", !7, i64 0}
!23 = distinct !{!23, !19}
!24 = distinct !{!24, !19}


; 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 [104 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.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 [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [20 x i8], align 1
@_ZZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionEE13LOG__sMessage = external hidden constant [54 x i8], align 16
@__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE = external hidden unnamed_addr constant [46 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE = external hidden unnamed_addr constant [192 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [116 x i8], align 1
@_ZZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionEE13LOG__sMessage_0 = external hidden constant [53 x i8], align 16

; Function Attrs: mustprogress 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) local_unnamed_addr #1

; 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

declare noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedTargetEPKhmPl(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN14NAMESPACE_MAINL9IndexByteIvEEPT_S2_m(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE(ptr noundef %0, i64 noundef %1, double noundef %2, ptr noundef readonly %3, ptr noundef readonly %4, ptr noundef %5) local_unnamed_addr #4 {
  %7 = alloca i64, align 8
  %8 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 2
  br i1 %9, label %10, label %11

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

11:                                               ; preds = %10, %6
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %12, label %13

12:                                               ; preds = %11
  tail call void @LogAssertFailure(i64 noundef 148, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.1)
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str, i32 noundef 148, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

13:                                               ; preds = %11
  %.not101 = icmp eq ptr %5, null
  br i1 %.not101, label %14, label %15

14:                                               ; preds = %13
  tail call void @LogAssertFailure(i64 noundef 149, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.5)
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 149, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

15:                                               ; preds = %13
  %16 = tail call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %.not102 = icmp eq i64 %16, 0
  br i1 %.not102, label %108, label %17

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %18 = call noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedTargetEPKhmPl(ptr noundef nonnull %0, i64 noundef 0, ptr noundef nonnull %7)
  %.not103 = icmp eq ptr %18, null
  br i1 %.not103, label %19, label %20

19:                                               ; preds = %17
  call void @LogAssertFailure(i64 noundef 155, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.7)
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str, i32 noundef 155, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

20:                                               ; preds = %17
  %21 = load i64, ptr %7, align 8, !tbaa !9
  %22 = icmp eq i64 %21, -2
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @LogAssertFailure(i64 noundef 156, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.9)
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str, i32 noundef 156, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

24:                                               ; preds = %20
  %25 = call noundef ptr @_ZN14NAMESPACE_MAIN18DataSetInteraction10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %.not104 = icmp eq ptr %25, null
  br i1 %.not104, label %26, label %27

26:                                               ; preds = %24
  call void @LogAssertFailure(i64 noundef 159, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.15)
  call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str, i32 noundef 159, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

27:                                               ; preds = %24
  %.not105 = icmp eq i64 %1, 0
  br i1 %.not105, label %31, label %28

28:                                               ; preds = %27
  %29 = call noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedWeightEPKhm(ptr noundef nonnull %0, i64 noundef 0)
  %.not106 = icmp eq ptr %29, null
  br i1 %.not106, label %30, label %31

30:                                               ; preds = %28
  call void @LogAssertFailure(i64 noundef 164, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.25)
  call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

31:                                               ; preds = %28, %27
  %.072 = phi ptr [ %29, %28 ], [ null, %27 ]
  %32 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %.not107 = icmp eq i64 %32, 0
  br i1 %.not107, label %33, label %34

33:                                               ; preds = %31
  call void @LogAssertFailure(i64 noundef 167, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.13)
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str, i32 noundef 167, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

34:                                               ; preds = %31
  %35 = call noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %36 = getelementptr inbounds %"struct.NAMESPACE_MAIN::DataSubsetInteraction", ptr %25, i64 %35
  br label %37

37:                                               ; preds = %102, %34
  %.088 = phi ptr [ %3, %34 ], [ %.391, %102 ]
  %.084 = phi ptr [ %4, %34 ], [ %.387, %102 ]
  %.080 = phi i8 [ 0, %34 ], [ %101, %102 ]
  %.076 = phi double [ undef, %34 ], [ %.379, %102 ]
  %.173 = phi ptr [ %.072, %34 ], [ %.4, %102 ]
  %.066 = phi ptr [ %25, %34 ], [ %103, %102 ]
  %.0 = phi ptr [ %18, %34 ], [ %.2, %102 ]
  %38 = call noundef i64 @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %.not108 = icmp eq i64 %38, 0
  br i1 %.not108, label %39, label %40

39:                                               ; preds = %37
  call void @LogAssertFailure(i64 noundef 176, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.17)
  call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str, i32 noundef 176, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

40:                                               ; preds = %37
  %41 = call noundef ptr @_ZN14NAMESPACE_MAIN21DataSubsetInteraction11GetGradHessEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %.not109 = icmp eq ptr %41, null
  br i1 %.not109, label %42, label %43

42:                                               ; preds = %40
  call void @LogAssertFailure(i64 noundef 178, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.19)
  call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str, i32 noundef 178, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

43:                                               ; preds = %40
  %44 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %45 = getelementptr inbounds i8, ptr %44, i64 128
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = call noundef i64 @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %48 = mul i64 %47, %46
  %49 = call noundef ptr @_ZN14NAMESPACE_MAINL9IndexByteIvEEPT_S2_m(ptr noundef nonnull %41, i64 noundef %48) #7
  %cond = icmp eq ptr %.173, null
  %50 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction10GetWeightsEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %51 = icmp eq ptr %50, null
  %52 = xor i1 %cond, %51
  br i1 %52, label %53, label %.preheader141

53:                                               ; preds = %43
  call void @LogAssertFailure(i64 noundef 183, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.27)
  call void @__assert_fail(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str, i32 noundef 183, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

.preheader141:                                    ; preds = %43, %96
  %.189 = phi ptr [ %.391, %96 ], [ %.088, %43 ]
  %.185 = phi ptr [ %.387, %96 ], [ %.084, %43 ]
  %.181 = phi i8 [ %101, %96 ], [ %.080, %43 ]
  %.177 = phi double [ %.379, %96 ], [ %.076, %43 ]
  %.075 = phi ptr [ %100, %96 ], [ %41, %43 ]
  %.274 = phi ptr [ %.4, %96 ], [ %.173, %43 ]
  %.1 = phi ptr [ %.2, %96 ], [ %.0, %43 ]
  %54 = icmp eq i8 %.181, 0
  br i1 %54, label %55, label %82

55:                                               ; preds = %.preheader141
  %.not112 = icmp eq ptr %.189, null
  br i1 %.not112, label %66, label %.preheader

.preheader:                                       ; preds = %55, %61
  %.070 = phi i64 [ %62, %61 ], [ 0, %55 ]
  %.067 = phi i64 [ %59, %61 ], [ 0, %55 ]
  br label %56

56:                                               ; preds = %56, %.preheader
  %.168 = phi i64 [ %.067, %.preheader ], [ %59, %56 ]
  %57 = getelementptr inbounds i8, ptr %.189, i64 %.168
  %58 = load i8, ptr %57, align 1, !tbaa !15
  %59 = add i64 %.168, 1
  %60 = icmp eq i8 %58, 0
  br i1 %60, label %56, label %61, !llvm.loop !16

61:                                               ; preds = %56
  %62 = add i64 %.070, 1
  %63 = icmp slt i8 %58, 0
  br i1 %63, label %.preheader, label %64, !llvm.loop !18

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %.189, i64 %59
  br label %66

66:                                               ; preds = %64, %55
  %.290 = phi ptr [ %65, %64 ], [ null, %55 ]
  %.282 = phi i8 [ %58, %64 ], [ 1, %55 ]
  %.171 = phi i64 [ %62, %64 ], [ 1, %55 ]
  %.269 = phi i64 [ %59, %64 ], [ 1, %55 ]
  %67 = getelementptr inbounds double, ptr %.1, i64 %.269
  %68 = getelementptr inbounds i8, ptr %67, i64 -8
  %69 = load double, ptr %68, align 8, !tbaa !19
  %.not113 = icmp eq ptr %.185, null
  br i1 %.not113, label %75, label %70

70:                                               ; preds = %66
  %71 = getelementptr inbounds double, ptr %.185, i64 %.171
  %72 = getelementptr inbounds i8, ptr %71, i64 -8
  %73 = load double, ptr %72, align 8, !tbaa !19
  %74 = fadd double %73, %2
  br label %75

75:                                               ; preds = %70, %66
  %.286 = phi ptr [ %71, %70 ], [ null, %66 ]
  %.065 = phi double [ %74, %70 ], [ %2, %66 ]
  %76 = fsub double %.065, %69
  %.not114 = icmp eq ptr %.274, null
  br i1 %.not114, label %82, label %77

77:                                               ; preds = %75
  %78 = getelementptr inbounds double, ptr %.274, i64 %.269
  %79 = getelementptr inbounds i8, ptr %78, i64 -8
  %80 = load double, ptr %79, align 8, !tbaa !19
  %81 = fmul double %76, %80
  br label %82

82:                                               ; preds = %75, %77, %.preheader141
  %.391 = phi ptr [ %.189, %.preheader141 ], [ %.290, %77 ], [ %.290, %75 ]
  %.387 = phi ptr [ %.185, %.preheader141 ], [ %.286, %77 ], [ %.286, %75 ]
  %.383 = phi i8 [ %.181, %.preheader141 ], [ %.282, %77 ], [ %.282, %75 ]
  %.379 = phi double [ %.177, %.preheader141 ], [ %81, %77 ], [ %76, %75 ]
  %.4 = phi ptr [ %.274, %.preheader141 ], [ %78, %77 ], [ null, %75 ]
  %.2 = phi ptr [ %.1, %.preheader141 ], [ %67, %77 ], [ %67, %75 ]
  %83 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %84 = getelementptr inbounds i8, ptr %83, i64 128
  %85 = load i64, ptr %84, align 8, !tbaa !11
  %86 = icmp eq i64 %85, 8
  br i1 %86, label %87, label %88

87:                                               ; preds = %82
  store double %.379, ptr %.075, align 8, !tbaa !19
  br label %96

88:                                               ; preds = %82
  %89 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %90 = getelementptr inbounds i8, ptr %89, i64 128
  %91 = load i64, ptr %90, align 8, !tbaa !11
  %92 = icmp eq i64 %91, 4
  br i1 %92, label %94, label %93

93:                                               ; preds = %88
  call void @LogAssertFailure(i64 noundef 241, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.21)
  call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str, i32 noundef 241, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

94:                                               ; preds = %88
  %95 = fptrunc double %.379 to float
  store float %95, ptr %.075, align 4, !tbaa !20
  br label %96

96:                                               ; preds = %94, %87
  %97 = call noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction19GetObjectiveWrapperEv(ptr noundef nonnull align 8 dereferenceable(40) %.066)
  %98 = getelementptr inbounds i8, ptr %97, i64 128
  %99 = load i64, ptr %98, align 8, !tbaa !11
  %100 = call noundef ptr @_ZN14NAMESPACE_MAINL9IndexByteIvEEPT_S2_m(ptr noundef nonnull %.075, i64 noundef %99) #7
  %101 = add i8 %.383, -1
  %.not115 = icmp eq ptr %49, %100
  br i1 %.not115, label %102, label %.preheader141, !llvm.loop !22

102:                                              ; preds = %96
  %103 = getelementptr inbounds i8, ptr %.066, i64 40
  %.not116 = icmp eq ptr %36, %103
  br i1 %.not116, label %104, label %37, !llvm.loop !23

104:                                              ; preds = %102
  %105 = icmp eq i8 %101, 0
  br i1 %105, label %107, label %106

106:                                              ; preds = %104
  call void @LogAssertFailure(i64 noundef 251, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE, ptr noundef nonnull @.str.23)
  call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str, i32 noundef 251, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionE) #6
  unreachable

107:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %108

108:                                              ; preds = %15, %107
  %109 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 2
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN45InitializeRmseGradientsAndHessiansInteractionEPKhmdPKaPKdPNS_18DataSetInteractionEE13LOG__sMessage_0)
  br label %112

112:                                              ; preds = %111, %108
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSamplesEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN18DataSetInteraction10GetSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

declare noundef ptr @_ZN14NAMESPACE_MAIN22GetDataSetSharedWeightEPKhm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK14NAMESPACE_MAIN18DataSetInteraction15GetCountSubsetsEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN21DataSubsetInteraction10GetWeightsEv(ptr noundef nonnull align 8 dereferenceable(40)) 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 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 = { 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 #5 = { 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 #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 = !{!6, !6, i64 0}
!6 = !{!"int", !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, !10, i64 128}
!12 = !{!"_ZTS16ObjectiveWrapper", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !6, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !6, i64 144, !13, i64 152}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!14, !14, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass