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

; 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.data = type { i32, i32, %struct.matrix, %struct.matrix, i32, ptr, ptr }
%struct.matrix = type { i32, i32, ptr }

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @get_random_paths(ptr noundef, i32 noundef, i32 noundef) #1

; 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) #2

; Function Attrs: nounwind uwtable
declare dso_local { i64, ptr } @load_image_augment_paths(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
declare dso_local { i64, ptr } @load_labels_paths(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @load_data_augment(ptr dead_on_unwind noalias writable sret(%struct.data) align 8 %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, float noundef %10, float noundef %11, float noundef %12, float noundef %13, float noundef %14) #1 {
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca %struct.matrix, align 8
  %31 = alloca %struct.matrix, align 8
  store ptr %1, ptr %16, align 8, !tbaa !5
  store i32 %2, ptr %17, align 4, !tbaa !9
  store i32 %3, ptr %18, align 4, !tbaa !9
  store ptr %4, ptr %19, align 8, !tbaa !5
  store i32 %5, ptr %20, align 4, !tbaa !9
  store ptr %6, ptr %21, align 8, !tbaa !5
  store i32 %7, ptr %22, align 4, !tbaa !9
  store i32 %8, ptr %23, align 4, !tbaa !9
  store i32 %9, ptr %24, align 4, !tbaa !9
  store float %10, ptr %25, align 4, !tbaa !11
  store float %11, ptr %26, align 4, !tbaa !11
  store float %12, ptr %27, align 4, !tbaa !11
  store float %13, ptr %28, align 4, !tbaa !11
  store float %14, ptr %29, align 4, !tbaa !11
  %32 = load i32, ptr %18, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %39

34:                                               ; preds = %15
  %35 = load ptr, ptr %16, align 8, !tbaa !5
  %36 = load i32, ptr %17, align 4, !tbaa !9
  %37 = load i32, ptr %18, align 4, !tbaa !9
  %38 = call ptr @get_random_paths(ptr noundef %35, i32 noundef %36, i32 noundef %37)
  store ptr %38, ptr %16, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %34, %15
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 64, i1 false)
  %40 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 4
  store i32 0, ptr %40, align 8, !tbaa !13
  %41 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #5
  %42 = load ptr, ptr %16, align 8, !tbaa !5
  %43 = load i32, ptr %17, align 4, !tbaa !9
  %44 = load i32, ptr %22, align 4, !tbaa !9
  %45 = load i32, ptr %23, align 4, !tbaa !9
  %46 = load i32, ptr %24, align 4, !tbaa !9
  %47 = load float, ptr %25, align 4, !tbaa !11
  %48 = load float, ptr %26, align 4, !tbaa !11
  %49 = load float, ptr %27, align 4, !tbaa !11
  %50 = load float, ptr %28, align 4, !tbaa !11
  %51 = load float, ptr %29, align 4, !tbaa !11
  %52 = call { i64, ptr } @load_image_augment_paths(ptr noundef %42, i32 noundef %43, i32 noundef %44, i32 noundef %45, i32 noundef %46, float noundef %47, float noundef %48, float noundef %49, float noundef %50, float noundef %51)
  %53 = getelementptr inbounds { i64, ptr }, ptr %30, i32 0, i32 0
  %54 = extractvalue { i64, ptr } %52, 0
  store i64 %54, ptr %53, align 8
  %55 = getelementptr inbounds { i64, ptr }, ptr %30, i32 0, i32 1
  %56 = extractvalue { i64, ptr } %52, 1
  store ptr %56, ptr %55, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 8 %30, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #5
  %57 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #5
  %58 = load ptr, ptr %16, align 8, !tbaa !5
  %59 = load i32, ptr %17, align 4, !tbaa !9
  %60 = load ptr, ptr %19, align 8, !tbaa !5
  %61 = load i32, ptr %20, align 4, !tbaa !9
  %62 = load ptr, ptr %21, align 8, !tbaa !5
  %63 = call { i64, ptr } @load_labels_paths(ptr noundef %58, i32 noundef %59, ptr noundef %60, i32 noundef %61, ptr noundef %62)
  %64 = getelementptr inbounds { i64, ptr }, ptr %31, i32 0, i32 0
  %65 = extractvalue { i64, ptr } %63, 0
  store i64 %65, ptr %64, align 8
  %66 = getelementptr inbounds { i64, ptr }, ptr %31, i32 0, i32 1
  %67 = extractvalue { i64, ptr } %63, 1
  store ptr %67, ptr %66, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %57, ptr align 8 %31, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #5
  %68 = load i32, ptr %18, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %39
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %71) #5
  br label %72

72:                                               ; preds = %70, %39
  ret void
}

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 40}
!14 = !{!"", !10, i64 0, !10, i64 4, !15, i64 8, !15, i64 24, !10, i64 40, !6, i64 48, !6, i64 56}
!15 = !{!"matrix", !10, i64 0, !10, i64 4, !6, i64 8}
!16 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 8, !5}


; 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.data = type { i32, i32, %struct.matrix, %struct.matrix, i32, ptr, ptr }
%struct.matrix = type { i32, i32, ptr }

; Function Attrs: nounwind uwtable
declare dso_local ptr @get_random_paths(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local { i64, ptr } @load_image_augment_paths(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) 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: nounwind uwtable
declare dso_local { i64, ptr } @load_labels_paths(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @load_data_augment(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.data) align 8 %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, float noundef %10, float noundef %11, float noundef %12, float noundef %13, float noundef %14) local_unnamed_addr #0 {
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %18, label %16

16:                                               ; preds = %15
  %17 = tail call ptr @get_random_paths(ptr noundef %1, i32 noundef %2, i32 noundef %3)
  br label %18

18:                                               ; preds = %16, %15
  %.0 = phi ptr [ %17, %16 ], [ %1, %15 ]
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %0, i8 0, i64 64, i1 false)
  %20 = tail call { i64, ptr } @load_image_augment_paths(ptr noundef %.0, i32 noundef %2, i32 noundef %7, i32 noundef %8, i32 noundef %9, float noundef %10, float noundef %11, float noundef %12, float noundef %13, float noundef %14)
  %21 = extractvalue { i64, ptr } %20, 0
  %22 = extractvalue { i64, ptr } %20, 1
  store i64 %21, ptr %19, align 8
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %22, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 24
  %24 = tail call { i64, ptr } @load_labels_paths(ptr noundef %.0, i32 noundef %2, ptr noundef %4, i32 noundef %5, ptr noundef %6)
  %25 = extractvalue { i64, ptr } %24, 0
  %26 = extractvalue { i64, ptr } %24, 1
  store i64 %25, ptr %23, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %26, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !5
  br i1 %.not, label %28, label %27

27:                                               ; preds = %18
  tail call void @free(ptr noundef %.0) #3
  br label %28

28:                                               ; preds = %27, %18
  ret void
}

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 nounwind willreturn allockind("free") memory(argmem: readwrite, 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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"}


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