; LLVM IR from Slingshot-Physics/slingshot-community :: tests/test_utils (random_graph_utils)

; 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<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_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.graph::types::edge_t" = type { i32, i32, i64, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>

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

declare noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef, i32 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10test_utils24randomConnectedComponentEiR12DynamicArrayIN5graph5types6edge_tIilEEE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::set", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.graph::types::edge_t", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca %"struct.std::pair", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  %19 = load ptr, ptr %4, align 8, !tbaa !9
  call void @_ZN12DynamicArrayIN5graph5types6edge_tIilEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %19)
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %125, %2
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %129

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 2
  store i64 %27, ptr %28, align 8, !tbaa !11
  %29 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 3
  store i32 0, ptr %29, align 8, !tbaa !15
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %53

32:                                               ; preds = %25
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %33)
          to label %35 unwind label %49

35:                                               ; preds = %32
  %36 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 0
  store i32 %34, ptr %36, align 8, !tbaa !16
  br label %37

37:                                               ; preds = %42, %35
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %38)
          to label %40 unwind label %49

40:                                               ; preds = %37
  %41 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 1
  store i32 %39, ptr %41, align 4, !tbaa !17
  br label %42

42:                                               ; preds = %40
  %43 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !16
  %45 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !17
  %47 = icmp eq i32 %44, %46
  br i1 %47, label %37, label %48, !llvm.loop !18

48:                                               ; preds = %42
  br label %108

49:                                               ; preds = %118, %111, %108, %37, %32
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %9, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %10, align 4
  br label %128

53:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %54 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  %55 = sub i64 %54, 1
  %56 = trunc i64 %55 to i32
  %57 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %56)
          to label %58 unwind label %68

58:                                               ; preds = %53
  store i32 %57, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr %5, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %59 = load ptr, ptr %13, align 8, !tbaa !9
  %60 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %59) #4
  %61 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %62 = load ptr, ptr %13, align 8, !tbaa !9
  %63 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %62) #4
  %64 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  br label %65

65:                                               ; preds = %87, %58
  %66 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  br i1 %66, label %72, label %67

67:                                               ; preds = %65
  store i32 7, ptr %7, align 4
  br label %89

68:                                               ; preds = %53
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %9, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %10, align 4
  br label %107

72:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %16, align 4, !tbaa !5
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %81

78:                                               ; preds = %72
  %79 = load i32, ptr %16, align 4, !tbaa !5
  %80 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 0
  store i32 %79, ptr %80, align 8, !tbaa !16
  store i32 7, ptr %7, align 4
  br label %84

81:                                               ; preds = %72
  %82 = load i32, ptr %12, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %12, align 4, !tbaa !5
  store i32 0, ptr %7, align 4
  br label %84

84:                                               ; preds = %81, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %85 = load i32, ptr %7, align 4
  switch i32 %85, label %89 [
    i32 0, label %86
  ]

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  br label %65

89:                                               ; preds = %84, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %96, %90
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %92)
          to label %94 unwind label %103

94:                                               ; preds = %91
  %95 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 1
  store i32 %93, ptr %95, align 4, !tbaa !17
  br label %96

96:                                               ; preds = %94
  %97 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !16
  %99 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !17
  %101 = icmp eq i32 %98, %100
  br i1 %101, label %91, label %102, !llvm.loop !20

102:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %108

103:                                              ; preds = %91
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %9, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %107

107:                                              ; preds = %103, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %128

108:                                              ; preds = %102, %48
  %109 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 0
  %110 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %109)
          to label %111 unwind label %49

111:                                              ; preds = %108
  %112 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 0
  %113 = extractvalue { ptr, i8 } %110, 0
  store ptr %113, ptr %112, align 8
  %114 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 1
  %115 = extractvalue { ptr, i8 } %110, 1
  store i8 %115, ptr %114, align 8
  %116 = getelementptr inbounds %"struct.graph::types::edge_t", ptr %8, i32 0, i32 1
  %117 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %116)
          to label %118 unwind label %49

118:                                              ; preds = %111
  %119 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %120 = extractvalue { ptr, i8 } %117, 0
  store ptr %120, ptr %119, align 8
  %121 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %122 = extractvalue { ptr, i8 } %117, 1
  store i8 %122, ptr %121, align 8
  %123 = load ptr, ptr %4, align 8, !tbaa !9
  invoke void @_ZN12DynamicArrayIN5graph5types6edge_tIilEEE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %123, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %124 unwind label %49

124:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %6, align 4, !tbaa !5
  br label %20, !llvm.loop !21

128:                                              ; preds = %107, %49
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #4
  br label %130

129:                                              ; preds = %24
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #4
  ret void

130:                                              ; preds = %128
  %131 = load ptr, ptr %9, align 8
  %132 = load i32, ptr %10, align 4
  %133 = insertvalue { ptr, i32 } poison, ptr %131, 0
  %134 = insertvalue { ptr, i32 } %133, i32 %132, 1
  resume { ptr, i32 } %134
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12DynamicArrayIN5graph5types6edge_tIilEEE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

attributes #0 = { 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 = { 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 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"_ZTSN5graph5types6edge_tIilEE", !6, i64 0, !6, i64 4, !13, i64 8, !14, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN5graph5types18enumTransitivity_tE", !7, i64 0}
!15 = !{!12, !14, i64 16}
!16 = !{!12, !6, i64 0}
!17 = !{!12, !6, i64 4}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


; 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<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_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.graph::types::edge_t" = type { i32, i32, i64, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

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

declare noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef, i32 noundef) local_unnamed_addr #1

; 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 uwtable
define dso_local void @_ZN10test_utils24randomConnectedComponentEiR12DynamicArrayIN5graph5types6edge_tIilEEE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::set", align 8
  %4 = alloca %"struct.graph::types::edge_t", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  tail call void @_ZN12DynamicArrayIN5graph5types6edge_tIilEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  %7 = icmp sgt i32 %0, 0
  br i1 %7, label %.lr.ph36, label %._crit_edge

.lr.ph36:                                         ; preds = %2
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  %9 = getelementptr inbounds i8, ptr %4, i64 16
  %10 = getelementptr inbounds i8, ptr %4, i64 4
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %11

._crit_edge:                                      ; preds = %49, %2
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  ret void

11:                                               ; preds = %.lr.ph36, %49
  %indvars.iv = phi i64 [ 0, %.lr.ph36 ], [ %indvars.iv.next, %49 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  store i64 %indvars.iv, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %9, align 8, !tbaa !12
  %12 = icmp eq i64 %indvars.iv, 0
  br i1 %12, label %13, label %21

13:                                               ; preds = %11
  %14 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %0)
          to label %15 unwind label %.loopexit.split-lp

15:                                               ; preds = %13
  store i32 %14, ptr %4, align 8, !tbaa !13
  br label %16

16:                                               ; preds = %18, %15
  %17 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %0)
          to label %18 unwind label %.loopexit

18:                                               ; preds = %16
  store i32 %17, ptr %10, align 4, !tbaa !14
  %19 = load i32, ptr %4, align 8, !tbaa !13
  %20 = icmp eq i32 %19, %17
  br i1 %20, label %16, label %.loopexit31, !llvm.loop !15

.loopexit:                                        ; preds = %16
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %50

.loopexit.split-lp:                               ; preds = %13, %.loopexit31, %46, %48
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %50

21:                                               ; preds = %11
  %22 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  %23 = trunc i64 %22 to i32
  %24 = add i32 %23, -1
  %25 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %24)
          to label %26 unwind label %30

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %27 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  store ptr %27, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %28 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  store ptr %28, ptr %6, align 8
  %29 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %29, label %.lr.ph, label %.loopexit33

30:                                               ; preds = %21
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %50

.lr.ph:                                           ; preds = %26, %34
  %.02434 = phi i32 [ %35, %34 ], [ 0, %26 ]
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %.not = icmp eq i32 %.02434, %25
  br i1 %.not, label %.thread, label %34

.thread:                                          ; preds = %.lr.ph
  %33 = load i32, ptr %32, align 4, !tbaa !17
  store i32 %33, ptr %4, align 8, !tbaa !13
  br label %.loopexit33

34:                                               ; preds = %.lr.ph
  %35 = add nuw nsw i32 %.02434, 1
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %37 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %37, label %.lr.ph, label %.loopexit33

.loopexit33:                                      ; preds = %34, %26, %.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %38

38:                                               ; preds = %40, %.loopexit33
  %39 = invoke noundef i32 @_ZN8edbdmath10random_intEii(i32 noundef 0, i32 noundef %0)
          to label %40 unwind label %43

40:                                               ; preds = %38
  store i32 %39, ptr %10, align 4, !tbaa !14
  %41 = load i32, ptr %4, align 8, !tbaa !13
  %42 = icmp eq i32 %41, %39
  br i1 %42, label %38, label %.loopexit31, !llvm.loop !18

43:                                               ; preds = %38
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %50

.loopexit31:                                      ; preds = %40, %18
  %45 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %46 unwind label %.loopexit.split-lp

46:                                               ; preds = %.loopexit31
  %47 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %48 unwind label %.loopexit.split-lp

48:                                               ; preds = %46
  invoke void @_ZN12DynamicArrayIN5graph5types6edge_tIilEEE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %49 unwind label %.loopexit.split-lp

49:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %11, !llvm.loop !19

50:                                               ; preds = %.loopexit, %.loopexit.split-lp, %30, %43
  %.pn28 = phi { ptr, i32 } [ %44, %43 ], [ %31, %30 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn28
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12DynamicArrayIN5graph5types6edge_tIilEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12DynamicArrayIN5graph5types6edge_tIilEEE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 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 = { 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 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 #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, !10, i64 8}
!6 = !{!"_ZTSN5graph5types6edge_tIilEE", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSN5graph5types18enumTransitivity_tE", !8, i64 0}
!12 = !{!6, !11, i64 16}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !7, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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