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

; 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: mustprogress nounwind uwtable
define dso_local void @_ZN4voro18pre_container_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 17
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %9, label %8

8:                                                ; preds = %1
  call void @_ZdaPv(ptr noundef %6) #2
  br label %9

9:                                                ; preds = %8, %1
  %10 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 12
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %15, label %14

14:                                               ; preds = %9
  call void @_ZdaPv(ptr noundef %12) #2
  br label %15

15:                                               ; preds = %14, %9
  br label %16

16:                                               ; preds = %40, %15
  %17 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 12
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %19 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 11
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  %21 = icmp ne ptr %18, %20
  br i1 %21, label %22, label %41

22:                                               ; preds = %16
  %23 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 17
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i32 -1
  store ptr %25, ptr %23, align 8, !tbaa !9
  %26 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 17
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %22
  call void @_ZdaPv(ptr noundef %28) #2
  br label %31

31:                                               ; preds = %30, %22
  %32 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 12
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  %34 = getelementptr inbounds ptr, ptr %33, i32 -1
  store ptr %34, ptr %32, align 8, !tbaa !14
  %35 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 12
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %31
  call void @_ZdaPv(ptr noundef %37) #2
  br label %40

40:                                               ; preds = %39, %31
  br label %16, !llvm.loop !16

41:                                               ; preds = %16
  %42 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 16
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = icmp eq ptr %43, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @_ZdaPv(ptr noundef %43) #2
  br label %46

46:                                               ; preds = %45, %41
  %47 = getelementptr inbounds %"class.voro::pre_container_base", ptr %3, i32 0, i32 11
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  %49 = icmp eq ptr %48, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @_ZdaPv(ptr noundef %48) #2
  br label %51

51:                                               ; preds = %50, %46
  ret void
}

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #1

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { builtin 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 112}
!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 72}
!15 = !{!10, !6, i64 64}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!10, !6, i64 104}


; 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 nounwind uwtable
define dso_local void @_ZN4voro18pre_container_baseD2Ev(ptr nocapture noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 112
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8, !tbaa !13
  %5 = icmp eq ptr %4, null
  br i1 %5, label %7, label %6

6:                                                ; preds = %1
  tail call void @_ZdaPv(ptr noundef nonnull %4) #2
  br label %7

7:                                                ; preds = %6, %1
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %11 = icmp eq ptr %10, null
  br i1 %11, label %13, label %12

12:                                               ; preds = %7
  tail call void @_ZdaPv(ptr noundef nonnull %10) #2
  %.pre = load ptr, ptr %8, align 8, !tbaa !14
  br label %13

13:                                               ; preds = %12, %7
  %14 = phi ptr [ %.pre, %12 ], [ %9, %7 ]
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %.not6 = icmp eq ptr %14, %16
  br i1 %.not6, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %13, %29
  %17 = phi ptr [ %30, %29 ], [ %14, %13 ]
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 -8
  store ptr %19, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = icmp eq ptr %20, null
  br i1 %21, label %23, label %22

22:                                               ; preds = %.lr.ph
  tail call void @_ZdaPv(ptr noundef nonnull %20) #2
  %.pre7 = load ptr, ptr %8, align 8, !tbaa !14
  br label %23

23:                                               ; preds = %22, %.lr.ph
  %24 = phi ptr [ %.pre7, %22 ], [ %17, %.lr.ph ]
  %25 = getelementptr inbounds i8, ptr %24, i64 -8
  store ptr %25, ptr %8, align 8, !tbaa !14
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  %27 = icmp eq ptr %26, null
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  tail call void @_ZdaPv(ptr noundef nonnull %26) #2
  %.pre8 = load ptr, ptr %8, align 8, !tbaa !14
  br label %29

29:                                               ; preds = %28, %23
  %30 = phi ptr [ %.pre8, %28 ], [ %25, %23 ]
  %31 = load ptr, ptr %15, align 8, !tbaa !15
  %.not = icmp eq ptr %30, %31
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %29, %13
  %32 = phi ptr [ %16, %13 ], [ %31, %29 ]
  %33 = getelementptr inbounds i8, ptr %0, i64 104
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = icmp eq ptr %34, null
  br i1 %35, label %37, label %36

36:                                               ; preds = %._crit_edge
  tail call void @_ZdaPv(ptr noundef nonnull %34) #2
  %.pre9 = load ptr, ptr %15, align 8, !tbaa !15
  br label %37

37:                                               ; preds = %36, %._crit_edge
  %38 = phi ptr [ %.pre9, %36 ], [ %32, %._crit_edge ]
  %39 = icmp eq ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  tail call void @_ZdaPv(ptr noundef nonnull %38) #2
  br label %41

41:                                               ; preds = %40, %37
  ret void
}

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { builtin 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, !12, i64 112}
!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 = !{!12, !12, i64 0}
!14 = !{!6, !12, i64 72}
!15 = !{!6, !12, i64 64}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!6, !12, i64 104}


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