; LLVM IR from facebook/redex :: libredex (TypeSystem)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<const DexType *, const DexType *, std::_Identity<const DexType *>, dextypes_comparator>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<const DexType *, const DexType *, std::_Identity<const DexType *>, dextypes_comparator>::_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_const_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10TypeSystem20get_local_interfacesERKSt3setIPK7DexType19dextypes_comparatorSaIS3_EE(ptr dead_on_unwind noalias writable sret(%"class.std::set") align 8 %0, ptr noundef nonnull align 8 dereferenceable(440) %1, ptr noundef nonnull align 8 dereferenceable(48) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK10TypeSystem26get_implemented_interfacesERKSt3setIPK7DexType19dextypes_comparatorSaIS3_EE(ptr dead_on_unwind writable sret(%"class.std::set") align 8 %0, ptr noundef nonnull align 8 dereferenceable(440) %21, ptr noundef nonnull align 8 dereferenceable(48) %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %23 = call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  %24 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %8, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  br label %25

25:                                               ; preds = %83, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %26 = call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  %27 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %9, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  %28 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIPK7DexTypeES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %85

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  store i8 1, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIPK7DexTypeEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNK10TypeSystem16get_implementorsEPK7DexType(ptr noundef nonnull align 8 dereferenceable(440) %21, ptr noundef %32)
          to label %34 unwind label %45

34:                                               ; preds = %30
  store ptr %33, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %35, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  %37 = call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %36) #4
  %38 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %37, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %39 = load ptr, ptr %15, align 8, !tbaa !5
  %40 = call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %39) #4
  %41 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  br label %42

42:                                               ; preds = %65, %34
  %43 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIPK7DexTypeES5_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  br i1 %43, label %49, label %44

44:                                               ; preds = %42
  store i32 4, ptr %10, align 4
  br label %67

45:                                               ; preds = %30
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %13, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %14, align 4
  br label %84

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIPK7DexTypeEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  store ptr %50, ptr %18, align 8, !tbaa !5
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  %53 = invoke noundef i64 @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5countERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %51, ptr noundef nonnull align 8 dereferenceable(8) %52)
          to label %54 unwind label %57

54:                                               ; preds = %49
  %55 = icmp ne i64 %53, 0
  br i1 %55, label %61, label %56

56:                                               ; preds = %54
  store i8 0, ptr %11, align 1, !tbaa !9
  store i32 4, ptr %10, align 4
  br label %62

57:                                               ; preds = %49
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %13, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %84

61:                                               ; preds = %54
  store i32 0, ptr %10, align 4
  br label %62

62:                                               ; preds = %61, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %63 = load i32, ptr %10, align 4
  switch i32 %63, label %67 [
    i32 0, label %64
  ]

64:                                               ; preds = %62
  br label %65

65:                                               ; preds = %64
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIPK7DexTypeEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  br label %42

67:                                               ; preds = %62, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %68

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

71:                                               ; preds = %68
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIPK7DexTypeEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br label %83

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !13
  %74 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8
  %76 = invoke ptr @_ZNSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr %75)
          to label %77 unwind label %79

77:                                               ; preds = %73
  %78 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %76, ptr %78, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %83

79:                                               ; preds = %73
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %13, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %84

83:                                               ; preds = %77, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  br label %25, !llvm.loop !14

84:                                               ; preds = %79, %57, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @_ZNSt3setIPK7DexType19dextypes_comparatorSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  br label %89

85:                                               ; preds = %29
  store i1 true, ptr %7, align 1
  store i32 1, ptr %10, align 4
  %86 = load i1, ptr %7, align 1
  br i1 %86, label %88, label %87

87:                                               ; preds = %85
  call void @_ZNSt3setIPK7DexType19dextypes_comparatorSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  br label %88

88:                                               ; preds = %87, %85
  ret void

89:                                               ; preds = %84
  %90 = load ptr, ptr %13, align 8
  %91 = load i32, ptr %14, align 4
  %92 = insertvalue { ptr, i32 } poison, ptr %90, 0
  %93 = insertvalue { ptr, i32 } %92, i32 %91, 1
  resume { ptr, i32 } %93
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10TypeSystem26get_implemented_interfacesERKSt3setIPK7DexType19dextypes_comparatorSaIS3_EE(ptr dead_on_unwind noalias writable sret(%"class.std::set") align 8, ptr noundef nonnull align 8 dereferenceable(440), ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

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

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

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

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

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

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

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

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

; 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) #3

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{i64 0, i64 8, !5}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<const DexType *, const DexType *, std::_Identity<const DexType *>, dextypes_comparator>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<const DexType *, const DexType *, std::_Identity<const DexType *>, dextypes_comparator>::_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_const_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10TypeSystem20get_local_interfacesERKSt3setIPK7DexType19dextypes_comparatorSaIS3_EE(ptr dead_on_unwind noalias writable sret(%"class.std::set") align 8 %0, ptr noundef nonnull align 8 dereferenceable(440) %1, ptr noundef nonnull align 8 dereferenceable(48) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  tail call void @_ZNK10TypeSystem26get_implemented_interfacesERKSt3setIPK7DexType19dextypes_comparatorSaIS3_EE(ptr dead_on_unwind writable sret(%"class.std::set") align 8 %0, ptr noundef nonnull align 8 dereferenceable(440) %1, ptr noundef nonnull align 8 dereferenceable(48) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %8 = tail call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  store ptr %8, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %9 = tail call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  store ptr %9, ptr %5, align 8
  %10 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIPK7DexTypeES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %10, label %.lr.ph18, label %._crit_edge

._crit_edge:                                      ; preds = %34, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret void

.lr.ph18:                                         ; preds = %3, %34
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIPK7DexTypeEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNK10TypeSystem16get_implementorsEPK7DexType(ptr noundef nonnull align 8 dereferenceable(440) %1, ptr noundef %12)
          to label %14 unwind label %18

14:                                               ; preds = %.lr.ph18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %15 = call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #3
  store ptr %15, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %16 = call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #3
  store ptr %16, ptr %7, align 8
  %17 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIPK7DexTypeES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  br i1 %17, label %.lr.ph, label %.loopexit

18:                                               ; preds = %.lr.ph18
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %37

.lr.ph:                                           ; preds = %14, %25
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIPK7DexTypeEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %21 = invoke noundef i64 @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5countERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %22 unwind label %23

22:                                               ; preds = %.lr.ph
  %.not.not = icmp eq i64 %21, 0
  br i1 %.not.not, label %29, label %25

23:                                               ; preds = %.lr.ph
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  br label %37

25:                                               ; preds = %22
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIPK7DexTypeEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %27 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIPK7DexTypeES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  br i1 %27, label %.lr.ph, label %.loopexit

.loopexit:                                        ; preds = %25, %14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIPK7DexTypeEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br label %34

29:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  %.sroa.0.0.copyload = load ptr, ptr %4, align 8, !tbaa !5
  %30 = invoke ptr @_ZNSt3setIPK7DexType19dextypes_comparatorSaIS2_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr %.sroa.0.0.copyload)
          to label %31 unwind label %32

31:                                               ; preds = %29
  store ptr %30, ptr %4, align 8, !tbaa !5
  br label %34

32:                                               ; preds = %29
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %37

34:                                               ; preds = %31, %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %35 = call ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  store ptr %35, ptr %5, align 8
  %36 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIPK7DexTypeES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %36, label %.lr.ph18, label %._crit_edge, !llvm.loop !9

37:                                               ; preds = %32, %23, %18
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %24, %23 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @_ZNSt3setIPK7DexType19dextypes_comparatorSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10TypeSystem26get_implemented_interfacesERKSt3setIPK7DexType19dextypes_comparatorSaIS3_EE(ptr dead_on_unwind noalias writable sret(%"class.std::set") align 8, ptr noundef nonnull align 8 dereferenceable(440), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIPK7DexTypeES5_(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 ptr @_ZNKSt3setIPK7DexType19dextypes_comparatorSaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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