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

; Function Attrs: nounwind uwtable
declare dso_local i32 @local_out_height(ptr noundef byval(%struct.layer) align 8) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @local_out_width(ptr noundef byval(%struct.layer) align 8) #0

; Function Attrs: nounwind uwtable
define dso_local void @make_local_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, i32 noundef %7, i32 noundef %8, i32 noundef %9) #0 {
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca float, align 4
  store i32 %1, ptr %11, align 4, !tbaa !5
  store i32 %2, ptr %12, align 4, !tbaa !5
  store i32 %3, ptr %13, align 4, !tbaa !5
  store i32 %4, ptr %14, align 4, !tbaa !5
  store i32 %5, ptr %15, align 4, !tbaa !5
  store i32 %6, ptr %16, align 4, !tbaa !5
  store i32 %7, ptr %17, align 4, !tbaa !5
  store i32 %8, ptr %18, align 4, !tbaa !5
  store i32 %9, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 808, i1 false)
  %25 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 0
  store i32 12, ptr %25, align 8, !tbaa !9
  %26 = load i32, ptr %12, align 4, !tbaa !5
  %27 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 17
  store i32 %26, ptr %27, align 8, !tbaa !14
  %28 = load i32, ptr %13, align 4, !tbaa !5
  %29 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 18
  store i32 %28, ptr %29, align 4, !tbaa !15
  %30 = load i32, ptr %14, align 4, !tbaa !5
  %31 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 19
  store i32 %30, ptr %31, align 8, !tbaa !16
  %32 = load i32, ptr %15, align 4, !tbaa !5
  %33 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 23
  store i32 %32, ptr %33, align 8, !tbaa !17
  %34 = load i32, ptr %11, align 4, !tbaa !5
  %35 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  store i32 %34, ptr %35, align 8, !tbaa !18
  %36 = load i32, ptr %17, align 4, !tbaa !5
  %37 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 28
  store i32 %36, ptr %37, align 4, !tbaa !19
  %38 = load i32, ptr %16, align 4, !tbaa !5
  %39 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 26
  store i32 %38, ptr %39, align 4, !tbaa !20
  %40 = load i32, ptr %18, align 4, !tbaa !5
  %41 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 30
  store i32 %40, ptr %41, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %42 = call i32 @local_out_height(ptr noundef byval(%struct.layer) align 8 %0)
  store i32 %42, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %43 = call i32 @local_out_width(ptr noundef byval(%struct.layer) align 8 %0)
  store i32 %43, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %44 = load i32, ptr %21, align 4, !tbaa !5
  %45 = load i32, ptr %22, align 4, !tbaa !5
  %46 = mul nsw i32 %44, %45
  store i32 %46, ptr %23, align 4, !tbaa !5
  %47 = load i32, ptr %21, align 4, !tbaa !5
  %48 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 20
  store i32 %47, ptr %48, align 4, !tbaa !22
  %49 = load i32, ptr %22, align 4, !tbaa !5
  %50 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 21
  store i32 %49, ptr %50, align 8, !tbaa !23
  %51 = load i32, ptr %15, align 4, !tbaa !5
  %52 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 22
  store i32 %51, ptr %52, align 4, !tbaa !24
  %53 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 20
  %54 = load i32, ptr %53, align 4, !tbaa !22
  %55 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 21
  %56 = load i32, ptr %55, align 8, !tbaa !23
  %57 = mul nsw i32 %54, %56
  %58 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 22
  %59 = load i32, ptr %58, align 4, !tbaa !24
  %60 = mul nsw i32 %57, %59
  %61 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  store i32 %60, ptr %61, align 8, !tbaa !25
  %62 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 18
  %63 = load i32, ptr %62, align 4, !tbaa !15
  %64 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 17
  %65 = load i32, ptr %64, align 8, !tbaa !14
  %66 = mul nsw i32 %63, %65
  %67 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 19
  %68 = load i32, ptr %67, align 8, !tbaa !16
  %69 = mul nsw i32 %66, %68
  %70 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 14
  store i32 %69, ptr %70, align 4, !tbaa !26
  %71 = load i32, ptr %14, align 4, !tbaa !5
  %72 = load i32, ptr %15, align 4, !tbaa !5
  %73 = mul nsw i32 %71, %72
  %74 = load i32, ptr %16, align 4, !tbaa !5
  %75 = mul nsw i32 %73, %74
  %76 = load i32, ptr %16, align 4, !tbaa !5
  %77 = mul nsw i32 %75, %76
  %78 = load i32, ptr %23, align 4, !tbaa !5
  %79 = mul nsw i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = call noalias ptr @calloc(i64 noundef %80, i64 noundef 4) #7
  %82 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 97
  store ptr %81, ptr %82, align 8, !tbaa !27
  %83 = load i32, ptr %14, align 4, !tbaa !5
  %84 = load i32, ptr %15, align 4, !tbaa !5
  %85 = mul nsw i32 %83, %84
  %86 = load i32, ptr %16, align 4, !tbaa !5
  %87 = mul nsw i32 %85, %86
  %88 = load i32, ptr %16, align 4, !tbaa !5
  %89 = mul nsw i32 %87, %88
  %90 = load i32, ptr %23, align 4, !tbaa !5
  %91 = mul nsw i32 %89, %90
  %92 = sext i32 %91 to i64
  %93 = call noalias ptr @calloc(i64 noundef %92, i64 noundef 4) #7
  %94 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 98
  store ptr %93, ptr %94, align 8, !tbaa !28
  %95 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %96 = load i32, ptr %95, align 8, !tbaa !25
  %97 = sext i32 %96 to i64
  %98 = call noalias ptr @calloc(i64 noundef %97, i64 noundef 4) #7
  %99 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 93
  store ptr %98, ptr %99, align 8, !tbaa !29
  %100 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %101 = load i32, ptr %100, align 8, !tbaa !25
  %102 = sext i32 %101 to i64
  %103 = call noalias ptr @calloc(i64 noundef %102, i64 noundef 4) #7
  %104 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 94
  store ptr %103, ptr %104, align 8, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %105 = load i32, ptr %16, align 4, !tbaa !5
  %106 = load i32, ptr %16, align 4, !tbaa !5
  %107 = mul nsw i32 %105, %106
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = mul nsw i32 %107, %108
  %110 = sitofp i32 %109 to double
  %111 = fdiv double 2.000000e+00, %110
  %112 = call double @sqrt(double noundef %111) #6
  %113 = fptrunc double %112 to float
  store float %113, ptr %24, align 4, !tbaa !31
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %133, %10
  %115 = load i32, ptr %20, align 4, !tbaa !5
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = load i32, ptr %15, align 4, !tbaa !5
  %118 = mul nsw i32 %116, %117
  %119 = load i32, ptr %16, align 4, !tbaa !5
  %120 = mul nsw i32 %118, %119
  %121 = load i32, ptr %16, align 4, !tbaa !5
  %122 = mul nsw i32 %120, %121
  %123 = icmp slt i32 %115, %122
  br i1 %123, label %124, label %136

124:                                              ; preds = %114
  %125 = load float, ptr %24, align 4, !tbaa !31
  %126 = call float @rand_uniform(float noundef -1.000000e+00, float noundef 1.000000e+00)
  %127 = fmul float %125, %126
  %128 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 97
  %129 = load ptr, ptr %128, align 8, !tbaa !27
  %130 = load i32, ptr %20, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds float, ptr %129, i64 %131
  store float %127, ptr %132, align 4, !tbaa !31
  br label %133

133:                                              ; preds = %124
  %134 = load i32, ptr %20, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %20, align 4, !tbaa !5
  br label %114, !llvm.loop !32

136:                                              ; preds = %114
  %137 = load i32, ptr %21, align 4, !tbaa !5
  %138 = load i32, ptr %22, align 4, !tbaa !5
  %139 = mul nsw i32 %137, %138
  %140 = load i32, ptr %16, align 4, !tbaa !5
  %141 = mul nsw i32 %139, %140
  %142 = load i32, ptr %16, align 4, !tbaa !5
  %143 = mul nsw i32 %141, %142
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = mul nsw i32 %143, %144
  %146 = sext i32 %145 to i64
  %147 = call noalias ptr @calloc(i64 noundef %146, i64 noundef 4) #7
  %148 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 99
  store ptr %147, ptr %148, align 8, !tbaa !34
  %149 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %150 = load i32, ptr %149, align 8, !tbaa !18
  %151 = load i32, ptr %21, align 4, !tbaa !5
  %152 = mul nsw i32 %150, %151
  %153 = load i32, ptr %22, align 4, !tbaa !5
  %154 = mul nsw i32 %152, %153
  %155 = load i32, ptr %15, align 4, !tbaa !5
  %156 = mul nsw i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = call noalias ptr @calloc(i64 noundef %157, i64 noundef 4) #7
  %159 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  store ptr %158, ptr %159, align 8, !tbaa !35
  %160 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 11
  %161 = load i32, ptr %160, align 8, !tbaa !18
  %162 = load i32, ptr %21, align 4, !tbaa !5
  %163 = mul nsw i32 %161, %162
  %164 = load i32, ptr %22, align 4, !tbaa !5
  %165 = mul nsw i32 %163, %164
  %166 = load i32, ptr %15, align 4, !tbaa !5
  %167 = mul nsw i32 %165, %166
  %168 = sext i32 %167 to i64
  %169 = call noalias ptr @calloc(i64 noundef %168, i64 noundef 4) #7
  %170 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 100
  store ptr %169, ptr %170, align 8, !tbaa !36
  %171 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 3
  store ptr @forward_local_layer, ptr %171, align 8, !tbaa !37
  %172 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 4
  store ptr @backward_local_layer, ptr %172, align 8, !tbaa !38
  %173 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 5
  store ptr @update_local_layer, ptr %173, align 8, !tbaa !39
  %174 = load i32, ptr %19, align 4, !tbaa !5
  %175 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 1
  store i32 %174, ptr %175, align 4, !tbaa !40
  %176 = load ptr, ptr @stderr, align 8, !tbaa !41
  %177 = load i32, ptr %12, align 4, !tbaa !5
  %178 = load i32, ptr %13, align 4, !tbaa !5
  %179 = load i32, ptr %14, align 4, !tbaa !5
  %180 = load i32, ptr %15, align 4, !tbaa !5
  %181 = load i32, ptr %21, align 4, !tbaa !5
  %182 = load i32, ptr %22, align 4, !tbaa !5
  %183 = load i32, ptr %15, align 4, !tbaa !5
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %176, ptr noundef @.str, i32 noundef %177, i32 noundef %178, i32 noundef %179, i32 noundef %180, i32 noundef %181, i32 noundef %182, i32 noundef %183) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  ret void
}

; 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: nounwind
declare double @sqrt(double noundef) #4

declare float @rand_uniform(float noundef, float noundef) #5

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 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 96}
!15 = !{!10, !6, i64 100}
!16 = !{!10, !6, i64 104}
!17 = !{!10, !6, i64 120}
!18 = !{!10, !6, i64 72}
!19 = !{!10, !6, i64 140}
!20 = !{!10, !6, i64 132}
!21 = !{!10, !6, i64 148}
!22 = !{!10, !6, i64 108}
!23 = !{!10, !6, i64 112}
!24 = !{!10, !6, i64 116}
!25 = !{!10, !6, i64 88}
!26 = !{!10, !6, i64 84}
!27 = !{!10, !11, i64 496}
!28 = !{!10, !11, i64 504}
!29 = !{!10, !11, i64 464}
!30 = !{!10, !11, i64 472}
!31 = !{!12, !12, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!10, !11, i64 512}
!35 = !{!10, !11, i64 528}
!36 = !{!10, !11, i64 520}
!37 = !{!10, !11, i64 16}
!38 = !{!10, !11, i64 24}
!39 = !{!10, !11, i64 32}
!40 = !{!10, !6, i64 4}
!41 = !{!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 [67 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @local_out_height(ptr noundef byval(%struct.layer) align 8) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @local_out_width(ptr noundef byval(%struct.layer) align 8) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @make_local_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, i32 noundef %7, i32 noundef %8, i32 noundef %9) 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 12, ptr %0, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 %2, ptr %11, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 %3, ptr %12, align 4, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 %4, ptr %13, align 8, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 %5, ptr %14, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %1, ptr %15, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 140
  store i32 %7, ptr %16, align 4, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %0, i64 132
  store i32 %6, ptr %17, align 4, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %0, i64 148
  store i32 %8, ptr %18, align 4, !tbaa !20
  %19 = tail call i32 @local_out_height(ptr noundef nonnull byval(%struct.layer) align 8 %0)
  %20 = tail call i32 @local_out_width(ptr noundef nonnull byval(%struct.layer) align 8 %0)
  %21 = mul i32 %20, %19
  %22 = getelementptr inbounds i8, ptr %0, i64 108
  store i32 %19, ptr %22, align 4, !tbaa !21
  %23 = getelementptr inbounds i8, ptr %0, i64 112
  store i32 %20, ptr %23, align 8, !tbaa !22
  %24 = getelementptr inbounds i8, ptr %0, i64 116
  store i32 %5, ptr %24, align 4, !tbaa !23
  %25 = mul i32 %21, %5
  %26 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %25, ptr %26, align 8, !tbaa !24
  %27 = load i32, ptr %12, align 4, !tbaa !14
  %28 = load i32, ptr %11, align 8, !tbaa !13
  %29 = mul nsw i32 %28, %27
  %30 = load i32, ptr %13, align 8, !tbaa !15
  %31 = mul nsw i32 %29, %30
  %32 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 %31, ptr %32, align 4, !tbaa !25
  %33 = mul i32 %6, %4
  %34 = mul i32 %33, %5
  %35 = mul nsw i32 %34, %6
  %36 = mul nsw i32 %21, %35
  %37 = sext i32 %36 to i64
  %38 = tail call noalias ptr @calloc(i64 noundef %37, i64 noundef 4) #6
  %39 = getelementptr inbounds i8, ptr %0, i64 496
  store ptr %38, ptr %39, align 8, !tbaa !26
  %40 = tail call noalias ptr @calloc(i64 noundef %37, i64 noundef 4) #6
  %41 = getelementptr inbounds i8, ptr %0, i64 504
  store ptr %40, ptr %41, align 8, !tbaa !27
  %42 = sext i32 %25 to i64
  %43 = tail call noalias ptr @calloc(i64 noundef %42, i64 noundef 4) #6
  %44 = getelementptr inbounds i8, ptr %0, i64 464
  store ptr %43, ptr %44, align 8, !tbaa !28
  %45 = tail call noalias ptr @calloc(i64 noundef %42, i64 noundef 4) #6
  %46 = getelementptr inbounds i8, ptr %0, i64 472
  store ptr %45, ptr %46, align 8, !tbaa !29
  %47 = mul i32 %33, %6
  %48 = sitofp i32 %47 to double
  %49 = fdiv double 2.000000e+00, %48
  %50 = tail call double @sqrt(double noundef %49) #7
  %51 = fptrunc double %50 to float
  %52 = icmp sgt i32 %35, 0
  br i1 %52, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %10
  %wide.trip.count = zext nneg i32 %35 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %53 = tail call float @rand_uniform(float noundef -1.000000e+00, float noundef 1.000000e+00) #7
  %54 = fmul float %53, %51
  %55 = load ptr, ptr %39, align 8, !tbaa !26
  %56 = getelementptr inbounds float, ptr %55, i64 %indvars.iv
  store float %54, ptr %56, align 4, !tbaa !30
  %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 !31

._crit_edge:                                      ; preds = %.lr.ph, %10
  %57 = mul i32 %47, %21
  %58 = sext i32 %57 to i64
  %59 = tail call noalias ptr @calloc(i64 noundef %58, i64 noundef 4) #6
  %60 = getelementptr inbounds i8, ptr %0, i64 512
  store ptr %59, ptr %60, align 8, !tbaa !33
  %61 = load i32, ptr %15, align 8, !tbaa !17
  %62 = mul i32 %25, %61
  %63 = sext i32 %62 to i64
  %64 = tail call noalias ptr @calloc(i64 noundef %63, i64 noundef 4) #6
  %65 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr %64, ptr %65, align 8, !tbaa !34
  %66 = tail call noalias ptr @calloc(i64 noundef %63, i64 noundef 4) #6
  %67 = getelementptr inbounds i8, ptr %0, i64 520
  store ptr %66, ptr %67, align 8, !tbaa !35
  %68 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr @forward_local_layer, ptr %68, align 8, !tbaa !36
  %69 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr @backward_local_layer, ptr %69, align 8, !tbaa !37
  %70 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr @update_local_layer, ptr %70, align 8, !tbaa !38
  %71 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %9, ptr %71, align 4, !tbaa !39
  %72 = load ptr, ptr @stderr, align 8, !tbaa !40
  %73 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %19, i32 noundef %20, i32 noundef %5) #8
  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: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

declare float @rand_uniform(float noundef, float noundef) local_unnamed_addr #4

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

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

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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 #6 = { nounwind allocsize(0,1) }
attributes #7 = { nounwind }
attributes #8 = { cold 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 96}
!14 = !{!6, !7, i64 100}
!15 = !{!6, !7, i64 104}
!16 = !{!6, !7, i64 120}
!17 = !{!6, !7, i64 72}
!18 = !{!6, !7, i64 140}
!19 = !{!6, !7, i64 132}
!20 = !{!6, !7, i64 148}
!21 = !{!6, !7, i64 108}
!22 = !{!6, !7, i64 112}
!23 = !{!6, !7, i64 116}
!24 = !{!6, !7, i64 88}
!25 = !{!6, !7, i64 84}
!26 = !{!6, !10, i64 496}
!27 = !{!6, !10, i64 504}
!28 = !{!6, !10, i64 464}
!29 = !{!6, !10, i64 472}
!30 = !{!11, !11, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!6, !10, i64 512}
!34 = !{!6, !10, i64 528}
!35 = !{!6, !10, i64 520}
!36 = !{!6, !10, i64 16}
!37 = !{!6, !10, i64 24}
!38 = !{!6, !10, i64 32}
!39 = !{!6, !7, i64 4}
!40 = !{!10, !10, i64 0}


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