; 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 @_ZN4voro18pre_container_poly5setupERNS_14particle_orderERNS_14container_polyE(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 8 dereferenceable(408) %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
  %16 = 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
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %18 = getelementptr inbounds %"class.voro::pre_container_base", ptr %17, i32 0, i32 11
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  store ptr %19, 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
  %20 = getelementptr inbounds %"class.voro::pre_container_base", ptr %17, i32 0, i32 16
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  store ptr %21, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  br label %22

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

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

36:                                               ; preds = %40, %27
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = icmp ult ptr %37, %38
  br i1 %39, label %40, label %63

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

63:                                               ; preds = %36
  br label %22, !llvm.loop !20

64:                                               ; preds = %22
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  store ptr %66, ptr %8, align 8, !tbaa !5
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  store ptr %68, ptr %12, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %74, %64
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %"class.voro::pre_container_base", ptr %17, i32 0, i32 14
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = icmp ult ptr %70, %72
  br i1 %73, label %74, label %97

74:                                               ; preds = %69
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds i32, ptr %75, i32 1
  store ptr %76, ptr %8, align 8, !tbaa !5
  %77 = load i32, ptr %75, align 4, !tbaa !16
  store i32 %77, ptr %10, align 4, !tbaa !16
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds double, ptr %78, i32 1
  store ptr %79, ptr %12, align 8, !tbaa !5
  %80 = load double, ptr %78, align 8, !tbaa !17
  store double %80, ptr %13, align 8, !tbaa !17
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds double, ptr %81, i32 1
  store ptr %82, ptr %12, align 8, !tbaa !5
  %83 = load double, ptr %81, align 8, !tbaa !17
  store double %83, ptr %14, align 8, !tbaa !17
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds double, ptr %84, i32 1
  store ptr %85, ptr %12, align 8, !tbaa !5
  %86 = load double, ptr %84, align 8, !tbaa !17
  store double %86, ptr %15, align 8, !tbaa !17
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds double, ptr %87, i32 1
  store ptr %88, ptr %12, align 8, !tbaa !5
  %89 = load double, ptr %87, align 8, !tbaa !17
  store double %89, ptr %16, align 8, !tbaa !17
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = load i32, ptr %10, align 4, !tbaa !16
  %93 = load double, ptr %13, align 8, !tbaa !17
  %94 = load double, ptr %14, align 8, !tbaa !17
  %95 = load double, ptr %15, align 8, !tbaa !17
  %96 = load double, ptr %16, align 8, !tbaa !17
  call void @_ZN4voro14container_poly3putERNS_14particle_orderEidddd(ptr noundef nonnull align 8 dereferenceable(408) %90, ptr noundef nonnull align 8 dereferenceable(20) %91, i32 noundef %92, double noundef %93, double noundef %94, double noundef %95, double noundef %96)
  br label %69, !llvm.loop !22

97:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  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 @_ZN4voro14container_poly3putERNS_14particle_orderEidddd(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef nonnull align 8 dereferenceable(20), i32 noundef, double 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 @_ZN4voro18pre_container_poly5setupERNS_14particle_orderERNS_14container_polyE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 8 dereferenceable(408) %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 %.03439, i64 8
  %12 = getelementptr inbounds i8, ptr %.03340, 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
  %.03340 = phi ptr [ %12, %.loopexit ], [ %7, %3 ]
  %.03439 = phi ptr [ %11, %.loopexit ], [ %5, %3 ]
  %15 = load ptr, ptr %.03439, align 8, !tbaa !17
  %16 = load ptr, ptr %.03340, align 8, !tbaa !17
  br label %17

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

._crit_edge:                                      ; preds = %.loopexit, %3
  %.034.lcssa = phi ptr [ %5, %3 ], [ %11, %.loopexit ]
  %.033.lcssa = phi ptr [ %7, %3 ], [ %12, %.loopexit ]
  %28 = load ptr, ptr %.034.lcssa, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %0, i64 88
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = icmp ult ptr %28, %30
  br i1 %31, label %.lr.ph45.preheader, label %._crit_edge46

.lr.ph45.preheader:                               ; preds = %._crit_edge
  %32 = load ptr, ptr %.033.lcssa, align 8, !tbaa !17
  br label %.lr.ph45

.lr.ph45:                                         ; preds = %.lr.ph45.preheader, %.lr.ph45
  %.143 = phi ptr [ %41, %.lr.ph45 ], [ %32, %.lr.ph45.preheader ]
  %.13642 = phi ptr [ %33, %.lr.ph45 ], [ %28, %.lr.ph45.preheader ]
  %33 = getelementptr inbounds i8, ptr %.13642, i64 4
  %34 = load i32, ptr %.13642, align 4, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %.143, i64 8
  %36 = load double, ptr %.143, align 8, !tbaa !19
  %37 = getelementptr inbounds i8, ptr %.143, i64 16
  %38 = load double, ptr %35, align 8, !tbaa !19
  %39 = getelementptr inbounds i8, ptr %.143, i64 24
  %40 = load double, ptr %37, align 8, !tbaa !19
  %41 = getelementptr inbounds i8, ptr %.143, i64 32
  %42 = load double, ptr %39, align 8, !tbaa !19
  tail call void @_ZN4voro14container_poly3putERNS_14particle_orderEidddd(ptr noundef nonnull align 8 dereferenceable(408) %2, ptr noundef nonnull align 8 dereferenceable(20) %1, i32 noundef %34, double noundef %36, double noundef %38, double noundef %40, double noundef %42)
  %43 = load ptr, ptr %29, align 8, !tbaa !21
  %44 = icmp ult ptr %33, %43
  br i1 %44, label %.lr.ph45, label %._crit_edge46, !llvm.loop !22

._crit_edge46:                                    ; preds = %.lr.ph45, %._crit_edge
  ret void
}

declare void @_ZN4voro14container_poly3putERNS_14particle_orderEidddd(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef nonnull align 8 dereferenceable(20), i32 noundef, double 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