; LLVM IR from buresjan/optim_lbm :: nomad/ext/sgtelib/src/TrainingSet.ll (ZN7SGTELIB11TrainingSet15compute_scalingEv)

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

%"class.SGTELIB::TrainingSet" = type { ptr, i32, i32, i32, i8, ptr, i8, i32, double, double, i32, %"class.SGTELIB::Matrix", %"class.SGTELIB::Matrix", %"class.SGTELIB::Matrix", %"class.SGTELIB::Matrix", %"class.SGTELIB::Matrix", i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double }
%"class.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; 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: mustprogress uwtable
define dso_local void @_ZN7SGTELIB11TrainingSet15compute_scalingEv(ptr noundef nonnull align 8 dereferenceable(504) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %5

5:                                                ; preds = %21, %1
  %6 = load i32, ptr %3, align 4, !tbaa !9
  %7 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 2
  %8 = load i32, ptr %7, align 4, !tbaa !11
  %9 = icmp slt i32 %6, %8
  br i1 %9, label %10, label %24

10:                                               ; preds = %5
  %11 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 21
  %12 = load ptr, ptr %11, align 8, !tbaa !19
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds double, ptr %12, i64 %14
  store double 1.000000e+00, ptr %15, align 8, !tbaa !20
  %16 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 22
  %17 = load ptr, ptr %16, align 8, !tbaa !21
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds double, ptr %17, i64 %19
  store double 0.000000e+00, ptr %20, align 8, !tbaa !20
  br label %21

21:                                               ; preds = %10
  %22 = load i32, ptr %3, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !9
  br label %5, !llvm.loop !22

24:                                               ; preds = %5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %41, %24
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 3
  %28 = load i32, ptr %27, align 8, !tbaa !24
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %30, label %44

30:                                               ; preds = %25
  %31 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 31
  %32 = load ptr, ptr %31, align 8, !tbaa !25
  %33 = load i32, ptr %3, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds double, ptr %32, i64 %34
  store double 1.000000e+00, ptr %35, align 8, !tbaa !20
  %36 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 32
  %37 = load ptr, ptr %36, align 8, !tbaa !26
  %38 = load i32, ptr %3, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds double, ptr %37, i64 %39
  store double 0.000000e+00, ptr %40, align 8, !tbaa !20
  br label %41

41:                                               ; preds = %30
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !9
  br label %25, !llvm.loop !27

44:                                               ; preds = %25
  call void @_ZN7SGTELIB11TrainingSet16compute_mean_stdEv(ptr noundef nonnull align 8 dereferenceable(504) %4)
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %91, %44
  %46 = load i32, ptr %3, align 4, !tbaa !9
  %47 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %50, label %94

50:                                               ; preds = %45
  %51 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 25
  %52 = load ptr, ptr %51, align 8, !tbaa !28
  %53 = load i32, ptr %3, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %52, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = icmp sgt i32 %56, 1
  br i1 %57, label %58, label %71

58:                                               ; preds = %50
  %59 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 24
  %60 = load ptr, ptr %59, align 8, !tbaa !29
  %61 = load i32, ptr %3, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !20
  %65 = fdiv double 1.000000e+00, %64
  %66 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 21
  %67 = load ptr, ptr %66, align 8, !tbaa !19
  %68 = load i32, ptr %3, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %67, i64 %69
  store double %65, ptr %70, align 8, !tbaa !20
  br label %71

71:                                               ; preds = %58, %50
  %72 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 23
  %73 = load ptr, ptr %72, align 8, !tbaa !30
  %74 = load i32, ptr %3, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds double, ptr %73, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !20
  %78 = fneg double %77
  %79 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 21
  %80 = load ptr, ptr %79, align 8, !tbaa !19
  %81 = load i32, ptr %3, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %80, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !20
  %85 = fmul double %78, %84
  %86 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 22
  %87 = load ptr, ptr %86, align 8, !tbaa !21
  %88 = load i32, ptr %3, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %87, i64 %89
  store double %85, ptr %90, align 8, !tbaa !20
  br label %91

91:                                               ; preds = %71
  %92 = load i32, ptr %3, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %3, align 4, !tbaa !9
  br label %45, !llvm.loop !31

94:                                               ; preds = %45
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %141, %94
  %96 = load i32, ptr %3, align 4, !tbaa !9
  %97 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 3
  %98 = load i32, ptr %97, align 8, !tbaa !24
  %99 = icmp slt i32 %96, %98
  br i1 %99, label %100, label %144

100:                                              ; preds = %95
  %101 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 36
  %102 = load ptr, ptr %101, align 8, !tbaa !32
  %103 = load i32, ptr %3, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %102, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = icmp sgt i32 %106, 1
  br i1 %107, label %108, label %121

108:                                              ; preds = %100
  %109 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 34
  %110 = load ptr, ptr %109, align 8, !tbaa !33
  %111 = load i32, ptr %3, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %110, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !20
  %115 = fdiv double 1.000000e+00, %114
  %116 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 31
  %117 = load ptr, ptr %116, align 8, !tbaa !25
  %118 = load i32, ptr %3, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds double, ptr %117, i64 %119
  store double %115, ptr %120, align 8, !tbaa !20
  br label %121

121:                                              ; preds = %108, %100
  %122 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 33
  %123 = load ptr, ptr %122, align 8, !tbaa !34
  %124 = load i32, ptr %3, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %123, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !20
  %128 = fneg double %127
  %129 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 31
  %130 = load ptr, ptr %129, align 8, !tbaa !25
  %131 = load i32, ptr %3, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds double, ptr %130, i64 %132
  %134 = load double, ptr %133, align 8, !tbaa !20
  %135 = fmul double %128, %134
  %136 = getelementptr inbounds %"class.SGTELIB::TrainingSet", ptr %4, i32 0, i32 32
  %137 = load ptr, ptr %136, align 8, !tbaa !26
  %138 = load i32, ptr %3, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds double, ptr %137, i64 %139
  store double %135, ptr %140, align 8, !tbaa !20
  br label %141

141:                                              ; preds = %121
  %142 = load i32, ptr %3, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %3, align 4, !tbaa !9
  br label %95, !llvm.loop !35

144:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SGTELIB11TrainingSet16compute_mean_stdEv(ptr noundef nonnull align 8 dereferenceable(504)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"_ZTSN7SGTELIB11TrainingSetE", !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20, !6, i64 24, !13, i64 32, !10, i64 36, !14, i64 40, !14, i64 48, !10, i64 56, !15, i64 64, !15, i64 120, !15, i64 176, !15, i64 232, !15, i64 288, !10, i64 344, !10, i64 348, !10, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !10, i64 416, !10, i64 420, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !14, i64 496}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTSN7SGTELIB6MatrixE", !16, i64 8, !10, i64 40, !10, i64 44, !6, i64 48}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !18, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!12, !6, i64 376}
!20 = !{!14, !14, i64 0}
!21 = !{!12, !6, i64 384}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!12, !10, i64 16}
!25 = !{!12, !6, i64 448}
!26 = !{!12, !6, i64 456}
!27 = distinct !{!27, !23}
!28 = !{!12, !6, i64 408}
!29 = !{!12, !6, i64 400}
!30 = !{!12, !6, i64 392}
!31 = distinct !{!31, !23}
!32 = !{!12, !6, i64 488}
!33 = !{!12, !6, i64 472}
!34 = !{!12, !6, i64 464}
!35 = distinct !{!35, !23}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB11TrainingSet15compute_scalingEv(ptr noundef nonnull align 8 dereferenceable(504) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 12
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.preheader24

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 376
  %6 = load ptr, ptr %5, align 8, !tbaa !17
  %7 = getelementptr inbounds i8, ptr %0, i64 384
  %8 = load ptr, ptr %7, align 8, !tbaa !18
  %wide.trip.count = zext nneg i32 %3 to i64
  %min.iters.check = icmp ult i32 %3, 4
  %9 = ptrtoint ptr %8 to i64
  %10 = ptrtoint ptr %6 to i64
  %11 = sub i64 %9, %10
  %diff.check = icmp ult i64 %11, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %12 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.prol
  store double 1.000000e+00, ptr %12, align 8, !tbaa !19
  %13 = getelementptr inbounds double, ptr %8, i64 %indvars.iv.prol
  store double 0.000000e+00, ptr %13, align 8, !tbaa !19
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !20

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %14 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %15 = icmp ugt i64 %14, -4
  br i1 %15, label %.preheader24, label %scalar.ph

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %16 = getelementptr inbounds double, ptr %6, i64 %index
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %16, align 8, !tbaa !19
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %17, align 8, !tbaa !19
  %18 = getelementptr inbounds double, ptr %8, i64 %index
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store <2 x double> zeroinitializer, ptr %18, align 8, !tbaa !19
  store <2 x double> zeroinitializer, ptr %19, align 8, !tbaa !19
  %index.next = add nuw i64 %index, 4
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !22

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

.preheader24:                                     ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %1
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load i32, ptr %21, align 8, !tbaa !26
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph28, label %._crit_edge

.lr.ph28:                                         ; preds = %.preheader24
  %24 = getelementptr inbounds i8, ptr %0, i64 448
  %25 = load ptr, ptr %24, align 8, !tbaa !27
  %26 = getelementptr inbounds i8, ptr %0, i64 456
  %27 = load ptr, ptr %26, align 8, !tbaa !28
  %wide.trip.count39 = zext nneg i32 %22 to i64
  %min.iters.check59 = icmp ult i32 %22, 4
  %28 = ptrtoint ptr %27 to i64
  %29 = ptrtoint ptr %25 to i64
  %30 = sub i64 %28, %29
  %diff.check56 = icmp ult i64 %30, 32
  %or.cond72 = select i1 %min.iters.check59, i1 true, i1 %diff.check56
  br i1 %or.cond72, label %scalar.ph58.preheader, label %vector.ph60

scalar.ph58.preheader:                            ; preds = %middle.block57, %.lr.ph28
  %indvars.iv36.ph = phi i64 [ 0, %.lr.ph28 ], [ %n.vec62, %middle.block57 ]
  %xtraiter73 = and i64 %wide.trip.count39, 3
  %lcmp.mod74.not = icmp eq i64 %xtraiter73, 0
  br i1 %lcmp.mod74.not, label %scalar.ph58.prol.loopexit, label %scalar.ph58.prol

scalar.ph58.prol:                                 ; preds = %scalar.ph58.preheader, %scalar.ph58.prol
  %indvars.iv36.prol = phi i64 [ %indvars.iv.next37.prol, %scalar.ph58.prol ], [ %indvars.iv36.ph, %scalar.ph58.preheader ]
  %prol.iter75 = phi i64 [ %prol.iter75.next, %scalar.ph58.prol ], [ 0, %scalar.ph58.preheader ]
  %31 = getelementptr inbounds double, ptr %25, i64 %indvars.iv36.prol
  store double 1.000000e+00, ptr %31, align 8, !tbaa !19
  %32 = getelementptr inbounds double, ptr %27, i64 %indvars.iv36.prol
  store double 0.000000e+00, ptr %32, align 8, !tbaa !19
  %indvars.iv.next37.prol = add nuw nsw i64 %indvars.iv36.prol, 1
  %prol.iter75.next = add i64 %prol.iter75, 1
  %prol.iter75.cmp.not = icmp eq i64 %prol.iter75.next, %xtraiter73
  br i1 %prol.iter75.cmp.not, label %scalar.ph58.prol.loopexit, label %scalar.ph58.prol, !llvm.loop !29

scalar.ph58.prol.loopexit:                        ; preds = %scalar.ph58.prol, %scalar.ph58.preheader
  %indvars.iv36.unr = phi i64 [ %indvars.iv36.ph, %scalar.ph58.preheader ], [ %indvars.iv.next37.prol, %scalar.ph58.prol ]
  %33 = sub nsw i64 %indvars.iv36.ph, %wide.trip.count39
  %34 = icmp ugt i64 %33, -4
  br i1 %34, label %._crit_edge, label %scalar.ph58

vector.ph60:                                      ; preds = %.lr.ph28
  %n.vec62 = and i64 %wide.trip.count39, 2147483644
  br label %vector.body64

vector.body64:                                    ; preds = %vector.body64, %vector.ph60
  %index65 = phi i64 [ 0, %vector.ph60 ], [ %index.next66, %vector.body64 ]
  %35 = getelementptr inbounds double, ptr %25, i64 %index65
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %35, align 8, !tbaa !19
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %36, align 8, !tbaa !19
  %37 = getelementptr inbounds double, ptr %27, i64 %index65
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <2 x double> zeroinitializer, ptr %37, align 8, !tbaa !19
  store <2 x double> zeroinitializer, ptr %38, align 8, !tbaa !19
  %index.next66 = add nuw i64 %index65, 4
  %39 = icmp eq i64 %index.next66, %n.vec62
  br i1 %39, label %middle.block57, label %vector.body64, !llvm.loop !30

middle.block57:                                   ; preds = %vector.body64
  %cmp.n67 = icmp eq i64 %n.vec62, %wide.trip.count39
  br i1 %cmp.n67, label %._crit_edge, label %scalar.ph58.preheader

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %40 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  store double 1.000000e+00, ptr %40, align 8, !tbaa !19
  %41 = getelementptr inbounds double, ptr %8, i64 %indvars.iv
  store double 0.000000e+00, ptr %41, align 8, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next
  store double 1.000000e+00, ptr %42, align 8, !tbaa !19
  %43 = getelementptr inbounds double, ptr %8, i64 %indvars.iv.next
  store double 0.000000e+00, ptr %43, align 8, !tbaa !19
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %44 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next.1
  store double 1.000000e+00, ptr %44, align 8, !tbaa !19
  %45 = getelementptr inbounds double, ptr %8, i64 %indvars.iv.next.1
  store double 0.000000e+00, ptr %45, align 8, !tbaa !19
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %46 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next.2
  store double 1.000000e+00, ptr %46, align 8, !tbaa !19
  %47 = getelementptr inbounds double, ptr %8, i64 %indvars.iv.next.2
  store double 0.000000e+00, ptr %47, align 8, !tbaa !19
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %.preheader24, label %scalar.ph, !llvm.loop !31

scalar.ph58:                                      ; preds = %scalar.ph58.prol.loopexit, %scalar.ph58
  %indvars.iv36 = phi i64 [ %indvars.iv.next37.3, %scalar.ph58 ], [ %indvars.iv36.unr, %scalar.ph58.prol.loopexit ]
  %48 = getelementptr inbounds double, ptr %25, i64 %indvars.iv36
  store double 1.000000e+00, ptr %48, align 8, !tbaa !19
  %49 = getelementptr inbounds double, ptr %27, i64 %indvars.iv36
  store double 0.000000e+00, ptr %49, align 8, !tbaa !19
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %50 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next37
  store double 1.000000e+00, ptr %50, align 8, !tbaa !19
  %51 = getelementptr inbounds double, ptr %27, i64 %indvars.iv.next37
  store double 0.000000e+00, ptr %51, align 8, !tbaa !19
  %indvars.iv.next37.1 = add nuw nsw i64 %indvars.iv36, 2
  %52 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next37.1
  store double 1.000000e+00, ptr %52, align 8, !tbaa !19
  %53 = getelementptr inbounds double, ptr %27, i64 %indvars.iv.next37.1
  store double 0.000000e+00, ptr %53, align 8, !tbaa !19
  %indvars.iv.next37.2 = add nuw nsw i64 %indvars.iv36, 3
  %54 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next37.2
  store double 1.000000e+00, ptr %54, align 8, !tbaa !19
  %55 = getelementptr inbounds double, ptr %27, i64 %indvars.iv.next37.2
  store double 0.000000e+00, ptr %55, align 8, !tbaa !19
  %indvars.iv.next37.3 = add nuw nsw i64 %indvars.iv36, 4
  %exitcond40.not.3 = icmp eq i64 %indvars.iv.next37.3, %wide.trip.count39
  br i1 %exitcond40.not.3, label %._crit_edge, label %scalar.ph58, !llvm.loop !32

._crit_edge:                                      ; preds = %scalar.ph58.prol.loopexit, %scalar.ph58, %middle.block57, %.preheader24
  tail call void @_ZN7SGTELIB11TrainingSet16compute_mean_stdEv(ptr noundef nonnull align 8 dereferenceable(504) %0)
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph31, label %.preheader

.lr.ph31:                                         ; preds = %._crit_edge
  %58 = getelementptr inbounds i8, ptr %0, i64 408
  %59 = load ptr, ptr %58, align 8, !tbaa !33
  %60 = getelementptr inbounds i8, ptr %0, i64 400
  %61 = load ptr, ptr %60, align 8
  %62 = getelementptr inbounds i8, ptr %0, i64 376
  %63 = load ptr, ptr %62, align 8
  %64 = getelementptr inbounds i8, ptr %0, i64 392
  %65 = load ptr, ptr %64, align 8, !tbaa !34
  %66 = getelementptr inbounds i8, ptr %0, i64 384
  %67 = load ptr, ptr %66, align 8, !tbaa !18
  %wide.trip.count44 = zext nneg i32 %56 to i64
  br label %80

.preheader:                                       ; preds = %89, %._crit_edge
  %68 = load i32, ptr %21, align 8, !tbaa !26
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph33, label %._crit_edge34

.lr.ph33:                                         ; preds = %.preheader
  %70 = getelementptr inbounds i8, ptr %0, i64 488
  %71 = load ptr, ptr %70, align 8, !tbaa !35
  %72 = getelementptr inbounds i8, ptr %0, i64 472
  %73 = load ptr, ptr %72, align 8
  %74 = getelementptr inbounds i8, ptr %0, i64 448
  %75 = load ptr, ptr %74, align 8
  %76 = getelementptr inbounds i8, ptr %0, i64 464
  %77 = load ptr, ptr %76, align 8, !tbaa !36
  %78 = getelementptr inbounds i8, ptr %0, i64 456
  %79 = load ptr, ptr %78, align 8, !tbaa !28
  %wide.trip.count49 = zext nneg i32 %68 to i64
  br label %96

80:                                               ; preds = %.lr.ph31, %89
  %indvars.iv41 = phi i64 [ 0, %.lr.ph31 ], [ %indvars.iv.next42, %89 ]
  %81 = getelementptr inbounds i32, ptr %59, i64 %indvars.iv41
  %82 = load i32, ptr %81, align 4, !tbaa !37
  %83 = icmp sgt i32 %82, 1
  br i1 %83, label %84, label %._crit_edge51

._crit_edge51:                                    ; preds = %80
  %.phi.trans.insert = getelementptr inbounds double, ptr %63, i64 %indvars.iv41
  %.pre = load double, ptr %.phi.trans.insert, align 8, !tbaa !19
  br label %89

84:                                               ; preds = %80
  %85 = getelementptr inbounds double, ptr %61, i64 %indvars.iv41
  %86 = load double, ptr %85, align 8, !tbaa !19
  %87 = fdiv double 1.000000e+00, %86
  %88 = getelementptr inbounds double, ptr %63, i64 %indvars.iv41
  store double %87, ptr %88, align 8, !tbaa !19
  br label %89

89:                                               ; preds = %._crit_edge51, %84
  %90 = phi double [ %.pre, %._crit_edge51 ], [ %87, %84 ]
  %91 = getelementptr inbounds double, ptr %65, i64 %indvars.iv41
  %92 = load double, ptr %91, align 8, !tbaa !19
  %93 = fneg double %92
  %94 = fmul double %90, %93
  %95 = getelementptr inbounds double, ptr %67, i64 %indvars.iv41
  store double %94, ptr %95, align 8, !tbaa !19
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %exitcond45.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count44
  br i1 %exitcond45.not, label %.preheader, label %80, !llvm.loop !38

96:                                               ; preds = %.lr.ph33, %105
  %indvars.iv46 = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next47, %105 ]
  %97 = getelementptr inbounds i32, ptr %71, i64 %indvars.iv46
  %98 = load i32, ptr %97, align 4, !tbaa !37
  %99 = icmp sgt i32 %98, 1
  br i1 %99, label %100, label %._crit_edge52

._crit_edge52:                                    ; preds = %96
  %.phi.trans.insert53 = getelementptr inbounds double, ptr %75, i64 %indvars.iv46
  %.pre54 = load double, ptr %.phi.trans.insert53, align 8, !tbaa !19
  br label %105

100:                                              ; preds = %96
  %101 = getelementptr inbounds double, ptr %73, i64 %indvars.iv46
  %102 = load double, ptr %101, align 8, !tbaa !19
  %103 = fdiv double 1.000000e+00, %102
  %104 = getelementptr inbounds double, ptr %75, i64 %indvars.iv46
  store double %103, ptr %104, align 8, !tbaa !19
  br label %105

105:                                              ; preds = %._crit_edge52, %100
  %106 = phi double [ %.pre54, %._crit_edge52 ], [ %103, %100 ]
  %107 = getelementptr inbounds double, ptr %77, i64 %indvars.iv46
  %108 = load double, ptr %107, align 8, !tbaa !19
  %109 = fneg double %108
  %110 = fmul double %106, %109
  %111 = getelementptr inbounds double, ptr %79, i64 %indvars.iv46
  store double %110, ptr %111, align 8, !tbaa !19
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count49
  br i1 %exitcond50.not, label %._crit_edge34, label %96, !llvm.loop !39

._crit_edge34:                                    ; preds = %105, %.preheader
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SGTELIB11TrainingSet16compute_mean_stdEv(ptr noundef nonnull align 8 dereferenceable(504)) local_unnamed_addr #0 align 2

attributes #0 = { 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" }

!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 12}
!6 = !{!"_ZTSN7SGTELIB11TrainingSetE", !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 20, !11, i64 24, !10, i64 32, !7, i64 36, !12, i64 40, !12, i64 48, !7, i64 56, !13, i64 64, !13, i64 120, !13, i64 176, !13, i64 232, !13, i64 288, !7, i64 344, !7, i64 348, !7, i64 352, !11, i64 360, !11, i64 368, !11, i64 376, !11, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !7, i64 416, !7, i64 420, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !12, i64 496}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!"_ZTSN7SGTELIB6MatrixE", !14, i64 8, !7, i64 40, !7, i64 44, !11, i64 48}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !8, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!6, !11, i64 376}
!18 = !{!6, !11, i64 384}
!19 = !{!12, !12, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !23, !24, !25}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = !{!6, !7, i64 16}
!27 = !{!6, !11, i64 448}
!28 = !{!6, !11, i64 456}
!29 = distinct !{!29, !21}
!30 = distinct !{!30, !23, !24, !25}
!31 = distinct !{!31, !23, !24}
!32 = distinct !{!32, !23, !24}
!33 = !{!6, !11, i64 408}
!34 = !{!6, !11, i64 392}
!35 = !{!6, !11, i64 488}
!36 = !{!6, !11, i64 464}
!37 = !{!7, !7, i64 0}
!38 = distinct !{!38, !23}
!39 = distinct !{!39, !23}


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