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

; 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::pre_container_base" = type { double, double, double, double, double, double, i8, i8, i8, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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
define dso_local void @_ZN4voro13pre_container5setupERNS_14particle_orderERNS_9containerE(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 8 dereferenceable(368) %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %17 = getelementptr inbounds %"class.voro::pre_container_base", ptr %16, i32 0, i32 11
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  store ptr %18, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %19 = getelementptr inbounds %"class.voro::pre_container_base", ptr %16, i32 0, i32 16
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  store ptr %20, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  br label %21

21:                                               ; preds = %58, %3
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.voro::pre_container_base", ptr %16, i32 0, i32 12
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = icmp ult ptr %22, %24
  br i1 %25, label %26, label %59

26:                                               ; preds = %21
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds ptr, ptr %27, i32 1
  store ptr %28, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %27, align 8, !tbaa !5
  store ptr %29, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %30, i64 1024
  store ptr %31, ptr %9, align 8, !tbaa !5
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = getelementptr inbounds ptr, ptr %32, i32 1
  store ptr %33, ptr %11, align 8, !tbaa !5
  %34 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %34, ptr %12, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %39, %26
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = icmp ult ptr %36, %37
  br i1 %38, label %39, label %58

39:                                               ; preds = %35
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds i32, ptr %40, i32 1
  store ptr %41, ptr %8, align 8, !tbaa !5
  %42 = load i32, ptr %40, align 4, !tbaa !16
  store i32 %42, ptr %10, align 4, !tbaa !16
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = getelementptr inbounds double, ptr %43, i32 1
  store ptr %44, ptr %12, align 8, !tbaa !5
  %45 = load double, ptr %43, align 8, !tbaa !17
  store double %45, ptr %13, align 8, !tbaa !17
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %46, i32 1
  store ptr %47, ptr %12, align 8, !tbaa !5
  %48 = load double, ptr %46, align 8, !tbaa !17
  store double %48, ptr %14, align 8, !tbaa !17
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %49, i32 1
  store ptr %50, ptr %12, align 8, !tbaa !5
  %51 = load double, ptr %49, align 8, !tbaa !17
  store double %51, ptr %15, align 8, !tbaa !17
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !16
  %55 = load double, ptr %13, align 8, !tbaa !17
  %56 = load double, ptr %14, align 8, !tbaa !17
  %57 = load double, ptr %15, align 8, !tbaa !17
  call void @_ZN4voro9container3putERNS_14particle_orderEiddd(ptr noundef nonnull align 8 dereferenceable(368) %52, ptr noundef nonnull align 8 dereferenceable(20) %53, i32 noundef %54, double noundef %55, double noundef %56, double noundef %57)
  br label %35, !llvm.loop !18

58:                                               ; preds = %35
  br label %21, !llvm.loop !20

59:                                               ; preds = %21
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  store ptr %61, ptr %8, align 8, !tbaa !5
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  store ptr %63, ptr %12, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %69, %59
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.voro::pre_container_base", ptr %16, i32 0, i32 14
  %67 = load ptr, ptr %66, align 8, !tbaa !21
  %68 = icmp ult ptr %65, %67
  br i1 %68, label %69, label %88

69:                                               ; preds = %64
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds i32, ptr %70, i32 1
  store ptr %71, ptr %8, align 8, !tbaa !5
  %72 = load i32, ptr %70, align 4, !tbaa !16
  store i32 %72, ptr %10, align 4, !tbaa !16
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = getelementptr inbounds double, ptr %73, i32 1
  store ptr %74, ptr %12, align 8, !tbaa !5
  %75 = load double, ptr %73, align 8, !tbaa !17
  store double %75, ptr %13, align 8, !tbaa !17
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = getelementptr inbounds double, ptr %76, i32 1
  store ptr %77, ptr %12, align 8, !tbaa !5
  %78 = load double, ptr %76, align 8, !tbaa !17
  store double %78, ptr %14, align 8, !tbaa !17
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds double, ptr %79, i32 1
  store ptr %80, ptr %12, align 8, !tbaa !5
  %81 = load double, ptr %79, align 8, !tbaa !17
  store double %81, ptr %15, align 8, !tbaa !17
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load i32, ptr %10, align 4, !tbaa !16
  %85 = load double, ptr %13, align 8, !tbaa !17
  %86 = load double, ptr %14, align 8, !tbaa !17
  %87 = load double, ptr %15, align 8, !tbaa !17
  call void @_ZN4voro9container3putERNS_14particle_orderEiddd(ptr noundef nonnull align 8 dereferenceable(368) %82, ptr noundef nonnull align 8 dereferenceable(20) %83, i32 noundef %84, double noundef %85, double noundef %86, double noundef %87)
  br label %64, !llvm.loop !22

88:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

declare void @_ZN4voro9container3putERNS_14particle_orderEiddd(ptr noundef nonnull align 8 dereferenceable(368), ptr noundef nonnull align 8 dereferenceable(20), i32 noundef, double noundef, double noundef, double noundef) #2

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 = { "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++ TBAA"}
!9 = !{!10, !6, i64 64}
!10 = !{!"_ZTSN4voro18pre_container_baseE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !12, i64 49, !12, i64 50, !13, i64 52, !13, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"double", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !6, i64 104}
!15 = !{!10, !6, i64 72}
!16 = !{!13, !13, i64 0}
!17 = !{!11, !11, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!10, !6, i64 88}
!22 = distinct !{!22, !19}


; 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
define dso_local void @_ZN4voro13pre_container5setupERNS_14particle_orderERNS_9containerE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 8 dereferenceable(368) %2) local_unnamed_addr #0 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 64
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 104
  %7 = load ptr, ptr %6, align 8, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  %10 = icmp ult ptr %5, %9
  br i1 %10, label %.lr.ph, label %._crit_edge

.loopexit:                                        ; preds = %17
  %11 = getelementptr inbounds i8, ptr %.03035, i64 8
  %12 = getelementptr inbounds i8, ptr %.02936, i64 8
  %13 = load ptr, ptr %8, align 8, !tbaa !14
  %14 = icmp ult ptr %11, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !15

.lr.ph:                                           ; preds = %3, %.loopexit
  %.02936 = phi ptr [ %12, %.loopexit ], [ %7, %3 ]
  %.03035 = phi ptr [ %11, %.loopexit ], [ %5, %3 ]
  %15 = load ptr, ptr %.03035, align 8, !tbaa !17
  %16 = load ptr, ptr %.02936, align 8, !tbaa !17
  br label %17

17:                                               ; preds = %.lr.ph, %17
  %.034 = phi ptr [ %16, %.lr.ph ], [ %23, %17 ]
  %.031.idx33 = phi i64 [ 0, %.lr.ph ], [ %.031.add, %17 ]
  %.031.ptr = getelementptr inbounds i8, ptr %15, i64 %.031.idx33
  %.031.add = add nuw nsw i64 %.031.idx33, 4
  %18 = load i32, ptr %.031.ptr, align 4, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %.034, i64 8
  %20 = load double, ptr %.034, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %.034, i64 16
  %22 = load double, ptr %19, align 8, !tbaa !19
  %23 = getelementptr inbounds i8, ptr %.034, i64 24
  %24 = load double, ptr %21, align 8, !tbaa !19
  tail call void @_ZN4voro9container3putERNS_14particle_orderEiddd(ptr noundef nonnull align 8 dereferenceable(368) %2, ptr noundef nonnull align 8 dereferenceable(20) %1, i32 noundef %18, double noundef %20, double noundef %22, double noundef %24)
  %25 = icmp ult i64 %.031.idx33, 4092
  br i1 %25, label %17, label %.loopexit, !llvm.loop !20

._crit_edge:                                      ; preds = %.loopexit, %3
  %.030.lcssa = phi ptr [ %5, %3 ], [ %11, %.loopexit ]
  %.029.lcssa = phi ptr [ %7, %3 ], [ %12, %.loopexit ]
  %26 = load ptr, ptr %.030.lcssa, align 8, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %0, i64 88
  %28 = load ptr, ptr %27, align 8, !tbaa !21
  %29 = icmp ult ptr %26, %28
  br i1 %29, label %.lr.ph41.preheader, label %._crit_edge42

.lr.ph41.preheader:                               ; preds = %._crit_edge
  %30 = load ptr, ptr %.029.lcssa, align 8, !tbaa !17
  br label %.lr.ph41

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %.lr.ph41
  %.139 = phi ptr [ %37, %.lr.ph41 ], [ %30, %.lr.ph41.preheader ]
  %.13238 = phi ptr [ %31, %.lr.ph41 ], [ %26, %.lr.ph41.preheader ]
  %31 = getelementptr inbounds i8, ptr %.13238, i64 4
  %32 = load i32, ptr %.13238, align 4, !tbaa !18
  %33 = getelementptr inbounds i8, ptr %.139, i64 8
  %34 = load double, ptr %.139, align 8, !tbaa !19
  %35 = getelementptr inbounds i8, ptr %.139, i64 16
  %36 = load double, ptr %33, align 8, !tbaa !19
  %37 = getelementptr inbounds i8, ptr %.139, i64 24
  %38 = load double, ptr %35, align 8, !tbaa !19
  tail call void @_ZN4voro9container3putERNS_14particle_orderEiddd(ptr noundef nonnull align 8 dereferenceable(368) %2, ptr noundef nonnull align 8 dereferenceable(20) %1, i32 noundef %32, double noundef %34, double noundef %36, double noundef %38)
  %39 = load ptr, ptr %27, align 8, !tbaa !21
  %40 = icmp ult ptr %31, %39
  br i1 %40, label %.lr.ph41, label %._crit_edge42, !llvm.loop !22

._crit_edge42:                                    ; preds = %.lr.ph41, %._crit_edge
  ret void
}

declare void @_ZN4voro9container3putERNS_14particle_orderEiddd(ptr noundef nonnull align 8 dereferenceable(368), ptr noundef nonnull align 8 dereferenceable(20), i32 noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

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

!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, !12, i64 64}
!6 = !{!"_ZTSN4voro18pre_container_baseE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !10, i64 49, !10, i64 50, !11, i64 52, !11, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !12, i64 104}
!14 = !{!6, !12, i64 72}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !12, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !16}
!21 = !{!6, !12, i64 88}
!22 = distinct !{!22, !16}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass