; LLVM IR from interpretml/interpret :: shared/libebm (sampling)

; 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.NAMESPACE_MAIN::RandomDeterministic" = type { i64, i64, i64 }
%"class.NAMESPACE_MAIN::RandomNondeterministic" = type { i64, i64, %"class.std::random_device" }
%"class.std::random_device" = type { %union.anon }
%union.anon = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }

@g_traceLevel = external global i32, align 4
@_ZZ24SampleWithoutReplacementE13LOG__sMessage = external hidden constant [106 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_0 = external hidden constant [76 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_1 = external hidden constant [78 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_2 = external hidden constant [80 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_3 = external hidden constant [51 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_4 = external hidden constant [83 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_5 = external hidden constant [49 x i8], align 16
@_ZTISt9bad_alloc = external constant ptr
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_6 = external hidden constant [69 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_7 = external hidden constant [69 x i8], align 16
@.str = external hidden unnamed_addr constant [82 x i8], align 1
@__func__.SampleWithoutReplacement = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__.SampleWithoutReplacement = external hidden unnamed_addr constant [84 x i8], align 1
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_8 = external hidden constant [32 x i8], align 16

; Function Attrs: mustprogress uwtable
define dso_local i32 @SampleWithoutReplacement(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"class.NAMESPACE_MAIN::RandomDeterministic", align 8
  %25 = alloca i64, align 8
  %26 = alloca i8, align 1
  %27 = alloca %"class.NAMESPACE_MAIN::RandomNondeterministic", align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i64, align 8
  %31 = alloca i8, align 1
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  store i32 3, ptr %10, align 4, !tbaa !11
  %37 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %38 = icmp sle i32 3, %37
  br i1 %38, label %39, label %44

39:                                               ; preds = %36
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = load i64, ptr %8, align 8, !tbaa !9
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  call void (i32, ptr, ...) @InteralLogWithArguments(i32 noundef 3, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage, ptr noundef %40, i64 noundef %41, i64 noundef %42, ptr noundef %43)
  br label %44

44:                                               ; preds = %39, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  br label %45

45:                                               ; preds = %44
  %46 = load i64, ptr %7, align 8, !tbaa !9
  %47 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %46) #10
  %48 = xor i1 %47, true
  %49 = xor i1 %48, true
  %50 = zext i1 %49 to i64
  %51 = call i64 @llvm.expect.i64(i64 %50, i64 0)
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %53, label %60

53:                                               ; preds = %45
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  store i32 1, ptr %11, align 4, !tbaa !11
  %55 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %56 = icmp sle i32 1, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_0)
  br label %58

58:                                               ; preds = %57, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  br label %59

59:                                               ; preds = %58
  store i32 -3, ptr %5, align 4
  br label %287

60:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %61 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %61, ptr %12, align 8, !tbaa !9
  %62 = load i64, ptr %8, align 8, !tbaa !9
  %63 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %62) #10
  %64 = xor i1 %63, true
  %65 = xor i1 %64, true
  %66 = zext i1 %65 to i64
  %67 = call i64 @llvm.expect.i64(i64 %66, i64 0)
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %77

69:                                               ; preds = %60
  br label %70

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  store i32 1, ptr %13, align 4, !tbaa !11
  %71 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %72 = icmp sle i32 1, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_1)
  br label %74

74:                                               ; preds = %73, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  store i32 -3, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %286

77:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %78 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %78, ptr %15, align 8, !tbaa !9
  %79 = load i64, ptr %12, align 8, !tbaa !9
  %80 = load i64, ptr %15, align 8, !tbaa !9
  %81 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL10IsAddErrorImEEbT_S1_(i64 noundef %79, i64 noundef %80) #10
  %82 = xor i1 %81, true
  %83 = xor i1 %82, true
  %84 = zext i1 %83 to i64
  %85 = call i64 @llvm.expect.i64(i64 %84, i64 0)
  %86 = icmp ne i64 %85, 0
  br i1 %86, label %87, label %95

87:                                               ; preds = %77
  br label %88

88:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  store i32 1, ptr %16, align 4, !tbaa !11
  %89 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %90 = icmp sle i32 1, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_2)
  br label %92

92:                                               ; preds = %91, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  store i32 -3, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %285

95:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #10
  %96 = load i64, ptr %12, align 8, !tbaa !9
  %97 = load i64, ptr %15, align 8, !tbaa !9
  %98 = add i64 %96, %97
  store i64 %98, ptr %17, align 8, !tbaa !9
  %99 = load i64, ptr %17, align 8, !tbaa !9
  %100 = icmp eq i64 0, %99
  %101 = xor i1 %100, true
  %102 = xor i1 %101, true
  %103 = zext i1 %102 to i64
  %104 = call i64 @llvm.expect.i64(i64 %103, i64 0)
  %105 = icmp ne i64 %104, 0
  br i1 %105, label %106, label %114

106:                                              ; preds = %95
  br label %107

107:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  store i32 3, ptr %18, align 4, !tbaa !11
  %108 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %109 = icmp sle i32 3, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %107
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_3)
  br label %111

111:                                              ; preds = %110, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  store i32 0, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %284

114:                                              ; preds = %95
  %115 = load i64, ptr %17, align 8, !tbaa !9
  %116 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 1, i64 noundef %115) #10
  %117 = xor i1 %116, true
  %118 = xor i1 %117, true
  %119 = zext i1 %118 to i64
  %120 = call i64 @llvm.expect.i64(i64 %119, i64 0)
  %121 = icmp ne i64 %120, 0
  br i1 %121, label %122, label %130

122:                                              ; preds = %114
  br label %123

123:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #10
  store i32 1, ptr %19, align 4, !tbaa !11
  %124 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %125 = icmp sle i32 1, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %123
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_4)
  br label %127

127:                                              ; preds = %126, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  store i32 -3, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %284

130:                                              ; preds = %114
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = icmp eq ptr null, %131
  %133 = xor i1 %132, true
  %134 = xor i1 %133, true
  %135 = zext i1 %134 to i64
  %136 = call i64 @llvm.expect.i64(i64 %135, i64 0)
  %137 = icmp ne i64 %136, 0
  br i1 %137, label %138, label %146

138:                                              ; preds = %130
  br label %139

139:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  store i32 1, ptr %20, align 4, !tbaa !11
  %140 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %141 = icmp sle i32 1, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %139
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_5)
  br label %143

143:                                              ; preds = %142, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  store i32 -3, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %284

146:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %147 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %147, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %148, ptr %22, align 8, !tbaa !5
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = icmp ne ptr null, %149
  br i1 %150, label %151, label %187

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %152, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #10
  %153 = load ptr, ptr %23, align 8, !tbaa !5
  call void @_ZN14NAMESPACE_MAIN19RandomDeterministic10InitializeERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %153)
  br label %154

154:                                              ; preds = %182, %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #10
  %155 = load i64, ptr %17, align 8, !tbaa !9
  %156 = call noundef i64 @_ZN14NAMESPACE_MAIN19RandomDeterministic8NextFastImEENSt9enable_ifIXaasr3std11is_unsignedIT_EE5valueltclL_ZNSt14numeric_limitsIjE3maxEvEEclsr3std14numeric_limitsIS3_EE3maxEES3_E4typeES3_(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %155)
  store i64 %156, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #10
  %157 = load i64, ptr %25, align 8, !tbaa !9
  %158 = load i64, ptr %21, align 8, !tbaa !9
  %159 = icmp ult i64 %157, %158
  %160 = xor i1 %159, true
  %161 = xor i1 %160, true
  %162 = zext i1 %161 to i8
  store i8 %162, ptr %26, align 1, !tbaa !13
  %163 = load i8, ptr %26, align 1, !tbaa !13, !range !15, !noundef !16
  %164 = trunc i8 %163 to i1
  %165 = xor i1 %164, true
  %166 = xor i1 %165, true
  %167 = zext i1 %166 to i64
  %168 = select i1 %166, i64 1, i64 0
  %169 = load i64, ptr %21, align 8, !tbaa !9
  %170 = sub i64 %169, %168
  store i64 %170, ptr %21, align 8, !tbaa !9
  %171 = load i8, ptr %26, align 1, !tbaa !13, !range !15, !noundef !16
  %172 = trunc i8 %171 to i1
  %173 = xor i1 %172, true
  %174 = xor i1 %173, true
  %175 = zext i1 %174 to i64
  %176 = select i1 %174, i8 1, i8 -1
  %177 = load ptr, ptr %22, align 8, !tbaa !5
  store i8 %176, ptr %177, align 1, !tbaa !17
  %178 = load ptr, ptr %22, align 8, !tbaa !5
  %179 = getelementptr inbounds i8, ptr %178, i32 1
  store ptr %179, ptr %22, align 8, !tbaa !5
  %180 = load i64, ptr %17, align 8, !tbaa !9
  %181 = add i64 %180, -1
  store i64 %181, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  br label %182

182:                                              ; preds = %154
  %183 = load i64, ptr %17, align 8, !tbaa !9
  %184 = icmp ne i64 0, %183
  br i1 %184, label %154, label %185, !llvm.loop !18

185:                                              ; preds = %182
  %186 = load ptr, ptr %23, align 8, !tbaa !5
  call void @_ZN14NAMESPACE_MAIN19RandomDeterministic10InitializeERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %186, ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  br label %268

187:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 5016, ptr %27) #10
  invoke void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImEC2Ev(ptr noundef nonnull align 8 dereferenceable(5016) %27)
          to label %188 unwind label %222

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %218, %188
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #10
  %190 = load i64, ptr %17, align 8, !tbaa !9
  %191 = invoke noundef i64 @_ZN14NAMESPACE_MAIN22RandomNondeterministicImE8NextFastEm(ptr noundef nonnull align 8 dereferenceable(5016) %27, i64 noundef %190)
          to label %192 unwind label %226

192:                                              ; preds = %189
  store i64 %191, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #10
  %193 = load i64, ptr %30, align 8, !tbaa !9
  %194 = load i64, ptr %21, align 8, !tbaa !9
  %195 = icmp ult i64 %193, %194
  %196 = xor i1 %195, true
  %197 = xor i1 %196, true
  %198 = zext i1 %197 to i8
  store i8 %198, ptr %31, align 1, !tbaa !13
  %199 = load i8, ptr %31, align 1, !tbaa !13, !range !15, !noundef !16
  %200 = trunc i8 %199 to i1
  %201 = xor i1 %200, true
  %202 = xor i1 %201, true
  %203 = zext i1 %202 to i64
  %204 = select i1 %202, i64 1, i64 0
  %205 = load i64, ptr %21, align 8, !tbaa !9
  %206 = sub i64 %205, %204
  store i64 %206, ptr %21, align 8, !tbaa !9
  %207 = load i8, ptr %31, align 1, !tbaa !13, !range !15, !noundef !16
  %208 = trunc i8 %207 to i1
  %209 = xor i1 %208, true
  %210 = xor i1 %209, true
  %211 = zext i1 %210 to i64
  %212 = select i1 %210, i8 1, i8 -1
  %213 = load ptr, ptr %22, align 8, !tbaa !5
  store i8 %212, ptr %213, align 1, !tbaa !17
  %214 = load ptr, ptr %22, align 8, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %214, i32 1
  store ptr %215, ptr %22, align 8, !tbaa !5
  %216 = load i64, ptr %17, align 8, !tbaa !9
  %217 = add i64 %216, -1
  store i64 %217, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  br label %218

218:                                              ; preds = %192
  %219 = load i64, ptr %17, align 8, !tbaa !9
  %220 = icmp ne i64 0, %219
  br i1 %220, label %189, label %221, !llvm.loop !20

221:                                              ; preds = %218
  call void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImED2Ev(ptr noundef nonnull align 8 dereferenceable(5016) %27) #10
  call void @llvm.lifetime.end.p0(i64 5016, ptr %27) #10
  br label %267

222:                                              ; preds = %187
  %223 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9bad_alloc
          catch ptr null
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %28, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %29, align 4
  br label %230

226:                                              ; preds = %189
  %227 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9bad_alloc
          catch ptr null
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %28, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  call void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImED2Ev(ptr noundef nonnull align 8 dereferenceable(5016) %27) #10
  br label %230

230:                                              ; preds = %226, %222
  call void @llvm.lifetime.end.p0(i64 5016, ptr %27) #10
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %29, align 4
  %233 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9bad_alloc) #10
  %234 = icmp eq i32 %232, %233
  br i1 %234, label %235, label %243

235:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #10
  %236 = load ptr, ptr %28, align 8
  %237 = call ptr @__cxa_begin_catch(ptr %236) #10
  store ptr %237, ptr %33, align 8
  br label %238

238:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #10
  store i32 2, ptr %34, align 4, !tbaa !11
  %239 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %240 = icmp sle i32 2, %239
  br i1 %240, label %241, label %263

241:                                              ; preds = %238
  invoke void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_7)
          to label %242 unwind label %259

242:                                              ; preds = %241
  br label %263

243:                                              ; preds = %231
  %244 = load ptr, ptr %28, align 8
  %245 = call ptr @__cxa_begin_catch(ptr %244) #10
  br label %246

246:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #10
  store i32 2, ptr %32, align 4, !tbaa !11
  %247 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %248 = icmp sle i32 2, %247
  br i1 %248, label %249, label %255

249:                                              ; preds = %246
  invoke void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_6)
          to label %250 unwind label %251

250:                                              ; preds = %249
  br label %255

251:                                              ; preds = %249
  %252 = landingpad { ptr, i32 }
          cleanup
  %253 = extractvalue { ptr, i32 } %252, 0
  store ptr %253, ptr %28, align 8
  %254 = extractvalue { ptr, i32 } %252, 1
  store i32 %254, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #10
  invoke void @__cxa_end_catch()
          to label %258 unwind label %294

255:                                              ; preds = %250, %246
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #10
  br label %256

256:                                              ; preds = %255
  br label %257

257:                                              ; preds = %256
  store i32 -2, ptr %5, align 4
  store i32 1, ptr %14, align 4
  call void @__cxa_end_catch()
  br label %282

258:                                              ; preds = %251
  br label %283

259:                                              ; preds = %241
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %28, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #10
  invoke void @__cxa_end_catch()
          to label %266 unwind label %294

263:                                              ; preds = %242, %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #10
  br label %264

264:                                              ; preds = %263
  br label %265

265:                                              ; preds = %264
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  br label %282

266:                                              ; preds = %259
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  br label %283

267:                                              ; preds = %221
  br label %268

268:                                              ; preds = %267, %185
  %269 = load i64, ptr %21, align 8, !tbaa !9
  %270 = icmp eq i64 0, %269
  br i1 %270, label %273, label %271

271:                                              ; preds = %268
  call void @LogAssertFailure(i64 noundef 105, ptr noundef @.str, ptr noundef @__func__.SampleWithoutReplacement, ptr noundef @.str.1)
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str, i32 noundef 105, ptr noundef @__PRETTY_FUNCTION__.SampleWithoutReplacement) #11
  unreachable

272:                                              ; No predecessors!
  br label %273

273:                                              ; preds = %272, %268
  %274 = phi i1 [ true, %268 ], [ false, %272 ]
  br label %275

275:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #10
  store i32 3, ptr %35, align 4, !tbaa !11
  %276 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %277 = icmp sle i32 3, %276
  br i1 %277, label %278, label %279

278:                                              ; preds = %275
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZ24SampleWithoutReplacementE13LOG__sMessage_8)
  br label %279

279:                                              ; preds = %278, %275
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #10
  br label %280

280:                                              ; preds = %279
  br label %281

281:                                              ; preds = %280
  store i32 0, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %282

282:                                              ; preds = %281, %265, %257
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  br label %284

283:                                              ; preds = %266, %258
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %289

284:                                              ; preds = %282, %145, %129, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  br label %285

285:                                              ; preds = %284, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  br label %286

286:                                              ; preds = %285, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %287

287:                                              ; preds = %286, %59
  %288 = load i32, ptr %5, align 4
  ret i32 %288

289:                                              ; preds = %283
  %290 = load ptr, ptr %28, align 8
  %291 = load i32, ptr %29, align 4
  %292 = insertvalue { ptr, i32 } poison, ptr %290, 0
  %293 = insertvalue { ptr, i32 } %292, i32 %291, 1
  resume { ptr, i32 } %293

294:                                              ; preds = %259, %251
  %295 = landingpad { ptr, i32 }
          catch ptr null
  %296 = extractvalue { ptr, i32 } %295, 0
  call void @__clang_call_terminate(ptr %296) #11
  unreachable
}

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

declare void @InteralLogWithArguments(i32 noundef, ptr noundef, ...) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #4

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL10IsAddErrorImEEbT_S1_(i64 noundef, i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef, i64 noundef) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN14NAMESPACE_MAIN19RandomDeterministic10InitializeERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i64 @_ZN14NAMESPACE_MAIN19RandomDeterministic8NextFastImEENSt9enable_ifIXaasr3std11is_unsignedIT_EE5valueltclL_ZNSt14numeric_limitsIjE3maxEvEEclsr3std14numeric_limitsIS3_EE3maxEES3_E4typeES3_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImEC2Ev(ptr noundef nonnull align 8 dereferenceable(5016)) unnamed_addr #6 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i64 @_ZN14NAMESPACE_MAIN22RandomNondeterministicImE8NextFastEm(ptr noundef nonnull align 8 dereferenceable(5016), i64 noundef) #6 align 2

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

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #7

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #8

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !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.NAMESPACE_MAIN::RandomDeterministic" = type { i64, i64, i64 }
%"class.NAMESPACE_MAIN::RandomNondeterministic" = type { i64, i64, %"class.std::random_device" }
%"class.std::random_device" = type { %union.anon }
%union.anon = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }

@g_traceLevel = external local_unnamed_addr global i32, align 4
@_ZZ24SampleWithoutReplacementE13LOG__sMessage = external hidden constant [106 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_0 = external hidden constant [76 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_1 = external hidden constant [78 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_2 = external hidden constant [80 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_3 = external hidden constant [51 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_4 = external hidden constant [83 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_5 = external hidden constant [49 x i8], align 16
@_ZTISt9bad_alloc = external constant ptr
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_6 = external hidden constant [69 x i8], align 16
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_7 = external hidden constant [69 x i8], align 16
@.str = external hidden unnamed_addr constant [82 x i8], align 1
@__func__.SampleWithoutReplacement = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__.SampleWithoutReplacement = external hidden unnamed_addr constant [84 x i8], align 1
@_ZZ24SampleWithoutReplacementE13LOG__sMessage_8 = external hidden constant [32 x i8], align 16

; Function Attrs: mustprogress uwtable
define dso_local range(i32 -3, 1) i32 @SampleWithoutReplacement(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.NAMESPACE_MAIN::RandomDeterministic", align 8
  %6 = alloca %"class.NAMESPACE_MAIN::RandomNondeterministic", align 8
  %7 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 2
  br i1 %8, label %9, label %10

9:                                                ; preds = %4
  tail call void (i32, ptr, ...) @InteralLogWithArguments(i32 noundef 3, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage, ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3)
  br label %10

10:                                               ; preds = %9, %4
  %11 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %1) #9
  br i1 %11, label %12, label %16, !prof !9

12:                                               ; preds = %10
  %13 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %15, label %94

15:                                               ; preds = %12
  tail call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_0)
  br label %94

16:                                               ; preds = %10
  %17 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %2) #9
  br i1 %17, label %18, label %22, !prof !9

18:                                               ; preds = %16
  %19 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %21, label %94

21:                                               ; preds = %18
  tail call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_1)
  br label %94

22:                                               ; preds = %16
  %23 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL10IsAddErrorImEEbT_S1_(i64 noundef %1, i64 noundef %2) #9
  br i1 %23, label %24, label %28, !prof !9

24:                                               ; preds = %22
  %25 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %27, label %94

27:                                               ; preds = %24
  tail call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_2)
  br label %94

28:                                               ; preds = %22
  %29 = add i64 %2, %1
  %30 = icmp eq i64 %29, 0
  br i1 %30, label %31, label %35, !prof !9

31:                                               ; preds = %28
  %32 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 2
  br i1 %33, label %34, label %94

34:                                               ; preds = %31
  tail call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_3)
  br label %94

35:                                               ; preds = %28
  %36 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 1, i64 noundef %29) #9
  br i1 %36, label %37, label %41, !prof !9

37:                                               ; preds = %35
  %38 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %40, label %94

40:                                               ; preds = %37
  tail call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_4)
  br label %94

41:                                               ; preds = %35
  %42 = icmp eq ptr %3, null
  br i1 %42, label %43, label %47, !prof !9

43:                                               ; preds = %41
  %44 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %46, label %94

46:                                               ; preds = %43
  tail call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_5)
  br label %94

47:                                               ; preds = %41
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %57, label %48

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @_ZN14NAMESPACE_MAIN19RandomDeterministic10InitializeERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
  br label %49

49:                                               ; preds = %49, %48
  %.052 = phi ptr [ %3, %48 ], [ %54, %49 ]
  %.049 = phi i64 [ %1, %48 ], [ %52, %49 ]
  %.047 = phi i64 [ %29, %48 ], [ %55, %49 ]
  %50 = call noundef i64 @_ZN14NAMESPACE_MAIN19RandomDeterministic8NextFastImEENSt9enable_ifIXaasr3std11is_unsignedIT_EE5valueltclL_ZNSt14numeric_limitsIjE3maxEvEEclsr3std14numeric_limitsIS3_EE3maxEES3_E4typeES3_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.047)
  %51 = icmp ult i64 %50, %.049
  %.neg66 = sext i1 %51 to i64
  %52 = add i64 %.049, %.neg66
  %53 = select i1 %51, i8 1, i8 -1
  store i8 %53, ptr %.052, align 1, !tbaa !10
  %54 = getelementptr inbounds i8, ptr %.052, i64 1
  %55 = add i64 %.047, -1
  %.not67 = icmp eq i64 %55, 0
  br i1 %.not67, label %56, label %49, !llvm.loop !11

56:                                               ; preds = %49
  call void @_ZN14NAMESPACE_MAIN19RandomDeterministic10InitializeERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %86

57:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 5016, ptr nonnull %6) #9
  invoke void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImEC2Ev(ptr noundef nonnull align 8 dereferenceable(5016) %6)
          to label %.preheader unwind label %66

.preheader:                                       ; preds = %57, %59
  %.153 = phi ptr [ %63, %59 ], [ %3, %57 ]
  %.150 = phi i64 [ %61, %59 ], [ %1, %57 ]
  %.148 = phi i64 [ %64, %59 ], [ %29, %57 ]
  %58 = invoke noundef i64 @_ZN14NAMESPACE_MAIN22RandomNondeterministicImE8NextFastEm(ptr noundef nonnull align 8 dereferenceable(5016) %6, i64 noundef %.148)
          to label %59 unwind label %68

59:                                               ; preds = %.preheader
  %60 = icmp ult i64 %58, %.150
  %.neg = sext i1 %60 to i64
  %61 = add i64 %.150, %.neg
  %62 = select i1 %60, i8 1, i8 -1
  store i8 %62, ptr %.153, align 1, !tbaa !10
  %63 = getelementptr inbounds i8, ptr %.153, i64 1
  %64 = add i64 %.148, -1
  %.not65 = icmp eq i64 %64, 0
  br i1 %.not65, label %65, label %.preheader, !llvm.loop !13

65:                                               ; preds = %59
  call void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImED2Ev(ptr noundef nonnull align 8 dereferenceable(5016) %6) #9
  call void @llvm.lifetime.end.p0(i64 5016, ptr nonnull %6) #9
  br label %86

66:                                               ; preds = %57
  %67 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9bad_alloc
          catch ptr null
  br label %70

68:                                               ; preds = %.preheader
  %69 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9bad_alloc
          catch ptr null
  call void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImED2Ev(ptr noundef nonnull align 8 dereferenceable(5016) %6) #9
  br label %70

70:                                               ; preds = %68, %66
  %.pn = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  %.054 = extractvalue { ptr, i32 } %.pn, 0
  %.056 = extractvalue { ptr, i32 } %.pn, 1
  call void @llvm.lifetime.end.p0(i64 5016, ptr nonnull %6) #9
  %71 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9bad_alloc) #9
  %72 = icmp eq i32 %.056, %71
  %73 = call ptr @__cxa_begin_catch(ptr %.054) #9
  %74 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 1
  br i1 %72, label %76, label %78

76:                                               ; preds = %70
  br i1 %75, label %77, label %85

77:                                               ; preds = %76
  invoke void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_7)
          to label %85 unwind label %83

78:                                               ; preds = %70
  br i1 %75, label %79, label %82

79:                                               ; preds = %78
  invoke void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_6)
          to label %82 unwind label %80

80:                                               ; preds = %79
  %81 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %93 unwind label %95

82:                                               ; preds = %79, %78
  call void @__cxa_end_catch()
  br label %94

83:                                               ; preds = %77
  %84 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %93 unwind label %95

85:                                               ; preds = %77, %76
  call void @__cxa_end_catch()
  br label %94

86:                                               ; preds = %65, %56
  %.251 = phi i64 [ %52, %56 ], [ %61, %65 ]
  %87 = icmp eq i64 %.251, 0
  br i1 %87, label %89, label %88

88:                                               ; preds = %86
  call void @LogAssertFailure(i64 noundef 105, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.SampleWithoutReplacement, ptr noundef nonnull @.str.1)
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str, i32 noundef 105, ptr noundef nonnull @__PRETTY_FUNCTION__.SampleWithoutReplacement) #10
  unreachable

89:                                               ; preds = %86
  %90 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %91 = icmp sgt i32 %90, 2
  br i1 %91, label %92, label %94

92:                                               ; preds = %89
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef nonnull @_ZZ24SampleWithoutReplacementE13LOG__sMessage_8)
  br label %94

93:                                               ; preds = %83, %80
  %.pn63 = phi { ptr, i32 } [ %81, %80 ], [ %84, %83 ]
  resume { ptr, i32 } %.pn63

94:                                               ; preds = %21, %18, %34, %31, %40, %37, %46, %43, %89, %92, %85, %82, %24, %27, %12, %15
  %.4 = phi i32 [ -3, %15 ], [ -3, %12 ], [ -3, %21 ], [ -3, %18 ], [ -3, %27 ], [ -3, %24 ], [ 0, %34 ], [ 0, %31 ], [ -3, %40 ], [ -3, %37 ], [ -3, %46 ], [ -3, %43 ], [ -1, %85 ], [ -2, %82 ], [ 0, %92 ], [ 0, %89 ]
  ret i32 %.4

95:                                               ; preds = %83, %80
  %96 = landingpad { ptr, i32 }
          catch ptr null
  %97 = extractvalue { ptr, i32 } %96, 0
  call void @__clang_call_terminate(ptr %97) #10
  unreachable
}

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

declare void @InteralLogWithArguments(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) local_unnamed_addr #3

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL10IsAddErrorImEEbT_S1_(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN14NAMESPACE_MAIN19RandomDeterministic10InitializeERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i64 @_ZN14NAMESPACE_MAIN19RandomDeterministic8NextFastImEENSt9enable_ifIXaasr3std11is_unsignedIT_EE5valueltclL_ZNSt14numeric_limitsIjE3maxEvEEclsr3std14numeric_limitsIS3_EE3maxEES3_E4typeES3_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN14NAMESPACE_MAIN22RandomNondeterministicImEC2Ev(ptr noundef nonnull align 8 dereferenceable(5016)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i64 @_ZN14NAMESPACE_MAIN22RandomNondeterministicImE8NextFastEm(ptr noundef nonnull align 8 dereferenceable(5016), i64 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #7

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass