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

; 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.size_params = type { i32, i32, i32, i32, i32, 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 }

@.str.33 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

declare ptr @option_find_str(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @get_activation(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @parse_activation(ptr dead_on_unwind noalias writable sret(%struct.layer) align 8 %0, ptr noundef %1, ptr noundef byval(%struct.size_params) align 8 %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = call ptr @option_find_str(ptr noundef %7, ptr noundef @.str.33, ptr noundef @.str.98)
  store ptr %8, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = call i32 @get_activation(ptr noundef %9)
  store i32 %10, ptr %6, align 4, !tbaa !9
  %11 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 0
  %12 = load i32, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 1
  %14 = load i32, ptr %13, align 4, !tbaa !15
  %15 = load i32, ptr %6, align 4, !tbaa !9
  call void @make_activation_layer(ptr dead_on_unwind writable sret(%struct.layer) align 8 %0, i32 noundef %12, i32 noundef %14, i32 noundef %15)
  %16 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 2
  %17 = load i32, ptr %16, align 8, !tbaa !16
  %18 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 20
  store i32 %17, ptr %18, align 4, !tbaa !17
  %19 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 3
  %20 = load i32, ptr %19, align 4, !tbaa !20
  %21 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 21
  store i32 %20, ptr %21, align 8, !tbaa !21
  %22 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 4
  %23 = load i32, ptr %22, align 8, !tbaa !22
  %24 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 22
  store i32 %23, ptr %24, align 4, !tbaa !23
  %25 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 2
  %26 = load i32, ptr %25, align 8, !tbaa !16
  %27 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 17
  store i32 %26, ptr %27, align 8, !tbaa !24
  %28 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 3
  %29 = load i32, ptr %28, align 4, !tbaa !20
  %30 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 18
  store i32 %29, ptr %30, align 4, !tbaa !25
  %31 = getelementptr inbounds %struct.size_params, ptr %2, i32 0, i32 4
  %32 = load i32, ptr %31, align 8, !tbaa !22
  %33 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 19
  store i32 %32, ptr %33, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"size_params", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !13, i64 32}
!13 = !{!"network", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !14, i64 24, !10, i64 28, !14, i64 32, !14, i64 36, !6, i64 40, !10, i64 48, !6, i64 56, !10, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !6, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !10, i64 120, !14, i64 124, !14, i64 128, !14, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !14, i64 160, !14, i64 164, !14, i64 168, !14, i64 172, !14, i64 176, !10, i64 180, !6, i64 184}
!14 = !{!"float", !7, i64 0}
!15 = !{!12, !10, i64 4}
!16 = !{!12, !10, i64 8}
!17 = !{!18, !10, i64 108}
!18 = !{!"layer", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !14, i64 196, !14, i64 200, !14, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !10, i64 236, !10, i64 240, !10, i64 244, !10, i64 248, !10, i64 252, !14, i64 256, !14, i64 260, !14, i64 264, !10, i64 268, !14, i64 272, !14, i64 276, !14, i64 280, !14, i64 284, !14, i64 288, !14, i64 292, !14, i64 296, !10, i64 300, !10, i64 304, !14, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !14, i64 328, !14, i64 332, !14, 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, !19, i64 800}
!19 = !{!"long", !7, i64 0}
!20 = !{!12, !10, i64 12}
!21 = !{!18, !10, i64 112}
!22 = !{!12, !10, i64 16}
!23 = !{!18, !10, i64 116}
!24 = !{!18, !10, i64 96}
!25 = !{!18, !10, i64 100}
!26 = !{!18, !10, i64 104}


; 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.size_params = type { i32, i32, i32, i32, i32, 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 }

@.str.33 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [7 x i8], align 1

declare ptr @option_find_str(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @get_activation(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @parse_activation(ptr dead_on_unwind noalias writable sret(%struct.layer) align 8 %0, ptr noundef %1, ptr nocapture noundef readonly byval(%struct.size_params) align 8 %2) local_unnamed_addr #1 {
  %4 = tail call ptr @option_find_str(ptr noundef %1, ptr noundef nonnull @.str.33, ptr noundef nonnull @.str.98) #2
  %5 = tail call i32 @get_activation(ptr noundef %4) #2
  %6 = load i32, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !13
  tail call void @make_activation_layer(ptr dead_on_unwind writable sret(%struct.layer) align 8 %0, i32 noundef %6, i32 noundef %8, i32 noundef %5) #2
  %9 = getelementptr inbounds i8, ptr %2, i64 8
  %10 = load <4 x i32>, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr %2, i64 12
  %12 = getelementptr inbounds i8, ptr %0, i64 112
  %13 = load <2 x i32>, ptr %11, align 4, !tbaa !14
  store <2 x i32> %13, ptr %12, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = shufflevector <2 x i32> %13, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
  %16 = shufflevector <4 x i32> %10, <4 x i32> %15, <4 x i32> <i32 0, i32 4, i32 5, i32 poison>
  %17 = shufflevector <4 x i32> %16, <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 0>
  store <4 x i32> %17, ptr %14, align 8, !tbaa !14
  ret void
}

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

attributes #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 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 = { 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 = !{!"size_params", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"network", !11, i64 0, !7, i64 8, !7, i64 12, !11, i64 16, !12, i64 24, !7, i64 28, !12, i64 32, !12, i64 36, !11, i64 40, !7, i64 48, !11, i64 56, !7, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !11, i64 96, !11, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !7, i64 180, !11, i64 184}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!6, !7, i64 4}
!14 = !{!7, !7, i64 0}


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