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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @make_batchnorm_layer(ptr dead_on_unwind noalias writable sret(%struct.layer) align 8 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 {
  %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
  store i32 %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !5
  store i32 %4, ptr %9, align 4, !tbaa !5
  %11 = load ptr, ptr @stderr, align 8, !tbaa !9
  %12 = load i32, ptr %7, align 4, !tbaa !5
  %13 = load i32, ptr %8, align 4, !tbaa !5
  %14 = load i32, ptr %9, align 4, !tbaa !5
  %15 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef @.str, i32 noundef %12, i32 noundef %13, i32 noundef %14) #5
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 808, i1 false)
  %16 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 0
  store i32 18, ptr %16, align 8, !tbaa !11
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  store i32 %17, ptr %18, align 8, !tbaa !15
  %19 = load i32, ptr %8, align 4, !tbaa !5
  %20 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 20
  store i32 %19, ptr %20, align 4, !tbaa !16
  %21 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 17
  store i32 %19, ptr %21, align 8, !tbaa !17
  %22 = load i32, ptr %7, align 4, !tbaa !5
  %23 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 21
  store i32 %22, ptr %23, align 8, !tbaa !18
  %24 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 18
  store i32 %22, ptr %24, align 4, !tbaa !19
  %25 = load i32, ptr %9, align 4, !tbaa !5
  %26 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 22
  store i32 %25, ptr %26, align 4, !tbaa !20
  %27 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 19
  store i32 %25, ptr %27, align 8, !tbaa !21
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = mul nsw i32 %28, %29
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = mul nsw i32 %30, %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = mul nsw i32 %32, %33
  %35 = sext i32 %34 to i64
  %36 = call noalias ptr @calloc(i64 noundef %35, i64 noundef 4) #6
  %37 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  store ptr %36, ptr %37, align 8, !tbaa !22
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = mul nsw i32 %38, %39
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = mul nsw i32 %40, %41
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = mul nsw i32 %42, %43
  %45 = sext i32 %44 to i64
  %46 = call noalias ptr @calloc(i64 noundef %45, i64 noundef 4) #6
  %47 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 100
  store ptr %46, ptr %47, align 8, !tbaa !23
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = mul nsw i32 %48, %49
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = mul nsw i32 %50, %51
  %53 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 14
  store i32 %52, ptr %53, align 4, !tbaa !24
  %54 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 14
  %55 = load i32, ptr %54, align 4, !tbaa !24
  %56 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  store i32 %55, ptr %56, align 8, !tbaa !25
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = call noalias ptr @calloc(i64 noundef %58, i64 noundef 4) #6
  %60 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 95
  store ptr %59, ptr %60, align 8, !tbaa !26
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = call noalias ptr @calloc(i64 noundef %62, i64 noundef 4) #6
  %64 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 96
  store ptr %63, ptr %64, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %75, %5
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %69, label %78

69:                                               ; preds = %65
  %70 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 95
  %71 = load ptr, ptr %70, align 8, !tbaa !26
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds float, ptr %71, i64 %73
  store float 1.000000e+00, ptr %74, align 4, !tbaa !28
  br label %75

75:                                               ; preds = %69
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %10, align 4, !tbaa !5
  br label %65, !llvm.loop !29

78:                                               ; preds = %65
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = call noalias ptr @calloc(i64 noundef %80, i64 noundef 4) #6
  %82 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 105
  store ptr %81, ptr %82, align 8, !tbaa !31
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = call noalias ptr @calloc(i64 noundef %84, i64 noundef 4) #6
  %86 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 106
  store ptr %85, ptr %86, align 8, !tbaa !32
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = call noalias ptr @calloc(i64 noundef %88, i64 noundef 4) #6
  %90 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 109
  store ptr %89, ptr %90, align 8, !tbaa !33
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = call noalias ptr @calloc(i64 noundef %92, i64 noundef 4) #6
  %94 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 110
  store ptr %93, ptr %94, align 8, !tbaa !34
  %95 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 3
  store ptr @forward_batchnorm_layer, ptr %95, align 8, !tbaa !35
  %96 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 4
  store ptr @backward_batchnorm_layer, ptr %96, align 8, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @forward_batchnorm_layer(ptr noundef byval(%struct.layer) align 8, ptr noundef byval(%struct.network_state) align 8) #0

; Function Attrs: nounwind uwtable
declare dso_local void @backward_batchnorm_layer(ptr noundef byval(%struct.layer) align 8, ptr noundef byval(%struct.network_state) align 8) #0

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

attributes #0 = { 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 #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"layer", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !6, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !13, i64 200, !13, i64 204, !6, i64 208, !6, i64 212, !6, i64 216, !6, i64 220, !6, i64 224, !6, i64 228, !6, i64 232, !6, i64 236, !6, i64 240, !6, i64 244, !6, i64 248, !6, i64 252, !13, i64 256, !13, i64 260, !13, i64 264, !6, i64 268, !13, i64 272, !13, i64 276, !13, i64 280, !13, i64 284, !13, i64 288, !13, i64 292, !13, i64 296, !6, i64 300, !6, i64 304, !13, i64 308, !6, i64 312, !6, i64 316, !6, i64 320, !6, i64 324, !13, i64 328, !13, i64 332, !13, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368, !10, i64 376, !10, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !10, i64 520, !10, i64 528, !10, i64 536, !10, i64 544, !10, i64 552, !10, i64 560, !10, i64 568, !10, i64 576, !10, i64 584, !10, i64 592, !10, i64 600, !10, i64 608, !10, i64 616, !10, i64 624, !10, i64 632, !10, i64 640, !10, i64 648, !10, i64 656, !10, i64 664, !10, i64 672, !10, i64 680, !10, i64 688, !10, i64 696, !10, i64 704, !10, i64 712, !10, i64 720, !10, i64 728, !10, i64 736, !10, i64 744, !10, i64 752, !10, i64 760, !10, i64 768, !10, i64 776, !10, i64 784, !10, i64 792, !14, i64 800}
!13 = !{!"float", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !6, i64 72}
!16 = !{!12, !6, i64 108}
!17 = !{!12, !6, i64 96}
!18 = !{!12, !6, i64 112}
!19 = !{!12, !6, i64 100}
!20 = !{!12, !6, i64 116}
!21 = !{!12, !6, i64 104}
!22 = !{!12, !10, i64 528}
!23 = !{!12, !10, i64 520}
!24 = !{!12, !6, i64 84}
!25 = !{!12, !6, i64 88}
!26 = !{!12, !10, i64 480}
!27 = !{!12, !10, i64 488}
!28 = !{!13, !13, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!12, !10, i64 560}
!32 = !{!12, !10, i64 568}
!33 = !{!12, !10, i64 592}
!34 = !{!12, !10, i64 600}
!35 = !{!12, !10, i64 16}
!36 = !{!12, !10, i64 24}


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

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @make_batchnorm_layer(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.layer) align 8 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = load ptr, ptr @stderr, align 8, !tbaa !5
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str, i32 noundef %2, i32 noundef %3, i32 noundef %4) #5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(808) %0, i8 0, i64 808, i1 false)
  store i32 18, ptr %0, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %1, ptr %8, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %0, i64 108
  store i32 %3, ptr %9, align 4, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 %3, ptr %10, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %0, i64 112
  store i32 %2, ptr %11, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 %2, ptr %12, align 4, !tbaa !18
  %13 = getelementptr inbounds i8, ptr %0, i64 116
  store i32 %4, ptr %13, align 4, !tbaa !19
  %14 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 %4, ptr %14, align 8, !tbaa !20
  %15 = mul nsw i32 %3, %2
  %16 = mul nsw i32 %15, %4
  %17 = mul nsw i32 %16, %1
  %18 = sext i32 %17 to i64
  %19 = tail call noalias ptr @calloc(i64 noundef %18, i64 noundef 4) #6
  %20 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr %19, ptr %20, align 8, !tbaa !21
  %21 = tail call noalias ptr @calloc(i64 noundef %18, i64 noundef 4) #6
  %22 = getelementptr inbounds i8, ptr %0, i64 520
  store ptr %21, ptr %22, align 8, !tbaa !22
  %23 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 %16, ptr %23, align 4, !tbaa !23
  %24 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %16, ptr %24, align 8, !tbaa !24
  %25 = sext i32 %4 to i64
  %26 = tail call noalias ptr @calloc(i64 noundef %25, i64 noundef 4) #6
  %27 = getelementptr inbounds i8, ptr %0, i64 480
  store ptr %26, ptr %27, align 8, !tbaa !25
  %28 = tail call noalias ptr @calloc(i64 noundef %25, i64 noundef 4) #6
  %29 = getelementptr inbounds i8, ptr %0, i64 488
  store ptr %28, ptr %29, align 8, !tbaa !26
  %30 = icmp sgt i32 %4, 0
  br i1 %30, label %.lr.ph.preheader, label %._crit_edge

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

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %31 = getelementptr inbounds float, ptr %26, i64 %index
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, ptr %31, align 4, !tbaa !27
  store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, ptr %32, align 4, !tbaa !27
  %index.next = add nuw i64 %index, 8
  %33 = icmp eq i64 %index.next, %n.vec
  br i1 %33, label %middle.block, label %vector.body, !llvm.loop !28

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

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

.lr.ph:                                           ; preds = %.lr.ph.preheader30, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader30 ]
  %34 = getelementptr inbounds float, ptr %26, i64 %indvars.iv
  store float 1.000000e+00, ptr %34, align 4, !tbaa !27
  %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 !32

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %5
  %35 = tail call noalias ptr @calloc(i64 noundef %25, i64 noundef 4) #6
  %36 = getelementptr inbounds i8, ptr %0, i64 560
  store ptr %35, ptr %36, align 8, !tbaa !33
  %37 = tail call noalias ptr @calloc(i64 noundef %25, i64 noundef 4) #6
  %38 = getelementptr inbounds i8, ptr %0, i64 568
  store ptr %37, ptr %38, align 8, !tbaa !34
  %39 = tail call noalias ptr @calloc(i64 noundef %25, i64 noundef 4) #6
  %40 = getelementptr inbounds i8, ptr %0, i64 592
  store ptr %39, ptr %40, align 8, !tbaa !35
  %41 = tail call noalias ptr @calloc(i64 noundef %25, i64 noundef 4) #6
  %42 = getelementptr inbounds i8, ptr %0, i64 600
  store ptr %41, ptr %42, align 8, !tbaa !36
  %43 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr @forward_batchnorm_layer, ptr %43, align 8, !tbaa !37
  %44 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr @backward_batchnorm_layer, ptr %44, align 8, !tbaa !38
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; 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 #3

; Function Attrs: nounwind uwtable
declare dso_local void @forward_batchnorm_layer(ptr noundef byval(%struct.layer) align 8, ptr noundef byval(%struct.network_state) align 8) #4

; Function Attrs: nounwind uwtable
declare dso_local void @backward_batchnorm_layer(ptr noundef byval(%struct.layer) align 8, ptr noundef byval(%struct.network_state) align 8) #4

attributes #0 = { nofree 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 #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { 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 #5 = { cold 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"layer", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !12, i64 200, !12, i64 204, !11, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !12, i64 256, !12, i64 260, !12, i64 264, !11, i64 268, !12, i64 272, !12, i64 276, !12, i64 280, !12, i64 284, !12, i64 288, !12, i64 292, !12, i64 296, !11, i64 300, !11, i64 304, !12, i64 308, !11, i64 312, !11, i64 316, !11, i64 320, !11, i64 324, !12, i64 328, !12, i64 332, !12, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !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, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !13, i64 800}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !11, i64 72}
!15 = !{!10, !11, i64 108}
!16 = !{!10, !11, i64 96}
!17 = !{!10, !11, i64 112}
!18 = !{!10, !11, i64 100}
!19 = !{!10, !11, i64 116}
!20 = !{!10, !11, i64 104}
!21 = !{!10, !6, i64 528}
!22 = !{!10, !6, i64 520}
!23 = !{!10, !11, i64 84}
!24 = !{!10, !11, i64 88}
!25 = !{!10, !6, i64 480}
!26 = !{!10, !6, i64 488}
!27 = !{!12, !12, i64 0}
!28 = distinct !{!28, !29, !30, !31}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!"llvm.loop.isvectorized", i32 1}
!31 = !{!"llvm.loop.unroll.runtime.disable"}
!32 = distinct !{!32, !29, !31, !30}
!33 = !{!10, !6, i64 560}
!34 = !{!10, !6, i64 568}
!35 = !{!10, !6, i64 592}
!36 = !{!10, !6, i64 600}
!37 = !{!10, !6, i64 16}
!38 = !{!10, !6, i64 24}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass