; LLVM IR from robotics-upo/Heuristic_path_planners :: src/Planners (LazyThetaStarM1)

; 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.Planners::utils::Node" = type <{ ptr, %"class.Planners::utils::Vec3i", i32, i32, i32, i32, i32, double, i8, i8, i8, [5 x i8] }>
%"class.Planners::utils::Vec3i" = type { i32, i32, i32 }
%"class.Planners::AlgorithmBase" = type { ptr, %"class.std::function", %"class.std::vector", %"class.Planners::utils::DiscreteWorld", i32, i8, double, i32, %"class.std::__cxx11::basic_string" }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Planners::utils::Vec3i, std::allocator<Planners::utils::Vec3i>>::_Vector_impl" }
%"struct.std::_Vector_base<Planners::utils::Vec3i, std::allocator<Planners::utils::Vec3i>>::_Vector_impl" = type { %"struct.std::_Vector_base<Planners::utils::Vec3i, std::allocator<Planners::utils::Vec3i>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Planners::utils::Vec3i, std::allocator<Planners::utils::Vec3i>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Planners::utils::DiscreteWorld" = type { %"class.std::vector.0", i64, i32, i32, i32, double }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Planners::utils::Node, std::allocator<Planners::utils::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Planners::utils::Node, std::allocator<Planners::utils::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Planners::utils::Node, std::allocator<Planners::utils::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Planners::utils::Node, std::allocator<Planners::utils::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; 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 nounwind uwtable
define dso_local noundef i32 @_ZN8Planners15LazyThetaStarM18computeGEPKNS_5utils4NodeEPS2_jj(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #1 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  %13 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.Planners::utils::Node", ptr %14, i32 0, i32 2
  %16 = load i32, ptr %15, align 4, !tbaa !11
  store i32 %16, ptr %11, align 4, !tbaa !9
  %17 = load i32, ptr %10, align 4, !tbaa !9
  %18 = icmp eq i32 %17, 8
  br i1 %18, label %19, label %26

19:                                               ; preds = %5
  %20 = load i32, ptr %9, align 4, !tbaa !9
  %21 = icmp ult i32 %20, 4
  %22 = zext i1 %21 to i64
  %23 = select i1 %21, i32 100, i32 141
  %24 = load i32, ptr %11, align 4, !tbaa !9
  %25 = add i32 %24, %23
  store i32 %25, ptr %11, align 4, !tbaa !9
  br label %39

26:                                               ; preds = %5
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = icmp ult i32 %27, 6
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  br label %35

30:                                               ; preds = %26
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = icmp ult i32 %31, 18
  %33 = zext i1 %32 to i64
  %34 = select i1 %32, i32 141, i32 173
  br label %35

35:                                               ; preds = %30, %29
  %36 = phi i32 [ 100, %29 ], [ %34, %30 ]
  %37 = load i32, ptr %11, align 4, !tbaa !9
  %38 = add i32 %37, %36
  store i32 %38, ptr %11, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %35, %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %40 = getelementptr inbounds %"class.Planners::AlgorithmBase", ptr %13, i32 0, i32 6
  %41 = load double, ptr %40, align 8, !tbaa !16
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.Planners::utils::Node", ptr %42, i32 0, i32 7
  %44 = load double, ptr %43, align 8, !tbaa !32
  %45 = fmul double %41, %44
  %46 = fmul double %45, 1.000000e+00
  %47 = fptoui double %46 to i32
  store i32 %47, ptr %12, align 4, !tbaa !9
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = add i32 %49, %48
  store i32 %50, ptr %11, align 4, !tbaa !9
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.Planners::utils::Node", ptr %52, i32 0, i32 4
  store i32 %51, ptr %53, align 4, !tbaa !33
  %54 = load i32, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  ret i32 %54
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 20}
!12 = !{!"_ZTSN8Planners5utils4NodeE", !6, i64 0, !13, i64 8, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !14, i64 40, !15, i64 48, !15, i64 49, !15, i64 50}
!13 = !{!"_ZTSN8Planners5utils5Vec3iE", !10, i64 0, !10, i64 4, !10, i64 8}
!14 = !{!"double", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!17, !14, i64 128}
!17 = !{!"_ZTSN8Planners13AlgorithmBaseE", !18, i64 8, !20, i64 40, !24, i64 64, !10, i64 120, !15, i64 124, !14, i64 128, !10, i64 136, !30, i64 144}
!18 = !{!"_ZTSSt8functionIFjN8Planners5utils5Vec3iES2_EE", !19, i64 0, !6, i64 24}
!19 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!20 = !{!"_ZTSSt6vectorIN8Planners5utils5Vec3iESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIN8Planners5utils5Vec3iESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils5Vec3iESaIS2_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils5Vec3iESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSN8Planners5utils13DiscreteWorldE", !25, i64 0, !29, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !14, i64 48}
!25 = !{!"_ZTSSt6vectorIN8Planners5utils4NodeESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN8Planners5utils4NodeESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils4NodeESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils4NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"long", !7, i64 0}
!30 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !31, i64 0, !29, i64 8, !7, i64 16}
!31 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!32 = !{!12, !14, i64 40}
!33 = !{!12, !10, i64 28}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef i32 @_ZN8Planners15LazyThetaStarM18computeGEPKNS_5utils4NodeEPS2_jj(ptr nocapture noundef nonnull readonly align 8 dereferenceable(320) %0, ptr nocapture noundef readonly %1, ptr nocapture noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #0 align 2 {
  %6 = getelementptr inbounds i8, ptr %1, i64 20
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp eq i32 %4, 8
  br i1 %8, label %9, label %12

9:                                                ; preds = %5
  %10 = icmp ult i32 %3, 4
  %11 = select i1 %10, i32 100, i32 141
  br label %17

12:                                               ; preds = %5
  %13 = icmp ult i32 %3, 6
  %14 = icmp ult i32 %3, 18
  %15 = select i1 %14, i32 141, i32 173
  %16 = select i1 %13, i32 100, i32 %15
  br label %17

17:                                               ; preds = %12, %9
  %.pn = phi i32 [ %11, %9 ], [ %16, %12 ]
  %.0 = add i32 %.pn, %7
  %18 = getelementptr inbounds i8, ptr %0, i64 128
  %19 = load double, ptr %18, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %2, i64 40
  %21 = load double, ptr %20, align 8, !tbaa !30
  %22 = fmul double %19, %21
  %23 = fptoui double %22 to i32
  %24 = add i32 %.0, %23
  %25 = getelementptr inbounds i8, ptr %2, i64 28
  store i32 %23, ptr %25, align 4, !tbaa !31
  ret i32 %24
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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, !11, i64 20}
!6 = !{!"_ZTSN8Planners5utils4NodeE", !7, i64 0, !10, i64 8, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !12, i64 40, !13, i64 48, !13, i64 49, !13, i64 50}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN8Planners5utils5Vec3iE", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"int", !8, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{!15, !12, i64 128}
!15 = !{!"_ZTSN8Planners13AlgorithmBaseE", !16, i64 8, !18, i64 40, !22, i64 64, !11, i64 120, !13, i64 124, !12, i64 128, !11, i64 136, !28, i64 144}
!16 = !{!"_ZTSSt8functionIFjN8Planners5utils5Vec3iES2_EE", !17, i64 0, !7, i64 24}
!17 = !{!"_ZTSSt14_Function_base", !8, i64 0, !7, i64 16}
!18 = !{!"_ZTSSt6vectorIN8Planners5utils5Vec3iESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN8Planners5utils5Vec3iESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils5Vec3iESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils5Vec3iESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!22 = !{!"_ZTSN8Planners5utils13DiscreteWorldE", !23, i64 0, !27, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 48}
!23 = !{!"_ZTSSt6vectorIN8Planners5utils4NodeESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN8Planners5utils4NodeESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils4NodeESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN8Planners5utils4NodeESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!27 = !{!"long", !8, i64 0}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !29, i64 0, !27, i64 8, !8, i64 16}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!30 = !{!6, !12, i64 40}
!31 = !{!6, !11, i64 28}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass