; LLVM IR from thepowersgang/mrustc :: src/hir/type.ll (ZNK3HIR15TypePathBinding12get_genericsEv)

; 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.HIR::Struct" = type <{ %"class.HIR::GenericParams", i32, [4 x i8], %"class.HIR::Struct::Data", i32, i32, %"struct.HIR::TraitMarkings", %"struct.HIR::StructMarkings", i32, [4 x i8] }>
%"class.HIR::GenericParams" = type { %"class.std::vector", %"class.std::vector.2", %"class.std::vector.7", %"class.std::vector.12" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.2" = type { %"struct.std::_Vector_base.3" }
%"struct.std::_Vector_base.3" = type { %"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.HIR::Struct::Data" = type { i32, %"union.HIR::Struct::Data::DataUnion" }
%"union.HIR::Struct::Data::DataUnion" = type { %"class.std::vector.124" }
%"class.std::vector.124" = type { %"struct.std::_Vector_base.125" }
%"struct.std::_Vector_base.125" = type { %"struct.std::_Vector_base<HIR::VisEnt<HIR::TypeRef>, std::allocator<HIR::VisEnt<HIR::TypeRef>>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::VisEnt<HIR::TypeRef>, std::allocator<HIR::VisEnt<HIR::TypeRef>>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::VisEnt<HIR::TypeRef>, std::allocator<HIR::VisEnt<HIR::TypeRef>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::VisEnt<HIR::TypeRef>, std::allocator<HIR::VisEnt<HIR::TypeRef>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.HIR::TraitMarkings" = type { i8, i8, i8, %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<HIR::SimplePath, std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>, std::_Select1st<std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>>, std::less<HIR::SimplePath>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<HIR::SimplePath, std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>, std::_Select1st<std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>>, std::less<HIR::SimplePath>>::_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.HIR::StructMarkings" = type { i8, i32, i32, i32, i32, i32, i32, i8, i8, %class.U128 }
%class.U128 = type { i64, i64 }
%"class.HIR::Union" = type { %"class.HIR::GenericParams", i32, %"class.std::vector.129", %"struct.HIR::TraitMarkings" }
%"class.std::vector.129" = type { %"struct.std::_Vector_base.130" }
%"struct.std::_Vector_base.130" = type { %"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.HIR::Enum" = type { %"class.HIR::GenericParams", i8, i32, %"class.HIR::Enum::Class", %"struct.HIR::TraitMarkings" }
%"class.HIR::Enum::Class" = type { i32, %"union.HIR::Enum::Class::DataUnion" }
%"union.HIR::Enum::Class::DataUnion" = type { %"class.std::vector.84", [8 x i8] }
%"class.std::vector.84" = type { %"struct.std::_Vector_base.85" }
%"struct.std::_Vector_base.85" = type { %"struct.std::_Vector_base<HIR::Enum::DataVariant, std::allocator<HIR::Enum::DataVariant>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::Enum::DataVariant, std::allocator<HIR::Enum::DataVariant>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::Enum::DataVariant, std::allocator<HIR::Enum::DataVariant>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::Enum::DataVariant, std::allocator<HIR::Enum::DataVariant>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.18 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3HIR15TypePathBinding12get_genericsEv = external hidden unnamed_addr constant [71 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

; 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 nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding9as_StructEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3HIR15TypePathBinding12get_genericsEv(ptr noundef nonnull align 8 dereferenceable(16) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %19 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #4
  store i8 1, ptr %4, align 1, !tbaa !9
  br label %20

20:                                               ; preds = %153, %1
  %21 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %22 = trunc i8 %21 to i1
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #4
  br label %154

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr %19, ptr %6, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %151, %24
  %26 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %27 = trunc i8 %26 to i1
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %152

29:                                               ; preds = %25
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call noundef i32 @_ZNK3HIR15TypePathBinding3tagEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
  switch i32 %31, label %150 [
    i32 0, label %32
    i32 1, label %33
    i32 2, label %51
    i32 3, label %69
    i32 4, label %87
    i32 5, label %108
    i32 6, label %129
  ]

32:                                               ; preds = %29
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.18, i32 noundef 1147, ptr noundef @__PRETTY_FUNCTION__._ZNK3HIR15TypePathBinding12get_genericsEv) #5
  unreachable

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  store i8 1, ptr %7, align 1, !tbaa !9
  br label %34

34:                                               ; preds = %49, %33
  %35 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %36 = trunc i8 %35 to i1
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  store i32 9, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  br label %50

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3HIR15TypePathBinding10as_UnboundEv(ptr noundef nonnull align 8 dereferenceable(16) %39)
  store ptr %40, ptr %8, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %47, %38
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %44 = trunc i8 %43 to i1
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 12, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %48

46:                                               ; preds = %41
  br label %47

47:                                               ; preds = %46
  store i8 0, ptr %7, align 1, !tbaa !9
  br label %41, !llvm.loop !13

48:                                               ; preds = %45
  br label %49

49:                                               ; preds = %48
  store i8 0, ptr %7, align 1, !tbaa !9
  br label %34, !llvm.loop !15

50:                                               ; preds = %37
  br label %150

51:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  store i8 1, ptr %9, align 1, !tbaa !9
  br label %52

52:                                               ; preds = %67, %51
  %53 = load i8, ptr %9, align 1, !tbaa !9, !range !11, !noundef !12
  %54 = trunc i8 %53 to i1
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 15, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  br label %68

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3HIR15TypePathBinding9as_OpaqueEv(ptr noundef nonnull align 8 dereferenceable(16) %57)
  store ptr %58, ptr %10, align 8, !tbaa !5
  br label %59

59:                                               ; preds = %65, %56
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load i8, ptr %9, align 1, !tbaa !9, !range !11, !noundef !12
  %62 = trunc i8 %61 to i1
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 18, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %66

64:                                               ; preds = %59
  br label %65

65:                                               ; preds = %64
  store i8 0, ptr %9, align 1, !tbaa !9
  br label %59, !llvm.loop !16

66:                                               ; preds = %63
  br label %67

67:                                               ; preds = %66
  store i8 0, ptr %9, align 1, !tbaa !9
  br label %52, !llvm.loop !17

68:                                               ; preds = %55
  br label %150

69:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  store i8 1, ptr %11, align 1, !tbaa !9
  br label %70

70:                                               ; preds = %85, %69
  %71 = load i8, ptr %11, align 1, !tbaa !9, !range !11, !noundef !12
  %72 = trunc i8 %71 to i1
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  store i32 21, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  br label %86

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding13as_ExternTypeEv(ptr noundef nonnull align 8 dereferenceable(16) %75)
  store ptr %76, ptr %12, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %83, %74
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = load i8, ptr %11, align 1, !tbaa !9, !range !11, !noundef !12
  %80 = trunc i8 %79 to i1
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 24, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %84

82:                                               ; preds = %77
  br label %83

83:                                               ; preds = %82
  store i8 0, ptr %11, align 1, !tbaa !9
  br label %77, !llvm.loop !18

84:                                               ; preds = %81
  br label %85

85:                                               ; preds = %84
  store i8 0, ptr %11, align 1, !tbaa !9
  br label %70, !llvm.loop !19

86:                                               ; preds = %73
  br label %150

87:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  store i8 1, ptr %13, align 1, !tbaa !9
  br label %88

88:                                               ; preds = %106, %87
  %89 = load i8, ptr %13, align 1, !tbaa !9, !range !11, !noundef !12
  %90 = trunc i8 %89 to i1
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  store i32 27, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  br label %107

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding9as_StructEv(ptr noundef nonnull align 8 dereferenceable(16) %93)
  store ptr %94, ptr %14, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %104, %92
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = load i8, ptr %13, align 1, !tbaa !9, !range !11, !noundef !12
  %98 = trunc i8 %97 to i1
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 30, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %105

100:                                              ; preds = %95
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = load ptr, ptr %101, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.HIR::Struct", ptr %102, i32 0, i32 0
  store ptr %103, ptr %3, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %100
  store i8 0, ptr %13, align 1, !tbaa !9
  br label %95, !llvm.loop !20

105:                                              ; preds = %99
  br label %106

106:                                              ; preds = %105
  store i8 0, ptr %13, align 1, !tbaa !9
  br label %88, !llvm.loop !21

107:                                              ; preds = %91
  br label %150

108:                                              ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  store i8 1, ptr %15, align 1, !tbaa !9
  br label %109

109:                                              ; preds = %127, %108
  %110 = load i8, ptr %15, align 1, !tbaa !9, !range !11, !noundef !12
  %111 = trunc i8 %110 to i1
  br i1 %111, label %113, label %112

112:                                              ; preds = %109
  store i32 33, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  br label %128

113:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding8as_UnionEv(ptr noundef nonnull align 8 dereferenceable(16) %114)
  store ptr %115, ptr %16, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %125, %113
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  %118 = load i8, ptr %15, align 1, !tbaa !9, !range !11, !noundef !12
  %119 = trunc i8 %118 to i1
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 36, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %126

121:                                              ; preds = %116
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  %124 = getelementptr inbounds %"class.HIR::Union", ptr %123, i32 0, i32 0
  store ptr %124, ptr %3, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %121
  store i8 0, ptr %15, align 1, !tbaa !9
  br label %116, !llvm.loop !22

126:                                              ; preds = %120
  br label %127

127:                                              ; preds = %126
  store i8 0, ptr %15, align 1, !tbaa !9
  br label %109, !llvm.loop !23

128:                                              ; preds = %112
  br label %150

129:                                              ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #4
  store i8 1, ptr %17, align 1, !tbaa !9
  br label %130

130:                                              ; preds = %148, %129
  %131 = load i8, ptr %17, align 1, !tbaa !9, !range !11, !noundef !12
  %132 = trunc i8 %131 to i1
  br i1 %132, label %134, label %133

133:                                              ; preds = %130
  store i32 39, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  br label %149

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding7as_EnumEv(ptr noundef nonnull align 8 dereferenceable(16) %135)
  store ptr %136, ptr %18, align 8, !tbaa !5
  br label %137

137:                                              ; preds = %146, %134
  %138 = load ptr, ptr %18, align 8, !tbaa !5
  %139 = load i8, ptr %17, align 1, !tbaa !9, !range !11, !noundef !12
  %140 = trunc i8 %139 to i1
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 42, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %147

142:                                              ; preds = %137
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  %145 = getelementptr inbounds %"class.HIR::Enum", ptr %144, i32 0, i32 0
  store ptr %145, ptr %3, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %142
  store i8 0, ptr %17, align 1, !tbaa !9
  br label %137, !llvm.loop !24

147:                                              ; preds = %141
  br label %148

148:                                              ; preds = %147
  store i8 0, ptr %17, align 1, !tbaa !9
  br label %130, !llvm.loop !25

149:                                              ; preds = %133
  br label %150

150:                                              ; preds = %149, %128, %107, %86, %68, %50, %29
  br label %151

151:                                              ; preds = %150
  store i8 0, ptr %4, align 1, !tbaa !9
  br label %25, !llvm.loop !26

152:                                              ; preds = %28
  br label %153

153:                                              ; preds = %152
  store i8 0, ptr %4, align 1, !tbaa !9
  br label %20, !llvm.loop !27

154:                                              ; preds = %23
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr %155
}

attributes #0 = { noreturn 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 #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14}


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

@.str.18 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3HIR15TypePathBinding12get_genericsEv = external hidden unnamed_addr constant [71 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef ptr @_ZNK3HIR15TypePathBinding12get_genericsEv(ptr noundef nonnull align 8 dereferenceable(16) %0) local_unnamed_addr #1 align 2 {
.lr.ph:
  %1 = tail call noundef i32 @_ZNK3HIR15TypePathBinding3tagEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  switch i32 %1, label %.loopexit62 [
    i32 0, label %.split
    i32 1, label %.preheader
    i32 2, label %.preheader51
    i32 3, label %.preheader53
    i32 4, label %.preheader55
    i32 5, label %.preheader57
    i32 6, label %.preheader59
  ]

.loopexit62:                                      ; preds = %.preheader53, %.preheader51, %.preheader, %.lr.ph, %.preheader55, %.preheader57, %.preheader59
  %.0.lcssa = phi ptr [ null, %.lr.ph ], [ %7, %.preheader55 ], [ %5, %.preheader57 ], [ %3, %.preheader59 ], [ null, %.preheader ], [ null, %.preheader51 ], [ null, %.preheader53 ]
  ret ptr %.0.lcssa

.preheader59:                                     ; preds = %.lr.ph
  %2 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding7as_EnumEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  br label %.loopexit62

.preheader57:                                     ; preds = %.lr.ph
  %4 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding8as_UnionEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  br label %.loopexit62

.preheader55:                                     ; preds = %.lr.ph
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding9as_StructEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  br label %.loopexit62

.preheader53:                                     ; preds = %.lr.ph
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3HIR15TypePathBinding13as_ExternTypeEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.loopexit62

.preheader51:                                     ; preds = %.lr.ph
  %9 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3HIR15TypePathBinding9as_OpaqueEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.loopexit62

.preheader:                                       ; preds = %.lr.ph
  %10 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3HIR15TypePathBinding10as_UnboundEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.loopexit62

.split:                                           ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.18, i32 noundef 1147, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK3HIR15TypePathBinding12get_genericsEv) #2
  unreachable
}

attributes #0 = { noreturn 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn 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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass