; LLVM IR from robotics-upo/Heuristic_path_planners :: include/voro++-0.4.6/src (container_prd)

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

%"class.voro::container_periodic_base" = type { %"class.voro::unitcell", %"class.voro::voro_base", i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%"class.voro::unitcell" = type { double, double, double, double, double, double, %"class.voro::voronoicell", double, double }
%"class.voro::voronoicell" = type { %"class.voro::voronoicell_base" }
%"class.voro::voronoicell_base" = type { ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, double, double, double, double }
%"class.voro::voro_base" = type { i32, i32, i32, i32, i32, double, double, double, double, double, double, 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: mustprogress uwtable
declare dso_local void @_ZN4voro23container_periodic_base19add_particle_memoryEi(ptr noundef nonnull align 8 dereferenceable(384), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4voro23container_periodic_base9put_imageEiiiddd(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, double noundef %5, double noundef %6) #1 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store double %4, ptr %12, align 8, !tbaa !11
  store double %5, ptr %13, align 8, !tbaa !11
  store double %6, ptr %14, align 8, !tbaa !11
  %17 = load ptr, ptr %8, align 8
  %18 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 11
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = load i32, ptr %9, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr %19, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 12
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr %25, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = icmp eq i32 %23, %29
  br i1 %30, label %31, label %33

31:                                               ; preds = %7
  %32 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN4voro23container_periodic_base19add_particle_memoryEi(ptr noundef nonnull align 8 dereferenceable(384) %17, i32 noundef %32)
  br label %33

33:                                               ; preds = %31, %7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #2
  %34 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 10
  %35 = load ptr, ptr %34, align 8, !tbaa !20
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds ptr, ptr %35, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 15
  %41 = load i32, ptr %40, align 4, !tbaa !21
  %42 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 11
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr %43, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = mul nsw i32 %41, %47
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds double, ptr %39, i64 %49
  store ptr %50, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  %51 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 10
  %52 = load ptr, ptr %51, align 8, !tbaa !20
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 15
  %58 = load i32, ptr %57, align 4, !tbaa !21
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = mul nsw i32 %58, %59
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %56, i64 %61
  store ptr %62, ptr %16, align 8, !tbaa !5
  %63 = load ptr, ptr %16, align 8, !tbaa !5
  %64 = getelementptr inbounds double, ptr %63, i32 1
  store ptr %64, ptr %16, align 8, !tbaa !5
  %65 = load double, ptr %63, align 8, !tbaa !11
  %66 = load double, ptr %12, align 8, !tbaa !11
  %67 = fadd double %65, %66
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = getelementptr inbounds double, ptr %68, i32 1
  store ptr %69, ptr %15, align 8, !tbaa !5
  store double %67, ptr %68, align 8, !tbaa !11
  %70 = load ptr, ptr %16, align 8, !tbaa !5
  %71 = getelementptr inbounds double, ptr %70, i32 1
  store ptr %71, ptr %16, align 8, !tbaa !5
  %72 = load double, ptr %70, align 8, !tbaa !11
  %73 = load double, ptr %13, align 8, !tbaa !11
  %74 = fadd double %72, %73
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = getelementptr inbounds double, ptr %75, i32 1
  store ptr %76, ptr %15, align 8, !tbaa !5
  store double %74, ptr %75, align 8, !tbaa !11
  %77 = load ptr, ptr %16, align 8, !tbaa !5
  %78 = load double, ptr %77, align 8, !tbaa !11
  %79 = load double, ptr %14, align 8, !tbaa !11
  %80 = fadd double %78, %79
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  store double %80, ptr %81, align 8, !tbaa !11
  %82 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 15
  %83 = load i32, ptr %82, align 4, !tbaa !21
  %84 = icmp eq i32 %83, 4
  br i1 %84, label %85, label %91

85:                                               ; preds = %33
  %86 = load ptr, ptr %16, align 8, !tbaa !5
  %87 = getelementptr inbounds double, ptr %86, i32 1
  store ptr %87, ptr %16, align 8, !tbaa !5
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = getelementptr inbounds double, ptr %89, i32 1
  store ptr %90, ptr %15, align 8, !tbaa !5
  store double %88, ptr %90, align 8, !tbaa !11
  br label %91

91:                                               ; preds = %85, %33
  %92 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 9
  %93 = load ptr, ptr %92, align 8, !tbaa !22
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds ptr, ptr %93, i64 %95
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %97, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 9
  %103 = load ptr, ptr %102, align 8, !tbaa !22
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.voro::container_periodic_base", ptr %17, i32 0, i32 11
  %109 = load ptr, ptr %108, align 8, !tbaa !13
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %109, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %112, align 4, !tbaa !9
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds i32, ptr %107, i64 %115
  store i32 %101, ptr %116, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 352}
!14 = !{!"_ZTSN4voro23container_periodic_baseE", !15, i64 0, !18, i64 224, !10, i64 304, !10, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !10, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !10, i64 376, !10, i64 380}
!15 = !{!"_ZTSN4voro8unitcellE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !16, i64 48, !12, i64 208, !12, i64 216}
!16 = !{!"_ZTSN4voro11voronoicellE", !17, i64 0}
!17 = !{!"_ZTSN4voro16voronoicell_baseE", !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !6, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152}
!18 = !{!"_ZTSN4voro9voro_baseE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !6, i64 72}
!19 = !{!14, !6, i64 360}
!20 = !{!14, !6, i64 344}
!21 = !{!14, !10, i64 380}
!22 = !{!14, !6, i64 336}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4voro23container_periodic_base19add_particle_memoryEi(ptr noundef nonnull align 8 dereferenceable(384), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4voro23container_periodic_base9put_imageEiiiddd(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, double noundef %5, double noundef %6) local_unnamed_addr #0 align 2 {
  %8 = getelementptr inbounds i8, ptr %0, i64 352
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = sext i32 %1 to i64
  %11 = getelementptr inbounds i32, ptr %9, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 360
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %15 = getelementptr inbounds i32, ptr %14, i64 %10
  %16 = load i32, ptr %15, align 4, !tbaa !16
  %17 = icmp eq i32 %12, %16
  br i1 %17, label %18, label %19

18:                                               ; preds = %7
  tail call void @_ZN4voro23container_periodic_base19add_particle_memoryEi(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef %1)
  %.pre = load ptr, ptr %8, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i32, ptr %.pre, i64 %10
  %.pre22 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !16
  br label %19

19:                                               ; preds = %18, %7
  %20 = phi i32 [ %.pre22, %18 ], [ %12, %7 ]
  %21 = phi ptr [ %.pre, %18 ], [ %9, %7 ]
  %22 = getelementptr inbounds i8, ptr %0, i64 344
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = getelementptr inbounds ptr, ptr %23, i64 %10
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %26 = getelementptr inbounds i8, ptr %0, i64 380
  %27 = load i32, ptr %26, align 4, !tbaa !20
  %28 = mul nsw i32 %20, %27
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds double, ptr %25, i64 %29
  %31 = sext i32 %2 to i64
  %32 = getelementptr inbounds ptr, ptr %23, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !19
  %34 = mul nsw i32 %27, %3
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds double, ptr %33, i64 %35
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load double, ptr %36, align 8, !tbaa !21
  %39 = fadd double %38, %4
  %40 = getelementptr inbounds i8, ptr %30, i64 8
  store double %39, ptr %30, align 8, !tbaa !21
  %41 = getelementptr inbounds i8, ptr %36, i64 16
  %42 = load double, ptr %37, align 8, !tbaa !21
  %43 = fadd double %42, %5
  %44 = getelementptr inbounds i8, ptr %30, i64 16
  store double %43, ptr %40, align 8, !tbaa !21
  %45 = load double, ptr %41, align 8, !tbaa !21
  %46 = fadd double %45, %6
  store double %46, ptr %44, align 8, !tbaa !21
  %47 = icmp eq i32 %27, 4
  br i1 %47, label %48, label %52

48:                                               ; preds = %19
  %49 = getelementptr inbounds i8, ptr %36, i64 24
  %50 = load double, ptr %49, align 8, !tbaa !21
  %51 = getelementptr inbounds i8, ptr %30, i64 24
  store double %50, ptr %51, align 8, !tbaa !21
  br label %52

52:                                               ; preds = %48, %19
  %53 = getelementptr inbounds i32, ptr %21, i64 %10
  %54 = getelementptr inbounds i8, ptr %0, i64 336
  %55 = load ptr, ptr %54, align 8, !tbaa !22
  %56 = getelementptr inbounds ptr, ptr %55, i64 %31
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = sext i32 %3 to i64
  %59 = getelementptr inbounds i32, ptr %57, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !16
  %61 = getelementptr inbounds ptr, ptr %55, i64 %10
  %62 = load ptr, ptr %61, align 8, !tbaa !19
  %63 = add nsw i32 %20, 1
  store i32 %63, ptr %53, align 4, !tbaa !16
  %64 = sext i32 %20 to i64
  %65 = getelementptr inbounds i32, ptr %62, i64 %64
  store i32 %60, ptr %65, align 4, !tbaa !16
  ret void
}

attributes #0 = { mustprogress 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" }

!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, !14, i64 352}
!6 = !{!"_ZTSN4voro23container_periodic_baseE", !7, i64 0, !15, i64 224, !13, i64 304, !13, i64 308, !13, i64 312, !13, i64 316, !13, i64 320, !13, i64 324, !13, i64 328, !14, i64 336, !14, i64 344, !14, i64 352, !14, i64 360, !14, i64 368, !13, i64 376, !13, i64 380}
!7 = !{!"_ZTSN4voro8unitcellE", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !11, i64 48, !8, i64 208, !8, i64 216}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN4voro11voronoicellE", !12, i64 0}
!12 = !{!"_ZTSN4voro16voronoicell_baseE", !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !13, i64 112, !13, i64 116, !14, i64 120, !8, i64 128, !8, i64 136, !8, i64 144, !8, i64 152}
!13 = !{!"int", !9, i64 0}
!14 = !{!"any pointer", !9, i64 0}
!15 = !{!"_ZTSN4voro9voro_baseE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !14, i64 72}
!16 = !{!13, !13, i64 0}
!17 = !{!6, !14, i64 360}
!18 = !{!6, !14, i64 344}
!19 = !{!14, !14, i64 0}
!20 = !{!6, !13, i64 380}
!21 = !{!8, !8, i64 0}
!22 = !{!6, !14, i64 336}


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