; LLVM IR from hans-ob1/neural_cam_ros :: src/detector (network)

; 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.network = type { ptr, i32, i32, ptr, float, i32, float, float, ptr, i32, ptr, i32, float, float, float, float, i32, i32, i32, ptr, ptr, i32, i32, i32, float, float, float, i32, i32, i32, i32, i32, i32, float, float, float, float, float, i32, ptr }
%struct.data = type { i32, i32, %struct.matrix, %struct.matrix, i32, ptr, ptr }
%struct.matrix = type { i32, i32, ptr }

; 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 allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_network_output_size(ptr noundef byval(%struct.network) align 8) #3

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @network_predict(ptr noundef byval(%struct.network) align 8, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local { i64, ptr } @network_predict_data_multi(ptr noundef byval(%struct.network) align 8 %0, ptr noundef byval(%struct.data) align 8 %1, i32 noundef %2) #3 {
  %4 = alloca %struct.matrix, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store i32 %2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %13 = call i32 @get_network_output_size(ptr noundef byval(%struct.network) align 8 %0)
  store i32 %13, ptr %10, align 4, !tbaa !5
  %14 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %15 = getelementptr inbounds %struct.matrix, ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = load i32, ptr %10, align 4, !tbaa !5
  %18 = call { i64, ptr } @make_matrix(i32 noundef %16, i32 noundef %17)
  %19 = getelementptr inbounds { i64, ptr }, ptr %4, i32 0, i32 0
  %20 = extractvalue { i64, ptr } %18, 0
  store i64 %20, ptr %19, align 8
  %21 = getelementptr inbounds { i64, ptr }, ptr %4, i32 0, i32 1
  %22 = extractvalue { i64, ptr } %18, 1
  store ptr %22, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %23 = getelementptr inbounds %struct.network, ptr %0, i32 0, i32 2
  %24 = load i32, ptr %23, align 4, !tbaa !13
  %25 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %26 = getelementptr inbounds %struct.matrix, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = mul nsw i32 %24, %27
  %29 = sext i32 %28 to i64
  %30 = call noalias ptr @calloc(i64 noundef %29, i64 noundef 4) #7
  store ptr %30, ptr %11, align 8, !tbaa !16
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %143, %3
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %34 = getelementptr inbounds %struct.matrix, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !9
  %36 = icmp slt i32 %32, %35
  br i1 %36, label %37, label %148

37:                                               ; preds = %31
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %75, %37
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = getelementptr inbounds %struct.network, ptr %0, i32 0, i32 2
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %43, label %78

43:                                               ; preds = %38
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr %8, align 4, !tbaa !5
  %46 = add nsw i32 %44, %45
  %47 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %48 = getelementptr inbounds %struct.matrix, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !9
  %50 = icmp eq i32 %46, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %43
  br label %78

52:                                               ; preds = %43
  %53 = load ptr, ptr %11, align 8, !tbaa !16
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %56 = getelementptr inbounds %struct.matrix, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !17
  %58 = mul nsw i32 %54, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds float, ptr %53, i64 %59
  %61 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %62 = getelementptr inbounds %struct.matrix, ptr %61, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %64, %65
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds ptr, ptr %63, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !16
  %70 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %71 = getelementptr inbounds %struct.matrix, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !17
  %73 = sext i32 %72 to i64
  %74 = mul i64 %73, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %60, ptr align 4 %69, i64 %74, i1 false)
  br label %75

75:                                               ; preds = %52
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !5
  br label %38, !llvm.loop !19

78:                                               ; preds = %51, %38
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %139, %78
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %83, label %142

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %84 = load ptr, ptr %11, align 8, !tbaa !16
  %85 = call ptr @network_predict(ptr noundef byval(%struct.network) align 8 %0, ptr noundef %84)
  store ptr %85, ptr %12, align 8, !tbaa !16
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %135, %83
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = getelementptr inbounds %struct.network, ptr %0, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !13
  %90 = icmp slt i32 %87, %89
  br i1 %90, label %91, label %138

91:                                               ; preds = %86
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = add nsw i32 %92, %93
  %95 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %96 = getelementptr inbounds %struct.matrix, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 8, !tbaa !9
  %98 = icmp eq i32 %94, %97
  br i1 %98, label %99, label %100

99:                                               ; preds = %91
  br label %138

100:                                              ; preds = %91
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %131, %100
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %134

105:                                              ; preds = %101
  %106 = load ptr, ptr %12, align 8, !tbaa !16
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = mul nsw i32 %108, %109
  %111 = add nsw i32 %107, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds float, ptr %106, i64 %112
  %114 = load float, ptr %113, align 4, !tbaa !21
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sitofp i32 %115 to float
  %117 = fdiv float %114, %116
  %118 = getelementptr inbounds %struct.matrix, ptr %4, i32 0, i32 2
  %119 = load ptr, ptr %118, align 8, !tbaa !22
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = add nsw i32 %120, %121
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds ptr, ptr %119, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !16
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds float, ptr %125, i64 %127
  %129 = load float, ptr %128, align 4, !tbaa !21
  %130 = fadd float %129, %117
  store float %130, ptr %128, align 4, !tbaa !21
  br label %131

131:                                              ; preds = %105
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %7, align 4, !tbaa !5
  br label %101, !llvm.loop !23

134:                                              ; preds = %101
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %8, align 4, !tbaa !5
  br label %86, !llvm.loop !24

138:                                              ; preds = %99, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %9, align 4, !tbaa !5
  br label %79, !llvm.loop !25

142:                                              ; preds = %79
  br label %143

143:                                              ; preds = %142
  %144 = getelementptr inbounds %struct.network, ptr %0, i32 0, i32 2
  %145 = load i32, ptr %144, align 4, !tbaa !13
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = add nsw i32 %146, %145
  store i32 %147, ptr %6, align 4, !tbaa !5
  br label %31, !llvm.loop !26

148:                                              ; preds = %31
  %149 = load ptr, ptr %11, align 8, !tbaa !16
  call void @free(ptr noundef %149) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %150 = load { i64, ptr }, ptr %4, align 8
  ret { i64, ptr } %150
}

declare { i64, ptr } @make_matrix(i32 noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0,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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 #5 = { "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,1) }

!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/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"", !6, i64 0, !6, i64 4, !11, i64 8, !11, i64 24, !6, i64 40, !12, i64 48, !12, i64 56}
!11 = !{!"matrix", !6, i64 0, !6, i64 4, !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 12}
!14 = !{!"network", !12, i64 0, !6, i64 8, !6, i64 12, !12, i64 16, !15, i64 24, !6, i64 28, !15, i64 32, !15, i64 36, !12, i64 40, !6, i64 48, !12, i64 56, !6, i64 64, !15, i64 68, !15, i64 72, !15, i64 76, !15, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !12, i64 96, !12, i64 104, !6, i64 112, !6, i64 116, !6, i64 120, !15, i64 124, !15, i64 128, !15, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !15, i64 160, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !6, i64 180, !12, i64 184}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !6, i64 12}
!18 = !{!10, !12, i64 16}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!15, !15, i64 0}
!22 = !{!11, !12, i64 8}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}


; 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.network = type { ptr, i32, i32, ptr, float, i32, float, float, ptr, i32, ptr, i32, float, float, float, float, i32, i32, i32, ptr, ptr, i32, i32, i32, float, float, float, i32, i32, i32, i32, i32, i32, float, float, float, float, float, i32, ptr }
%struct.data = type { i32, i32, %struct.matrix, %struct.matrix, i32, ptr, ptr }
%struct.matrix = type { i32, i32, ptr }

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_network_output_size(ptr noundef byval(%struct.network) align 8) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @network_predict(ptr noundef byval(%struct.network) align 8, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local { i64, ptr } @network_predict_data_multi(ptr noundef byval(%struct.network) align 8 %0, ptr nocapture noundef readonly byval(%struct.data) align 8 %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = tail call i32 @get_network_output_size(ptr noundef nonnull byval(%struct.network) align 8 %0)
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = tail call { i64, ptr } @make_matrix(i32 noundef %6, i32 noundef %4) #5
  %8 = extractvalue { i64, ptr } %7, 1
  %9 = getelementptr inbounds i8, ptr %0, i64 12
  %10 = load i32, ptr %9, align 4, !tbaa !12
  %11 = mul nsw i32 %10, %6
  %12 = sext i32 %11 to i64
  %13 = tail call noalias ptr @calloc(i64 noundef %12, i64 noundef 4) #6
  %14 = icmp sgt i32 %6, 0
  br i1 %14, label %.preheader37.lr.ph, label %._crit_edge54

.preheader37.lr.ph:                               ; preds = %3
  %15 = getelementptr inbounds i8, ptr %1, i64 12
  %16 = load i32, ptr %15, align 4
  %17 = getelementptr inbounds i8, ptr %1, i64 16
  %18 = load ptr, ptr %17, align 8
  %19 = sext i32 %16 to i64
  %20 = shl nsw i64 %19, 2
  %21 = icmp sgt i32 %2, 0
  %22 = sitofp i32 %2 to float
  %sext91 = zext nneg i32 %6 to i64
  br i1 %21, label %.preheader37.lr.ph.split.us, label %.preheader37.lr.ph.split

.preheader37.lr.ph.split.us:                      ; preds = %.preheader37.lr.ph
  %23 = icmp sgt i32 %4, 0
  br i1 %23, label %.preheader37.us.us.preheader, label %.preheader37.us

.preheader37.us.us.preheader:                     ; preds = %.preheader37.lr.ph.split.us
  %sext102 = zext nneg i32 %6 to i64
  %wide.trip.count98 = zext nneg i32 %4 to i64
  %24 = shl nuw nsw i64 %wide.trip.count98, 2
  %min.iters.check = icmp ult i32 %4, 4
  %n.vec = and i64 %wide.trip.count98, 2147483644
  %broadcast.splatinsert = insertelement <4 x float> poison, float %22, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count98
  %xtraiter = and i64 %wide.trip.count98, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %25 = add nsw i64 %wide.trip.count98, -1
  br label %.preheader37.us.us

.preheader37.us.us:                               ; preds = %.preheader37.us.us.preheader, %._crit_edge51.split.us.us.us
  %26 = phi i32 [ %37, %._crit_edge51.split.us.us.us ], [ %10, %.preheader37.us.us.preheader ]
  %.052.us.us = phi i32 [ %72, %._crit_edge51.split.us.us.us ], [ 0, %.preheader37.us.us.preheader ]
  %27 = icmp sgt i32 %26, 0
  %28 = sext i32 %.052.us.us to i64
  br i1 %27, label %.lr.ph.us.us.preheader, label %.lr.ph50.us.us.preheader

.lr.ph.us.us.preheader:                           ; preds = %.preheader37.us.us
  %wide.trip.count93 = zext nneg i32 %26 to i64
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader, %31
  %indvars.iv89 = phi i64 [ 0, %.lr.ph.us.us.preheader ], [ %indvars.iv.next90, %31 ]
  %29 = add nsw i64 %indvars.iv89, %28
  %30 = icmp eq i64 %29, %sext91
  br i1 %30, label %.lr.ph50.us.us.preheader, label %31

31:                                               ; preds = %.lr.ph.us.us
  %32 = mul nsw i64 %indvars.iv89, %19
  %33 = getelementptr inbounds float, ptr %13, i64 %32
  %34 = getelementptr inbounds ptr, ptr %18, i64 %29
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %35, i64 %20, i1 false)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count93
  br i1 %exitcond94.not, label %.lr.ph50.us.us.preheader, label %.lr.ph.us.us, !llvm.loop !16

.lr.ph50.us.us.preheader:                         ; preds = %31, %.lr.ph.us.us, %.preheader37.us.us
  br label %.lr.ph50.us.us

.lr.ph50.us.us:                                   ; preds = %.lr.ph50.us.us.preheader, %._crit_edge46.split.us.us.us.us
  %.03248.us.us.us = phi i32 [ %39, %._crit_edge46.split.us.us.us.us ], [ 0, %.lr.ph50.us.us.preheader ]
  %36 = tail call ptr @network_predict(ptr noundef nonnull byval(%struct.network) align 8 %0, ptr noundef %13)
  %37 = load i32, ptr %9, align 4, !tbaa !12
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph45.us.us.us.preheader, label %._crit_edge46.split.us.us.us.us

.lr.ph45.us.us.us.preheader:                      ; preds = %.lr.ph50.us.us
  %wide.trip.count104 = zext nneg i32 %37 to i64
  %scevgep115 = getelementptr i8, ptr %36, i64 %24
  br label %.lr.ph45.us.us.us

._crit_edge46.split.us.us.us.us:                  ; preds = %._crit_edge42.us.us.us.us, %.lr.ph45.us.us.us, %.lr.ph50.us.us
  %39 = add nuw nsw i32 %.03248.us.us.us, 1
  %exitcond106.not = icmp eq i32 %39, %2
  br i1 %exitcond106.not, label %._crit_edge51.split.us.us.us, label %.lr.ph50.us.us, !llvm.loop !18

.lr.ph45.us.us.us:                                ; preds = %.lr.ph45.us.us.us.preheader, %._crit_edge42.us.us.us.us
  %indvars.iv100 = phi i64 [ 0, %.lr.ph45.us.us.us.preheader ], [ %indvars.iv.next101, %._crit_edge42.us.us.us.us ]
  %40 = trunc i64 %indvars.iv100 to i32
  %41 = mul i32 %4, %40
  %42 = zext i32 %41 to i64
  %43 = shl nuw nsw i64 %42, 2
  %scevgep114 = getelementptr i8, ptr %36, i64 %43
  %scevgep116 = getelementptr i8, ptr %scevgep115, i64 %43
  %44 = add nsw i64 %indvars.iv100, %28
  %45 = icmp eq i64 %44, %sext102
  br i1 %45, label %._crit_edge46.split.us.us.us.us, label %.preheader.us.us.us.us

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv95 = phi i64 [ %indvars.iv.next96.1, %scalar.ph ], [ %indvars.iv95.unr, %scalar.ph.prol.loopexit ]
  %gep = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv95
  %46 = load float, ptr %gep, align 4, !tbaa !19
  %47 = fdiv float %46, %22
  %48 = getelementptr inbounds float, ptr %57, i64 %indvars.iv95
  %49 = load float, ptr %48, align 4, !tbaa !19
  %50 = fadd float %47, %49
  store float %50, ptr %48, align 4, !tbaa !19
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %gep.1 = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv.next96
  %51 = load float, ptr %gep.1, align 4, !tbaa !19
  %52 = fdiv float %51, %22
  %53 = getelementptr inbounds float, ptr %57, i64 %indvars.iv.next96
  %54 = load float, ptr %53, align 4, !tbaa !19
  %55 = fadd float %52, %54
  store float %55, ptr %53, align 4, !tbaa !19
  %indvars.iv.next96.1 = add nuw nsw i64 %indvars.iv95, 2
  %exitcond99.not.1 = icmp eq i64 %indvars.iv.next96.1, %wide.trip.count98
  br i1 %exitcond99.not.1, label %._crit_edge42.us.us.us.us, label %scalar.ph, !llvm.loop !20

.preheader.us.us.us.us:                           ; preds = %.lr.ph45.us.us.us
  %56 = getelementptr inbounds ptr, ptr %8, i64 %44
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = trunc i64 %indvars.iv100 to i32
  %59 = mul i32 %4, %58
  %60 = zext i32 %59 to i64
  %invariant.gep = getelementptr inbounds float, ptr %36, i64 %60
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader.us.us.us.us
  %indvars.iv95.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.preheader.us.us.us.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %gep.prol = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv95.ph
  %61 = load float, ptr %gep.prol, align 4, !tbaa !19
  %62 = fdiv float %61, %22
  %63 = getelementptr inbounds float, ptr %57, i64 %indvars.iv95.ph
  %64 = load float, ptr %63, align 4, !tbaa !19
  %65 = fadd float %62, %64
  store float %65, ptr %63, align 4, !tbaa !19
  %indvars.iv.next96.prol = or disjoint i64 %indvars.iv95.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv95.unr = phi i64 [ %indvars.iv95.ph, %scalar.ph.preheader ], [ %indvars.iv.next96.prol, %scalar.ph.prol ]
  %66 = icmp eq i64 %indvars.iv95.ph, %25
  br i1 %66, label %._crit_edge42.us.us.us.us, label %scalar.ph

vector.memcheck:                                  ; preds = %.preheader.us.us.us.us
  %scevgep = getelementptr i8, ptr %57, i64 %24
  %bound0 = icmp ult ptr %57, %scevgep116
  %bound1 = icmp ult ptr %scevgep114, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %vector.memcheck, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
  %67 = getelementptr inbounds float, ptr %invariant.gep, i64 %index
  %wide.load = load <4 x float>, ptr %67, align 4, !tbaa !19, !alias.scope !22
  %68 = fdiv <4 x float> %wide.load, %broadcast.splat
  %69 = getelementptr inbounds float, ptr %57, i64 %index
  %wide.load117 = load <4 x float>, ptr %69, align 4, !tbaa !19, !alias.scope !25, !noalias !22
  %70 = fadd <4 x float> %68, %wide.load117
  store <4 x float> %70, ptr %69, align 4, !tbaa !19, !alias.scope !25, !noalias !22
  %index.next = add nuw i64 %index, 4
  %71 = icmp eq i64 %index.next, %n.vec
  br i1 %71, label %middle.block, label %vector.body, !llvm.loop !27

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge42.us.us.us.us, label %scalar.ph.preheader

._crit_edge42.us.us.us.us:                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count104
  br i1 %exitcond105.not, label %._crit_edge46.split.us.us.us.us, label %.lr.ph45.us.us.us, !llvm.loop !29

._crit_edge51.split.us.us.us:                     ; preds = %._crit_edge46.split.us.us.us.us
  %72 = add nsw i32 %37, %.052.us.us
  %73 = icmp slt i32 %72, %6
  br i1 %73, label %.preheader37.us.us, label %._crit_edge54, !llvm.loop !30

.preheader37.us:                                  ; preds = %.preheader37.lr.ph.split.us, %._crit_edge51.split.us57
  %74 = phi i32 [ %86, %._crit_edge51.split.us57 ], [ %10, %.preheader37.lr.ph.split.us ]
  %.052.us = phi i32 [ %87, %._crit_edge51.split.us57 ], [ 0, %.preheader37.lr.ph.split.us ]
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.lr.ph.us.preheader, label %._crit_edge46.split.us.preheader

.lr.ph.us.preheader:                              ; preds = %.preheader37.us
  %76 = sext i32 %.052.us to i64
  %wide.trip.count86 = zext nneg i32 %74 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %79
  %indvars.iv82 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next83, %79 ]
  %77 = add nsw i64 %indvars.iv82, %76
  %78 = icmp eq i64 %77, %sext91
  br i1 %78, label %._crit_edge46.split.us.preheader, label %79

79:                                               ; preds = %.lr.ph.us
  %80 = mul nsw i64 %indvars.iv82, %19
  %81 = getelementptr inbounds float, ptr %13, i64 %80
  %82 = getelementptr inbounds ptr, ptr %18, i64 %77
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %81, ptr align 4 %83, i64 %20, i1 false)
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count86
  br i1 %exitcond87.not, label %._crit_edge46.split.us.preheader, label %.lr.ph.us, !llvm.loop !16

._crit_edge46.split.us.preheader:                 ; preds = %79, %.lr.ph.us, %.preheader37.us
  br label %._crit_edge46.split.us

._crit_edge46.split.us:                           ; preds = %._crit_edge46.split.us.preheader, %._crit_edge46.split.us
  %.03248.us55 = phi i32 [ %85, %._crit_edge46.split.us ], [ 0, %._crit_edge46.split.us.preheader ]
  %84 = tail call ptr @network_predict(ptr noundef nonnull byval(%struct.network) align 8 %0, ptr noundef %13)
  %85 = add nuw nsw i32 %.03248.us55, 1
  %exitcond88.not = icmp eq i32 %85, %2
  br i1 %exitcond88.not, label %._crit_edge51.split.us57, label %._crit_edge46.split.us, !llvm.loop !18

._crit_edge51.split.us57:                         ; preds = %._crit_edge46.split.us
  %86 = load i32, ptr %9, align 4, !tbaa !12
  %87 = add nsw i32 %86, %.052.us
  %88 = icmp slt i32 %87, %6
  br i1 %88, label %.preheader37.us, label %._crit_edge54, !llvm.loop !30

.preheader37.lr.ph.split:                         ; preds = %.preheader37.lr.ph
  %89 = icmp sgt i32 %10, 0
  br i1 %89, label %.preheader37.lr.ph.split.split.us, label %._crit_edge54

.preheader37.lr.ph.split.split.us:                ; preds = %.preheader37.lr.ph.split
  %90 = zext nneg i32 %10 to i64
  %wide.trip.count77 = zext nneg i32 %10 to i64
  br label %.preheader37.us59

.preheader37.us59:                                ; preds = %._crit_edge.us63, %.preheader37.lr.ph.split.split.us
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %._crit_edge.us63 ], [ 0, %.preheader37.lr.ph.split.split.us ]
  br label %91

91:                                               ; preds = %.preheader37.us59, %94
  %indvars.iv73 = phi i64 [ 0, %.preheader37.us59 ], [ %indvars.iv.next74, %94 ]
  %92 = add nuw nsw i64 %indvars.iv73, %indvars.iv79
  %93 = icmp eq i64 %92, %sext91
  br i1 %93, label %._crit_edge.us63, label %94

94:                                               ; preds = %91
  %95 = mul nsw i64 %indvars.iv73, %19
  %96 = getelementptr inbounds float, ptr %13, i64 %95
  %97 = getelementptr inbounds ptr, ptr %18, i64 %92
  %98 = load ptr, ptr %97, align 8, !tbaa !15
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %96, ptr align 4 %98, i64 %20, i1 false)
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge.us63, label %91, !llvm.loop !16

._crit_edge.us63:                                 ; preds = %94, %91
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, %90
  %99 = icmp ult i64 %indvars.iv.next80, %sext91
  br i1 %99, label %.preheader37.us59, label %._crit_edge54, !llvm.loop !30

._crit_edge54:                                    ; preds = %._crit_edge.us63, %._crit_edge51.split.us57, %._crit_edge51.split.us.us.us, %.preheader37.lr.ph.split, %3
  tail call void @free(ptr noundef %13) #5
  ret { i64, ptr } %7
}

declare { i64, ptr } @make_matrix(i32 noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 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 #4 = { "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 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

!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 8}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 24, !7, i64 40, !11, i64 48, !11, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"matrix", !7, i64 0, !7, i64 4, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !7, i64 12}
!13 = !{!"network", !11, i64 0, !7, i64 8, !7, i64 12, !11, i64 16, !14, i64 24, !7, i64 28, !14, i64 32, !14, i64 36, !11, i64 40, !7, i64 48, !11, i64 56, !7, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !11, i64 96, !11, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !14, i64 124, !14, i64 128, !14, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !14, i64 160, !14, i64 164, !14, i64 168, !14, i64 172, !14, i64 176, !7, i64 180, !11, i64 184}
!14 = !{!"float", !8, i64 0}
!15 = !{!11, !11, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!14, !14, i64 0}
!20 = distinct !{!20, !17, !21}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !17, !21, !28}
!28 = !{!"llvm.loop.unroll.runtime.disable"}
!29 = distinct !{!29, !17}
!30 = distinct !{!30, !17}


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