; LLVM IR from thepowersgang/mrustc :: src/trans/target.ll (Z18Target_GetTypeReprRK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE)

; 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.std::map.109" = type { %"class.std::_Rb_tree.110" }
%"class.std::_Rb_tree.110" = type { %"struct.std::_Rb_tree<HIR::TypeRef, std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>, std::_Select1st<std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>>, std::less<HIR::TypeRef>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<HIR::TypeRef, std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>, std::_Select1st<std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>>, std::less<HIR::TypeRef>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.122" = type <{ %"struct.std::_Rb_tree_iterator", i8, [7 x i8] }>
%"struct.std::pair.124" = type { %"class.HIR::TypeRef", %"class.std::unique_ptr.114" }
%"class.HIR::TypeRef" = type { ptr }
%"class.std::unique_ptr.114" = type { %"struct.std::__uniq_ptr_data.115" }
%"struct.std::__uniq_ptr_data.115" = type { %"class.std::__uniq_ptr_impl.116" }
%"class.std::__uniq_ptr_impl.116" = type { %"class.std::tuple.117" }
%"class.std::tuple.117" = type { %"struct.std::_Tuple_impl.118" }
%"struct.std::_Tuple_impl.118" = type { %"struct.std::_Head_base.121" }
%"struct.std::_Head_base.121" = type { ptr }
%"struct.std::pair" = type { %"class.HIR::TypeRef", %"class.std::unique_ptr.114" }

@g_debug_indent_level = external global i32, align 4
@_ZN12_GLOBAL__N_17s_cacheE = external hidden global %"class.std::map.109", align 8
@__FUNCTION__._Z18Target_GetTypeReprRK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE = external hidden unnamed_addr constant [19 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [18 x i8], align 1

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

declare noundef zeroext i1 @_Z13debug_enabledv() #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3decRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z18Target_GetTypeReprRK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(424) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair.122", align 8
  %12 = alloca %"struct.std::pair.124", align 8
  %13 = alloca %"class.HIR::TypeRef", align 8
  %14 = alloca %"class.std::unique_ptr.114", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca { ptr, i8 }, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = call ptr @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN12_GLOBAL__N_17s_cacheE, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %20 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %8, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %21 = call ptr @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @_ZN12_GLOBAL__N_17s_cacheE) #7
  %22 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %9, i32 0, i32 0
  store ptr %21, ptr %22, align 8
  %23 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br i1 %23, label %24, label %28

24:                                               ; preds = %3
  %25 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %26 = getelementptr inbounds %"struct.std::pair", ptr %25, i32 0, i32 1
  %27 = call noundef ptr @_ZNKSt10unique_ptrI8TypeReprSt14default_deleteIS0_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #7
  store ptr %27, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %75

28:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNK3HIR7TypeRef5cloneEv(ptr dead_on_unwind writable sret(%"class.HIR::TypeRef") align 8 %13, ptr noundef nonnull align 8 dereferenceable(8) %29)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN12_GLOBAL__N_114make_type_reprERK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE(ptr dead_on_unwind writable sret(%"class.std::unique_ptr.114") align 8 %14, ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(424) %31, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %33 unwind label %53

33:                                               ; preds = %28
  invoke void @_ZSt9make_pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind writable sret(%"struct.std::pair.124") align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %34 unwind label %57

34:                                               ; preds = %33
  %35 = invoke { ptr, i8 } @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE6insertIS9_IS1_S6_EEENSt9enable_ifIXsr16is_constructibleISB_T_EE5valueES9_ISt17_Rb_tree_iteratorISB_EbEE4typeEOSH_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN12_GLOBAL__N_17s_cacheE, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %36 unwind label %61

36:                                               ; preds = %34
  store { ptr, i8 } %35, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %17, i64 9, i1 false)
  call void @_ZNSt4pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  call void @_ZNSt10unique_ptrI8TypeReprSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  %37 = getelementptr inbounds %"struct.std::pair.122", ptr %11, i32 0, i32 1
  %38 = load i8, ptr %37, align 8, !tbaa !9, !range !13, !noundef !14
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %70

40:                                               ; preds = %36
  br label %41

41:                                               ; preds = %40
  %42 = call noundef zeroext i1 @_Z13debug_enabledv()
  br i1 %42, label %43, label %67

43:                                               ; preds = %41
  %44 = load i32, ptr @g_debug_indent_level, align 4, !tbaa !15
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef %44, ptr noundef @__FUNCTION__._Z18Target_GetTypeReprRK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef @.str.63)
  %47 = getelementptr inbounds %"struct.std::pair.122", ptr %11, i32 0, i32 0
  %48 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %47) #7
  %49 = getelementptr inbounds %"struct.std::pair", ptr %48, i32 0, i32 0
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3HIRlsERSoRKNS_7TypeRefE(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %49)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef @_ZSt3decRSt8ios_base)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %67

53:                                               ; preds = %28
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %15, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %16, align 4
  br label %66

57:                                               ; preds = %33
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %15, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %16, align 4
  br label %65

61:                                               ; preds = %34
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %15, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %16, align 4
  call void @_ZNSt4pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  br label %65

65:                                               ; preds = %61, %57
  call void @_ZNSt10unique_ptrI8TypeReprSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br label %66

66:                                               ; preds = %65, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %77

67:                                               ; preds = %43, %41
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69, %36
  %71 = getelementptr inbounds %"struct.std::pair.122", ptr %11, i32 0, i32 0
  %72 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %71) #7
  %73 = getelementptr inbounds %"struct.std::pair", ptr %72, i32 0, i32 1
  %74 = call noundef ptr @_ZNKSt10unique_ptrI8TypeReprSt14default_deleteIS0_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %73) #7
  store ptr %74, ptr %4, align 8
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %75

75:                                               ; preds = %70, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %76 = load ptr, ptr %4, align 8
  ret ptr %76

77:                                               ; preds = %66
  %78 = load ptr, ptr %15, align 8
  %79 = load i32, ptr %16, align 4
  %80 = insertvalue { ptr, i32 } poison, ptr %78, 0
  %81 = insertvalue { ptr, i32 } %80, i32 %79, 1
  resume { ptr, i32 } %81
}

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN3HIRlsERSoRKNS_7TypeRefE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE6insertIS9_IS1_S6_EEENSt9enable_ifIXsr16is_constructibleISB_T_EE5valueES9_ISt17_Rb_tree_iteratorISB_EbEE4typeEOSH_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.124") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

declare void @_ZNK3HIR7TypeRef5cloneEv(ptr dead_on_unwind writable sret(%"class.HIR::TypeRef") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_114make_type_reprERK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr.114") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(424), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { inlinehint 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 = { 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 #5 = { 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 #6 = { 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 #7 = { 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, !12, i64 8}
!10 = !{!"_ZTSSt4pairISt17_Rb_tree_iteratorIS_IKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEEbE", !11, i64 0, !12, i64 8}
!11 = !{!"_ZTSSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEE", !6, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}


; 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.std::map.109" = type { %"class.std::_Rb_tree.110" }
%"class.std::_Rb_tree.110" = type { %"struct.std::_Rb_tree<HIR::TypeRef, std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>, std::_Select1st<std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>>, std::less<HIR::TypeRef>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<HIR::TypeRef, std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>, std::_Select1st<std::pair<const HIR::TypeRef, std::unique_ptr<TypeRepr>>>, std::less<HIR::TypeRef>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.122" = type <{ %"struct.std::_Rb_tree_iterator", i8, [7 x i8] }>
%"struct.std::pair.124" = type { %"class.HIR::TypeRef", %"class.std::unique_ptr.114" }
%"class.HIR::TypeRef" = type { ptr }
%"class.std::unique_ptr.114" = type { %"struct.std::__uniq_ptr_data.115" }
%"struct.std::__uniq_ptr_data.115" = type { %"class.std::__uniq_ptr_impl.116" }
%"class.std::__uniq_ptr_impl.116" = type { %"class.std::tuple.117" }
%"class.std::tuple.117" = type { %"struct.std::_Tuple_impl.118" }
%"struct.std::_Tuple_impl.118" = type { %"struct.std::_Head_base.121" }
%"struct.std::_Head_base.121" = type { ptr }

@g_debug_indent_level = external local_unnamed_addr global i32, align 4
@_ZN12_GLOBAL__N_17s_cacheE = external hidden global %"class.std::map.109", align 8
@__FUNCTION__._Z18Target_GetTypeReprRK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE = external hidden unnamed_addr constant [19 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [18 x i8], align 1

; 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

declare noundef zeroext i1 @_Z13debug_enabledv() local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z18Target_GetTypeReprRK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(424) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca %"struct.std::pair.122", align 8
  %7 = alloca %"struct.std::pair.124", align 8
  %8 = alloca %"class.HIR::TypeRef", align 8
  %9 = alloca %"class.std::unique_ptr.114", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %10 = tail call ptr @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN12_GLOBAL__N_17s_cacheE, ptr noundef nonnull align 8 dereferenceable(8) %2)
  store ptr %10, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %11 = tail call ptr @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @_ZN12_GLOBAL__N_17s_cacheE) #6
  store ptr %11, ptr %5, align 8
  %12 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %12, label %13, label %17

13:                                               ; preds = %3
  %14 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = call noundef ptr @_ZNKSt10unique_ptrI8TypeReprSt14default_deleteIS0_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %45

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZNK3HIR7TypeRef5cloneEv(ptr dead_on_unwind nonnull writable sret(%"class.HIR::TypeRef") align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  invoke void @_ZN12_GLOBAL__N_114make_type_reprERK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr.114") align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(424) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %18 unwind label %33

18:                                               ; preds = %17
  invoke void @_ZSt9make_pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.124") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %19 unwind label %35

19:                                               ; preds = %18
  %20 = invoke { ptr, i8 } @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE6insertIS9_IS1_S6_EEENSt9enable_ifIXsr16is_constructibleISB_T_EE5valueES9_ISt17_Rb_tree_iteratorISB_EbEE4typeEOSH_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN12_GLOBAL__N_17s_cacheE, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %21 unwind label %37

21:                                               ; preds = %19
  %.fca.0.extract = extractvalue { ptr, i8 } %20, 0
  %.fca.1.extract = extractvalue { ptr, i8 } %20, 1
  store ptr %.fca.0.extract, ptr %6, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  store i8 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt4pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @_ZNSt10unique_ptrI8TypeReprSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %22 = trunc nuw i8 %.fca.1.extract to i1
  br i1 %22, label %23, label %41

23:                                               ; preds = %21
  %24 = call noundef zeroext i1 @_Z13debug_enabledv()
  br i1 %24, label %25, label %41

25:                                               ; preds = %23
  %26 = load i32, ptr @g_debug_indent_level, align 4, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef %26, ptr noundef nonnull @__FUNCTION__._Z18Target_GetTypeReprRK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @.str.63)
  %29 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3HIRlsERSoRKNS_7TypeRefE(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @_ZSt3decRSt8ios_base)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %41

33:                                               ; preds = %17
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %40

35:                                               ; preds = %18
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

37:                                               ; preds = %19
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  br label %39

39:                                               ; preds = %37, %35
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @_ZNSt10unique_ptrI8TypeReprSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br label %40

40:                                               ; preds = %39, %33
  %.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn

41:                                               ; preds = %23, %25, %21
  %42 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS5_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = call noundef ptr @_ZNKSt10unique_ptrI8TypeReprSt14default_deleteIS0_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %43) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %45

45:                                               ; preds = %41, %13
  %.0 = phi ptr [ %16, %13 ], [ %44, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret ptr %.0
}

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN3HIRlsERSoRKNS_7TypeRefE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EESt4lessIS1_ESaISt4pairIKS1_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIN3HIR7TypeRefESt10unique_ptrI8TypeReprSt14default_deleteIS3_EEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.124") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare void @_ZNK3HIR7TypeRef5cloneEv(ptr dead_on_unwind writable sret(%"class.HIR::TypeRef") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_114make_type_reprERK4SpanRK18StaticTraitResolveRKN3HIR7TypeRefE(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr.114") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(424), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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 #5 = { 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 #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass