; LLVM IR from turi-code/SFrame :: oss_test/random/test_alias.ll (Z19run_alias_benchmarkmSt6vectorIdSaIdEE)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.graphlab::timer" = type { %struct.timeval }
%struct.timeval = type { i64, i64 }
%"class.graphlab::random::alias_sampler" = type { %"class.std::vector.0", %"class.std::vector", i64 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Setw" = type { i32 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19run_alias_benchmarkmSt6vectorIdSaIdEE(i64 noundef %0, ptr noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.graphlab::timer", align 8
  %6 = alloca %"class.graphlab::random::alias_sampler", align 8
  %7 = alloca %"struct.std::_Setw", align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::_Setw", align 4
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::_Setw", align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.std::_Setw", align 4
  store i64 %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  call void @_ZN8graphlab5timerC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 56, ptr %6) #6
  call void @_ZN8graphlab6random13alias_samplerC1ERKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %18 = invoke i32 @_ZSt4setwi(i32 noundef 20)
          to label %19 unwind label %39

19:                                               ; preds = %2
  %20 = getelementptr inbounds %"struct.std::_Setw", ptr %7, i32 0, i32 0
  store i32 %18, ptr %20, align 4
  %21 = getelementptr inbounds %"struct.std::_Setw", ptr %7, i32 0, i32 0
  %22 = load i32, ptr %21, align 4
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %22)
          to label %24 unwind label %39

24:                                               ; preds = %19
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef @.str)
          to label %26 unwind label %39

26:                                               ; preds = %24
  %27 = invoke noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %28 unwind label %39

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %25, double noundef %27)
          to label %30 unwind label %39

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %32 unwind label %39

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  invoke void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %33 unwind label %43

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %50, %33
  %35 = load i64, ptr %11, align 8, !tbaa !5
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %37 = icmp ult i64 %35, %36
  br i1 %37, label %47, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %57

39:                                               ; preds = %30, %28, %26, %24, %19, %2
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %8, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %9, align 4
  br label %145

43:                                               ; preds = %102, %100, %98, %96, %91, %89, %72, %70, %68, %66, %64, %59, %57, %32
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %8, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %9, align 4
  br label %144

47:                                               ; preds = %34
  %48 = invoke noundef i64 @_ZN8graphlab6random13alias_sampler6sampleEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %49 unwind label %53

49:                                               ; preds = %47
  store i64 %48, ptr %10, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %49
  %51 = load i64, ptr %11, align 8, !tbaa !5
  %52 = add i64 %51, 1
  store i64 %52, ptr %11, align 8, !tbaa !5
  br label %34, !llvm.loop !11

53:                                               ; preds = %47
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %8, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %144

57:                                               ; preds = %38
  %58 = invoke i32 @_ZSt4setwi(i32 noundef 20)
          to label %59 unwind label %43

59:                                               ; preds = %57
  %60 = getelementptr inbounds %"struct.std::_Setw", ptr %12, i32 0, i32 0
  store i32 %58, ptr %60, align 4
  %61 = getelementptr inbounds %"struct.std::_Setw", ptr %12, i32 0, i32 0
  %62 = load i32, ptr %61, align 4
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %62)
          to label %64 unwind label %43

64:                                               ; preds = %59
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef @.str.4)
          to label %66 unwind label %43

66:                                               ; preds = %64
  %67 = invoke noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %68 unwind label %43

68:                                               ; preds = %66
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %65, double noundef %67)
          to label %70 unwind label %43

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %72 unwind label %43

72:                                               ; preds = %70
  invoke void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %73 unwind label %43

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %82, %73
  %75 = load i64, ptr %13, align 8, !tbaa !5
  %76 = load i64, ptr %3, align 8, !tbaa !5
  %77 = icmp ult i64 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %89

79:                                               ; preds = %74
  %80 = invoke noundef i64 @_ZN8graphlab6random11multinomialIdEEmRKSt6vectorIT_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %81 unwind label %85

81:                                               ; preds = %79
  store i64 %80, ptr %10, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %81
  %83 = load i64, ptr %13, align 8, !tbaa !5
  %84 = add i64 %83, 1
  store i64 %84, ptr %13, align 8, !tbaa !5
  br label %74, !llvm.loop !13

85:                                               ; preds = %79
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %8, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %144

89:                                               ; preds = %78
  %90 = invoke i32 @_ZSt4setwi(i32 noundef 20)
          to label %91 unwind label %43

91:                                               ; preds = %89
  %92 = getelementptr inbounds %"struct.std::_Setw", ptr %14, i32 0, i32 0
  store i32 %90, ptr %92, align 4
  %93 = getelementptr inbounds %"struct.std::_Setw", ptr %14, i32 0, i32 0
  %94 = load i32, ptr %93, align 4
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %94)
          to label %96 unwind label %43

96:                                               ; preds = %91
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef @.str.5)
          to label %98 unwind label %43

98:                                               ; preds = %96
  %99 = invoke noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %100 unwind label %43

100:                                              ; preds = %98
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %97, double noundef %99)
          to label %102 unwind label %43

102:                                              ; preds = %100
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %104 unwind label %43

104:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %105 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store i64 %105, ptr %15, align 8, !tbaa !5
  invoke void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %106 unwind label %112

106:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %120, %106
  %108 = load i64, ptr %16, align 8, !tbaa !5
  %109 = load i64, ptr %3, align 8, !tbaa !5
  %110 = icmp ult i64 %108, %109
  br i1 %110, label %116, label %111

111:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %127

112:                                              ; preds = %140, %138, %136, %134, %129, %127, %104
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %8, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %9, align 4
  br label %143

116:                                              ; preds = %107
  %117 = load i64, ptr %15, align 8, !tbaa !5
  %118 = invoke noundef i64 @_ZN8graphlab6random12fast_uniformImEET_S2_S2_(i64 noundef 0, i64 noundef %117)
          to label %119 unwind label %123

119:                                              ; preds = %116
  store i64 %118, ptr %10, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %119
  %121 = load i64, ptr %16, align 8, !tbaa !5
  %122 = add i64 %121, 1
  store i64 %122, ptr %16, align 8, !tbaa !5
  br label %107, !llvm.loop !14

123:                                              ; preds = %116
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %8, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %143

127:                                              ; preds = %111
  %128 = invoke i32 @_ZSt4setwi(i32 noundef 20)
          to label %129 unwind label %112

129:                                              ; preds = %127
  %130 = getelementptr inbounds %"struct.std::_Setw", ptr %17, i32 0, i32 0
  store i32 %128, ptr %130, align 4
  %131 = getelementptr inbounds %"struct.std::_Setw", ptr %17, i32 0, i32 0
  %132 = load i32, ptr %131, align 4
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %132)
          to label %134 unwind label %112

134:                                              ; preds = %129
  %135 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef @.str.6)
          to label %136 unwind label %112

136:                                              ; preds = %134
  %137 = invoke noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %138 unwind label %112

138:                                              ; preds = %136
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %135, double noundef %137)
          to label %140 unwind label %112

140:                                              ; preds = %138
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %142 unwind label %112

142:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZN8graphlab6random13alias_samplerD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  ret void

143:                                              ; preds = %123, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %144

144:                                              ; preds = %143, %85, %53, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %145

145:                                              ; preds = %144, %39
  call void @_ZN8graphlab6random13alias_samplerD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %8, align 8
  %148 = load i32, ptr %9, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8graphlab5timerC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

declare void @_ZN8graphlab6random13alias_samplerC1ERKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt4setwi(i32 noundef) #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare noundef i64 @_ZN8graphlab6random13alias_sampler6sampleEv(ptr noundef nonnull align 8 dereferenceable(56)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN8graphlab6random11multinomialIdEEmRKSt6vectorIT_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN8graphlab6random12fast_uniformImEET_S2_S2_(i64 noundef, i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8graphlab6random13alias_samplerD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 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 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 = { 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 #5 = { "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 #6 = { 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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.graphlab::timer" = type { %struct.timeval }
%struct.timeval = type { i64, i64 }
%"class.graphlab::random::alias_sampler" = type { %"class.std::vector.0", %"class.std::vector", i64 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19run_alias_benchmarkmSt6vectorIdSaIdEE(i64 noundef %0, ptr noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.graphlab::timer", align 8
  %4 = alloca %"class.graphlab::random::alias_sampler", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  call void @_ZN8graphlab5timerC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #6
  call void @_ZN8graphlab6random13alias_samplerC1ERKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %5 = call i32 @_ZSt4setwi(i32 noundef 20)
  %6 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %5)
          to label %7 unwind label %17

7:                                                ; preds = %2
  %8 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull @.str)
          to label %9 unwind label %17

9:                                                ; preds = %7
  %10 = call noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %11 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %8, double noundef %10)
          to label %12 unwind label %17

12:                                               ; preds = %9
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %14 unwind label %17

14:                                               ; preds = %12
  call void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %.not = icmp eq i64 %0, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %22, %14
  %15 = call i32 @_ZSt4setwi(i32 noundef 20)
  %16 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %15)
          to label %26 unwind label %19

17:                                               ; preds = %12, %9, %7, %2
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %67

19:                                               ; preds = %46, %43, %41, %._crit_edge29, %31, %28, %26, %._crit_edge
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %67

.lr.ph:                                           ; preds = %14, %22
  %.01925 = phi i64 [ %23, %22 ], [ 0, %14 ]
  %21 = invoke noundef i64 @_ZN8graphlab6random13alias_sampler6sampleEv(ptr noundef nonnull align 8 dereferenceable(56) %4)
          to label %22 unwind label %24

22:                                               ; preds = %.lr.ph
  %23 = add nuw i64 %.01925, 1
  %exitcond.not = icmp eq i64 %23, %0
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

24:                                               ; preds = %.lr.ph
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %67

26:                                               ; preds = %._crit_edge
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @.str.4)
          to label %28 unwind label %19

28:                                               ; preds = %26
  %29 = call noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %27, double noundef %29)
          to label %31 unwind label %19

31:                                               ; preds = %28
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %33 unwind label %19

33:                                               ; preds = %31
  call void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  br i1 %.not, label %._crit_edge29, label %.lr.ph28

._crit_edge29:                                    ; preds = %37, %33
  %34 = call i32 @_ZSt4setwi(i32 noundef 20)
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %34)
          to label %41 unwind label %19

.lr.ph28:                                         ; preds = %33, %37
  %.01826 = phi i64 [ %38, %37 ], [ 0, %33 ]
  %36 = invoke noundef i64 @_ZN8graphlab6random11multinomialIdEEmRKSt6vectorIT_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %37 unwind label %39

37:                                               ; preds = %.lr.ph28
  %38 = add nuw i64 %.01826, 1
  %exitcond36.not = icmp eq i64 %38, %0
  br i1 %exitcond36.not, label %._crit_edge29, label %.lr.ph28, !llvm.loop !7

39:                                               ; preds = %.lr.ph28
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %67

41:                                               ; preds = %._crit_edge29
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @.str.5)
          to label %43 unwind label %19

43:                                               ; preds = %41
  %44 = call noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %42, double noundef %44)
          to label %46 unwind label %19

46:                                               ; preds = %43
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %48 unwind label %19

48:                                               ; preds = %46
  %49 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  br i1 %.not, label %._crit_edge33, label %.lr.ph32

._crit_edge33:                                    ; preds = %55, %48
  %50 = call i32 @_ZSt4setwi(i32 noundef 20)
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %50)
          to label %59 unwind label %52

52:                                               ; preds = %64, %61, %59, %._crit_edge33
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %67

.lr.ph32:                                         ; preds = %48, %55
  %.01430 = phi i64 [ %56, %55 ], [ 0, %48 ]
  %54 = invoke noundef i64 @_ZN8graphlab6random12fast_uniformImEET_S2_S2_(i64 noundef 0, i64 noundef %49)
          to label %55 unwind label %57

55:                                               ; preds = %.lr.ph32
  %56 = add nuw i64 %.01430, 1
  %exitcond37.not = icmp eq i64 %56, %0
  br i1 %exitcond37.not, label %._crit_edge33, label %.lr.ph32, !llvm.loop !8

57:                                               ; preds = %.lr.ph32
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %67

59:                                               ; preds = %._crit_edge33
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @.str.6)
          to label %61 unwind label %52

61:                                               ; preds = %59
  %62 = call noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %60, double noundef %62)
          to label %64 unwind label %52

64:                                               ; preds = %61
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %66 unwind label %52

66:                                               ; preds = %64
  call void @_ZN8graphlab6random13alias_samplerD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  ret void

67:                                               ; preds = %19, %24, %39, %57, %52, %17
  %.pn22.pn = phi { ptr, i32 } [ %18, %17 ], [ %25, %24 ], [ %40, %39 ], [ %20, %19 ], [ %58, %57 ], [ %53, %52 ]
  call void @_ZN8graphlab6random13alias_samplerD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn22.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8graphlab5timerC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

declare void @_ZN8graphlab6random13alias_samplerC1ERKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt4setwi(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare noundef i64 @_ZN8graphlab6random13alias_sampler6sampleEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN8graphlab6random11multinomialIdEEmRKSt6vectorIT_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN8graphlab6random12fast_uniformImEET_S2_S2_(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8graphlab6random13alias_samplerD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 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 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 = { 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 #5 = { "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 #6 = { 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"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass