; LLVM IR from facebookresearch/baspacho :: baspacho/testing (TestingMatGen)

; 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::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<>::param_type" }
%"struct.std::uniform_real_distribution<>::param_type" = type { double, double }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.BaSpaCho::testing_utils::SparseMatGenerator" = type { %"class.std::mersenne_twister_engine", %"class.std::vector" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::set<long>, std::allocator<std::set<long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::set<long>, std::allocator<std::set<long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::set<long>, std::allocator<std::set<long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::set<long>, std::allocator<std::set<long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1

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

; 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 noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8BaSpaCho13testing_utils18SparseMatGenerator13connectRangesElllldl(ptr noundef nonnull align 8 dereferenceable(5024) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, double noundef %5, i64 noundef %6) #2 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca double, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca %"class.std::uniform_real_distribution", align 8
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca %"struct.std::pair", align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i64 %1, ptr %9, align 8, !tbaa !9
  store i64 %2, ptr %10, align 8, !tbaa !9
  store i64 %3, ptr %11, align 8, !tbaa !9
  store i64 %4, ptr %12, align 8, !tbaa !9
  store double %5, ptr %13, align 8, !tbaa !11
  store i64 %6, ptr %14, align 8, !tbaa !9
  %33 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %34 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %34, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !13
  %35 = load i64, ptr %15, align 8, !tbaa !9
  %36 = load i32, ptr %16, align 4, !tbaa !13
  %37 = sext i32 %36 to i64
  %38 = icmp sge i64 %35, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %7
  call void @_ZN8BaSpaCho10throwErrorIliEEvPKciS2_RKT_RKT0_(ptr noundef @.str, i32 noundef 22, ptr noundef @.str.1, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  br label %40

40:                                               ; preds = %39, %7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %41 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %41, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !13
  %42 = load i64, ptr %17, align 8, !tbaa !9
  %43 = load i32, ptr %18, align 4, !tbaa !13
  %44 = sext i32 %43 to i64
  %45 = icmp sge i64 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %40
  call void @_ZN8BaSpaCho10throwErrorIliEEvPKciS2_RKT_RKT0_(ptr noundef @.str, i32 noundef 23, ptr noundef @.str.2, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  br label %47

47:                                               ; preds = %46, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %48 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %48, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %49 = getelementptr inbounds %"struct.BaSpaCho::testing_utils::SparseMatGenerator", ptr %33, i32 0, i32 1
  %50 = call noundef i64 @_ZNKSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #4
  store i64 %50, ptr %20, align 8, !tbaa !9
  %51 = load i64, ptr %19, align 8, !tbaa !9
  %52 = load i64, ptr %20, align 8, !tbaa !9
  %53 = icmp ule i64 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %47
  call void @_ZN8BaSpaCho10throwErrorIlmEEvPKciS2_RKT_RKT0_(ptr noundef @.str, i32 noundef 24, ptr noundef @.str.3, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
  br label %55

55:                                               ; preds = %54, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %56 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %56, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %57 = getelementptr inbounds %"struct.BaSpaCho::testing_utils::SparseMatGenerator", ptr %33, i32 0, i32 1
  %58 = call noundef i64 @_ZNKSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #4
  store i64 %58, ptr %22, align 8, !tbaa !9
  %59 = load i64, ptr %21, align 8, !tbaa !9
  %60 = load i64, ptr %22, align 8, !tbaa !9
  %61 = icmp ule i64 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %55
  call void @_ZN8BaSpaCho10throwErrorIlmEEvPKciS2_RKT_RKT0_(ptr noundef @.str, i32 noundef 25, ptr noundef @.str.4, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22)
  br label %63

63:                                               ; preds = %62, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  %64 = load i64, ptr %9, align 8, !tbaa !9
  %65 = load i64, ptr %11, align 8, !tbaa !9
  %66 = icmp sgt i64 %64, %65
  br i1 %66, label %67, label %74

67:                                               ; preds = %63
  %68 = load i64, ptr %11, align 8, !tbaa !9
  %69 = load i64, ptr %12, align 8, !tbaa !9
  %70 = load i64, ptr %9, align 8, !tbaa !9
  %71 = load i64, ptr %10, align 8, !tbaa !9
  %72 = load double, ptr %13, align 8, !tbaa !11
  %73 = load i64, ptr %14, align 8, !tbaa !9
  call void @_ZN8BaSpaCho13testing_utils18SparseMatGenerator13connectRangesElllldl(ptr noundef nonnull align 8 dereferenceable(5024) %33, i64 noundef %68, i64 noundef %69, i64 noundef %70, i64 noundef %71, double noundef %72, i64 noundef %73)
  br label %140

74:                                               ; preds = %63
  %75 = load i64, ptr %10, align 8, !tbaa !9
  %76 = load i64, ptr %12, align 8, !tbaa !9
  %77 = icmp sgt i64 %75, %76
  br i1 %77, label %78, label %85

78:                                               ; preds = %74
  %79 = load i64, ptr %11, align 8, !tbaa !9
  %80 = load i64, ptr %12, align 8, !tbaa !9
  %81 = load i64, ptr %12, align 8, !tbaa !9
  %82 = load i64, ptr %10, align 8, !tbaa !9
  %83 = load double, ptr %13, align 8, !tbaa !11
  %84 = load i64, ptr %14, align 8, !tbaa !9
  call void @_ZN8BaSpaCho13testing_utils18SparseMatGenerator13connectRangesElllldl(ptr noundef nonnull align 8 dereferenceable(5024) %33, i64 noundef %79, i64 noundef %80, i64 noundef %81, i64 noundef %82, double noundef %83, i64 noundef %84)
  br label %85

85:                                               ; preds = %78, %74
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #4
  call void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %23, double noundef 0.000000e+00, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %86 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %86, ptr %24, align 8, !tbaa !9
  br label %87

87:                                               ; preds = %136, %85
  %88 = load i64, ptr %24, align 8, !tbaa !9
  %89 = load i64, ptr %10, align 8, !tbaa !9
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %92, label %91

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

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %93 = load i64, ptr %11, align 8, !tbaa !9
  %94 = load i64, ptr %24, align 8, !tbaa !9
  %95 = sub nsw i64 %93, %94
  store i64 %95, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  store i64 1, ptr %28, align 8, !tbaa !9
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %96)
  %98 = load i64, ptr %97, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  store i64 %98, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %99 = load i64, ptr %12, align 8, !tbaa !9
  %100 = load i64, ptr %24, align 8, !tbaa !9
  %101 = sub nsw i64 %99, %100
  store i64 %101, ptr %30, align 8, !tbaa !9
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %103 = load i64, ptr %102, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  store i64 %103, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %104 = load i64, ptr %24, align 8, !tbaa !9
  %105 = load i64, ptr %26, align 8, !tbaa !9
  %106 = add nsw i64 %104, %105
  store i64 %106, ptr %31, align 8, !tbaa !9
  br label %107

107:                                              ; preds = %132, %92
  %108 = load i64, ptr %31, align 8, !tbaa !9
  %109 = load i64, ptr %24, align 8, !tbaa !9
  %110 = load i64, ptr %29, align 8, !tbaa !9
  %111 = add nsw i64 %109, %110
  %112 = icmp slt i64 %108, %111
  br i1 %112, label %114, label %113

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

114:                                              ; preds = %107
  %115 = load double, ptr %13, align 8, !tbaa !11
  %116 = fcmp oge double %115, 1.000000e+00
  br i1 %116, label %122, label %117

117:                                              ; preds = %114
  %118 = load double, ptr %13, align 8, !tbaa !11
  %119 = getelementptr inbounds %"struct.BaSpaCho::testing_utils::SparseMatGenerator", ptr %33, i32 0, i32 0
  %120 = call noundef double @_ZNSt25uniform_real_distributionIdEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEdRT_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(5000) %119)
  %121 = fcmp ogt double %118, %120
  br i1 %121, label %122, label %131

122:                                              ; preds = %117, %114
  %123 = getelementptr inbounds %"struct.BaSpaCho::testing_utils::SparseMatGenerator", ptr %33, i32 0, i32 1
  %124 = load i64, ptr %24, align 8, !tbaa !9
  %125 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %123, i64 noundef %124) #4
  %126 = call { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %125, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %127 = getelementptr inbounds { ptr, i8 }, ptr %32, i32 0, i32 0
  %128 = extractvalue { ptr, i8 } %126, 0
  store ptr %128, ptr %127, align 8
  %129 = getelementptr inbounds { ptr, i8 }, ptr %32, i32 0, i32 1
  %130 = extractvalue { ptr, i8 } %126, 1
  store i8 %130, ptr %129, align 8
  br label %131

131:                                              ; preds = %122, %117
  br label %132

132:                                              ; preds = %131
  %133 = load i64, ptr %31, align 8, !tbaa !9
  %134 = add nsw i64 %133, 1
  store i64 %134, ptr %31, align 8, !tbaa !9
  br label %107, !llvm.loop !15

135:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %24, align 8, !tbaa !9
  %138 = add nsw i64 %137, 1
  store i64 %138, ptr %24, align 8, !tbaa !9
  br label %87, !llvm.loop !17

139:                                              ; preds = %91
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #4
  br label %140

140:                                              ; preds = %139, %67
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNSt25uniform_real_distributionIdEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEdRT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(5000)) #2 align 2

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<>::param_type" }
%"struct.std::uniform_real_distribution<>::param_type" = type { double, double }

@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1

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

; 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 noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8BaSpaCho13testing_utils18SparseMatGenerator13connectRangesElllldl(ptr noundef nonnull align 8 dereferenceable(5024) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, double noundef %5, i64 noundef %6) local_unnamed_addr #2 align 2 {
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.std::uniform_real_distribution", align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  store i64 %6, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  store i64 %1, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  %22 = icmp sgt i64 %1, -1
  br i1 %22, label %24, label %23

23:                                               ; preds = %7
  call void @_ZN8BaSpaCho10throwErrorIliEEvPKciS2_RKT_RKT0_(ptr noundef nonnull @.str, i32 noundef 22, ptr noundef nonnull @.str.1, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  br label %24

24:                                               ; preds = %23, %7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  store i64 %3, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  %25 = icmp sgt i64 %3, -1
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  call void @_ZN8BaSpaCho10throwErrorIliEEvPKciS2_RKT_RKT0_(ptr noundef nonnull @.str, i32 noundef 23, ptr noundef nonnull @.str.2, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  br label %27

27:                                               ; preds = %26, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  store i64 %2, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %28 = getelementptr inbounds i8, ptr %0, i64 5000
  %29 = call noundef i64 @_ZNKSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #4
  store i64 %29, ptr %14, align 8, !tbaa !5
  %.not = icmp ult i64 %29, %2
  br i1 %.not, label %30, label %31

30:                                               ; preds = %27
  call void @_ZN8BaSpaCho10throwErrorIlmEEvPKciS2_RKT_RKT0_(ptr noundef nonnull @.str, i32 noundef 24, ptr noundef nonnull @.str.3, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
  br label %31

31:                                               ; preds = %30, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  store i64 %4, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %32 = call noundef i64 @_ZNKSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #4
  store i64 %32, ptr %16, align 8, !tbaa !5
  %.not39 = icmp ult i64 %32, %4
  br i1 %.not39, label %33, label %34

33:                                               ; preds = %31
  call void @_ZN8BaSpaCho10throwErrorIlmEEvPKciS2_RKT_RKT0_(ptr noundef nonnull @.str, i32 noundef 25, ptr noundef nonnull @.str.4, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  br label %34

34:                                               ; preds = %33, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  %35 = icmp sgt i64 %1, %3
  br i1 %35, label %36, label %37

36:                                               ; preds = %34
  call void @_ZN8BaSpaCho13testing_utils18SparseMatGenerator13connectRangesElllldl(ptr noundef nonnull align 8 dereferenceable(5024) %0, i64 noundef %3, i64 noundef %4, i64 noundef %1, i64 noundef %2, double noundef %5, i64 noundef %6)
  br label %79

37:                                               ; preds = %34
  %38 = icmp sgt i64 %2, %4
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  call void @_ZN8BaSpaCho13testing_utils18SparseMatGenerator13connectRangesElllldl(ptr noundef nonnull align 8 dereferenceable(5024) %0, i64 noundef %3, i64 noundef %4, i64 noundef %4, i64 noundef %2, double noundef %5, i64 noundef %6)
  br label %40

40:                                               ; preds = %39, %37
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #4
  call void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %17, double noundef 0.000000e+00, double noundef 1.000000e+00)
  %41 = icmp slt i64 %1, %2
  br i1 %41, label %.lr.ph43, label %._crit_edge44

.lr.ph43:                                         ; preds = %40
  %42 = fcmp ult double %5, 1.000000e+00
  br i1 %42, label %.lr.ph43.split.us, label %.lr.ph43.split

.lr.ph43.split.us:                                ; preds = %.lr.ph43, %._crit_edge.split.us.us
  %.040.us = phi i64 [ %53, %._crit_edge.split.us.us ], [ %1, %.lr.ph43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #4
  %43 = sub nsw i64 %3, %.040.us
  store i64 %43, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #4
  store i64 1, ptr %19, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = load i64, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #4
  %47 = sub nsw i64 %4, %.040.us
  store i64 %47, ptr %20, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %49 = load i64, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #4
  %50 = add nsw i64 %46, %.040.us
  %51 = add nsw i64 %49, %.040.us
  store i64 %50, ptr %21, align 8, !tbaa !5
  %52 = icmp slt i64 %46, %49
  br i1 %52, label %.lr.ph.us, label %._crit_edge.split.us.us

._crit_edge.split.us.us:                          ; preds = %59, %.lr.ph43.split.us
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #4
  %53 = add i64 %.040.us, 1
  %exitcond46.not = icmp eq i64 %53, %2
  br i1 %exitcond46.not, label %._crit_edge44, label %.lr.ph43.split.us, !llvm.loop !11

.lr.ph.us:                                        ; preds = %.lr.ph43.split.us, %59
  %54 = call noundef double @_ZNSt25uniform_real_distributionIdEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEdRT_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(5000) %0)
  %55 = fcmp olt double %54, %5
  br i1 %55, label %56, label %59

56:                                               ; preds = %.lr.ph.us
  %57 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %.040.us) #4
  %58 = call { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %57, ptr noundef nonnull align 8 dereferenceable(8) %21)
  br label %59

59:                                               ; preds = %56, %.lr.ph.us
  %60 = load i64, ptr %21, align 8, !tbaa !5
  %61 = add nsw i64 %60, 1
  store i64 %61, ptr %21, align 8, !tbaa !5
  %62 = icmp slt i64 %61, %51
  br i1 %62, label %.lr.ph.us, label %._crit_edge.split.us.us, !llvm.loop !13

._crit_edge44:                                    ; preds = %._crit_edge.split, %._crit_edge.split.us.us, %40
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #4
  br label %79

.lr.ph43.split:                                   ; preds = %.lr.ph43, %._crit_edge.split
  %.040 = phi i64 [ %73, %._crit_edge.split ], [ %1, %.lr.ph43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #4
  %63 = sub nsw i64 %3, %.040
  store i64 %63, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #4
  store i64 1, ptr %19, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %64)
  %66 = load i64, ptr %65, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #4
  %67 = sub nsw i64 %4, %.040
  store i64 %67, ptr %20, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %69 = load i64, ptr %68, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #4
  %70 = add nsw i64 %66, %.040
  %71 = add nsw i64 %69, %.040
  store i64 %70, ptr %21, align 8, !tbaa !5
  %72 = icmp slt i64 %66, %69
  br i1 %72, label %.lr.ph, label %._crit_edge.split

._crit_edge.split:                                ; preds = %.lr.ph, %.lr.ph43.split
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #4
  %73 = add i64 %.040, 1
  %exitcond.not = icmp eq i64 %73, %2
  br i1 %exitcond.not, label %._crit_edge44, label %.lr.ph43.split, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph43.split, %.lr.ph
  %74 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIlSt4lessIlESaIlEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %.040) #4
  %75 = call { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %74, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %76 = load i64, ptr %21, align 8, !tbaa !5
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %21, align 8, !tbaa !5
  %78 = icmp slt i64 %77, %71
  br i1 %78, label %.lr.ph, label %._crit_edge.split, !llvm.loop !13

79:                                               ; preds = %._crit_edge44, %36
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8BaSpaCho10throwErrorIliEEvPKciS2_RKT_RKT0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNSt25uniform_real_distributionIdEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEdRT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(5000)) 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass