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

; 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 uwtable
define dso_local void @_ZN4voro13pre_container3putEiddd(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %1, double noundef %2, double noundef %3, double noundef %4) #0 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store double %2, ptr %8, align 8, !tbaa !11
  store double %3, ptr %9, align 8, !tbaa !11
  store double %4, ptr %10, align 8, !tbaa !11
  %11 = load ptr, ptr %6, align 8
  %12 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 6
  %13 = load i8, ptr %12, align 8, !tbaa !13, !range !16, !noundef !17
  %14 = trunc i8 %13 to i1
  br i1 %14, label %25, label %15

15:                                               ; preds = %5
  %16 = load double, ptr %8, align 8, !tbaa !11
  %17 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 0
  %18 = load double, ptr %17, align 8, !tbaa !18
  %19 = fcmp oge double %16, %18
  br i1 %19, label %20, label %77

20:                                               ; preds = %15
  %21 = load double, ptr %8, align 8, !tbaa !11
  %22 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 1
  %23 = load double, ptr %22, align 8, !tbaa !19
  %24 = fcmp ole double %21, %23
  br i1 %24, label %25, label %77

25:                                               ; preds = %20, %5
  %26 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 7
  %27 = load i8, ptr %26, align 1, !tbaa !20, !range !16, !noundef !17
  %28 = trunc i8 %27 to i1
  br i1 %28, label %39, label %29

29:                                               ; preds = %25
  %30 = load double, ptr %9, align 8, !tbaa !11
  %31 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 2
  %32 = load double, ptr %31, align 8, !tbaa !21
  %33 = fcmp oge double %30, %32
  br i1 %33, label %34, label %77

34:                                               ; preds = %29
  %35 = load double, ptr %9, align 8, !tbaa !11
  %36 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 3
  %37 = load double, ptr %36, align 8, !tbaa !22
  %38 = fcmp ole double %35, %37
  br i1 %38, label %39, label %77

39:                                               ; preds = %34, %25
  %40 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 8
  %41 = load i8, ptr %40, align 2, !tbaa !23, !range !16, !noundef !17
  %42 = trunc i8 %41 to i1
  br i1 %42, label %53, label %43

43:                                               ; preds = %39
  %44 = load double, ptr %10, align 8, !tbaa !11
  %45 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 4
  %46 = load double, ptr %45, align 8, !tbaa !24
  %47 = fcmp oge double %44, %46
  br i1 %47, label %48, label %77

48:                                               ; preds = %43
  %49 = load double, ptr %10, align 8, !tbaa !11
  %50 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 5
  %51 = load double, ptr %50, align 8, !tbaa !25
  %52 = fcmp ole double %49, %51
  br i1 %52, label %53, label %77

53:                                               ; preds = %48, %39
  %54 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 14
  %55 = load ptr, ptr %54, align 8, !tbaa !26
  %56 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 15
  %57 = load ptr, ptr %56, align 8, !tbaa !27
  %58 = icmp eq ptr %55, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %53
  call void @_ZN4voro18pre_container_base9new_chunkEv(ptr noundef nonnull align 8 dereferenceable(128) %11)
  br label %60

60:                                               ; preds = %59, %53
  %61 = load i32, ptr %7, align 4, !tbaa !9
  %62 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 14
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = getelementptr inbounds i32, ptr %63, i32 1
  store ptr %64, ptr %62, align 8, !tbaa !26
  store i32 %61, ptr %63, align 4, !tbaa !9
  %65 = load double, ptr %8, align 8, !tbaa !11
  %66 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 18
  %67 = load ptr, ptr %66, align 8, !tbaa !28
  %68 = getelementptr inbounds double, ptr %67, i32 1
  store ptr %68, ptr %66, align 8, !tbaa !28
  store double %65, ptr %67, align 8, !tbaa !11
  %69 = load double, ptr %9, align 8, !tbaa !11
  %70 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 18
  %71 = load ptr, ptr %70, align 8, !tbaa !28
  %72 = getelementptr inbounds double, ptr %71, i32 1
  store ptr %72, ptr %70, align 8, !tbaa !28
  store double %69, ptr %71, align 8, !tbaa !11
  %73 = load double, ptr %10, align 8, !tbaa !11
  %74 = getelementptr inbounds %"class.voro::pre_container_base", ptr %11, i32 0, i32 18
  %75 = load ptr, ptr %74, align 8, !tbaa !28
  %76 = getelementptr inbounds double, ptr %75, i32 1
  store ptr %76, ptr %74, align 8, !tbaa !28
  store double %73, ptr %75, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %60, %48, %43, %34, %29, %20, %15
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4voro18pre_container_base9new_chunkEv(ptr noundef nonnull align 8 dereferenceable(128)) #0 align 2

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, !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, !15, i64 48}
!14 = !{!"_ZTSN4voro18pre_container_baseE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !15, i64 48, !15, i64 49, !15, i64 50, !10, i64 52, !10, 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}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!14, !12, i64 0}
!19 = !{!14, !12, i64 8}
!20 = !{!14, !15, i64 49}
!21 = !{!14, !12, i64 16}
!22 = !{!14, !12, i64 24}
!23 = !{!14, !15, i64 50}
!24 = !{!14, !12, i64 32}
!25 = !{!14, !12, i64 40}
!26 = !{!14, !6, i64 88}
!27 = !{!14, !6, i64 96}
!28 = !{!14, !6, i64 120}


; 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_container3putEiddd(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %1, double noundef %2, double noundef %3, double noundef %4) local_unnamed_addr #0 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  %7 = load i8, ptr %6, align 8, !tbaa !5, !range !13, !noundef !14
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %15, label %9

9:                                                ; preds = %5
  %10 = load double, ptr %0, align 8, !tbaa !15
  %11 = fcmp ugt double %10, %2
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load double, ptr %12, align 8
  %14 = fcmp ult double %13, %2
  %or.cond = select i1 %11, i1 true, i1 %14
  br i1 %or.cond, label %52, label %15

15:                                               ; preds = %9, %5
  %16 = getelementptr inbounds i8, ptr %0, i64 49
  %17 = load i8, ptr %16, align 1, !tbaa !16, !range !13, !noundef !14
  %18 = trunc nuw i8 %17 to i1
  br i1 %18, label %26, label %19

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  %21 = load double, ptr %20, align 8, !tbaa !17
  %22 = fcmp ugt double %21, %3
  %23 = getelementptr inbounds i8, ptr %0, i64 24
  %24 = load double, ptr %23, align 8
  %25 = fcmp ult double %24, %3
  %or.cond16 = select i1 %22, i1 true, i1 %25
  br i1 %or.cond16, label %52, label %26

26:                                               ; preds = %19, %15
  %27 = getelementptr inbounds i8, ptr %0, i64 50
  %28 = load i8, ptr %27, align 2, !tbaa !18, !range !13, !noundef !14
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %37, label %30

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %0, i64 32
  %32 = load double, ptr %31, align 8, !tbaa !19
  %33 = fcmp ugt double %32, %4
  %34 = getelementptr inbounds i8, ptr %0, i64 40
  %35 = load double, ptr %34, align 8
  %36 = fcmp ult double %35, %4
  %or.cond19 = select i1 %33, i1 true, i1 %36
  br i1 %or.cond19, label %52, label %37

37:                                               ; preds = %30, %26
  %38 = getelementptr inbounds i8, ptr %0, i64 88
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = getelementptr inbounds i8, ptr %0, i64 96
  %41 = load ptr, ptr %40, align 8, !tbaa !21
  %42 = icmp eq ptr %39, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %37
  tail call void @_ZN4voro18pre_container_base9new_chunkEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %.pre = load ptr, ptr %38, align 8, !tbaa !20
  br label %44

44:                                               ; preds = %43, %37
  %45 = phi ptr [ %.pre, %43 ], [ %39, %37 ]
  %46 = getelementptr inbounds i8, ptr %45, i64 4
  store ptr %46, ptr %38, align 8, !tbaa !20
  store i32 %1, ptr %45, align 4, !tbaa !22
  %47 = getelementptr inbounds i8, ptr %0, i64 120
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  store double %2, ptr %48, align 8, !tbaa !24
  %50 = getelementptr inbounds i8, ptr %48, i64 16
  store double %3, ptr %49, align 8, !tbaa !24
  %51 = getelementptr inbounds i8, ptr %48, i64 24
  store ptr %51, ptr %47, align 8, !tbaa !23
  store double %4, ptr %50, align 8, !tbaa !24
  br label %52

52:                                               ; preds = %44, %30, %19, %9
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4voro18pre_container_base9new_chunkEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #0 align 2

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, !10, i64 48}
!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 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !10, i64 49}
!17 = !{!6, !7, i64 16}
!18 = !{!6, !10, i64 50}
!19 = !{!6, !7, i64 32}
!20 = !{!6, !12, i64 88}
!21 = !{!6, !12, i64 96}
!22 = !{!11, !11, i64 0}
!23 = !{!6, !12, i64 120}
!24 = !{!7, !7, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass