; 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

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

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

28:                                               ; preds = %126, %2
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %31 = getelementptr inbounds %struct.matrix, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %34, label %131

34:                                               ; preds = %28
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %72, %34
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = getelementptr inbounds %struct.network, ptr %0, i32 0, i32 2
  %38 = load i32, ptr %37, align 4, !tbaa !13
  %39 = icmp slt i32 %36, %38
  br i1 %39, label %40, label %75

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

48:                                               ; preds = %40
  br label %75

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

72:                                               ; preds = %49
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %6, align 4, !tbaa !5
  br label %35, !llvm.loop !19

75:                                               ; preds = %48, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %76 = load ptr, ptr %8, align 8, !tbaa !17
  %77 = call ptr @network_predict(ptr noundef byval(%struct.network) align 8 %0, ptr noundef %76)
  store ptr %77, ptr %9, align 8, !tbaa !17
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %122, %75
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = getelementptr inbounds %struct.network, ptr %0, i32 0, i32 2
  %81 = load i32, ptr %80, align 4, !tbaa !13
  %82 = icmp slt i32 %79, %81
  br i1 %82, label %83, label %125

83:                                               ; preds = %78
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = add nsw i32 %84, %85
  %87 = getelementptr inbounds %struct.data, ptr %1, i32 0, i32 2
  %88 = getelementptr inbounds %struct.matrix, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !9
  %90 = icmp eq i32 %86, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  br label %125

92:                                               ; preds = %83
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %118, %92
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %121

97:                                               ; preds = %93
  %98 = load ptr, ptr %9, align 8, !tbaa !17
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = mul nsw i32 %100, %101
  %103 = add nsw i32 %99, %102
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds float, ptr %98, i64 %104
  %106 = load float, ptr %105, align 4, !tbaa !21
  %107 = getelementptr inbounds %struct.matrix, ptr %3, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !22
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = add nsw i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %108, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !17
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds float, ptr %114, i64 %116
  store float %106, ptr %117, align 4, !tbaa !21
  br label %118

118:                                              ; preds = %97
  %119 = load i32, ptr %5, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %5, align 4, !tbaa !5
  br label %93, !llvm.loop !23

121:                                              ; preds = %93
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %6, align 4, !tbaa !5
  br label %78, !llvm.loop !24

125:                                              ; preds = %91, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %126

126:                                              ; preds = %125
  %127 = getelementptr inbounds %struct.network, ptr %0, i32 0, i32 2
  %128 = load i32, ptr %127, align 4, !tbaa !13
  %129 = load i32, ptr %4, align 4, !tbaa !5
  %130 = add nsw i32 %129, %128
  store i32 %130, ptr %4, align 4, !tbaa !5
  br label %28, !llvm.loop !25

131:                                              ; preds = %28
  %132 = load ptr, ptr %8, align 8, !tbaa !17
  call void @free(ptr noundef %132) #6
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %133 = load { i64, ptr }, ptr %3, align 8
  ret { i64, ptr } %133
}

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 = !{!10, !6, i64 12}
!17 = !{!12, !12, i64 0}
!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}


; 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

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

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

.preheader31.lr.ph:                               ; preds = %2
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load ptr, ptr %16, align 8
  %18 = sext i32 %11 to i64
  %19 = shl nsw i64 %18, 2
  %20 = icmp sgt i32 %3, 0
  %sext52 = zext nneg i32 %5 to i64
  br i1 %20, label %.preheader31.us.preheader, label %.preheader31

.preheader31.us.preheader:                        ; preds = %.preheader31.lr.ph
  %sext63 = zext nneg i32 %5 to i64
  %wide.trip.count59 = zext nneg i32 %3 to i64
  %min.iters.check = icmp ult i32 %3, 8
  %n.vec = and i64 %wide.trip.count59, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count59
  %xtraiter = and i64 %wide.trip.count59, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader31.us

.preheader31.us:                                  ; preds = %.preheader31.us.preheader, %._crit_edge40.split.us.us
  %21 = phi i32 [ %32, %._crit_edge40.split.us.us ], [ %9, %.preheader31.us.preheader ]
  %.044.us = phi i32 [ %36, %._crit_edge40.split.us.us ], [ 0, %.preheader31.us.preheader ]
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph.us.preheader, label %._crit_edge.us

.lr.ph.us.preheader:                              ; preds = %.preheader31.us
  %23 = sext i32 %.044.us to i64
  %wide.trip.count54 = zext nneg i32 %21 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %26
  %indvars.iv50 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next51, %26 ]
  %24 = add nsw i64 %indvars.iv50, %23
  %25 = icmp eq i64 %24, %sext52
  br i1 %25, label %._crit_edge.us, label %26

26:                                               ; preds = %.lr.ph.us
  %27 = mul nsw i64 %indvars.iv50, %18
  %28 = getelementptr inbounds float, ptr %14, i64 %27
  %29 = getelementptr inbounds ptr, ptr %17, i64 %24
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %30, i64 %19, i1 false)
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count54
  br i1 %exitcond55.not, label %._crit_edge.us, label %.lr.ph.us, !llvm.loop !17

._crit_edge.us:                                   ; preds = %26, %.lr.ph.us, %.preheader31.us
  %31 = tail call ptr @network_predict(ptr noundef nonnull byval(%struct.network) align 8 %0, ptr noundef %14)
  %32 = load i32, ptr %8, align 4, !tbaa !12
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph39.us.preheader, label %._crit_edge40.split.us.us

.lr.ph39.us.preheader:                            ; preds = %._crit_edge.us
  %34 = ptrtoint ptr %31 to i64
  %35 = sext i32 %.044.us to i64
  %wide.trip.count65 = zext nneg i32 %32 to i64
  br label %.lr.ph39.us

._crit_edge40.split.us.us:                        ; preds = %._crit_edge36.us.us, %.lr.ph39.us, %._crit_edge.us
  %36 = add nsw i32 %32, %.044.us
  %37 = icmp slt i32 %36, %5
  br i1 %37, label %.preheader31.us, label %._crit_edge46, !llvm.loop !19

.lr.ph39.us:                                      ; preds = %.lr.ph39.us.preheader, %._crit_edge36.us.us
  %indvars.iv61 = phi i64 [ 0, %.lr.ph39.us.preheader ], [ %indvars.iv.next62, %._crit_edge36.us.us ]
  %38 = trunc i64 %indvars.iv61 to i32
  %39 = mul i32 %3, %38
  %40 = zext i32 %39 to i64
  %41 = shl nuw nsw i64 %40, 2
  %42 = add nsw i64 %indvars.iv61, %35
  %43 = icmp eq i64 %42, %sext63
  br i1 %43, label %._crit_edge40.split.us.us, label %.preheader.us.us

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv56 = phi i64 [ %indvars.iv.next57.3, %scalar.ph ], [ %indvars.iv56.unr, %scalar.ph.prol.loopexit ]
  %gep = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv56
  %44 = load float, ptr %gep, align 4, !tbaa !20
  %45 = getelementptr inbounds float, ptr %53, i64 %indvars.iv56
  store float %44, ptr %45, align 4, !tbaa !20
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %gep.1 = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv.next57
  %46 = load float, ptr %gep.1, align 4, !tbaa !20
  %47 = getelementptr inbounds float, ptr %53, i64 %indvars.iv.next57
  store float %46, ptr %47, align 4, !tbaa !20
  %indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 2
  %gep.2 = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv.next57.1
  %48 = load float, ptr %gep.2, align 4, !tbaa !20
  %49 = getelementptr inbounds float, ptr %53, i64 %indvars.iv.next57.1
  store float %48, ptr %49, align 4, !tbaa !20
  %indvars.iv.next57.2 = add nuw nsw i64 %indvars.iv56, 3
  %gep.3 = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv.next57.2
  %50 = load float, ptr %gep.3, align 4, !tbaa !20
  %51 = getelementptr inbounds float, ptr %53, i64 %indvars.iv.next57.2
  store float %50, ptr %51, align 4, !tbaa !20
  %indvars.iv.next57.3 = add nuw nsw i64 %indvars.iv56, 4
  %exitcond60.not.3 = icmp eq i64 %indvars.iv.next57.3, %wide.trip.count59
  br i1 %exitcond60.not.3, label %._crit_edge36.us.us, label %scalar.ph, !llvm.loop !21

.preheader.us.us:                                 ; preds = %.lr.ph39.us
  %52 = getelementptr inbounds ptr, ptr %7, i64 %42
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = trunc i64 %indvars.iv61 to i32
  %55 = mul i32 %3, %54
  %56 = zext i32 %55 to i64
  %invariant.gep = getelementptr inbounds float, ptr %31, i64 %56
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader.us.us
  %indvars.iv56.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.preheader.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, %scalar.ph.prol
  %indvars.iv56.prol = phi i64 [ %indvars.iv.next57.prol, %scalar.ph.prol ], [ %indvars.iv56.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %gep.prol = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv56.prol
  %57 = load float, ptr %gep.prol, align 4, !tbaa !20
  %58 = getelementptr inbounds float, ptr %53, i64 %indvars.iv56.prol
  store float %57, ptr %58, align 4, !tbaa !20
  %indvars.iv.next57.prol = add nuw nsw i64 %indvars.iv56.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 !23

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv56.unr = phi i64 [ %indvars.iv56.ph, %scalar.ph.preheader ], [ %indvars.iv.next57.prol, %scalar.ph.prol ]
  %59 = sub nsw i64 %indvars.iv56.ph, %wide.trip.count59
  %60 = icmp ugt i64 %59, -4
  br i1 %60, label %._crit_edge36.us.us, label %scalar.ph

vector.memcheck:                                  ; preds = %.preheader.us.us
  %61 = ptrtoint ptr %53 to i64
  %62 = add i64 %41, %34
  %63 = sub i64 %61, %62
  %diff.check = icmp ult i64 %63, 32
  br i1 %diff.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %vector.memcheck, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
  %64 = getelementptr inbounds float, ptr %invariant.gep, i64 %index
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %wide.load = load <4 x float>, ptr %64, align 4, !tbaa !20
  %wide.load69 = load <4 x float>, ptr %65, align 4, !tbaa !20
  %66 = getelementptr inbounds float, ptr %53, i64 %index
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  store <4 x float> %wide.load, ptr %66, align 4, !tbaa !20
  store <4 x float> %wide.load69, ptr %67, align 4, !tbaa !20
  %index.next = add nuw i64 %index, 8
  %68 = icmp eq i64 %index.next, %n.vec
  br i1 %68, label %middle.block, label %vector.body, !llvm.loop !25

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

._crit_edge36.us.us:                              ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge40.split.us.us, label %.lr.ph39.us, !llvm.loop !27

.preheader31:                                     ; preds = %.preheader31.lr.ph, %._crit_edge
  %69 = phi i32 [ %80, %._crit_edge ], [ %9, %.preheader31.lr.ph ]
  %.044 = phi i32 [ %81, %._crit_edge ], [ 0, %.preheader31.lr.ph ]
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader31
  %71 = sext i32 %.044 to i64
  %wide.trip.count = zext nneg i32 %69 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %74
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %74 ]
  %72 = add nsw i64 %indvars.iv, %71
  %73 = icmp eq i64 %72, %sext52
  br i1 %73, label %._crit_edge, label %74

74:                                               ; preds = %.lr.ph
  %75 = mul nsw i64 %indvars.iv, %18
  %76 = getelementptr inbounds float, ptr %14, i64 %75
  %77 = getelementptr inbounds ptr, ptr %17, i64 %72
  %78 = load ptr, ptr %77, align 8, !tbaa !16
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %76, ptr align 4 %78, i64 %19, i1 false)
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %74, %.lr.ph, %.preheader31
  %79 = tail call ptr @network_predict(ptr noundef nonnull byval(%struct.network) align 8 %0, ptr noundef %14)
  %80 = load i32, ptr %8, align 4, !tbaa !12
  %81 = add nsw i32 %80, %.044
  %82 = icmp slt i32 %81, %5
  br i1 %82, label %.preheader31, label %._crit_edge46, !llvm.loop !19

._crit_edge46:                                    ; preds = %._crit_edge, %._crit_edge40.split.us.us, %2
  tail call void @free(ptr noundef %14) #5
  ret { i64, ptr } %6
}

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 = !{!6, !7, i64 12}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!14, !14, i64 0}
!21 = distinct !{!21, !18, !22}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !18, !22, !26}
!26 = !{!"llvm.loop.unroll.runtime.disable"}
!27 = distinct !{!27, !18}


; 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,SROAPass,SimplifyCFGPass,TailCallElimPass