; LLVM IR from hans-ob1/neural_cam_ros :: src/detector (connected_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 }

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

; Function Attrs: nounwind uwtable
define dso_local void @forward_connected_layer(ptr noundef byval(%struct.layer) align 8 %0, ptr noundef byval(%struct.network_state) align 8 %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %10 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = mul nsw i32 %11, %13
  %15 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  call void @fill_cpu(i32 noundef %14, float noundef 0.000000e+00, ptr noundef %16, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %17 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %18 = load i32, ptr %17, align 8, !tbaa !13
  store i32 %18, ptr %4, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %19 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 14
  %20 = load i32, ptr %19, align 4, !tbaa !16
  store i32 %20, ptr %5, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %21 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %22 = load i32, ptr %21, align 8, !tbaa !5
  store i32 %22, ptr %6, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %23 = getelementptr inbounds %struct.network_state, ptr %1, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  store ptr %24, ptr %7, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %25 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 97
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  store ptr %26, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %27 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  store ptr %28, ptr %9, align 8, !tbaa !20
  %29 = load i32, ptr %4, align 4, !tbaa !15
  %30 = load i32, ptr %6, align 4, !tbaa !15
  %31 = load i32, ptr %5, align 4, !tbaa !15
  %32 = load ptr, ptr %7, align 8, !tbaa !20
  %33 = load i32, ptr %5, align 4, !tbaa !15
  %34 = load ptr, ptr %8, align 8, !tbaa !20
  %35 = load i32, ptr %5, align 4, !tbaa !15
  %36 = load ptr, ptr %9, align 8, !tbaa !20
  %37 = load i32, ptr %6, align 4, !tbaa !15
  call void @gemm(i32 noundef 0, i32 noundef 1, i32 noundef %29, i32 noundef %30, i32 noundef %31, float noundef 1.000000e+00, ptr noundef %32, i32 noundef %33, ptr noundef %34, i32 noundef %35, float noundef 1.000000e+00, ptr noundef %36, i32 noundef %37)
  %38 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 9
  %39 = load i32, ptr %38, align 8, !tbaa !22
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %132

41:                                               ; preds = %2
  %42 = getelementptr inbounds %struct.network_state, ptr %1, i32 0, i32 4
  %43 = load i32, ptr %42, align 8, !tbaa !23
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %112

45:                                               ; preds = %41
  %46 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  %48 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %49 = load i32, ptr %48, align 8, !tbaa !13
  %50 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %51 = load i32, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 105
  %53 = load ptr, ptr %52, align 8, !tbaa !24
  call void @mean_cpu(ptr noundef %47, i32 noundef %49, i32 noundef %51, i32 noundef 1, ptr noundef %53)
  %54 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 105
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  %58 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %59 = load i32, ptr %58, align 8, !tbaa !13
  %60 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %61 = load i32, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 106
  %63 = load ptr, ptr %62, align 8, !tbaa !25
  call void @variance_cpu(ptr noundef %55, ptr noundef %57, i32 noundef %59, i32 noundef %61, i32 noundef 1, ptr noundef %63)
  %64 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %65 = load i32, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 109
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  call void @scal_cpu(i32 noundef %65, float noundef 0x3FEE666660000000, ptr noundef %67, i32 noundef 1)
  %68 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %69 = load i32, ptr %68, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 105
  %71 = load ptr, ptr %70, align 8, !tbaa !24
  %72 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 109
  %73 = load ptr, ptr %72, align 8, !tbaa !26
  call void @axpy_cpu(i32 noundef %69, float noundef 0x3FA99999A0000000, ptr noundef %71, i32 noundef 1, ptr noundef %73, i32 noundef 1)
  %74 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %75 = load i32, ptr %74, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 110
  %77 = load ptr, ptr %76, align 8, !tbaa !27
  call void @scal_cpu(i32 noundef %75, float noundef 0x3FEE666660000000, ptr noundef %77, i32 noundef 1)
  %78 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %79 = load i32, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 106
  %81 = load ptr, ptr %80, align 8, !tbaa !25
  %82 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 110
  %83 = load ptr, ptr %82, align 8, !tbaa !27
  call void @axpy_cpu(i32 noundef %79, float noundef 0x3FA99999A0000000, ptr noundef %81, i32 noundef 1, ptr noundef %83, i32 noundef 1)
  %84 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %85 = load i32, ptr %84, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %87 = load i32, ptr %86, align 8, !tbaa !13
  %88 = mul nsw i32 %85, %87
  %89 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %90 = load ptr, ptr %89, align 8, !tbaa !14
  %91 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 111
  %92 = load ptr, ptr %91, align 8, !tbaa !28
  call void @copy_cpu(i32 noundef %88, ptr noundef %90, i32 noundef 1, ptr noundef %92, i32 noundef 1)
  %93 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %94 = load ptr, ptr %93, align 8, !tbaa !14
  %95 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 105
  %96 = load ptr, ptr %95, align 8, !tbaa !24
  %97 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 106
  %98 = load ptr, ptr %97, align 8, !tbaa !25
  %99 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %100 = load i32, ptr %99, align 8, !tbaa !13
  %101 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %102 = load i32, ptr %101, align 8, !tbaa !5
  call void @normalize_cpu(ptr noundef %94, ptr noundef %96, ptr noundef %98, i32 noundef %100, i32 noundef %102, i32 noundef 1)
  %103 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %104 = load i32, ptr %103, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %106 = load i32, ptr %105, align 8, !tbaa !13
  %107 = mul nsw i32 %104, %106
  %108 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %109 = load ptr, ptr %108, align 8, !tbaa !14
  %110 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 112
  %111 = load ptr, ptr %110, align 8, !tbaa !29
  call void @copy_cpu(i32 noundef %107, ptr noundef %109, i32 noundef 1, ptr noundef %111, i32 noundef 1)
  br label %123

112:                                              ; preds = %41
  %113 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %114 = load ptr, ptr %113, align 8, !tbaa !14
  %115 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 109
  %116 = load ptr, ptr %115, align 8, !tbaa !26
  %117 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 110
  %118 = load ptr, ptr %117, align 8, !tbaa !27
  %119 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %120 = load i32, ptr %119, align 8, !tbaa !13
  %121 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %122 = load i32, ptr %121, align 8, !tbaa !5
  call void @normalize_cpu(ptr noundef %114, ptr noundef %116, ptr noundef %118, i32 noundef %120, i32 noundef %122, i32 noundef 1)
  br label %123

123:                                              ; preds = %112, %45
  %124 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %125 = load ptr, ptr %124, align 8, !tbaa !14
  %126 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 95
  %127 = load ptr, ptr %126, align 8, !tbaa !30
  %128 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %129 = load i32, ptr %128, align 8, !tbaa !13
  %130 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %131 = load i32, ptr %130, align 8, !tbaa !5
  call void @scale_bias(ptr noundef %125, ptr noundef %127, i32 noundef %129, i32 noundef %131, i32 noundef 1)
  br label %132

132:                                              ; preds = %123, %2
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %133

133:                                              ; preds = %151, %132
  %134 = load i32, ptr %3, align 4, !tbaa !15
  %135 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %136 = load i32, ptr %135, align 8, !tbaa !13
  %137 = icmp slt i32 %134, %136
  br i1 %137, label %138, label %154

138:                                              ; preds = %133
  %139 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %140 = load i32, ptr %139, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 93
  %142 = load ptr, ptr %141, align 8, !tbaa !31
  %143 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %144 = load ptr, ptr %143, align 8, !tbaa !14
  %145 = load i32, ptr %3, align 4, !tbaa !15
  %146 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %147 = load i32, ptr %146, align 8, !tbaa !5
  %148 = mul nsw i32 %145, %147
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds float, ptr %144, i64 %149
  call void @axpy_cpu(i32 noundef %140, float noundef 1.000000e+00, ptr noundef %142, i32 noundef 1, ptr noundef %150, i32 noundef 1)
  br label %151

151:                                              ; preds = %138
  %152 = load i32, ptr %3, align 4, !tbaa !15
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %3, align 4, !tbaa !15
  br label %133, !llvm.loop !32

154:                                              ; preds = %133
  %155 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  %156 = load ptr, ptr %155, align 8, !tbaa !14
  %157 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %158 = load i32, ptr %157, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %160 = load i32, ptr %159, align 8, !tbaa !13
  %161 = mul nsw i32 %158, %160
  %162 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !34
  call void @activate_array(ptr noundef %156, i32 noundef %161, i32 noundef %163)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

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

declare void @axpy_cpu(i32 noundef, float noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

declare void @scal_cpu(i32 noundef, float noundef, ptr noundef, i32 noundef) #2

declare void @fill_cpu(i32 noundef, float noundef, ptr noundef, i32 noundef) #2

declare void @gemm(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, ptr noundef, i32 noundef) #2

declare void @mean_cpu(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @variance_cpu(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @copy_cpu(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

declare void @normalize_cpu(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @scale_bias(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @activate_array(ptr noundef, i32 noundef, i32 noundef) #2

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

!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 88}
!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 72}
!14 = !{!6, !10, i64 528}
!15 = !{!7, !7, i64 0}
!16 = !{!6, !7, i64 84}
!17 = !{!18, !10, i64 8}
!18 = !{!"network_state", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !19, i64 40}
!19 = !{!"network", !10, i64 0, !7, i64 8, !7, i64 12, !10, i64 16, !11, i64 24, !7, i64 28, !11, i64 32, !11, i64 36, !10, i64 40, !7, i64 48, !10, i64 56, !7, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !10, i64 96, !10, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !7, i64 180, !10, i64 184}
!20 = !{!10, !10, i64 0}
!21 = !{!6, !10, i64 496}
!22 = !{!6, !7, i64 64}
!23 = !{!18, !7, i64 32}
!24 = !{!6, !10, i64 560}
!25 = !{!6, !10, i64 568}
!26 = !{!6, !10, i64 592}
!27 = !{!6, !10, i64 600}
!28 = !{!6, !10, i64 608}
!29 = !{!6, !10, i64 616}
!30 = !{!6, !10, i64 480}
!31 = !{!6, !10, i64 464}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!6, !7, i64 4}


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

; Function Attrs: nounwind uwtable
define dso_local void @forward_connected_layer(ptr nocapture noundef readonly byval(%struct.layer) align 8 %0, ptr nocapture noundef readonly byval(%struct.network_state) align 8 %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 88
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  %6 = load i32, ptr %5, align 8, !tbaa !13
  %7 = mul nsw i32 %6, %4
  %8 = getelementptr inbounds i8, ptr %0, i64 528
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  tail call void @fill_cpu(i32 noundef %7, float noundef 0.000000e+00, ptr noundef %9, i32 noundef 1) #2
  %10 = getelementptr inbounds i8, ptr %0, i64 84
  %11 = load i32, ptr %10, align 4, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 496
  %15 = load ptr, ptr %14, align 8, !tbaa !19
  tail call void @gemm(i32 noundef 0, i32 noundef 1, i32 noundef %6, i32 noundef %4, i32 noundef %11, float noundef 1.000000e+00, ptr noundef %13, i32 noundef %11, ptr noundef %15, i32 noundef %11, float noundef 1.000000e+00, ptr noundef %9, i32 noundef %4) #2
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  %17 = load i32, ptr %16, align 8, !tbaa !20
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %42, label %18

18:                                               ; preds = %2
  %19 = getelementptr inbounds i8, ptr %1, i64 32
  %20 = load i32, ptr %19, align 8, !tbaa !21
  %.not12 = icmp eq i32 %20, 0
  br i1 %.not12, label %34, label %21

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %0, i64 560
  %23 = load ptr, ptr %22, align 8, !tbaa !22
  tail call void @mean_cpu(ptr noundef %9, i32 noundef %6, i32 noundef %4, i32 noundef 1, ptr noundef %23) #2
  %24 = getelementptr inbounds i8, ptr %0, i64 568
  %25 = load ptr, ptr %24, align 8, !tbaa !23
  tail call void @variance_cpu(ptr noundef %9, ptr noundef %23, i32 noundef %6, i32 noundef %4, i32 noundef 1, ptr noundef %25) #2
  %26 = getelementptr inbounds i8, ptr %0, i64 592
  %27 = load ptr, ptr %26, align 8, !tbaa !24
  tail call void @scal_cpu(i32 noundef %4, float noundef 0x3FEE666660000000, ptr noundef %27, i32 noundef 1) #2
  tail call void @axpy_cpu(i32 noundef %4, float noundef 0x3FA99999A0000000, ptr noundef %23, i32 noundef 1, ptr noundef %27, i32 noundef 1) #2
  %28 = getelementptr inbounds i8, ptr %0, i64 600
  %29 = load ptr, ptr %28, align 8, !tbaa !25
  tail call void @scal_cpu(i32 noundef %4, float noundef 0x3FEE666660000000, ptr noundef %29, i32 noundef 1) #2
  tail call void @axpy_cpu(i32 noundef %4, float noundef 0x3FA99999A0000000, ptr noundef %25, i32 noundef 1, ptr noundef %29, i32 noundef 1) #2
  %30 = getelementptr inbounds i8, ptr %0, i64 608
  %31 = load ptr, ptr %30, align 8, !tbaa !26
  tail call void @copy_cpu(i32 noundef %7, ptr noundef %9, i32 noundef 1, ptr noundef %31, i32 noundef 1) #2
  tail call void @normalize_cpu(ptr noundef %9, ptr noundef %23, ptr noundef %25, i32 noundef %6, i32 noundef %4, i32 noundef 1) #2
  %32 = getelementptr inbounds i8, ptr %0, i64 616
  %33 = load ptr, ptr %32, align 8, !tbaa !27
  tail call void @copy_cpu(i32 noundef %7, ptr noundef %9, i32 noundef 1, ptr noundef %33, i32 noundef 1) #2
  br label %39

34:                                               ; preds = %18
  %35 = getelementptr inbounds i8, ptr %0, i64 592
  %36 = load ptr, ptr %35, align 8, !tbaa !24
  %37 = getelementptr inbounds i8, ptr %0, i64 600
  %38 = load ptr, ptr %37, align 8, !tbaa !25
  tail call void @normalize_cpu(ptr noundef %9, ptr noundef %36, ptr noundef %38, i32 noundef %6, i32 noundef %4, i32 noundef 1) #2
  br label %39

39:                                               ; preds = %34, %21
  %40 = getelementptr inbounds i8, ptr %0, i64 480
  %41 = load ptr, ptr %40, align 8, !tbaa !28
  tail call void @scale_bias(ptr noundef %9, ptr noundef %41, i32 noundef %6, i32 noundef %4, i32 noundef 1) #2
  br label %42

42:                                               ; preds = %39, %2
  %43 = icmp sgt i32 %6, 0
  br i1 %43, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %42
  %44 = getelementptr inbounds i8, ptr %0, i64 464
  %45 = load ptr, ptr %44, align 8, !tbaa !29
  %46 = sext i32 %4 to i64
  %wide.trip.count = zext nneg i32 %6 to i64
  br label %47

47:                                               ; preds = %.lr.ph, %47
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %47 ]
  %48 = mul nsw i64 %indvars.iv, %46
  %49 = getelementptr inbounds float, ptr %9, i64 %48
  tail call void @axpy_cpu(i32 noundef %4, float noundef 1.000000e+00, ptr noundef %45, i32 noundef 1, ptr noundef %49, i32 noundef 1) #2
  %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 %47, !llvm.loop !30

._crit_edge:                                      ; preds = %47, %42
  %50 = getelementptr inbounds i8, ptr %0, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !32
  tail call void @activate_array(ptr noundef %9, i32 noundef %7, i32 noundef %51) #2
  ret void
}

declare void @axpy_cpu(i32 noundef, float noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @scal_cpu(i32 noundef, float noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @fill_cpu(i32 noundef, float noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @gemm(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @mean_cpu(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @variance_cpu(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @copy_cpu(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @normalize_cpu(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @scale_bias(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @activate_array(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 88}
!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 72}
!14 = !{!6, !10, i64 528}
!15 = !{!6, !7, i64 84}
!16 = !{!17, !10, i64 8}
!17 = !{!"network_state", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !18, i64 40}
!18 = !{!"network", !10, i64 0, !7, i64 8, !7, i64 12, !10, i64 16, !11, i64 24, !7, i64 28, !11, i64 32, !11, i64 36, !10, i64 40, !7, i64 48, !10, i64 56, !7, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !10, i64 96, !10, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !7, i64 180, !10, i64 184}
!19 = !{!6, !10, i64 496}
!20 = !{!6, !7, i64 64}
!21 = !{!17, !7, i64 32}
!22 = !{!6, !10, i64 560}
!23 = !{!6, !10, i64 568}
!24 = !{!6, !10, i64 592}
!25 = !{!6, !10, i64 600}
!26 = !{!6, !10, i64 608}
!27 = !{!6, !10, i64 616}
!28 = !{!6, !10, i64 480}
!29 = !{!6, !10, i64 464}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!6, !7, i64 4}


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