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

; 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

; Function Attrs: nounwind uwtable
define dso_local void @update_local_layer(ptr noundef byval(%struct.layer) align 8 %0, i32 noundef %1, float noundef %2, float noundef %3, float noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 %1, ptr %6, align 4, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !9
  store float %4, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %12 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 21
  %13 = load i32, ptr %12, align 8, !tbaa !11
  %14 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 20
  %15 = load i32, ptr %14, align 4, !tbaa !15
  %16 = mul nsw i32 %13, %15
  store i32 %16, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %17 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 26
  %18 = load i32, ptr %17, align 4, !tbaa !16
  %19 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 26
  %20 = load i32, ptr %19, align 4, !tbaa !16
  %21 = mul nsw i32 %18, %20
  %22 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 19
  %23 = load i32, ptr %22, align 8, !tbaa !17
  %24 = mul nsw i32 %21, %23
  %25 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 23
  %26 = load i32, ptr %25, align 8, !tbaa !18
  %27 = mul nsw i32 %24, %26
  %28 = load i32, ptr %10, align 4, !tbaa !5
  %29 = mul nsw i32 %27, %28
  store i32 %29, ptr %11, align 4, !tbaa !5
  %30 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %31 = load i32, ptr %30, align 8, !tbaa !19
  %32 = load float, ptr %7, align 4, !tbaa !9
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sitofp i32 %33 to float
  %35 = fdiv float %32, %34
  %36 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 94
  %37 = load ptr, ptr %36, align 8, !tbaa !20
  %38 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 93
  %39 = load ptr, ptr %38, align 8, !tbaa !21
  call void @axpy_cpu(i32 noundef %31, float noundef %35, ptr noundef %37, i32 noundef 1, ptr noundef %39, i32 noundef 1)
  %40 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 15
  %41 = load i32, ptr %40, align 8, !tbaa !19
  %42 = load float, ptr %8, align 4, !tbaa !9
  %43 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 94
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  call void @scal_cpu(i32 noundef %41, float noundef %42, ptr noundef %44, i32 noundef 1)
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %46 = load float, ptr %9, align 4, !tbaa !9
  %47 = fneg float %46
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = sitofp i32 %48 to float
  %50 = fmul float %47, %49
  %51 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 97
  %52 = load ptr, ptr %51, align 8, !tbaa !22
  %53 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 98
  %54 = load ptr, ptr %53, align 8, !tbaa !23
  call void @axpy_cpu(i32 noundef %45, float noundef %50, ptr noundef %52, i32 noundef 1, ptr noundef %54, i32 noundef 1)
  %55 = load i32, ptr %11, align 4, !tbaa !5
  %56 = load float, ptr %7, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sitofp i32 %57 to float
  %59 = fdiv float %56, %58
  %60 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 98
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  %62 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 97
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  call void @axpy_cpu(i32 noundef %55, float noundef %59, ptr noundef %61, i32 noundef 1, ptr noundef %63, i32 noundef 1)
  %64 = load i32, ptr %11, align 4, !tbaa !5
  %65 = load float, ptr %8, align 4, !tbaa !9
  %66 = getelementptr inbounds %struct.layer, ptr %0, i32 0, i32 98
  %67 = load ptr, ptr %66, align 8, !tbaa !23
  call void @scal_cpu(i32 noundef %64, float noundef %65, ptr noundef %67, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  ret void
}

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

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, !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 = !{!"float", !7, i64 0}
!11 = !{!12, !6, i64 112}
!12 = !{!"layer", !6, i64 0, !6, i64 4, !6, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, 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, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, 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, !10, i64 256, !10, i64 260, !10, i64 264, !6, i64 268, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !10, i64 288, !10, i64 292, !10, i64 296, !6, i64 300, !6, i64 304, !10, i64 308, !6, i64 312, !6, i64 316, !6, i64 320, !6, i64 324, !10, i64 328, !10, i64 332, !10, i64 336, !13, i64 344, !13, i64 352, !13, i64 360, !13, i64 368, !13, i64 376, !13, i64 384, !13, i64 392, !13, i64 400, !13, i64 408, !13, i64 416, !13, i64 424, !13, i64 432, !13, i64 440, !13, i64 448, !13, i64 456, !13, i64 464, !13, i64 472, !13, i64 480, !13, i64 488, !13, i64 496, !13, i64 504, !13, i64 512, !13, i64 520, !13, i64 528, !13, i64 536, !13, i64 544, !13, i64 552, !13, i64 560, !13, i64 568, !13, i64 576, !13, i64 584, !13, i64 592, !13, i64 600, !13, i64 608, !13, i64 616, !13, i64 624, !13, i64 632, !13, i64 640, !13, i64 648, !13, i64 656, !13, i64 664, !13, i64 672, !13, i64 680, !13, i64 688, !13, i64 696, !13, i64 704, !13, i64 712, !13, i64 720, !13, i64 728, !13, i64 736, !13, i64 744, !13, i64 752, !13, i64 760, !13, i64 768, !13, i64 776, !13, i64 784, !13, i64 792, !14, i64 800}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !6, i64 108}
!16 = !{!12, !6, i64 132}
!17 = !{!12, !6, i64 104}
!18 = !{!12, !6, i64 120}
!19 = !{!12, !6, i64 88}
!20 = !{!12, !13, i64 472}
!21 = !{!12, !13, i64 464}
!22 = !{!12, !13, i64 496}
!23 = !{!12, !13, i64 504}


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

; Function Attrs: nounwind uwtable
define dso_local void @update_local_layer(ptr nocapture noundef readonly byval(%struct.layer) align 8 %0, i32 noundef %1, float noundef %2, float noundef %3, float noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %0, i64 112
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 108
  %9 = load i32, ptr %8, align 4, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %0, i64 132
  %11 = load i32, ptr %10, align 4, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %0, i64 104
  %13 = load i32, ptr %12, align 8, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %0, i64 120
  %15 = load i32, ptr %14, align 8, !tbaa !16
  %16 = mul i32 %9, %7
  %17 = mul i32 %16, %11
  %18 = mul i32 %17, %11
  %19 = mul i32 %18, %13
  %20 = mul i32 %19, %15
  %21 = getelementptr inbounds i8, ptr %0, i64 88
  %22 = load i32, ptr %21, align 8, !tbaa !17
  %23 = sitofp i32 %1 to float
  %24 = fdiv float %2, %23
  %25 = getelementptr inbounds i8, ptr %0, i64 472
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %0, i64 464
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  tail call void @axpy_cpu(i32 noundef %22, float noundef %24, ptr noundef %26, i32 noundef 1, ptr noundef %28, i32 noundef 1) #2
  tail call void @scal_cpu(i32 noundef %22, float noundef %3, ptr noundef %26, i32 noundef 1) #2
  %29 = fneg float %4
  %30 = fmul float %23, %29
  %31 = getelementptr inbounds i8, ptr %0, i64 496
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  %33 = getelementptr inbounds i8, ptr %0, i64 504
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  tail call void @axpy_cpu(i32 noundef %20, float noundef %30, ptr noundef %32, i32 noundef 1, ptr noundef %34, i32 noundef 1) #2
  tail call void @axpy_cpu(i32 noundef %20, float noundef %24, ptr noundef %34, i32 noundef 1, ptr noundef %32, i32 noundef 1) #2
  tail call void @scal_cpu(i32 noundef %20, float noundef %3, ptr noundef %34, i32 noundef 1) #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

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 112}
!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 108}
!14 = !{!6, !7, i64 132}
!15 = !{!6, !7, i64 104}
!16 = !{!6, !7, i64 120}
!17 = !{!6, !7, i64 88}
!18 = !{!6, !10, i64 472}
!19 = !{!6, !10, i64 464}
!20 = !{!6, !10, i64 496}
!21 = !{!6, !10, i64 504}


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