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

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

19:                                               ; preds = %55, %2
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.voro::pre_container_base", ptr %14, i32 0, i32 12
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = icmp ult ptr %20, %22
  br i1 %23, label %24, label %56

24:                                               ; preds = %19
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds ptr, ptr %25, i32 1
  store ptr %26, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %27, ptr %6, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds i32, ptr %28, i64 1024
  store ptr %29, ptr %7, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds ptr, ptr %30, i32 1
  store ptr %31, ptr %9, align 8, !tbaa !5
  %32 = load ptr, ptr %30, align 8, !tbaa !5
  store ptr %32, ptr %10, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %37, %24
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = icmp ult ptr %34, %35
  br i1 %36, label %37, label %55

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

55:                                               ; preds = %33
  br label %19, !llvm.loop !20

56:                                               ; preds = %19
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  store ptr %58, ptr %6, align 8, !tbaa !5
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %60, ptr %10, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %66, %56
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.voro::pre_container_base", ptr %14, i32 0, i32 14
  %64 = load ptr, ptr %63, align 8, !tbaa !21
  %65 = icmp ult ptr %62, %64
  br i1 %65, label %66, label %84

66:                                               ; preds = %61
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds i32, ptr %67, i32 1
  store ptr %68, ptr %6, align 8, !tbaa !5
  %69 = load i32, ptr %67, align 4, !tbaa !16
  store i32 %69, ptr %8, align 4, !tbaa !16
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds double, ptr %70, i32 1
  store ptr %71, ptr %10, align 8, !tbaa !5
  %72 = load double, ptr %70, align 8, !tbaa !17
  store double %72, ptr %11, align 8, !tbaa !17
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds double, ptr %73, i32 1
  store ptr %74, ptr %10, align 8, !tbaa !5
  %75 = load double, ptr %73, align 8, !tbaa !17
  store double %75, ptr %12, align 8, !tbaa !17
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = getelementptr inbounds double, ptr %76, i32 1
  store ptr %77, ptr %10, align 8, !tbaa !5
  %78 = load double, ptr %76, align 8, !tbaa !17
  store double %78, ptr %13, align 8, !tbaa !17
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = load i32, ptr %8, align 4, !tbaa !16
  %81 = load double, ptr %11, align 8, !tbaa !17
  %82 = load double, ptr %12, align 8, !tbaa !17
  %83 = load double, ptr %13, align 8, !tbaa !17
  call void @_ZN4voro9container3putEiddd(ptr noundef nonnull align 8 dereferenceable(368) %79, i32 noundef %80, double noundef %81, double noundef %82, double noundef %83)
  br label %61, !llvm.loop !22

84:                                               ; preds = %61
  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 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

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

.lr.ph:                                           ; preds = %2, %.loopexit
  %.02734 = phi ptr [ %11, %.loopexit ], [ %6, %2 ]
  %.02833 = phi ptr [ %10, %.loopexit ], [ %4, %2 ]
  %14 = load ptr, ptr %.02833, align 8, !tbaa !17
  %15 = load ptr, ptr %.02734, align 8, !tbaa !17
  br label %16

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

._crit_edge:                                      ; preds = %.loopexit, %2
  %.028.lcssa = phi ptr [ %4, %2 ], [ %10, %.loopexit ]
  %.027.lcssa = phi ptr [ %6, %2 ], [ %11, %.loopexit ]
  %25 = load ptr, ptr %.028.lcssa, align 8, !tbaa !17
  %26 = getelementptr inbounds i8, ptr %0, i64 88
  %27 = load ptr, ptr %26, align 8, !tbaa !21
  %28 = icmp ult ptr %25, %27
  br i1 %28, label %.lr.ph39.preheader, label %._crit_edge40

.lr.ph39.preheader:                               ; preds = %._crit_edge
  %29 = load ptr, ptr %.027.lcssa, align 8, !tbaa !17
  br label %.lr.ph39

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %.lr.ph39
  %.137 = phi ptr [ %36, %.lr.ph39 ], [ %29, %.lr.ph39.preheader ]
  %.13036 = phi ptr [ %30, %.lr.ph39 ], [ %25, %.lr.ph39.preheader ]
  %30 = getelementptr inbounds i8, ptr %.13036, i64 4
  %31 = load i32, ptr %.13036, align 4, !tbaa !18
  %32 = getelementptr inbounds i8, ptr %.137, i64 8
  %33 = load double, ptr %.137, align 8, !tbaa !19
  %34 = getelementptr inbounds i8, ptr %.137, i64 16
  %35 = load double, ptr %32, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %.137, i64 24
  %37 = load double, ptr %34, align 8, !tbaa !19
  tail call void @_ZN4voro9container3putEiddd(ptr noundef nonnull align 8 dereferenceable(368) %1, i32 noundef %31, double noundef %33, double noundef %35, double noundef %37)
  %38 = load ptr, ptr %26, align 8, !tbaa !21
  %39 = icmp ult ptr %30, %38
  br i1 %39, label %.lr.ph39, label %._crit_edge40, !llvm.loop !22

._crit_edge40:                                    ; preds = %.lr.ph39, %._crit_edge
  ret void
}

declare void @_ZN4voro9container3putEiddd(ptr noundef nonnull align 8 dereferenceable(368), 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