; LLVM IR from leggedrobotics/ocs2 :: ocs2_core/src/automatic_differentation (CppAdSparsity)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::insert_iterator" = type { ptr, %"struct.std::_Rb_tree_const_iterator" }

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [110 x i8], align 1
@__PRETTY_FUNCTION__._ZN4ocs214cppad_sparsity15getIntersectionERKSt6vectorISt3setImSt4lessImESaImEESaIS6_EESA_ = external hidden unnamed_addr constant [104 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ocs214cppad_sparsity15getIntersectionERKSt6vectorISt3setImSt4lessImESaImEESaIS6_EESA_(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i1, align 1
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"class.std::insert_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"class.std::insert_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
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %24 = icmp eq i64 %21, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %3
  br label %28

26:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 40, ptr noundef @__PRETTY_FUNCTION__._ZN4ocs214cppad_sparsity15getIntersectionERKSt6vectorISt3setImSt4lessImESaImEESaIS6_EESA_) #6
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  store i64 %30, ptr %7, align 8, !tbaa !9
  store i1 false, ptr %8, align 1
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  call void @_ZNSaISt3setImSt4lessImESaImEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEC2EmRKS5_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %32, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %33 unwind label %40

33:                                               ; preds = %28
  call void @_ZNSt15__new_allocatorISt3setImSt4lessImESaImEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %34

34:                                               ; preds = %103, %33
  %35 = load i32, ptr %12, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = load i64, ptr %7, align 8, !tbaa !9
  %38 = icmp ult i64 %36, %37
  br i1 %38, label %44, label %39

39:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %110

40:                                               ; preds = %28
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %10, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %11, align 4
  call void @_ZNSt15__new_allocatorISt3setImSt4lessImESaImEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %114

44:                                               ; preds = %34
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load i32, ptr %12, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %47) #5
  %49 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %48) #5
  %50 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %49, ptr %50, align 8
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load i32, ptr %12, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %53) #5
  %55 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %54) #5
  %56 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !11
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59) #5
  %61 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %60) #5
  %62 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %61, ptr %62, align 8
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load i32, ptr %12, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %65) #5
  %67 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %66) #5
  %68 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  %69 = load i32, ptr %12, align 4, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %70) #5
  %72 = load i32, ptr %12, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %73) #5
  %75 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %74) #5
  %76 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %75, ptr %76, align 8
  %77 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8
  %79 = invoke { ptr, ptr } @_ZSt8inserterISt3setImSt4lessImESaImEEESt15insert_iteratorIT_ERS6_NS6_8iteratorE(ptr noundef nonnull align 8 dereferenceable(48) %71, ptr %78)
          to label %80 unwind label %106

80:                                               ; preds = %44
  %81 = getelementptr inbounds { ptr, ptr }, ptr %17, i32 0, i32 0
  %82 = extractvalue { ptr, ptr } %79, 0
  store ptr %82, ptr %81, align 8
  %83 = getelementptr inbounds { ptr, ptr }, ptr %17, i32 0, i32 1
  %84 = extractvalue { ptr, ptr } %79, 1
  store ptr %84, ptr %83, align 8
  %85 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8
  %87 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  %89 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8
  %91 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8
  %93 = getelementptr inbounds { ptr, ptr }, ptr %17, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8
  %95 = getelementptr inbounds { ptr, ptr }, ptr %17, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8
  %97 = invoke { ptr, ptr } @_ZSt16set_intersectionISt23_Rb_tree_const_iteratorImES1_St15insert_iteratorISt3setImSt4lessImESaImEEEET1_T_SA_T0_SB_S9_(ptr %86, ptr %88, ptr %90, ptr %92, ptr %94, ptr %96)
          to label %98 unwind label %106

98:                                               ; preds = %80
  %99 = getelementptr inbounds { ptr, ptr }, ptr %19, i32 0, i32 0
  %100 = extractvalue { ptr, ptr } %97, 0
  store ptr %100, ptr %99, align 8
  %101 = getelementptr inbounds { ptr, ptr }, ptr %19, i32 0, i32 1
  %102 = extractvalue { ptr, ptr } %97, 1
  store ptr %102, ptr %101, align 8
  br label %103

103:                                              ; preds = %98
  %104 = load i32, ptr %12, align 4, !tbaa !11
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !11
  br label %34, !llvm.loop !13

106:                                              ; preds = %80, %44
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %10, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %114

110:                                              ; preds = %39
  store i1 true, ptr %8, align 1
  %111 = load i1, ptr %8, align 1
  br i1 %111, label %113, label %112

112:                                              ; preds = %110
  call void @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %113

113:                                              ; preds = %112, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void

114:                                              ; preds = %106, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %115

115:                                              ; preds = %114
  %116 = load ptr, ptr %10, align 8
  %117 = load i32, ptr %11, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEC2EmRKS5_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZSt16set_intersectionISt23_Rb_tree_const_iteratorImES1_St15insert_iteratorISt3setImSt4lessImESaImEEEET1_T_SA_T0_SB_S9_(ptr, ptr, ptr, ptr, ptr, ptr) #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZSt8inserterISt3setImSt4lessImESaImEEESt15insert_iteratorIT_ERS6_NS6_8iteratorE(ptr noundef nonnull align 8 dereferenceable(48), ptr) #4

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::set<unsigned long>, std::allocator<std::set<unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [110 x i8], align 1
@__PRETTY_FUNCTION__._ZN4ocs214cppad_sparsity15getIntersectionERKSt6vectorISt3setImSt4lessImESaImEESaIS6_EESA_ = external hidden unnamed_addr constant [104 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ocs214cppad_sparsity15getIntersectionERKSt6vectorISt3setImSt4lessImESaImEESaIS6_EESA_(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::allocator", align 1
  %5 = tail call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %6 = tail call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %7 = icmp eq i64 %5, %6
  br i1 %7, label %9, label %8

8:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 40, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4ocs214cppad_sparsity15getIntersectionERKSt6vectorISt3setImSt4lessImESaImEESaIS6_EESA_) #6
  unreachable

9:                                                ; preds = %3
  %10 = tail call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %11 = tail call noundef i64 @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZNSaISt3setImSt4lessImESaImEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEC2EmRKS5_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %11, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %12 unwind label %13

12:                                               ; preds = %9
  call void @_ZNSt15__new_allocatorISt3setImSt4lessImESaImEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

13:                                               ; preds = %9
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt3setImSt4lessImESaImEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  br label %34

.lr.ph:                                           ; preds = %12, %31
  %indvars.iv = phi i64 [ %indvars.iv.next, %31 ], [ 0, %12 ]
  %15 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #5
  %16 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #5
  %17 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #5
  %18 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %17) #5
  %19 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %20 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  %21 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %22 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  %23 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  %24 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  %25 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %24) #5
  %26 = invoke { ptr, ptr } @_ZSt8inserterISt3setImSt4lessImESaImEEESt15insert_iteratorIT_ERS6_NS6_8iteratorE(ptr noundef nonnull align 8 dereferenceable(48) %23, ptr %25)
          to label %27 unwind label %32

27:                                               ; preds = %.lr.ph
  %28 = extractvalue { ptr, ptr } %26, 0
  %29 = extractvalue { ptr, ptr } %26, 1
  %30 = invoke { ptr, ptr } @_ZSt16set_intersectionISt23_Rb_tree_const_iteratorImES1_St15insert_iteratorISt3setImSt4lessImESaImEEEET1_T_SA_T0_SB_S9_(ptr %16, ptr %18, ptr %20, ptr %22, ptr %28, ptr %29)
          to label %31 unwind label %32

31:                                               ; preds = %27
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

32:                                               ; preds = %27, %.lr.ph
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %34

._crit_edge:                                      ; preds = %31, %12
  ret void

34:                                               ; preds = %32, %13
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %14, %13 ]
  resume { ptr, i32 } %.pn
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt3setImSt4lessImESaImEESaIS4_EEC2EmRKS5_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZSt16set_intersectionISt23_Rb_tree_const_iteratorImES1_St15insert_iteratorISt3setImSt4lessImESaImEEEET1_T_SA_T0_SB_S9_(ptr, ptr, ptr, ptr, ptr, ptr) local_unnamed_addr #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZSt8inserterISt3setImSt4lessImESaImEEESt15insert_iteratorIT_ERS6_NS6_8iteratorE(ptr noundef nonnull align 8 dereferenceable(48), ptr) local_unnamed_addr #4

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

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

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

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


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