; LLVM IR from hans-ob1/neural_cam_ros :: src/detector (region_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 [11 x i8], align 1

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

69:                                               ; preds = %80, %7
  %70 = load i32, ptr %14, align 4, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !5
  %72 = mul nsw i32 %71, 2
  %73 = icmp slt i32 %70, %72
  br i1 %73, label %74, label %83

74:                                               ; preds = %69
  %75 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 93
  %76 = load ptr, ptr %75, align 8, !tbaa !21
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds float, ptr %76, i64 %78
  store float 5.000000e-01, ptr %79, align 4, !tbaa !28
  br label %80

80:                                               ; preds = %74
  %81 = load i32, ptr %14, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %14, align 4, !tbaa !5
  br label %69, !llvm.loop !29

83:                                               ; preds = %69
  %84 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 3
  store ptr @forward_region_layer, ptr %84, align 8, !tbaa !31
  %85 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 4
  store ptr @backward_region_layer, ptr %85, align 8, !tbaa !32
  %86 = load ptr, ptr @stderr, align 8, !tbaa !33
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str) #7
  call void @srand(i32 noundef 0) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  ret void
}

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @forward_region_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_region_layer(ptr noundef byval(%struct.layer) align 8, ptr noundef byval(%struct.network_state) align 8) #0

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #5

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="64" "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 "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 allocsize(0,1) }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"layer", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, 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, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !12, i64 200, !12, 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, !12, i64 256, !12, i64 260, !12, i64 264, !6, i64 268, !12, i64 272, !12, i64 276, !12, i64 280, !12, i64 284, !12, i64 288, !12, i64 292, !12, i64 296, !6, i64 300, !6, i64 304, !12, i64 308, !6, i64 312, !6, i64 316, !6, i64 320, !6, i64 324, !12, i64 328, !12, i64 332, !12, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368, !11, i64 376, !11, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !11, i64 416, !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, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !11, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !11, i64 576, !11, i64 584, !11, i64 592, !11, i64 600, !11, i64 608, !11, i64 616, !11, i64 624, !11, i64 632, !11, i64 640, !11, i64 648, !11, i64 656, !11, i64 664, !11, i64 672, !11, i64 680, !11, i64 688, !11, i64 696, !11, i64 704, !11, i64 712, !11, i64 720, !11, i64 728, !11, i64 736, !11, i64 744, !11, i64 752, !11, i64 760, !11, i64 768, !11, i64 776, !11, i64 784, !11, i64 792, !13, i64 800}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !6, i64 120}
!15 = !{!10, !6, i64 72}
!16 = !{!10, !6, i64 96}
!17 = !{!10, !6, i64 100}
!18 = !{!10, !6, i64 212}
!19 = !{!10, !6, i64 216}
!20 = !{!10, !11, i64 392}
!21 = !{!10, !11, i64 464}
!22 = !{!10, !11, i64 472}
!23 = !{!10, !6, i64 88}
!24 = !{!10, !6, i64 84}
!25 = !{!10, !6, i64 92}
!26 = !{!10, !11, i64 520}
!27 = !{!10, !11, i64 528}
!28 = !{!12, !12, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!10, !11, i64 16}
!32 = !{!10, !11, i64 24}
!33 = !{!11, !11, i64 0}


; 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 [11 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @make_region_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, i32 noundef %5, i32 noundef %6) local_unnamed_addr #0 {
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(808) %0, i8 0, i64 808, i1 false)
  store i32 21, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 %4, ptr %8, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %1, ptr %9, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 %3, ptr %10, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 %2, ptr %11, align 4, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %0, i64 212
  store i32 %5, ptr %12, align 4, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %0, i64 216
  store i32 %6, ptr %13, align 8, !tbaa !18
  %14 = tail call noalias dereferenceable_or_null(4) ptr @calloc(i64 noundef 1, i64 noundef 4) #7
  %15 = getelementptr inbounds i8, ptr %0, i64 392
  store ptr %14, ptr %15, align 8, !tbaa !19
  %16 = shl nsw i32 %4, 1
  %17 = sext i32 %16 to i64
  %18 = tail call noalias ptr @calloc(i64 noundef %17, i64 noundef 4) #7
  %19 = getelementptr inbounds i8, ptr %0, i64 464
  store ptr %18, ptr %19, align 8, !tbaa !20
  %20 = tail call noalias ptr @calloc(i64 noundef %17, i64 noundef 4) #7
  %21 = getelementptr inbounds i8, ptr %0, i64 472
  store ptr %20, ptr %21, align 8, !tbaa !21
  %22 = mul nsw i32 %3, %2
  %23 = mul nsw i32 %22, %4
  %24 = add i32 %5, 1
  %25 = add i32 %24, %6
  %26 = mul nsw i32 %23, %25
  %27 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %26, ptr %27, align 8, !tbaa !22
  %28 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 %26, ptr %28, align 4, !tbaa !23
  %29 = getelementptr inbounds i8, ptr %0, i64 92
  store i32 150, ptr %29, align 4, !tbaa !24
  %30 = mul nsw i32 %26, %1
  %31 = sext i32 %30 to i64
  %32 = tail call noalias ptr @calloc(i64 noundef %31, i64 noundef 4) #7
  %33 = getelementptr inbounds i8, ptr %0, i64 520
  store ptr %32, ptr %33, align 8, !tbaa !25
  %34 = tail call noalias ptr @calloc(i64 noundef %31, i64 noundef 4) #7
  %35 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr %34, ptr %35, align 8, !tbaa !26
  %36 = icmp sgt i32 %4, 0
  br i1 %36, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %7
  %smax = tail call i32 @llvm.smax.i32(i32 %16, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  %min.iters.check = icmp slt i32 %4, 4
  br i1 %min.iters.check, label %.lr.ph.preheader21, 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 ]
  %37 = getelementptr inbounds float, ptr %18, i64 %index
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <4 x float> <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, ptr %37, align 4, !tbaa !27
  store <4 x float> <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, ptr %38, align 4, !tbaa !27
  %index.next = add nuw i64 %index, 8
  %39 = icmp eq i64 %index.next, %n.vec
  br i1 %39, 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.preheader21

.lr.ph.preheader21:                               ; 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.preheader21, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader21 ]
  %40 = getelementptr inbounds float, ptr %18, i64 %indvars.iv
  store float 5.000000e-01, ptr %40, 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, %7
  %41 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr @forward_region_layer, ptr %41, align 8, !tbaa !33
  %42 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr @backward_region_layer, ptr %42, align 8, !tbaa !34
  %43 = load ptr, ptr @stderr, align 8, !tbaa !35
  %44 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str) #8
  tail call void @srand(i32 noundef 0) #9
  ret void
}

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

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

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

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

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"layer", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !7, i64 160, !7, i64 164, !7, i64 168, !7, i64 172, !7, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !7, i64 208, !7, i64 212, !7, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !7, i64 240, !7, i64 244, !7, i64 248, !7, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !7, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !11, i64 288, !11, i64 292, !11, i64 296, !7, i64 300, !7, i64 304, !11, i64 308, !7, i64 312, !7, i64 316, !7, i64 320, !7, i64 324, !11, i64 328, !11, i64 332, !11, 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, !12, i64 800}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !7, i64 120}
!14 = !{!6, !7, i64 72}
!15 = !{!6, !7, i64 96}
!16 = !{!6, !7, i64 100}
!17 = !{!6, !7, i64 212}
!18 = !{!6, !7, i64 216}
!19 = !{!6, !10, i64 392}
!20 = !{!6, !10, i64 464}
!21 = !{!6, !10, i64 472}
!22 = !{!6, !7, i64 88}
!23 = !{!6, !7, i64 84}
!24 = !{!6, !7, i64 92}
!25 = !{!6, !10, i64 520}
!26 = !{!6, !10, i64 528}
!27 = !{!11, !11, 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 = !{!6, !10, i64 16}
!34 = !{!6, !10, i64 24}
!35 = !{!10, !10, i64 0}


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