; LLVM IR from thepowersgang/mrustc :: src/hir_typeck/helpers.ll (ZNK16HMTypeInferrence9get_valueEj)

; 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.Span = type { ptr }
%"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.anon.191 = type { i8 }
%class.anon.193 = type { i8 }
%class.anon.195 = type { ptr, ptr }
%class.HMTypeInferrence = type <{ %"class.std::vector", %"class.std::vector.0", i8, [7 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HMTypeInferrence::IVar, std::allocator<HMTypeInferrence::IVar>>::_Vector_impl" }
%"struct.std::_Vector_base<HMTypeInferrence::IVar, std::allocator<HMTypeInferrence::IVar>>::_Vector_impl" = type { %"struct.std::_Vector_base<HMTypeInferrence::IVar, std::allocator<HMTypeInferrence::IVar>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HMTypeInferrence::IVar, std::allocator<HMTypeInferrence::IVar>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<HMTypeInferrence::IVarValue, std::allocator<HMTypeInferrence::IVarValue>>::_Vector_impl" }
%"struct.std::_Vector_base<HMTypeInferrence::IVarValue, std::allocator<HMTypeInferrence::IVarValue>>::_Vector_impl" = type { %"struct.std::_Vector_base<HMTypeInferrence::IVarValue, std::allocator<HMTypeInferrence::IVarValue>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HMTypeInferrence::IVarValue, std::allocator<HMTypeInferrence::IVarValue>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.HMTypeInferrence::IVarValue" = type { i32, %"class.std::unique_ptr.8" }
%"class.std::unique_ptr.8" = type { %"struct.std::__uniq_ptr_data.9" }
%"struct.std::__uniq_ptr_data.9" = type { %"class.std::__uniq_ptr_impl.10" }
%"class.std::__uniq_ptr_impl.10" = type { %"class.std::tuple.11" }
%"class.std::tuple.11" = type { %"struct.std::_Tuple_impl.12" }
%"struct.std::_Tuple_impl.12" = type { %"struct.std::_Head_base.15" }
%"struct.std::_Head_base.15" = type { ptr }

@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr

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

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

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) #1

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

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

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

declare void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: nounwind
declare void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16HMTypeInferrence9get_valueEj(ptr noundef nonnull align 8 dereferenceable(49) %0, i32 noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.Span, align 8
  %7 = alloca %"class.std::function", align 8
  %8 = alloca %class.anon.191, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.Span, align 8
  %15 = alloca %"class.std::function", align 8
  %16 = alloca %class.anon.193, align 1
  %17 = alloca ptr, align 8
  %18 = alloca %struct.Span, align 8
  %19 = alloca %"class.std::function", align 8
  %20 = alloca %class.anon.195, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %21 = load ptr, ptr %4, align 8
  br label %22

22:                                               ; preds = %2
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = icmp ne i32 %23, -1
  br i1 %24, label %37, label %25

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %7)
          to label %26 unwind label %29

26:                                               ; preds = %25
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %27 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef @.str.8)
          to label %28 unwind label %33

28:                                               ; preds = %26
  call void @__cxa_throw(ptr %27, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #6
  unreachable

29:                                               ; preds = %25
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %9, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %10, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %112

33:                                               ; preds = %26
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %9, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %10, align 4
  call void @__cxa_free_exception(ptr %27) #5
  br label %112

37:                                               ; preds = %22
  br label %38

38:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %39 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %39, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %86, %38
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds %class.HMTypeInferrence, ptr %21, i32 0, i32 1
  %44 = call noundef i64 @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #5
  %45 = icmp ult i64 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %40
  store i32 4, ptr %13, align 4
  br label %89

47:                                               ; preds = %40
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds %class.HMTypeInferrence, ptr %21, i32 0, i32 1
  %52 = call noundef i64 @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #5
  %53 = icmp ult i64 %50, %52
  br i1 %53, label %66, label %54

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef %15)
          to label %55 unwind label %58

55:                                               ; preds = %54
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %56 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef @.str.8)
          to label %57 unwind label %62

57:                                               ; preds = %55
  call void @__cxa_throw(ptr %56, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #6
  unreachable

58:                                               ; preds = %54
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %9, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %10, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %91

62:                                               ; preds = %55
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %9, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %10, align 4
  call void @__cxa_free_exception(ptr %56) #5
  br label %91

66:                                               ; preds = %48
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %69 = getelementptr inbounds %class.HMTypeInferrence, ptr %21, i32 0, i32 1
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71) #5
  store ptr %72, ptr %17, align 8, !tbaa !5
  %73 = load ptr, ptr %17, align 8, !tbaa !5
  %74 = call noundef zeroext i1 @_ZNK16HMTypeInferrence9IVarValue8is_aliasEv(ptr noundef nonnull align 8 dereferenceable(16) %73)
  br i1 %74, label %79, label %75

75:                                               ; preds = %68
  %76 = load ptr, ptr %17, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.HMTypeInferrence::IVarValue", ptr %76, i32 0, i32 1
  %78 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt10unique_ptrIN3HIR12ConstGenericESt14default_deleteIS1_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %77) #5
  store ptr %78, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %83

79:                                               ; preds = %68
  %80 = load ptr, ptr %17, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.HMTypeInferrence::IVarValue", ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !11
  store i32 %82, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %13, align 4
  br label %83

83:                                               ; preds = %79, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %84 = load i32, ptr %13, align 4
  switch i32 %84, label %89 [
    i32 0, label %85
  ]

85:                                               ; preds = %83
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = add i32 %87, 1
  store i32 %88, ptr %12, align 4, !tbaa !9
  br label %40, !llvm.loop !19

89:                                               ; preds = %83, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %90 = load i32, ptr %13, align 4
  switch i32 %90, label %109 [
    i32 4, label %92
  ]

91:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %111

92:                                               ; preds = %89
  call void @_ZNK16HMTypeInferrence4dumpEv(ptr noundef nonnull align 8 dereferenceable(49) %21)
  br label %93

93:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %94 = getelementptr inbounds %class.anon.195, ptr %20, i32 0, i32 0
  store ptr %5, ptr %94, align 8, !tbaa !5
  %95 = getelementptr inbounds %class.anon.195, ptr %20, i32 0, i32 1
  store ptr %11, ptr %95, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef %19)
          to label %96 unwind label %99

96:                                               ; preds = %93
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %97 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %97, ptr noundef @.str.8)
          to label %98 unwind label %103

98:                                               ; preds = %96
  call void @__cxa_throw(ptr %97, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #6
  unreachable

99:                                               ; preds = %93
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %9, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %10, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %111

103:                                              ; preds = %96
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %9, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %10, align 4
  call void @__cxa_free_exception(ptr %97) #5
  br label %111

107:                                              ; No predecessors!
  br label %108

108:                                              ; preds = %107
  unreachable

109:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %110 = load ptr, ptr %3, align 8
  ret ptr %110

111:                                              ; preds = %103, %99, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %112

112:                                              ; preds = %111, %33, %29
  %113 = load ptr, ptr %9, align 8
  %114 = load i32, ptr %10, align 4
  %115 = insertvalue { ptr, i32 } poison, ptr %113, 0
  %116 = insertvalue { ptr, i32 } %115, i32 %114, 1
  resume { ptr, i32 } %116
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_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 hidden void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_1vEEOT_"(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(16) ptr @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) 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 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 "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 #5 = { nounwind }
attributes #6 = { noreturn }

!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 0}
!12 = !{!"_ZTSN16HMTypeInferrence9IVarValueE", !10, i64 0, !13, i64 8}
!13 = !{!"_ZTSSt10unique_ptrIN3HIR12ConstGenericESt14default_deleteIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIN3HIR12ConstGenericESt14default_deleteIS1_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIN3HIR12ConstGenericESt14default_deleteIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPN3HIR12ConstGenericESt14default_deleteIS1_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPN3HIR12ConstGenericESt14default_deleteIS1_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EPN3HIR12ConstGenericELb0EE", !6, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"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.Span = type { ptr }
%"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.anon.191 = type { i8 }
%class.anon.193 = type { i8 }
%class.anon.195 = type { ptr, ptr }

@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr

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

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

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) #1

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

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

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

declare void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16HMTypeInferrence9get_valueEj(ptr noundef nonnull align 8 dereferenceable(49) %0, i32 noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca %struct.Span, align 8
  %5 = alloca %"class.std::function", align 8
  %6 = alloca %class.anon.191, align 1
  %7 = alloca i32, align 4
  %8 = alloca %struct.Span, align 8
  %9 = alloca %"class.std::function", align 8
  %10 = alloca %class.anon.193, align 1
  %11 = alloca %struct.Span, align 8
  %12 = alloca %"class.std::function", align 8
  %13 = alloca %class.anon.195, align 8
  store i32 %1, ptr %3, align 4, !tbaa !5
  %.not = icmp eq i32 %1, -1
  br i1 %.not, label %14, label %22

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %5)
          to label %15 unwind label %18

15:                                               ; preds = %14
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %16 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull @.str.8)
          to label %17 unwind label %20

17:                                               ; preds = %15
  call void @__cxa_throw(ptr nonnull %16, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #6
  unreachable

18:                                               ; preds = %14
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %57

20:                                               ; preds = %15
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %16) #5
  br label %57

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %23 = getelementptr inbounds i8, ptr %0, i64 24
  %24 = tail call noundef i64 @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %.not2133.not = icmp eq i64 %24, 0
  br i1 %.not2133.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %22, %40
  %.01334 = phi i32 [ %42, %40 ], [ 0, %22 ]
  %25 = phi i32 [ %41, %40 ], [ %1, %22 ]
  %26 = zext i32 %25 to i64
  %27 = tail call noundef i64 @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %28 = icmp ugt i64 %27, %26
  br i1 %28, label %37, label %29

29:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull %9)
          to label %30 unwind label %33

30:                                               ; preds = %29
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %31 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull @.str.8)
          to label %32 unwind label %35

32:                                               ; preds = %30
  call void @__cxa_throw(ptr nonnull %31, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #6
  unreachable

33:                                               ; preds = %29
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %56

35:                                               ; preds = %30
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %31) #5
  br label %56

37:                                               ; preds = %.lr.ph
  %38 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %26) #5
  %39 = tail call noundef zeroext i1 @_ZNK16HMTypeInferrence9IVarValue8is_aliasEv(ptr noundef nonnull align 8 dereferenceable(16) %38)
  br i1 %39, label %40, label %53

40:                                               ; preds = %37
  %41 = load i32, ptr %38, align 8, !tbaa !9
  %42 = add i32 %.01334, 1
  %43 = zext i32 %42 to i64
  %44 = tail call noundef i64 @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %.not21 = icmp ugt i64 %44, %43
  br i1 %.not21, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %40, %22
  %.lcssa30 = phi i32 [ %1, %22 ], [ %41, %40 ]
  store i32 %.lcssa30, ptr %7, align 4, !tbaa !5
  tail call void @_ZNK16HMTypeInferrence4dumpEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #5
  store ptr %3, ptr %13, align 8, !tbaa !20
  %45 = getelementptr inbounds i8, ptr %13, i64 8
  store ptr %7, ptr %45, align 8, !tbaa !20
  call void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull %12)
          to label %46 unwind label %49

46:                                               ; preds = %._crit_edge
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  %47 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull @.str.8)
          to label %48 unwind label %51

48:                                               ; preds = %46
  call void @__cxa_throw(ptr nonnull %47, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #6
  unreachable

49:                                               ; preds = %._crit_edge
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %56

51:                                               ; preds = %46
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %47) #5
  br label %56

53:                                               ; preds = %37
  %54 = getelementptr inbounds i8, ptr %38, i64 8
  %55 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt10unique_ptrIN3HIR12ConstGenericESt14default_deleteIS1_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %54) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  ret ptr %55

56:                                               ; preds = %33, %35, %51, %49
  %.pn22 = phi { ptr, i32 } [ %52, %51 ], [ %50, %49 ], [ %36, %35 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %57

57:                                               ; preds = %56, %20, %18
  %.pn22.pn = phi { ptr, i32 } [ %.pn22, %56 ], [ %21, %20 ], [ %19, %18 ]
  resume { ptr, i32 } %.pn22.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_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 hidden void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_1vEEOT_"(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(16) ptr @_ZNKSt6vectorIN16HMTypeInferrence9IVarValueESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZNK16HMTypeInferrence9get_valueEjE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) 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 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 "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 #5 = { nounwind }
attributes #6 = { noreturn }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN16HMTypeInferrence9IVarValueE", !6, i64 0, !11, i64 8}
!11 = !{!"_ZTSSt10unique_ptrIN3HIR12ConstGenericESt14default_deleteIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt15__uniq_ptr_dataIN3HIR12ConstGenericESt14default_deleteIS1_ELb1ELb1EE", !13, i64 0}
!13 = !{!"_ZTSSt15__uniq_ptr_implIN3HIR12ConstGenericESt14default_deleteIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt5tupleIJPN3HIR12ConstGenericESt14default_deleteIS1_EEE", !15, i64 0}
!15 = !{!"_ZTSSt11_Tuple_implILm0EJPN3HIR12ConstGenericESt14default_deleteIS1_EEE", !16, i64 0}
!16 = !{!"_ZTSSt10_Head_baseILm0EPN3HIR12ConstGenericELb0EE", !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!17, !17, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass