; LLVM IR from thepowersgang/mrustc :: src/expand/mod.ll (Z15Expand_FunctionRK11ExpandStateRN3AST6ModuleERNS2_8FunctionE)

; 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.__gnu_cxx::__normal_iterator.346" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.345" = type { ptr }
%"class.std::function.44" = 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.anon.347 = type { i8 }
%"struct.AST::Function::Arg" = type { %"class.AST::AttributeList", %"class.AST::Pattern", %class.TypeRef }
%"class.AST::AttributeList" = type { %"class.std::vector.48" }
%"class.std::vector.48" = type { %"struct.std::_Vector_base.49" }
%"struct.std::_Vector_base.49" = type { %"struct.std::_Vector_base<AST::Attribute, std::allocator<AST::Attribute>>::_Vector_impl" }
%"struct.std::_Vector_base<AST::Attribute, std::allocator<AST::Attribute>>::_Vector_impl" = type { %"struct.std::_Vector_base<AST::Attribute, std::allocator<AST::Attribute>>::_Vector_impl_data" }
%"struct.std::_Vector_base<AST::Attribute, std::allocator<AST::Attribute>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.AST::Pattern" = type { ptr, %struct.Span, %"class.std::vector.294", %"class.AST::Pattern::Data" }
%struct.Span = type { ptr }
%"class.std::vector.294" = type { %"struct.std::_Vector_base.295" }
%"struct.std::_Vector_base.295" = type { %"struct.std::_Vector_base<AST::PatternBinding, std::allocator<AST::PatternBinding>>::_Vector_impl" }
%"struct.std::_Vector_base<AST::PatternBinding, std::allocator<AST::PatternBinding>>::_Vector_impl" = type { %"struct.std::_Vector_base<AST::PatternBinding, std::allocator<AST::PatternBinding>>::_Vector_impl_data" }
%"struct.std::_Vector_base<AST::PatternBinding, std::allocator<AST::PatternBinding>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.AST::Pattern::Data" = type { i32, %"union.AST::Pattern::Data::DataUnion" }
%"union.AST::Pattern::Data::DataUnion" = type { %"struct.AST::Pattern::Data::Data_Value" }
%"struct.AST::Pattern::Data::Data_Value" = type { %"class.AST::Pattern::Value", %"class.AST::Pattern::Value" }
%"class.AST::Pattern::Value" = type { i32, %"union.AST::Pattern::Value::DataUnion" }
%"union.AST::Pattern::Value::DataUnion" = type { %"class.AST::Path" }
%"class.AST::Path" = type { ptr, %"class.AST::Path::Class", %"struct.AST::Path::Bindings" }
%"class.AST::Path::Class" = type { i32, %"union.AST::Path::Class::DataUnion" }
%"union.AST::Path::Class::DataUnion" = type { %"struct.AST::Path::Class::Data_UFCS" }
%"struct.AST::Path::Class::Data_UFCS" = type { %"class.std::unique_ptr.124", %"class.std::unique_ptr.132", %"class.std::vector.119" }
%"class.std::unique_ptr.124" = type { %"struct.std::__uniq_ptr_data.125" }
%"struct.std::__uniq_ptr_data.125" = type { %"class.std::__uniq_ptr_impl.126" }
%"class.std::__uniq_ptr_impl.126" = type { %"class.std::tuple.127" }
%"class.std::tuple.127" = type { %"struct.std::_Tuple_impl.128" }
%"struct.std::_Tuple_impl.128" = type { %"struct.std::_Head_base.131" }
%"struct.std::_Head_base.131" = type { ptr }
%"class.std::unique_ptr.132" = type { %"struct.std::__uniq_ptr_data.133" }
%"struct.std::__uniq_ptr_data.133" = type { %"class.std::__uniq_ptr_impl.134" }
%"class.std::__uniq_ptr_impl.134" = type { %"class.std::tuple.135" }
%"class.std::tuple.135" = type { %"struct.std::_Tuple_impl.136" }
%"struct.std::_Tuple_impl.136" = type { %"struct.std::_Head_base.139" }
%"struct.std::_Head_base.139" = type { ptr }
%"class.std::vector.119" = type { %"struct.std::_Vector_base.120" }
%"struct.std::_Vector_base.120" = type { %"struct.std::_Vector_base<AST::PathNode, std::allocator<AST::PathNode>>::_Vector_impl" }
%"struct.std::_Vector_base<AST::PathNode, std::allocator<AST::PathNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<AST::PathNode, std::allocator<AST::PathNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<AST::PathNode, std::allocator<AST::PathNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.AST::Path::Bindings" = type { %"struct.AST::PathBinding", %"struct.AST::PathBinding.140", %"struct.AST::PathBinding.141" }
%"struct.AST::PathBinding" = type { %"struct.AST::AbsolutePath", %"class.AST::PathBinding_Value" }
%"struct.AST::AbsolutePath" = type { %class.RcString, %"class.std::vector" }
%class.RcString = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<RcString, std::allocator<RcString>>::_Vector_impl" }
%"struct.std::_Vector_base<RcString, std::allocator<RcString>>::_Vector_impl" = type { %"struct.std::_Vector_base<RcString, std::allocator<RcString>>::_Vector_impl_data" }
%"struct.std::_Vector_base<RcString, std::allocator<RcString>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.AST::PathBinding_Value" = type { i32, %"union.AST::PathBinding_Value::DataUnion" }
%"union.AST::PathBinding_Value::DataUnion" = type { %"struct.AST::PathBinding_Value::Data_EnumVar" }
%"struct.AST::PathBinding_Value::Data_EnumVar" = type { ptr, i32, ptr }
%"struct.AST::PathBinding.140" = type { %"struct.AST::AbsolutePath", %"class.AST::PathBinding_Type" }
%"class.AST::PathBinding_Type" = type { i32, %"union.AST::PathBinding_Type::DataUnion" }
%"union.AST::PathBinding_Type::DataUnion" = type { %"struct.AST::PathBinding_Type::Data_Module" }
%"struct.AST::PathBinding_Type::Data_Module" = type { ptr, %"struct.AST::PathBinding_Type::(anonymous struct)::Hir" }
%"struct.AST::PathBinding_Type::(anonymous struct)::Hir" = type { ptr, ptr }
%"struct.AST::PathBinding.141" = type { %"struct.AST::AbsolutePath", %"class.AST::PathBinding_Macro" }
%"class.AST::PathBinding_Macro" = type { i32, %"union.AST::PathBinding_Macro::DataUnion" }
%"union.AST::PathBinding_Macro::DataUnion" = type { %"struct.AST::PathBinding_Macro::Data_ProcMacroDerive" }
%"struct.AST::PathBinding_Macro::Data_ProcMacroDerive" = type { ptr, %class.RcString }
%class.TypeRef = type { %struct.Span, %class.TypeData }
%class.TypeData = type { i32, %"union.TypeData::DataUnion" }
%"union.TypeData::DataUnion" = type { %"struct.TypeData::Data_ErasedType", [32 x i8] }
%"struct.TypeData::Data_ErasedType" = type { %"class.std::vector.199", %"class.std::vector.199", %"class.std::vector.204" }
%"class.std::vector.199" = type { %"struct.std::_Vector_base.200" }
%"struct.std::_Vector_base.200" = type { %"struct.std::_Vector_base<Type_TraitPath, std::allocator<Type_TraitPath>>::_Vector_impl" }
%"struct.std::_Vector_base<Type_TraitPath, std::allocator<Type_TraitPath>>::_Vector_impl" = type { %"struct.std::_Vector_base<Type_TraitPath, std::allocator<Type_TraitPath>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Type_TraitPath, std::allocator<Type_TraitPath>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.204" = type { %"struct.std::_Vector_base.205" }
%"struct.std::_Vector_base.205" = type { %"struct.std::_Vector_base<AST::LifetimeRef, std::allocator<AST::LifetimeRef>>::_Vector_impl" }
%"struct.std::_Vector_base<AST::LifetimeRef, std::allocator<AST::LifetimeRef>>::_Vector_impl" = type { %"struct.std::_Vector_base<AST::LifetimeRef, std::allocator<AST::LifetimeRef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<AST::LifetimeRef, std::allocator<AST::LifetimeRef>>::_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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12Expand_AttrsRK11ExpandStateRKN3AST13AttributeListE9AttrStageSt8functionIFvRK4SpanRK15ExpandDecoratorRKNS2_9AttributeEEE(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z20Expand_Attrs_CfgOnlyRK11ExpandStateRN3AST13AttributeListE(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14Expand_PatternRK11ExpandStateRN3AST6ModuleERNS2_7PatternEb(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(480), ptr noundef nonnull align 8 dereferenceable(544), i1 noundef zeroext) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11Expand_TypeRK11ExpandStateRN3AST6ModuleER7TypeRef(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(480), ptr noundef nonnull align 8 dereferenceable(120)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11Expand_ExprRK11ExpandStateRN3AST4ExprE(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15Expand_FunctionRK11ExpandStateRN3AST6ModuleERNS2_8FunctionE(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(480) %1, ptr noundef nonnull align 8 dereferenceable(368) %2) #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.346", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.345", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.345", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.345", align 8
  %14 = alloca %"class.std::function.44", align 8
  %15 = alloca %class.anon.347, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %18

18:                                               ; preds = %66, %3
  %19 = load i64, ptr %7, align 8, !tbaa !9
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %20)
  %22 = call noundef i64 @_ZNKSt6vectorIN3AST8Function3ArgESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  %23 = icmp ult i64 %19, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %18
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %73

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %26)
  %28 = load i64, ptr %7, align 8, !tbaa !9
  %29 = call noundef nonnull align 8 dereferenceable(688) ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %28) #3
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.AST::Function::Arg", ptr %31, i32 0, i32 0
  %33 = call noundef zeroext i1 @_Z20Expand_Attrs_CfgOnlyRK11ExpandStateRN3AST13AttributeListE(ptr noundef nonnull align 8 dereferenceable(30) %30, ptr noundef nonnull align 8 dereferenceable(24) %32)
  br i1 %33, label %50, label %34

34:                                               ; preds = %25
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %35)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %37)
  %39 = call ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #3
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.345", ptr %12, i32 0, i32 0
  store ptr %39, ptr %40, align 8
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3AST8Function3ArgESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef %41) #3
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.345", ptr %11, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN3AST8Function3ArgESt6vectorIS3_SaIS3_EEEC2IPS3_vEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.346", ptr %10, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8
  %46 = call ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS2_S4_EE(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr %45)
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.345", ptr %13, i32 0, i32 0
  store ptr %46, ptr %47, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %48 = load i64, ptr %7, align 8, !tbaa !9
  %49 = add i64 %48, -1
  store i64 %49, ptr %7, align 8, !tbaa !9
  store i32 4, ptr %8, align 4
  br label %63

50:                                               ; preds = %25
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.AST::Function::Arg", ptr %53, i32 0, i32 1
  call void @_Z14Expand_PatternRK11ExpandStateRN3AST6ModuleERNS2_7PatternEb(ptr noundef nonnull align 8 dereferenceable(30) %51, ptr noundef nonnull align 8 dereferenceable(480) %52, ptr noundef nonnull align 8 dereferenceable(544) %54, i1 noundef zeroext false)
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.AST::Function::Arg", ptr %57, i32 0, i32 2
  call void @_Z11Expand_TypeRK11ExpandStateRN3AST6ModuleER7TypeRef(ptr noundef nonnull align 8 dereferenceable(30) %55, ptr noundef nonnull align 8 dereferenceable(480) %56, ptr noundef nonnull align 8 dereferenceable(120) %58)
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.AST::Function::Arg", ptr %60, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  call void @"_ZNSt8functionIFvRK4SpanRK15ExpandDecoratorRKN3AST9AttributeEEEC2IZ15Expand_FunctionRK11ExpandStateRNS6_6ModuleERNS6_8FunctionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  invoke void @_Z12Expand_AttrsRK11ExpandStateRKN3AST13AttributeListE9AttrStageSt8functionIFvRK4SpanRK15ExpandDecoratorRKNS2_9AttributeEEE(ptr noundef nonnull align 8 dereferenceable(30) %59, ptr noundef nonnull align 8 dereferenceable(24) %61, i32 noundef 1, ptr noundef %14)
          to label %62 unwind label %69

62:                                               ; preds = %50
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  store i32 0, ptr %8, align 4
  br label %63

63:                                               ; preds = %62, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %64 = load i32, ptr %8, align 4
  switch i32 %64, label %86 [
    i32 0, label %65
    i32 4, label %66
  ]

65:                                               ; preds = %63
  br label %66

66:                                               ; preds = %65, %63
  %67 = load i64, ptr %7, align 8, !tbaa !9
  %68 = add i64 %67, 1
  store i64 %68, ptr %7, align 8, !tbaa !9
  br label %18, !llvm.loop !11

69:                                               ; preds = %50
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %16, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %17, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %81

73:                                               ; preds = %24
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN3AST8Function7rettypeEv(ptr noundef nonnull align 8 dereferenceable(368) %76)
  call void @_Z11Expand_TypeRK11ExpandStateRN3AST6ModuleER7TypeRef(ptr noundef nonnull align 8 dereferenceable(30) %74, ptr noundef nonnull align 8 dereferenceable(480) %75, ptr noundef nonnull align 8 dereferenceable(120) %77)
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3AST8Function4codeEv(ptr noundef nonnull align 8 dereferenceable(368) %79)
  call void @_Z11Expand_ExprRK11ExpandStateRN3AST4ExprE(ptr noundef nonnull align 8 dereferenceable(30) %78, ptr noundef nonnull align 8 dereferenceable(16) %80)
  ret void

81:                                               ; preds = %69
  %82 = load ptr, ptr %16, align 8
  %83 = load i32, ptr %17, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85

86:                                               ; preds = %63
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(688) ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRK4SpanRK15ExpandDecoratorRKN3AST9AttributeEEEC2IZ15Expand_FunctionRK11ExpandStateRNS6_6ModuleERNS6_8FunctionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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"

%"class.__gnu_cxx::__normal_iterator.346" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.345" = type { ptr }
%"class.std::function.44" = 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.anon.347 = type { i8 }

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

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
declare dso_local void @_Z12Expand_AttrsRK11ExpandStateRKN3AST13AttributeListE9AttrStageSt8functionIFvRK4SpanRK15ExpandDecoratorRKNS2_9AttributeEEE(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z20Expand_Attrs_CfgOnlyRK11ExpandStateRN3AST13AttributeListE(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14Expand_PatternRK11ExpandStateRN3AST6ModuleERNS2_7PatternEb(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(480), ptr noundef nonnull align 8 dereferenceable(544), i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11Expand_TypeRK11ExpandStateRN3AST6ModuleER7TypeRef(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(480), ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11Expand_ExprRK11ExpandStateRN3AST4ExprE(ptr noundef nonnull align 8 dereferenceable(30), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15Expand_FunctionRK11ExpandStateRN3AST6ModuleERNS2_8FunctionE(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(480) %1, ptr noundef nonnull align 8 dereferenceable(368) %2) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.346", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.345", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.345", align 8
  %7 = alloca %"class.std::function.44", align 8
  %8 = alloca %class.anon.347, align 1
  %9 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %2)
  %10 = tail call noundef i64 @_ZNKSt6vectorIN3AST8Function3ArgESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %28, %3
  %11 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN3AST8Function7rettypeEv(ptr noundef nonnull align 8 dereferenceable(368) %2)
  call void @_Z11Expand_TypeRK11ExpandStateRN3AST6ModuleER7TypeRef(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(480) %1, ptr noundef nonnull align 8 dereferenceable(120) %11)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3AST8Function4codeEv(ptr noundef nonnull align 8 dereferenceable(368) %2)
  call void @_Z11Expand_ExprRK11ExpandStateRN3AST4ExprE(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(16) %12)
  ret void

.lr.ph:                                           ; preds = %3, %28
  %.025 = phi i64 [ %29, %28 ], [ 0, %3 ]
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %2)
  %14 = call noundef nonnull align 8 dereferenceable(688) ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %.025) #3
  %15 = call noundef zeroext i1 @_Z20Expand_Attrs_CfgOnlyRK11ExpandStateRN3AST13AttributeListE(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(24) %14)
  br i1 %15, label %24, label %16

16:                                               ; preds = %.lr.ph
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %2)
  %19 = call ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  store ptr %19, ptr %6, align 8
  %20 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3AST8Function3ArgESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef %.025) #3
  store ptr %20, ptr %5, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN3AST8Function3ArgESt6vectorIS3_SaIS3_EEEC2IPS3_vEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %21 = load ptr, ptr %4, align 8
  %22 = call ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS2_S4_EE(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  %23 = add i64 %.025, -1
  br label %28

24:                                               ; preds = %.lr.ph
  %25 = getelementptr inbounds i8, ptr %14, i64 24
  call void @_Z14Expand_PatternRK11ExpandStateRN3AST6ModuleERNS2_7PatternEb(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(480) %1, ptr noundef nonnull align 8 dereferenceable(544) %25, i1 noundef zeroext false)
  %26 = getelementptr inbounds i8, ptr %14, i64 568
  call void @_Z11Expand_TypeRK11ExpandStateRN3AST6ModuleER7TypeRef(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(480) %1, ptr noundef nonnull align 8 dereferenceable(120) %26)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #3
  call void @"_ZNSt8functionIFvRK4SpanRK15ExpandDecoratorRKN3AST9AttributeEEEC2IZ15Expand_FunctionRK11ExpandStateRNS6_6ModuleERNS6_8FunctionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 1 dereferenceable(1) %8) #3
  invoke void @_Z12Expand_AttrsRK11ExpandStateRKN3AST13AttributeListE9AttrStageSt8functionIFvRK4SpanRK15ExpandDecoratorRKNS2_9AttributeEEE(ptr noundef nonnull align 8 dereferenceable(30) %0, ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 1, ptr noundef nonnull %7)
          to label %27 unwind label %33

27:                                               ; preds = %24
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  br label %28

28:                                               ; preds = %27, %16
  %.1 = phi i64 [ %.025, %27 ], [ %23, %16 ]
  %29 = add i64 %.1, 1
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3AST8Function4argsEv(ptr noundef nonnull align 8 dereferenceable(368) %2)
  %31 = call noundef i64 @_ZNKSt6vectorIN3AST8Function3ArgESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #3
  %32 = icmp ult i64 %29, %31
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !5

33:                                               ; preds = %24
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  resume { ptr, i32 } %34
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(688) ptr @_ZNSt6vectorIN3AST8Function3ArgESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRK4SpanRK15ExpandDecoratorRKN3AST9AttributeEEEC2IZ15Expand_FunctionRK11ExpandStateRNS6_6ModuleERNS6_8FunctionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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