; LLVM IR from softmin/ReHLine-SVM :: liblinear (linear)

; 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.problem = type { i32, i32, ptr, ptr, double }

@stderr = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [101 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @rand() #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @train(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @cross_validation(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.problem, align 8
  %19 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.problem, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !11
  store i32 %22, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %23 = load i32, ptr %11, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = mul i64 %24, 4
  %26 = call noalias ptr @malloc(i64 noundef %25) #7
  store ptr %26, ptr %12, align 8, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = icmp sgt i32 %27, %28
  br i1 %29, label %30, label %34

30:                                               ; preds = %4
  %31 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %31, ptr %7, align 4, !tbaa !9
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.7) #6
  br label %34

34:                                               ; preds = %30, %4
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = mul i64 %37, 4
  %39 = call noalias ptr @malloc(i64 noundef %38) #7
  store ptr %39, ptr %10, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %50, %34
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %44, label %53

44:                                               ; preds = %40
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i32, ptr %46, i64 %48
  store i32 %45, ptr %49, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %44
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %9, align 4, !tbaa !9
  br label %40, !llvm.loop !14

53:                                               ; preds = %40
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %74, %53
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %58, label %77

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = call i32 @rand() #6
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = sub nsw i32 %61, %62
  %64 = srem i32 %60, %63
  %65 = add nsw i32 %59, %64
  store i32 %65, ptr %13, align 4, !tbaa !9
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %66, i64 %68
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %70, i64 %72
  call void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %69, ptr noundef nonnull align 4 dereferenceable(4) %73)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %74

74:                                               ; preds = %58
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %9, align 4, !tbaa !9
  br label %54, !llvm.loop !16

77:                                               ; preds = %54
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %92, %77
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = icmp sle i32 %79, %80
  br i1 %81, label %82, label %95

82:                                               ; preds = %78
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = mul nsw i32 %83, %84
  %86 = load i32, ptr %7, align 4, !tbaa !9
  %87 = sdiv i32 %85, %86
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %88, i64 %90
  store i32 %87, ptr %91, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %82
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %9, align 4, !tbaa !9
  br label %78, !llvm.loop !17

95:                                               ; preds = %78
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %262, %95
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = load i32, ptr %7, align 4, !tbaa !9
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %100, label %265

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %101, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  store i32 %105, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %106, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !9
  store i32 %111, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #6
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.problem, ptr %112, i32 0, i32 4
  %114 = load double, ptr %113, align 8, !tbaa !18
  %115 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 4
  store double %114, ptr %115, align 8, !tbaa !18
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.problem, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !19
  %119 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 1
  store i32 %118, ptr %119, align 4, !tbaa !19
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = load i32, ptr %15, align 4, !tbaa !9
  %122 = load i32, ptr %14, align 4, !tbaa !9
  %123 = sub nsw i32 %121, %122
  %124 = sub nsw i32 %120, %123
  %125 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 0
  store i32 %124, ptr %125, align 8, !tbaa !11
  %126 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = mul i64 %128, 8
  %130 = call noalias ptr @malloc(i64 noundef %129) #7
  %131 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 3
  store ptr %130, ptr %131, align 8, !tbaa !20
  %132 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 0
  %133 = load i32, ptr %132, align 8, !tbaa !11
  %134 = sext i32 %133 to i64
  %135 = mul i64 %134, 8
  %136 = call noalias ptr @malloc(i64 noundef %135) #7
  %137 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 2
  store ptr %136, ptr %137, align 8, !tbaa !21
  store i32 0, ptr %17, align 4, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %177, %100
  %139 = load i32, ptr %16, align 4, !tbaa !9
  %140 = load i32, ptr %14, align 4, !tbaa !9
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %142, label %180

142:                                              ; preds = %138
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.problem, ptr %143, i32 0, i32 3
  %145 = load ptr, ptr %144, align 8, !tbaa !20
  %146 = load ptr, ptr %12, align 8, !tbaa !5
  %147 = load i32, ptr %16, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %146, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds ptr, ptr %145, i64 %151
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 3
  %155 = load ptr, ptr %154, align 8, !tbaa !20
  %156 = load i32, ptr %17, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds ptr, ptr %155, i64 %157
  store ptr %153, ptr %158, align 8, !tbaa !5
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.problem, ptr %159, i32 0, i32 2
  %161 = load ptr, ptr %160, align 8, !tbaa !21
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = load i32, ptr %16, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds i32, ptr %162, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds double, ptr %161, i64 %167
  %169 = load double, ptr %168, align 8, !tbaa !22
  %170 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 2
  %171 = load ptr, ptr %170, align 8, !tbaa !21
  %172 = load i32, ptr %17, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds double, ptr %171, i64 %173
  store double %169, ptr %174, align 8, !tbaa !22
  %175 = load i32, ptr %17, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %17, align 4, !tbaa !9
  br label %177

177:                                              ; preds = %142
  %178 = load i32, ptr %16, align 4, !tbaa !9
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %16, align 4, !tbaa !9
  br label %138, !llvm.loop !23

180:                                              ; preds = %138
  %181 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %181, ptr %16, align 4, !tbaa !9
  br label %182

182:                                              ; preds = %221, %180
  %183 = load i32, ptr %16, align 4, !tbaa !9
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %186, label %224

186:                                              ; preds = %182
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.problem, ptr %187, i32 0, i32 3
  %189 = load ptr, ptr %188, align 8, !tbaa !20
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = load i32, ptr %16, align 4, !tbaa !9
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds i32, ptr %190, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds ptr, ptr %189, i64 %195
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 3
  %199 = load ptr, ptr %198, align 8, !tbaa !20
  %200 = load i32, ptr %17, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds ptr, ptr %199, i64 %201
  store ptr %197, ptr %202, align 8, !tbaa !5
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.problem, ptr %203, i32 0, i32 2
  %205 = load ptr, ptr %204, align 8, !tbaa !21
  %206 = load ptr, ptr %12, align 8, !tbaa !5
  %207 = load i32, ptr %16, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds i32, ptr %206, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds double, ptr %205, i64 %211
  %213 = load double, ptr %212, align 8, !tbaa !22
  %214 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 2
  %215 = load ptr, ptr %214, align 8, !tbaa !21
  %216 = load i32, ptr %17, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds double, ptr %215, i64 %217
  store double %213, ptr %218, align 8, !tbaa !22
  %219 = load i32, ptr %17, align 4, !tbaa !9
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %17, align 4, !tbaa !9
  br label %221

221:                                              ; preds = %186
  %222 = load i32, ptr %16, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %16, align 4, !tbaa !9
  br label %182, !llvm.loop !24

224:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = call ptr @train(ptr noundef %18, ptr noundef %225)
  store ptr %226, ptr %19, align 8, !tbaa !5
  %227 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %227, ptr %16, align 4, !tbaa !9
  br label %228

228:                                              ; preds = %254, %224
  %229 = load i32, ptr %16, align 4, !tbaa !9
  %230 = load i32, ptr %15, align 4, !tbaa !9
  %231 = icmp slt i32 %229, %230
  br i1 %231, label %232, label %257

232:                                              ; preds = %228
  %233 = load ptr, ptr %19, align 8, !tbaa !5
  %234 = load ptr, ptr %5, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.problem, ptr %234, i32 0, i32 3
  %236 = load ptr, ptr %235, align 8, !tbaa !20
  %237 = load ptr, ptr %12, align 8, !tbaa !5
  %238 = load i32, ptr %16, align 4, !tbaa !9
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds i32, ptr %237, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !9
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds ptr, ptr %236, i64 %242
  %244 = load ptr, ptr %243, align 8, !tbaa !5
  %245 = call double @predict(ptr noundef %233, ptr noundef %244)
  %246 = load ptr, ptr %8, align 8, !tbaa !5
  %247 = load ptr, ptr %12, align 8, !tbaa !5
  %248 = load i32, ptr %16, align 4, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds i32, ptr %247, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !9
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds double, ptr %246, i64 %252
  store double %245, ptr %253, align 8, !tbaa !22
  br label %254

254:                                              ; preds = %232
  %255 = load i32, ptr %16, align 4, !tbaa !9
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %16, align 4, !tbaa !9
  br label %228, !llvm.loop !25

257:                                              ; preds = %228
  call void @free_and_destroy_model(ptr noundef %19)
  %258 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 3
  %259 = load ptr, ptr %258, align 8, !tbaa !20
  call void @free(ptr noundef %259) #6
  %260 = getelementptr inbounds %struct.problem, ptr %18, i32 0, i32 2
  %261 = load ptr, ptr %260, align 8, !tbaa !21
  call void @free(ptr noundef %261) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %262

262:                                              ; preds = %257
  %263 = load i32, ptr %9, align 4, !tbaa !9
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %9, align 4, !tbaa !9
  br label %96, !llvm.loop !26

265:                                              ; preds = %96
  %266 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %266) #6
  %267 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %267) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local double @predict(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @free_and_destroy_model(ptr noundef) #5

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS7problem", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !13, i64 24}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = !{!12, !13, i64 24}
!19 = !{!12, !10, i64 4}
!20 = !{!12, !6, i64 16}
!21 = !{!12, !6, i64 8}
!22 = !{!13, !13, i64 0}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}


; 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.problem = type { i32, i32, ptr, ptr, double }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [101 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @train(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @cross_validation(ptr nocapture noundef readonly %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #3 {
  %5 = alloca %struct.problem, align 8
  %6 = alloca ptr, align 8
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = shl nsw i64 %8, 2
  %10 = tail call noalias ptr @malloc(i64 noundef %9) #8
  %11 = icmp slt i32 %7, %2
  br i1 %11, label %12, label %15

12:                                               ; preds = %4
  %13 = load ptr, ptr @stderr, align 8, !tbaa !12
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.7) #9
  br label %15

15:                                               ; preds = %12, %4
  %.081 = phi i32 [ %7, %12 ], [ %2, %4 ]
  %16 = add i32 %.081, 1
  %17 = sext i32 %16 to i64
  %18 = shl nsw i64 %17, 2
  %19 = tail call noalias ptr @malloc(i64 noundef %18) #8
  %20 = icmp sgt i32 %7, 0
  br i1 %20, label %.lr.ph.preheader, label %.preheader90

.lr.ph.preheader:                                 ; preds = %15
  %wide.trip.count = zext nneg i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 8
  br i1 %min.iters.check, label %.lr.ph.preheader148, label %vector.ph

.lr.ph.preheader148:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %21 = getelementptr inbounds i32, ptr %10, i64 %index
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  store <4 x i32> %vec.ind, ptr %21, align 4, !tbaa !13
  store <4 x i32> %step.add, ptr %22, align 4, !tbaa !13
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %23 = icmp eq i64 %index.next, %n.vec
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader91, label %.lr.ph.preheader148

.preheader91:                                     ; preds = %.lr.ph, %middle.block
  br i1 %20, label %.lr.ph94.preheader, label %.preheader90

.lr.ph94.preheader:                               ; preds = %.preheader91
  %wide.trip.count115 = zext nneg i32 %7 to i64
  br label %.lr.ph94

.lr.ph:                                           ; preds = %.lr.ph.preheader148, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader148 ]
  %24 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv
  %25 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %25, ptr %24, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader91, label %.lr.ph, !llvm.loop !18

.preheader90:                                     ; preds = %.lr.ph94, %15, %.preheader91
  %.not95 = icmp slt i32 %.081, 0
  br i1 %.not95, label %._crit_edge110, label %.lr.ph97.preheader

.lr.ph97.preheader:                               ; preds = %.preheader90
  %wide.trip.count120 = zext i32 %16 to i64
  %xtraiter = and i64 %wide.trip.count120, 1
  %26 = icmp eq i32 %.081, 0
  br i1 %26, label %.lr.ph109.unr-lcssa, label %.lr.ph97.preheader.new

.lr.ph97.preheader.new:                           ; preds = %.lr.ph97.preheader
  %unroll_iter = and i64 %wide.trip.count120, 4294967294
  br label %.lr.ph97

.lr.ph94:                                         ; preds = %.lr.ph94.preheader, %.lr.ph94
  %indvars.iv112 = phi i64 [ 0, %.lr.ph94.preheader ], [ %indvars.iv.next113, %.lr.ph94 ]
  %27 = tail call i32 @rand() #10
  %28 = trunc i64 %indvars.iv112 to i32
  %29 = sub i32 %7, %28
  %30 = srem i32 %27, %29
  %31 = trunc nuw nsw i64 %indvars.iv112 to i32
  %32 = add nsw i32 %30, %31
  %33 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv112
  %34 = sext i32 %32 to i64
  %35 = getelementptr inbounds i32, ptr %10, i64 %34
  tail call void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %35)
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115
  br i1 %exitcond116.not, label %.preheader90, label %.lr.ph94, !llvm.loop !19

.lr.ph109.unr-lcssa:                              ; preds = %.lr.ph97, %.lr.ph97.preheader
  %indvars.iv117.unr = phi i64 [ 0, %.lr.ph97.preheader ], [ %indvars.iv.next118.1, %.lr.ph97 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph109, label %.lr.ph97.epil

.lr.ph97.epil:                                    ; preds = %.lr.ph109.unr-lcssa
  %36 = trunc i64 %indvars.iv117.unr to i32
  %37 = mul i32 %7, %36
  %38 = sdiv i32 %37, %.081
  %39 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv117.unr
  store i32 %38, ptr %39, align 4, !tbaa !13
  br label %.lr.ph109

.lr.ph109:                                        ; preds = %.lr.ph109.unr-lcssa, %.lr.ph97.epil
  %40 = getelementptr inbounds i8, ptr %0, i64 24
  %41 = getelementptr inbounds i8, ptr %5, i64 24
  %42 = getelementptr inbounds i8, ptr %0, i64 4
  %43 = getelementptr inbounds i8, ptr %5, i64 4
  %44 = getelementptr inbounds i8, ptr %5, i64 16
  %45 = getelementptr inbounds i8, ptr %5, i64 8
  %46 = getelementptr inbounds i8, ptr %0, i64 16
  %47 = getelementptr inbounds i8, ptr %0, i64 8
  %wide.trip.count145 = zext nneg i32 %.081 to i64
  %.pre = load i32, ptr %19, align 4, !tbaa !13
  %48 = add nsw i64 %8, -1
  %invariant.gep = getelementptr i8, ptr %10, i64 4
  br label %57

.lr.ph97:                                         ; preds = %.lr.ph97, %.lr.ph97.preheader.new
  %indvars.iv117 = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %indvars.iv.next118.1, %.lr.ph97 ]
  %niter = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %niter.next.1, %.lr.ph97 ]
  %49 = trunc i64 %indvars.iv117 to i32
  %50 = mul i32 %7, %49
  %51 = sdiv i32 %50, %.081
  %52 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv117
  store i32 %51, ptr %52, align 4, !tbaa !13
  %indvars.iv.next118 = or disjoint i64 %indvars.iv117, 1
  %53 = trunc i64 %indvars.iv.next118 to i32
  %54 = mul i32 %7, %53
  %55 = sdiv i32 %54, %.081
  %56 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv.next118
  store i32 %55, ptr %56, align 4, !tbaa !13
  %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.lr.ph109.unr-lcssa, label %.lr.ph97, !llvm.loop !20

57:                                               ; preds = %.lr.ph109, %._crit_edge107
  %58 = phi i32 [ %.pre, %.lr.ph109 ], [ %60, %._crit_edge107 ]
  %indvars.iv142 = phi i64 [ 0, %.lr.ph109 ], [ %indvars.iv.next143, %._crit_edge107 ]
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %59 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv.next143
  %60 = load i32, ptr %59, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #10
  %61 = load double, ptr %40, align 8, !tbaa !21
  store double %61, ptr %41, align 8, !tbaa !21
  %62 = load i32, ptr %42, align 4, !tbaa !22
  store i32 %62, ptr %43, align 4, !tbaa !22
  %.neg = sub i32 %58, %60
  %63 = add i32 %.neg, %7
  store i32 %63, ptr %5, align 8, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = shl nsw i64 %64, 3
  %66 = call noalias ptr @malloc(i64 noundef %65) #8
  store ptr %66, ptr %44, align 8, !tbaa !23
  %67 = call noalias ptr @malloc(i64 noundef %65) #8
  store ptr %67, ptr %45, align 8, !tbaa !24
  %68 = icmp sgt i32 %58, 0
  br i1 %68, label %.lr.ph100.preheader, label %.preheader

.lr.ph100.preheader:                              ; preds = %57
  %wide.trip.count127 = zext nneg i32 %58 to i64
  %xtraiter149 = and i64 %wide.trip.count127, 1
  %69 = icmp eq i32 %58, 1
  br i1 %69, label %.preheader.loopexit.unr-lcssa, label %.lr.ph100.preheader.new

.lr.ph100.preheader.new:                          ; preds = %.lr.ph100.preheader
  %unroll_iter151 = and i64 %wide.trip.count127, 2147483646
  br label %.lr.ph100

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph100, %.lr.ph100.preheader
  %indvars.iv122.unr = phi i64 [ 0, %.lr.ph100.preheader ], [ %indvars.iv.next123.1, %.lr.ph100 ]
  %lcmp.mod150.not = icmp eq i64 %xtraiter149, 0
  br i1 %lcmp.mod150.not, label %.preheader, label %.lr.ph100.epil

.lr.ph100.epil:                                   ; preds = %.preheader.loopexit.unr-lcssa
  %70 = load ptr, ptr %46, align 8, !tbaa !23
  %71 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv122.unr
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds ptr, ptr %70, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !12
  %76 = load ptr, ptr %44, align 8, !tbaa !23
  %77 = getelementptr inbounds ptr, ptr %76, i64 %indvars.iv122.unr
  store ptr %75, ptr %77, align 8, !tbaa !12
  %78 = load ptr, ptr %47, align 8, !tbaa !24
  %79 = getelementptr inbounds double, ptr %78, i64 %73
  %80 = load double, ptr %79, align 8, !tbaa !25
  %81 = load ptr, ptr %45, align 8, !tbaa !24
  %82 = getelementptr inbounds double, ptr %81, i64 %indvars.iv122.unr
  store double %80, ptr %82, align 8, !tbaa !25
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph100.epil, %.preheader.loopexit.unr-lcssa, %57
  %.0.lcssa = phi i32 [ 0, %57 ], [ %58, %.preheader.loopexit.unr-lcssa ], [ %58, %.lr.ph100.epil ]
  %83 = icmp slt i32 %60, %7
  br i1 %83, label %.lr.ph103.preheader, label %._crit_edge

.lr.ph103.preheader:                              ; preds = %.preheader
  %84 = zext nneg i32 %.0.lcssa to i64
  %85 = sext i32 %60 to i64
  %86 = sub nsw i64 %8, %85
  %xtraiter153 = and i64 %86, 1
  %lcmp.mod154.not = icmp eq i64 %xtraiter153, 0
  br i1 %lcmp.mod154.not, label %.lr.ph103.prol.loopexit, label %.lr.ph103.prol

.lr.ph103.prol:                                   ; preds = %.lr.ph103.preheader
  %87 = load ptr, ptr %46, align 8, !tbaa !23
  %88 = getelementptr inbounds i32, ptr %10, i64 %85
  %89 = load i32, ptr %88, align 4, !tbaa !13
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %87, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !12
  %93 = load ptr, ptr %44, align 8, !tbaa !23
  %94 = getelementptr inbounds ptr, ptr %93, i64 %84
  store ptr %92, ptr %94, align 8, !tbaa !12
  %95 = load ptr, ptr %47, align 8, !tbaa !24
  %96 = getelementptr inbounds double, ptr %95, i64 %90
  %97 = load double, ptr %96, align 8, !tbaa !25
  %98 = load ptr, ptr %45, align 8, !tbaa !24
  %99 = getelementptr inbounds double, ptr %98, i64 %84
  store double %97, ptr %99, align 8, !tbaa !25
  %indvars.iv.next130.prol = add nuw nsw i64 %84, 1
  %indvars.iv.next132.prol = add nsw i64 %85, 1
  br label %.lr.ph103.prol.loopexit

.lr.ph103.prol.loopexit:                          ; preds = %.lr.ph103.prol, %.lr.ph103.preheader
  %indvars.iv131.unr = phi i64 [ %85, %.lr.ph103.preheader ], [ %indvars.iv.next132.prol, %.lr.ph103.prol ]
  %indvars.iv129.unr = phi i64 [ %84, %.lr.ph103.preheader ], [ %indvars.iv.next130.prol, %.lr.ph103.prol ]
  %100 = icmp eq i64 %48, %85
  br i1 %100, label %._crit_edge, label %.lr.ph103

.lr.ph100:                                        ; preds = %.lr.ph100, %.lr.ph100.preheader.new
  %indvars.iv122 = phi i64 [ 0, %.lr.ph100.preheader.new ], [ %indvars.iv.next123.1, %.lr.ph100 ]
  %niter152 = phi i64 [ 0, %.lr.ph100.preheader.new ], [ %niter152.next.1, %.lr.ph100 ]
  %101 = load ptr, ptr %46, align 8, !tbaa !23
  %102 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv122
  %103 = load i32, ptr %102, align 4, !tbaa !13
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds ptr, ptr %101, i64 %104
  %106 = load ptr, ptr %105, align 8, !tbaa !12
  %107 = load ptr, ptr %44, align 8, !tbaa !23
  %108 = getelementptr inbounds ptr, ptr %107, i64 %indvars.iv122
  store ptr %106, ptr %108, align 8, !tbaa !12
  %109 = load ptr, ptr %47, align 8, !tbaa !24
  %110 = getelementptr inbounds double, ptr %109, i64 %104
  %111 = load double, ptr %110, align 8, !tbaa !25
  %112 = load ptr, ptr %45, align 8, !tbaa !24
  %113 = getelementptr inbounds double, ptr %112, i64 %indvars.iv122
  store double %111, ptr %113, align 8, !tbaa !25
  %indvars.iv.next123 = or disjoint i64 %indvars.iv122, 1
  %114 = load ptr, ptr %46, align 8, !tbaa !23
  %115 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next123
  %116 = load i32, ptr %115, align 4, !tbaa !13
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %114, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !12
  %120 = load ptr, ptr %44, align 8, !tbaa !23
  %121 = getelementptr inbounds ptr, ptr %120, i64 %indvars.iv.next123
  store ptr %119, ptr %121, align 8, !tbaa !12
  %122 = load ptr, ptr %47, align 8, !tbaa !24
  %123 = getelementptr inbounds double, ptr %122, i64 %117
  %124 = load double, ptr %123, align 8, !tbaa !25
  %125 = load ptr, ptr %45, align 8, !tbaa !24
  %126 = getelementptr inbounds double, ptr %125, i64 %indvars.iv.next123
  store double %124, ptr %126, align 8, !tbaa !25
  %indvars.iv.next123.1 = add nuw nsw i64 %indvars.iv122, 2
  %niter152.next.1 = add i64 %niter152, 2
  %niter152.ncmp.1 = icmp eq i64 %niter152.next.1, %unroll_iter151
  br i1 %niter152.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %.lr.ph100, !llvm.loop !26

.lr.ph103:                                        ; preds = %.lr.ph103.prol.loopexit, %.lr.ph103
  %indvars.iv131 = phi i64 [ %indvars.iv.next132.1, %.lr.ph103 ], [ %indvars.iv131.unr, %.lr.ph103.prol.loopexit ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130.1, %.lr.ph103 ], [ %indvars.iv129.unr, %.lr.ph103.prol.loopexit ]
  %127 = load ptr, ptr %46, align 8, !tbaa !23
  %128 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv131
  %129 = load i32, ptr %128, align 4, !tbaa !13
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds ptr, ptr %127, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !12
  %133 = load ptr, ptr %44, align 8, !tbaa !23
  %134 = getelementptr inbounds ptr, ptr %133, i64 %indvars.iv129
  store ptr %132, ptr %134, align 8, !tbaa !12
  %135 = load ptr, ptr %47, align 8, !tbaa !24
  %136 = getelementptr inbounds double, ptr %135, i64 %130
  %137 = load double, ptr %136, align 8, !tbaa !25
  %138 = load ptr, ptr %45, align 8, !tbaa !24
  %139 = getelementptr inbounds double, ptr %138, i64 %indvars.iv129
  store double %137, ptr %139, align 8, !tbaa !25
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %140 = load ptr, ptr %46, align 8, !tbaa !23
  %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv131
  %141 = load i32, ptr %gep, align 4, !tbaa !13
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds ptr, ptr %140, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !12
  %145 = load ptr, ptr %44, align 8, !tbaa !23
  %146 = getelementptr inbounds ptr, ptr %145, i64 %indvars.iv.next130
  store ptr %144, ptr %146, align 8, !tbaa !12
  %147 = load ptr, ptr %47, align 8, !tbaa !24
  %148 = getelementptr inbounds double, ptr %147, i64 %142
  %149 = load double, ptr %148, align 8, !tbaa !25
  %150 = load ptr, ptr %45, align 8, !tbaa !24
  %151 = getelementptr inbounds double, ptr %150, i64 %indvars.iv.next130
  store double %149, ptr %151, align 8, !tbaa !25
  %indvars.iv.next130.1 = add nuw nsw i64 %indvars.iv129, 2
  %indvars.iv.next132.1 = add nsw i64 %indvars.iv131, 2
  %exitcond137.not.1 = icmp eq i64 %indvars.iv.next132.1, %8
  br i1 %exitcond137.not.1, label %._crit_edge, label %.lr.ph103, !llvm.loop !27

._crit_edge:                                      ; preds = %.lr.ph103.prol.loopexit, %.lr.ph103, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #10
  %152 = call ptr @train(ptr noundef nonnull %5, ptr noundef %1)
  store ptr %152, ptr %6, align 8, !tbaa !12
  %153 = icmp slt i32 %58, %60
  br i1 %153, label %.lr.ph106.preheader, label %._crit_edge107

.lr.ph106.preheader:                              ; preds = %._crit_edge
  %154 = sext i32 %58 to i64
  br label %.lr.ph106

.lr.ph106:                                        ; preds = %.lr.ph106.preheader, %.lr.ph106
  %indvars.iv138 = phi i64 [ %154, %.lr.ph106.preheader ], [ %indvars.iv.next139, %.lr.ph106 ]
  %155 = load ptr, ptr %6, align 8, !tbaa !12
  %156 = load ptr, ptr %46, align 8, !tbaa !23
  %157 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv138
  %158 = load i32, ptr %157, align 4, !tbaa !13
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds ptr, ptr %156, i64 %159
  %161 = load ptr, ptr %160, align 8, !tbaa !12
  %162 = call double @predict(ptr noundef %155, ptr noundef %161)
  %163 = load i32, ptr %157, align 4, !tbaa !13
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds double, ptr %3, i64 %164
  store double %162, ptr %165, align 8, !tbaa !25
  %indvars.iv.next139 = add nsw i64 %indvars.iv138, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next139 to i32
  %exitcond141.not = icmp eq i32 %60, %lftr.wideiv
  br i1 %exitcond141.not, label %._crit_edge107, label %.lr.ph106, !llvm.loop !28

._crit_edge107:                                   ; preds = %.lr.ph106, %._crit_edge
  call void @free_and_destroy_model(ptr noundef nonnull %6)
  %166 = load ptr, ptr %44, align 8, !tbaa !23
  call void @free(ptr noundef %166) #10
  %167 = load ptr, ptr %45, align 8, !tbaa !24
  call void @free(ptr noundef %167) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #10
  %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145
  br i1 %exitcond146.not, label %._crit_edge110, label %57, !llvm.loop !29

._crit_edge110:                                   ; preds = %._crit_edge107, %.preheader90
  call void @free(ptr noundef %19) #10
  call void @free(ptr noundef %10) #10
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local double @predict(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @free_and_destroy_model(ptr noundef) local_unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nofree 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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { 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 #8 = { nounwind allocsize(0) }
attributes #9 = { cold nounwind }
attributes #10 = { 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, !7, i64 0}
!6 = !{!"_ZTS7problem", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !11, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15, !16, !17}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !15, !17, !16}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = !{!6, !11, i64 24}
!22 = !{!6, !7, i64 4}
!23 = !{!6, !10, i64 16}
!24 = !{!6, !10, i64 8}
!25 = !{!11, !11, i64 0}
!26 = distinct !{!26, !15}
!27 = distinct !{!27, !15}
!28 = distinct !{!28, !15}
!29 = distinct !{!29, !15}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass