; LLVM IR from OAID/AutoKernel :: AutoSearch/src/adams2019 (LoopNest)

; 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"

%"struct.PerfectHashMap<Halide::Internal::Autoscheduler::FunctionDAG::Node, long>::const_iterator" = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.54" = type { ptr }
%"struct.Halide::Internal::Autoscheduler::LoopNest" = type <{ %"class.Halide::Internal::RefCount", [4 x i8], %"class.std::vector.3", %"class.std::vector.8", %class.PerfectHashMap, %"class.std::set", %class.PerfectHashMap.21, ptr, ptr, i8, i8, i8, i8, i32, i32, [4 x i8] }>
%"class.Halide::Internal::RefCount" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>, std::allocator<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>>>::_Vector_impl" }
%"struct.std::_Vector_base<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>, std::allocator<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>, std::allocator<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>, std::allocator<Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::LoopNest>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.PerfectHashMap = type { %"class.std::vector.13", i32, i32 }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, const Halide::Internal::Autoscheduler::FunctionDAG::Node *, std::_Identity<const Halide::Internal::Autoscheduler::FunctionDAG::Node *>, std::less<const Halide::Internal::Autoscheduler::FunctionDAG::Node *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, const Halide::Internal::Autoscheduler::FunctionDAG::Node *, std::_Identity<const Halide::Internal::Autoscheduler::FunctionDAG::Node *>, std::less<const Halide::Internal::Autoscheduler::FunctionDAG::Node *>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%class.PerfectHashMap.21 = type { %"class.std::vector.22", i32, i32 }
%"class.std::vector.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = type { %"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>, std::allocator<std::pair<const Halide::Internal::Autoscheduler::FunctionDAG::Node *, Halide::Internal::IntrusivePtr<const Halide::Internal::Autoscheduler::BoundContents>>>>::_Vector_impl_data" = type { 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 nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK6Halide8Internal12IntrusivePtrIKNS0_13Autoscheduler8LoopNestEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorneERKS7_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE3endEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iterator5valueEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK6Halide8Internal13Autoscheduler8LoopNest17max_inlined_callsEv(ptr noundef nonnull align 8 dereferenceable(196) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.PerfectHashMap<Halide::Internal::Autoscheduler::FunctionDAG::Node, long>::const_iterator", align 8
  %5 = alloca %"struct.PerfectHashMap<Halide::Internal::Autoscheduler::FunctionDAG::Node, long>::const_iterator", align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.54", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.54", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #4
  %12 = getelementptr inbounds %"struct.Halide::Internal::Autoscheduler::LoopNest", ptr %11, i32 0, i32 4
  %13 = call { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
  %14 = getelementptr inbounds { ptr, ptr }, ptr %4, i32 0, i32 0
  %15 = extractvalue { ptr, ptr } %13, 0
  store ptr %15, ptr %14, align 8
  %16 = getelementptr inbounds { ptr, ptr }, ptr %4, i32 0, i32 1
  %17 = extractvalue { ptr, ptr } %13, 1
  store ptr %17, ptr %16, align 8
  br label %18

18:                                               ; preds = %31, %1
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #4
  %19 = getelementptr inbounds %"struct.Halide::Internal::Autoscheduler::LoopNest", ptr %11, i32 0, i32 4
  %20 = call { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %19)
  %21 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 0
  %22 = extractvalue { ptr, ptr } %20, 0
  store ptr %22, ptr %21, align 8
  %23 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 1
  %24 = extractvalue { ptr, ptr } %20, 1
  store ptr %24, ptr %23, align 8
  %25 = call noundef zeroext i1 @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorneERKS7_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  br i1 %25, label %27, label %26

26:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #4
  br label %32

27:                                               ; preds = %18
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iterator5valueEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load i64, ptr %29, align 8, !tbaa !9
  store i64 %30, ptr %3, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %27
  call void @_ZN14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef 0)
  br label %18, !llvm.loop !11

32:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %33 = getelementptr inbounds %"struct.Halide::Internal::Autoscheduler::LoopNest", ptr %11, i32 0, i32 3
  store ptr %33, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #4
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.54", ptr %7, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #4
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.54", ptr %8, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  br label %40

40:                                               ; preds = %50, %32
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br i1 %41, label %43, label %42

42:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %52

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  store ptr %44, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = call noundef ptr @_ZNK6Halide8Internal12IntrusivePtrIKNS0_13Autoscheduler8LoopNestEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %45)
  %47 = call noundef i64 @_ZNK6Halide8Internal13Autoscheduler8LoopNest17max_inlined_callsEv(ptr noundef nonnull align 8 dereferenceable(196) %46)
  store i64 %47, ptr %10, align 8, !tbaa !9
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %49 = load i64, ptr %48, align 8, !tbaa !9
  store i64 %49, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %50

50:                                               ; preds = %43
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br label %40

52:                                               ; preds = %42
  %53 = load i64, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret i64 %53
}

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 = { inlinehint 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 #3 = { 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 #4 = { 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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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"

%"struct.PerfectHashMap<Halide::Internal::Autoscheduler::FunctionDAG::Node, long>::const_iterator" = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.54" = type { ptr }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK6Halide8Internal12IntrusivePtrIKNS0_13Autoscheduler8LoopNestEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorneERKS7_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE3endEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iterator5valueEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK6Halide8Internal13Autoscheduler8LoopNest17max_inlined_callsEv(ptr noundef nonnull align 8 dereferenceable(196) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca i64, align 8
  %3 = alloca %"struct.PerfectHashMap<Halide::Internal::Autoscheduler::FunctionDAG::Node, long>::const_iterator", align 8
  %4 = alloca %"struct.PerfectHashMap<Halide::Internal::Autoscheduler::FunctionDAG::Node, long>::const_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.54", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.54", align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = tail call { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %10 = extractvalue { ptr, ptr } %9, 0
  store ptr %10, ptr %3, align 8
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  %12 = extractvalue { ptr, ptr } %9, 1
  store ptr %12, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %13 = tail call { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %14 = extractvalue { ptr, ptr } %13, 0
  store ptr %14, ptr %4, align 8
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  %16 = extractvalue { ptr, ptr } %13, 1
  store ptr %16, ptr %15, align 8
  %17 = call noundef zeroext i1 @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorneERKS7_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %19 = call ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  store ptr %19, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %20 = call ptr @_ZNKSt6vectorIN6Halide8Internal12IntrusivePtrIKNS1_13Autoscheduler8LoopNestEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  store ptr %20, ptr %6, align 8
  %21 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %21, label %.lr.ph5, label %._crit_edge6

.lr.ph:                                           ; preds = %1, %.lr.ph
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iterator5valueEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %24 = load i64, ptr %23, align 8, !tbaa !5
  store i64 %24, ptr %2, align 8, !tbaa !5
  call void @_ZN14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorppEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %25 = call { ptr, ptr } @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %26 = extractvalue { ptr, ptr } %25, 0
  store ptr %26, ptr %4, align 8
  %27 = extractvalue { ptr, ptr } %25, 1
  store ptr %27, ptr %15, align 8
  %28 = call noundef zeroext i1 @_ZNK14PerfectHashMapIN6Halide8Internal13Autoscheduler11FunctionDAG4NodeElLi4E22PerfectHashMapAsserterE14const_iteratorneERKS7_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge6:                                     ; preds = %.lr.ph5, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %29 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret i64 %29

.lr.ph5:                                          ; preds = %._crit_edge, %.lr.ph5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %31 = call noundef ptr @_ZNK6Halide8Internal12IntrusivePtrIKNS0_13Autoscheduler8LoopNestEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = call noundef i64 @_ZNK6Halide8Internal13Autoscheduler8LoopNest17max_inlined_callsEv(ptr noundef nonnull align 8 dereferenceable(196) %31)
  store i64 %32, ptr %7, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %34 = load i64, ptr %33, align 8, !tbaa !5
  store i64 %34, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %36 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN6Halide8Internal12IntrusivePtrIKNS2_13Autoscheduler8LoopNestEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %36, label %.lr.ph5, label %._crit_edge6
}

attributes #0 = { mustprogress 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 = { inlinehint 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 #3 = { 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 #4 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass