; LLVM IR from hans-ob1/neural_cam_ros :: src/detector (rnn_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 [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

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

76:                                               ; preds = %9
  br label %85

77:                                               ; preds = %9
  %78 = load i32, ptr %17, align 4, !tbaa !5
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  br label %83

81:                                               ; preds = %77
  %82 = load i32, ptr %15, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %81, %80
  %84 = phi i32 [ 0, %80 ], [ %82, %81 ]
  br label %85

85:                                               ; preds = %83, %76
  %86 = phi i32 [ 9, %76 ], [ %84, %83 ]
  %87 = load i32, ptr %16, align 4, !tbaa !5
  call void @make_connected_layer(ptr dead_on_unwind writable sret(%struct.layer) align 8 %19, i32 noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef %86, i32 noundef %87)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %68, ptr align 8 %19, i64 808, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 808, ptr %19) #8
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 120
  %90 = load ptr, ptr %89, align 8, !tbaa !24
  %91 = getelementptr inbounds %struct.layer, ptr %90, i32 0, i32 11
  store i32 %88, ptr %91, align 8, !tbaa !11
  %92 = call noalias ptr @malloc(i64 noundef 808) #10
  %93 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 121
  store ptr %92, ptr %93, align 8, !tbaa !25
  %94 = load ptr, ptr @stderr, align 8, !tbaa !9
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.1) #8
  %96 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 121
  %97 = load ptr, ptr %96, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 808, ptr %20) #8
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = load i32, ptr %14, align 4, !tbaa !5
  %100 = mul nsw i32 %98, %99
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = load i32, ptr %15, align 4, !tbaa !5
  %104 = load i32, ptr %16, align 4, !tbaa !5
  call void @make_connected_layer(ptr dead_on_unwind writable sret(%struct.layer) align 8 %20, i32 noundef %100, i32 noundef %101, i32 noundef %102, i32 noundef %103, i32 noundef %104)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %97, ptr align 8 %20, i64 808, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 808, ptr %20) #8
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 121
  %107 = load ptr, ptr %106, align 8, !tbaa !25
  %108 = getelementptr inbounds %struct.layer, ptr %107, i32 0, i32 11
  store i32 %105, ptr %108, align 8, !tbaa !11
  %109 = load i32, ptr %13, align 4, !tbaa !5
  %110 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  store i32 %109, ptr %110, align 8, !tbaa !26
  %111 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 121
  %112 = load ptr, ptr %111, align 8, !tbaa !25
  %113 = getelementptr inbounds %struct.layer, ptr %112, i32 0, i32 101
  %114 = load ptr, ptr %113, align 8, !tbaa !27
  %115 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 101
  store ptr %114, ptr %115, align 8, !tbaa !27
  %116 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 121
  %117 = load ptr, ptr %116, align 8, !tbaa !25
  %118 = getelementptr inbounds %struct.layer, ptr %117, i32 0, i32 100
  %119 = load ptr, ptr %118, align 8, !tbaa !28
  %120 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 100
  store ptr %119, ptr %120, align 8, !tbaa !28
  %121 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 3
  store ptr @forward_rnn_layer, ptr %121, align 8, !tbaa !29
  %122 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 4
  store ptr @backward_rnn_layer, ptr %122, align 8, !tbaa !30
  %123 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 5
  store ptr @update_rnn_layer, ptr %123, align 8, !tbaa !31
  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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

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

declare void @make_connected_layer(ptr dead_on_unwind writable sret(%struct.layer) align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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

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

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 = { nounwind allocsize(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { nounwind allocsize(0) }

!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 72}
!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 0}
!16 = !{!12, !6, i64 172}
!17 = !{!12, !6, i64 176}
!18 = !{!12, !6, i64 84}
!19 = !{!12, !10, i64 400}
!20 = !{!12, !10, i64 672}
!21 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 16, i64 8, !9, i64 24, i64 8, !9, i64 32, i64 8, !9, i64 40, i64 8, !9, i64 48, i64 8, !9, i64 56, i64 8, !9, i64 64, i64 4, !5, i64 68, i64 4, !5, i64 72, i64 4, !5, i64 76, i64 4, !5, i64 80, i64 4, !5, i64 84, i64 4, !5, i64 88, i64 4, !5, i64 92, i64 4, !5, i64 96, i64 4, !5, i64 100, i64 4, !5, i64 104, i64 4, !5, i64 108, i64 4, !5, i64 112, i64 4, !5, i64 116, i64 4, !5, i64 120, i64 4, !5, i64 124, i64 4, !5, i64 128, i64 4, !5, i64 132, i64 4, !5, i64 136, i64 4, !5, i64 140, i64 4, !5, i64 144, i64 4, !5, i64 148, i64 4, !5, i64 152, i64 4, !5, i64 156, i64 4, !5, i64 160, i64 4, !5, i64 164, i64 4, !5, i64 168, i64 4, !5, i64 172, i64 4, !5, i64 176, i64 4, !5, i64 180, i64 4, !22, i64 184, i64 4, !22, i64 188, i64 4, !22, i64 192, i64 4, !22, i64 196, i64 4, !22, i64 200, i64 4, !22, i64 204, i64 4, !22, i64 208, i64 4, !5, i64 212, i64 4, !5, i64 216, i64 4, !5, i64 220, i64 4, !5, i64 224, i64 4, !5, i64 228, i64 4, !5, i64 232, i64 4, !5, i64 236, i64 4, !5, i64 240, i64 4, !5, i64 244, i64 4, !5, i64 248, i64 4, !5, i64 252, i64 4, !5, i64 256, i64 4, !22, i64 260, i64 4, !22, i64 264, i64 4, !22, i64 268, i64 4, !5, i64 272, i64 4, !22, i64 276, i64 4, !22, i64 280, i64 4, !22, i64 284, i64 4, !22, i64 288, i64 4, !22, i64 292, i64 4, !22, i64 296, i64 4, !22, i64 300, i64 4, !5, i64 304, i64 4, !5, i64 308, i64 4, !22, i64 312, i64 4, !5, i64 316, i64 4, !5, i64 320, i64 4, !5, i64 324, i64 4, !5, i64 328, i64 4, !22, i64 332, i64 4, !22, i64 336, i64 4, !22, i64 344, i64 8, !9, i64 352, i64 8, !9, i64 360, i64 8, !9, i64 368, i64 8, !9, i64 376, i64 8, !9, i64 384, i64 8, !9, i64 392, i64 8, !9, i64 400, i64 8, !9, i64 408, i64 8, !9, i64 416, i64 8, !9, i64 424, i64 8, !9, i64 432, i64 8, !9, i64 440, i64 8, !9, i64 448, i64 8, !9, i64 456, i64 8, !9, i64 464, i64 8, !9, i64 472, i64 8, !9, i64 480, i64 8, !9, i64 488, i64 8, !9, i64 496, i64 8, !9, i64 504, i64 8, !9, i64 512, i64 8, !9, i64 520, i64 8, !9, i64 528, i64 8, !9, i64 536, i64 8, !9, i64 544, i64 8, !9, i64 552, i64 8, !9, i64 560, i64 8, !9, i64 568, i64 8, !9, i64 576, i64 8, !9, i64 584, i64 8, !9, i64 592, i64 8, !9, i64 600, i64 8, !9, i64 608, i64 8, !9, i64 616, i64 8, !9, i64 624, i64 8, !9, i64 632, i64 8, !9, i64 640, i64 8, !9, i64 648, i64 8, !9, i64 656, i64 8, !9, i64 664, i64 8, !9, i64 672, i64 8, !9, i64 680, i64 8, !9, i64 688, i64 8, !9, i64 696, i64 8, !9, i64 704, i64 8, !9, i64 712, i64 8, !9, i64 720, i64 8, !9, i64 728, i64 8, !9, i64 736, i64 8, !9, i64 744, i64 8, !9, i64 752, i64 8, !9, i64 760, i64 8, !9, i64 768, i64 8, !9, i64 776, i64 8, !9, i64 784, i64 8, !9, i64 792, i64 8, !9, i64 800, i64 8, !23}
!22 = !{!13, !13, i64 0}
!23 = !{!14, !14, i64 0}
!24 = !{!12, !10, i64 680}
!25 = !{!12, !10, i64 688}
!26 = !{!12, !6, i64 88}
!27 = !{!12, !10, i64 528}
!28 = !{!12, !10, i64 520}
!29 = !{!12, !10, i64 16}
!30 = !{!12, !10, i64 24}
!31 = !{!12, !10, i64 32}


; 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 [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @make_rnn_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, i32 noundef %7, i32 noundef %8) local_unnamed_addr #0 {
  %10 = alloca %struct.layer, align 8
  %11 = alloca %struct.layer, align 8
  %12 = alloca %struct.layer, align 8
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str, i32 noundef %2, i32 noundef %4) #8
  %15 = sdiv i32 %1, %5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(808) %0, i8 0, i64 808, i1 false)
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %15, ptr %16, align 8, !tbaa !9
  store i32 15, ptr %0, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %0, i64 172
  store i32 %5, ptr %17, align 4, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %0, i64 176
  store i32 %3, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 %2, ptr %19, align 4, !tbaa !17
  %20 = add nsw i32 %5, 1
  %21 = mul i32 %20, %3
  %22 = mul i32 %21, %15
  %23 = sext i32 %22 to i64
  %24 = tail call noalias ptr @calloc(i64 noundef %23, i64 noundef 4) #9
  %25 = getelementptr inbounds i8, ptr %0, i64 400
  store ptr %24, ptr %25, align 8, !tbaa !18
  %26 = tail call noalias dereferenceable_or_null(808) ptr @malloc(i64 noundef 808) #10
  %27 = getelementptr inbounds i8, ptr %0, i64 672
  store ptr %26, ptr %27, align 8, !tbaa !19
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.1) #8
  call void @llvm.lifetime.start.p0(i64 808, ptr nonnull %10) #11
  %30 = mul nsw i32 %15, %5
  call void @make_connected_layer(ptr dead_on_unwind nonnull writable sret(%struct.layer) align 8 %10, i32 noundef %30, i32 noundef %2, i32 noundef %3, i32 noundef %6, i32 noundef %7) #11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(808) %26, ptr noundef nonnull align 8 dereferenceable(808) %10, i64 808, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 808, ptr nonnull %10) #11
  %31 = getelementptr inbounds i8, ptr %26, i64 72
  store i32 %15, ptr %31, align 8, !tbaa !9
  %32 = call noalias dereferenceable_or_null(808) ptr @malloc(i64 noundef 808) #10
  %33 = getelementptr inbounds i8, ptr %0, i64 680
  store ptr %32, ptr %33, align 8, !tbaa !24
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.1) #8
  call void @llvm.lifetime.start.p0(i64 808, ptr nonnull %11) #11
  %36 = icmp eq i32 %8, 2
  %37 = icmp eq i32 %8, 1
  %38 = select i1 %37, i32 0, i32 %6
  %39 = select i1 %36, i32 9, i32 %38
  call void @make_connected_layer(ptr dead_on_unwind nonnull writable sret(%struct.layer) align 8 %11, i32 noundef %30, i32 noundef %3, i32 noundef %3, i32 noundef %39, i32 noundef %7) #11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(808) %32, ptr noundef nonnull align 8 dereferenceable(808) %11, i64 808, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 808, ptr nonnull %11) #11
  %40 = getelementptr inbounds i8, ptr %32, i64 72
  store i32 %15, ptr %40, align 8, !tbaa !9
  %41 = call noalias dereferenceable_or_null(808) ptr @malloc(i64 noundef 808) #10
  %42 = getelementptr inbounds i8, ptr %0, i64 688
  store ptr %41, ptr %42, align 8, !tbaa !25
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.1) #8
  call void @llvm.lifetime.start.p0(i64 808, ptr nonnull %12) #11
  call void @make_connected_layer(ptr dead_on_unwind nonnull writable sret(%struct.layer) align 8 %12, i32 noundef %30, i32 noundef %3, i32 noundef %4, i32 noundef %6, i32 noundef %7) #11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(808) %41, ptr noundef nonnull align 8 dereferenceable(808) %12, i64 808, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 808, ptr nonnull %12) #11
  %45 = getelementptr inbounds i8, ptr %41, i64 72
  store i32 %15, ptr %45, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %4, ptr %46, align 8, !tbaa !26
  %47 = getelementptr inbounds i8, ptr %41, i64 520
  %48 = getelementptr inbounds i8, ptr %0, i64 520
  %49 = load <2 x ptr>, ptr %47, align 8, !tbaa !5
  store <2 x ptr> %49, ptr %48, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr @forward_rnn_layer, ptr %50, align 8, !tbaa !27
  %51 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr @backward_rnn_layer, ptr %51, align 8, !tbaa !28
  %52 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr @update_rnn_layer, ptr %52, align 8, !tbaa !29
  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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

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

declare void @make_connected_layer(ptr dead_on_unwind writable sret(%struct.layer) align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass