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

; 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
declare dso_local void @_ZN4voro18pre_container_base9new_chunkEv(ptr noundef nonnull align 8 dereferenceable(128)) #0 align 2

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

17:                                               ; preds = %6
  %18 = load double, ptr %9, align 8, !tbaa !11
  %19 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 0
  %20 = load double, ptr %19, align 8, !tbaa !18
  %21 = fcmp oge double %18, %20
  br i1 %21, label %22, label %83

22:                                               ; preds = %17
  %23 = load double, ptr %9, align 8, !tbaa !11
  %24 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 1
  %25 = load double, ptr %24, align 8, !tbaa !19
  %26 = fcmp ole double %23, %25
  br i1 %26, label %27, label %83

27:                                               ; preds = %22, %6
  %28 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 7
  %29 = load i8, ptr %28, align 1, !tbaa !20, !range !16, !noundef !17
  %30 = trunc i8 %29 to i1
  br i1 %30, label %41, label %31

31:                                               ; preds = %27
  %32 = load double, ptr %10, align 8, !tbaa !11
  %33 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 2
  %34 = load double, ptr %33, align 8, !tbaa !21
  %35 = fcmp oge double %32, %34
  br i1 %35, label %36, label %83

36:                                               ; preds = %31
  %37 = load double, ptr %10, align 8, !tbaa !11
  %38 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 3
  %39 = load double, ptr %38, align 8, !tbaa !22
  %40 = fcmp ole double %37, %39
  br i1 %40, label %41, label %83

41:                                               ; preds = %36, %27
  %42 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 8
  %43 = load i8, ptr %42, align 2, !tbaa !23, !range !16, !noundef !17
  %44 = trunc i8 %43 to i1
  br i1 %44, label %55, label %45

45:                                               ; preds = %41
  %46 = load double, ptr %11, align 8, !tbaa !11
  %47 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 4
  %48 = load double, ptr %47, align 8, !tbaa !24
  %49 = fcmp oge double %46, %48
  br i1 %49, label %50, label %83

50:                                               ; preds = %45
  %51 = load double, ptr %11, align 8, !tbaa !11
  %52 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 5
  %53 = load double, ptr %52, align 8, !tbaa !25
  %54 = fcmp ole double %51, %53
  br i1 %54, label %55, label %83

55:                                               ; preds = %50, %41
  %56 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 14
  %57 = load ptr, ptr %56, align 8, !tbaa !26
  %58 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 15
  %59 = load ptr, ptr %58, align 8, !tbaa !27
  %60 = icmp eq ptr %57, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %55
  call void @_ZN4voro18pre_container_base9new_chunkEv(ptr noundef nonnull align 8 dereferenceable(128) %13)
  br label %62

62:                                               ; preds = %61, %55
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 14
  %65 = load ptr, ptr %64, align 8, !tbaa !26
  %66 = getelementptr inbounds i32, ptr %65, i32 1
  store ptr %66, ptr %64, align 8, !tbaa !26
  store i32 %63, ptr %65, align 4, !tbaa !9
  %67 = load double, ptr %9, align 8, !tbaa !11
  %68 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 18
  %69 = load ptr, ptr %68, align 8, !tbaa !28
  %70 = getelementptr inbounds double, ptr %69, i32 1
  store ptr %70, ptr %68, align 8, !tbaa !28
  store double %67, ptr %69, align 8, !tbaa !11
  %71 = load double, ptr %10, align 8, !tbaa !11
  %72 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 18
  %73 = load ptr, ptr %72, align 8, !tbaa !28
  %74 = getelementptr inbounds double, ptr %73, i32 1
  store ptr %74, ptr %72, align 8, !tbaa !28
  store double %71, ptr %73, align 8, !tbaa !11
  %75 = load double, ptr %11, align 8, !tbaa !11
  %76 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 18
  %77 = load ptr, ptr %76, align 8, !tbaa !28
  %78 = getelementptr inbounds double, ptr %77, i32 1
  store ptr %78, ptr %76, align 8, !tbaa !28
  store double %75, ptr %77, align 8, !tbaa !11
  %79 = load double, ptr %12, align 8, !tbaa !11
  %80 = getelementptr inbounds %"class.voro::pre_container_base", ptr %13, i32 0, i32 18
  %81 = load ptr, ptr %80, align 8, !tbaa !28
  %82 = getelementptr inbounds double, ptr %81, i32 1
  store ptr %82, ptr %80, align 8, !tbaa !28
  store double %79, ptr %81, align 8, !tbaa !11
  br label %83

83:                                               ; preds = %62, %50, %45, %36, %31, %22, %17
  ret void
}

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
declare dso_local void @_ZN4voro18pre_container_base9new_chunkEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4voro18pre_container_poly3putEidddd(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5) local_unnamed_addr #0 align 2 {
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !13, !noundef !14
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %16, label %10

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

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

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

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

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

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

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

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

54:                                               ; preds = %45, %31, %20, %10
  ret void
}

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