; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/数据结构 (四分树)

; 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::linear_congruential_engine" = type { i64 }
%"class.std::uniform_int_distribution" = type { %"struct.std::uniform_int_distribution<unsigned int>::param_type" }
%"struct.std::uniform_int_distribution<unsigned int>::param_type" = type { i32, i32 }

@A = external dso_local global [2000 x [2000 x i32]], align 16
@tot = external dso_local global i32, align 4
@mn = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5buildiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5queryiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::linear_congruential_engine", align 8
  %6 = alloca %"class.std::uniform_int_distribution", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 500, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 500, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 10000, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE4seedEm(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 123)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %30 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZNSt24uniform_int_distributionIjEC2Ejj(ptr noundef nonnull align 4 dereferenceable(8) %6, i32 noundef 1, i32 noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %54, %0
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %57

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %50, %36
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %53

42:                                               ; preds = %37
  %43 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %45
  %47 = load i32, ptr %9, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [2000 x i32], ptr %46, i64 0, i64 %48
  store i32 %43, ptr %49, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %42
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %9, align 4, !tbaa !5
  br label %37, !llvm.loop !9

53:                                               ; preds = %41
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %7, align 4, !tbaa !5
  br label %31, !llvm.loop !11

57:                                               ; preds = %35
  call void @_Z4initv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = call noundef i32 @_Z5buildiiii(i32 noundef 1, i32 noundef %58, i32 noundef 1, i32 noundef %59)
  store i32 %60, ptr %10, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %238, %57
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %4, align 4, !tbaa !5
  %64 = icmp ne i32 %62, 0
  br i1 %64, label %65, label %239

65:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %66 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i32 %66, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %67 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i32 %67, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %68 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i32 %68, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %69 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i32 %69, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  store i32 %71, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %73 = load i32, ptr %72, align 4, !tbaa !5
  store i32 %73, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %78 = call i32 @rand() #7
  %79 = srem i32 %78, 3
  store i32 %79, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %80 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i32 %80, ptr %20, align 4, !tbaa !5
  %81 = load i32, ptr %19, align 4, !tbaa !5
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %121

83:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %84 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %84, ptr %21, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %111, %83
  %86 = load i32, ptr %21, align 4, !tbaa !5
  %87 = load i32, ptr %16, align 4, !tbaa !5
  %88 = icmp sle i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %114

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %91 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %91, ptr %22, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %107, %90
  %93 = load i32, ptr %22, align 4, !tbaa !5
  %94 = load i32, ptr %18, align 4, !tbaa !5
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %110

97:                                               ; preds = %92
  %98 = load i32, ptr %20, align 4, !tbaa !5
  %99 = load i32, ptr %21, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %100
  %102 = load i32, ptr %22, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [2000 x i32], ptr %101, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, %98
  store i32 %106, ptr %104, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %97
  %108 = load i32, ptr %22, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %22, align 4, !tbaa !5
  br label %92, !llvm.loop !12

110:                                              ; preds = %96
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %21, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %21, align 4, !tbaa !5
  br label %85, !llvm.loop !13

114:                                              ; preds = %89
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = load i32, ptr %16, align 4, !tbaa !5
  %118 = load i32, ptr %17, align 4, !tbaa !5
  %119 = load i32, ptr %18, align 4, !tbaa !5
  %120 = load i32, ptr %20, align 4, !tbaa !5
  call void @_Z6updateiiiiiii(i32 noundef %115, i32 noundef %116, i32 noundef %117, i32 noundef %118, i32 noundef %119, i32 noundef 0, i32 noundef %120)
  br label %238

121:                                              ; preds = %65
  %122 = load i32, ptr %19, align 4, !tbaa !5
  %123 = icmp eq i32 %122, 1
  br i1 %123, label %124, label %160

124:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %125 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %125, ptr %23, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %150, %124
  %127 = load i32, ptr %23, align 4, !tbaa !5
  %128 = load i32, ptr %16, align 4, !tbaa !5
  %129 = icmp sle i32 %127, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %126
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %153

131:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %132 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %132, ptr %24, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %146, %131
  %134 = load i32, ptr %24, align 4, !tbaa !5
  %135 = load i32, ptr %18, align 4, !tbaa !5
  %136 = icmp sle i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 19, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %149

138:                                              ; preds = %133
  %139 = load i32, ptr %20, align 4, !tbaa !5
  %140 = load i32, ptr %23, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %141
  %143 = load i32, ptr %24, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [2000 x i32], ptr %142, i64 0, i64 %144
  store i32 %139, ptr %145, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %138
  %147 = load i32, ptr %24, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %24, align 4, !tbaa !5
  br label %133, !llvm.loop !14

149:                                              ; preds = %137
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %23, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %23, align 4, !tbaa !5
  br label %126, !llvm.loop !15

153:                                              ; preds = %130
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = load i32, ptr %15, align 4, !tbaa !5
  %156 = load i32, ptr %16, align 4, !tbaa !5
  %157 = load i32, ptr %17, align 4, !tbaa !5
  %158 = load i32, ptr %18, align 4, !tbaa !5
  %159 = load i32, ptr %20, align 4, !tbaa !5
  call void @_Z6updateiiiiiii(i32 noundef %154, i32 noundef %155, i32 noundef %156, i32 noundef %157, i32 noundef %158, i32 noundef 1, i32 noundef %159)
  br label %237

160:                                              ; preds = %121
  store i32 1073741824, ptr @mn, align 4, !tbaa !5
  store i32 -1073741824, ptr @mx, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 1073741824, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 -1073741824, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %161 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %161, ptr %28, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %204, %160
  %163 = load i32, ptr %28, align 4, !tbaa !5
  %164 = load i32, ptr %16, align 4, !tbaa !5
  %165 = icmp sle i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 22, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %207

167:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %168 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %168, ptr %29, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %200, %167
  %170 = load i32, ptr %29, align 4, !tbaa !5
  %171 = load i32, ptr %18, align 4, !tbaa !5
  %172 = icmp sle i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  store i32 25, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %203

174:                                              ; preds = %169
  %175 = load i32, ptr %28, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %176
  %178 = load i32, ptr %29, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [2000 x i32], ptr %177, i64 0, i64 %179
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %180)
  %182 = load i32, ptr %181, align 4, !tbaa !5
  store i32 %182, ptr %25, align 4, !tbaa !5
  %183 = load i32, ptr %28, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %184
  %186 = load i32, ptr %29, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [2000 x i32], ptr %185, i64 0, i64 %187
  %189 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %188)
  %190 = load i32, ptr %189, align 4, !tbaa !5
  store i32 %190, ptr %26, align 4, !tbaa !5
  %191 = load i32, ptr %28, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %192
  %194 = load i32, ptr %29, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [2000 x i32], ptr %193, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = load i32, ptr %27, align 4, !tbaa !5
  %199 = add nsw i32 %198, %197
  store i32 %199, ptr %27, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %174
  %201 = load i32, ptr %29, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %29, align 4, !tbaa !5
  br label %169, !llvm.loop !16

203:                                              ; preds = %173
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %28, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %28, align 4, !tbaa !5
  br label %162, !llvm.loop !17

207:                                              ; preds = %166
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = load i32, ptr %15, align 4, !tbaa !5
  %210 = load i32, ptr %16, align 4, !tbaa !5
  %211 = load i32, ptr %17, align 4, !tbaa !5
  %212 = load i32, ptr %18, align 4, !tbaa !5
  call void @_Z5queryiiiii(i32 noundef %208, i32 noundef %209, i32 noundef %210, i32 noundef %211, i32 noundef %212)
  %213 = load i32, ptr %25, align 4, !tbaa !5
  %214 = load i32, ptr @mn, align 4, !tbaa !5
  %215 = icmp ne i32 %213, %214
  br i1 %215, label %216, label %220

216:                                              ; preds = %207
  %217 = load i32, ptr %25, align 4, !tbaa !5
  %218 = load i32, ptr @mn, align 4, !tbaa !5
  %219 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %217, i32 noundef %218)
  br label %220

220:                                              ; preds = %216, %207
  %221 = load i32, ptr @mx, align 4, !tbaa !5
  %222 = load i32, ptr %26, align 4, !tbaa !5
  %223 = icmp ne i32 %221, %222
  br i1 %223, label %224, label %228

224:                                              ; preds = %220
  %225 = load i32, ptr %26, align 4, !tbaa !5
  %226 = load i32, ptr @mx, align 4, !tbaa !5
  %227 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %225, i32 noundef %226)
  br label %228

228:                                              ; preds = %224, %220
  %229 = load i32, ptr @tot, align 4, !tbaa !5
  %230 = load i32, ptr %27, align 4, !tbaa !5
  %231 = icmp ne i32 %229, %230
  br i1 %231, label %232, label %236

232:                                              ; preds = %228
  %233 = load i32, ptr %27, align 4, !tbaa !5
  %234 = load i32, ptr @tot, align 4, !tbaa !5
  %235 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %233, i32 noundef %234)
  br label %236

236:                                              ; preds = %232, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %237

237:                                              ; preds = %236, %153
  br label %238

238:                                              ; preds = %237, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %61, !llvm.loop !18

239:                                              ; preds = %61
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %240 = load i32, ptr %1, align 4
  ret i32 %240
}

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

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

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

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

; Function Attrs: nounwind
declare i32 @rand() #5

declare i32 @printf(ptr noundef, ...) #6

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

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


; 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::linear_congruential_engine" = type { i64 }
%"class.std::uniform_int_distribution" = type { %"struct.std::uniform_int_distribution<unsigned int>::param_type" }
%"struct.std::uniform_int_distribution<unsigned int>::param_type" = type { i32, i32 }

@A = external dso_local global [2000 x [2000 x i32]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@mn = external dso_local local_unnamed_addr global i32, align 4
@mx = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5buildiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5queryiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca %"class.std::linear_congruential_engine", align 8
  %2 = alloca %"class.std::uniform_int_distribution", align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE4seedEm(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef 123)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @_ZNSt24uniform_int_distributionIjEC2Ejj(ptr noundef nonnull align 4 dereferenceable(8) %2, i32 noundef 1, i32 noundef 500)
  br label %.preheader101

.preheader101:                                    ; preds = %0, %11
  %indvars.iv128 = phi i64 [ 1, %0 ], [ %indvars.iv.next129, %11 ]
  br label %12

9:                                                ; preds = %11
  call void @_Z4initv()
  %10 = call noundef i32 @_Z5buildiiii(i32 noundef 1, i32 noundef 500, i32 noundef 1, i32 noundef 500)
  br label %15

11:                                               ; preds = %12
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond131.not = icmp eq i64 %indvars.iv.next129, 501
  br i1 %exitcond131.not, label %9, label %.preheader101, !llvm.loop !5

12:                                               ; preds = %.preheader101, %12
  %indvars.iv = phi i64 [ 1, %.preheader101 ], [ %indvars.iv.next, %12 ]
  %13 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %14 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %indvars.iv128, i64 %indvars.iv
  store i32 %13, ptr %14, align 4, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 501
  br i1 %exitcond.not, label %11, label %12, !llvm.loop !11

15:                                               ; preds = %9, %85
  %16 = phi i32 [ 9999, %9 ], [ %86, %85 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %17 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i32 %17, ptr %3, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %18 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i32 %18, ptr %4, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %19 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i32 %19, ptr %5, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %20 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i32 %20, ptr %6, align 4, !tbaa !7
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %22 = load i32, ptr %21, align 4, !tbaa !7
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %24 = load i32, ptr %23, align 4, !tbaa !7
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %26 = load i32, ptr %25, align 4, !tbaa !7
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %28 = load i32, ptr %27, align 4, !tbaa !7
  %29 = call i32 @rand() #7
  %30 = srem i32 %29, 3
  %31 = call noundef i32 @_ZNSt24uniform_int_distributionIjEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEjRT_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  switch i32 %30, label %58 [
    i32 0, label %.preheader99
    i32 1, label %.preheader100
  ]

.preheader100:                                    ; preds = %15
  %.not93106 = icmp sgt i32 %22, %24
  %.not94104 = icmp sgt i32 %26, %28
  %or.cond = select i1 %.not93106, i1 true, i1 %.not94104
  br i1 %or.cond, label %._crit_edge108, label %.preheader98.preheader

.preheader98.preheader:                           ; preds = %.preheader100
  %32 = sext i32 %26 to i64
  %33 = add i32 %28, 1
  %34 = sext i32 %22 to i64
  %35 = add i32 %24, 1
  %36 = sub i32 %28, %26
  %37 = zext i32 %36 to i64
  %38 = add nuw nsw i64 %37, 1
  %min.iters.check166 = icmp ult i32 %36, 7
  %n.vec169 = and i64 %38, 8589934584
  %ind.end170 = add nsw i64 %n.vec169, %32
  %broadcast.splatinsert175 = insertelement <4 x i32> poison, i32 %31, i64 0
  %broadcast.splat176 = shufflevector <4 x i32> %broadcast.splatinsert175, <4 x i32> poison, <4 x i32> zeroinitializer
  %cmp.n178 = icmp eq i64 %38, %n.vec169
  br label %.preheader98

.preheader99:                                     ; preds = %15
  %.not95112 = icmp sgt i32 %22, %24
  %.not96109 = icmp sgt i32 %26, %28
  %or.cond161 = select i1 %.not95112, i1 true, i1 %.not96109
  br i1 %or.cond161, label %._crit_edge114, label %.preheader97.preheader

.preheader97.preheader:                           ; preds = %.preheader99
  %39 = sext i32 %26 to i64
  %40 = add i32 %28, 1
  %41 = sext i32 %22 to i64
  %42 = add i32 %24, 1
  %43 = sub i32 %28, %26
  %44 = zext i32 %43 to i64
  %45 = add nuw nsw i64 %44, 1
  %min.iters.check = icmp ult i32 %43, 7
  %n.vec = and i64 %45, 8589934584
  %ind.end = add nsw i64 %n.vec, %39
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %31, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %cmp.n = icmp eq i64 %45, %n.vec
  br label %.preheader97

.preheader97:                                     ; preds = %.preheader97.preheader, %._crit_edge111
  %indvars.iv146 = phi i64 [ %41, %.preheader97.preheader ], [ %indvars.iv.next147, %._crit_edge111 ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader97
  %indvars.iv141.ph = phi i64 [ %39, %.preheader97 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader97, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader97 ]
  %offset.idx = add i64 %index, %39
  %46 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %indvars.iv146, i64 %offset.idx
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load = load <4 x i32>, ptr %46, align 4, !tbaa !7
  %wide.load163 = load <4 x i32>, ptr %47, align 4, !tbaa !7
  %48 = add nsw <4 x i32> %wide.load, %broadcast.splat
  %49 = add nsw <4 x i32> %wide.load163, %broadcast.splat
  store <4 x i32> %48, ptr %46, align 4, !tbaa !7
  store <4 x i32> %49, ptr %47, align 4, !tbaa !7
  %index.next = add nuw i64 %index, 8
  %50 = icmp eq i64 %index.next, %n.vec
  br i1 %50, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge111, label %scalar.ph.preheader

._crit_edge114:                                   ; preds = %._crit_edge111, %.preheader99
  call void @_Z6updateiiiiiii(i32 noundef %10, i32 noundef %22, i32 noundef %24, i32 noundef %26, i32 noundef %28, i32 noundef 0, i32 noundef %31)
  br label %85

._crit_edge111:                                   ; preds = %scalar.ph, %middle.block
  %indvars.iv.next147 = add nsw i64 %indvars.iv146, 1
  %lftr.wideiv149 = trunc i64 %indvars.iv.next147 to i32
  %exitcond150.not = icmp eq i32 %42, %lftr.wideiv149
  br i1 %exitcond150.not, label %._crit_edge114, label %.preheader97, !llvm.loop !15

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %scalar.ph ], [ %indvars.iv141.ph, %scalar.ph.preheader ]
  %51 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %indvars.iv146, i64 %indvars.iv141
  %52 = load i32, ptr %51, align 4, !tbaa !7
  %53 = add nsw i32 %52, %31
  store i32 %53, ptr %51, align 4, !tbaa !7
  %indvars.iv.next142 = add nsw i64 %indvars.iv141, 1
  %lftr.wideiv144 = trunc i64 %indvars.iv.next142 to i32
  %exitcond145.not = icmp eq i32 %40, %lftr.wideiv144
  br i1 %exitcond145.not, label %._crit_edge111, label %scalar.ph, !llvm.loop !16

.preheader98:                                     ; preds = %.preheader98.preheader, %._crit_edge
  %indvars.iv136 = phi i64 [ %34, %.preheader98.preheader ], [ %indvars.iv.next137, %._crit_edge ]
  br i1 %min.iters.check166, label %scalar.ph165.preheader, label %vector.body172

scalar.ph165.preheader:                           ; preds = %middle.block164, %.preheader98
  %indvars.iv132.ph = phi i64 [ %32, %.preheader98 ], [ %ind.end170, %middle.block164 ]
  br label %scalar.ph165

vector.body172:                                   ; preds = %.preheader98, %vector.body172
  %index173 = phi i64 [ %index.next177, %vector.body172 ], [ 0, %.preheader98 ]
  %offset.idx174 = add i64 %index173, %32
  %54 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %indvars.iv136, i64 %offset.idx174
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  store <4 x i32> %broadcast.splat176, ptr %54, align 4, !tbaa !7
  store <4 x i32> %broadcast.splat176, ptr %55, align 4, !tbaa !7
  %index.next177 = add nuw i64 %index173, 8
  %56 = icmp eq i64 %index.next177, %n.vec169
  br i1 %56, label %middle.block164, label %vector.body172, !llvm.loop !17

middle.block164:                                  ; preds = %vector.body172
  br i1 %cmp.n178, label %._crit_edge, label %scalar.ph165.preheader

._crit_edge108:                                   ; preds = %._crit_edge, %.preheader100
  call void @_Z6updateiiiiiii(i32 noundef %10, i32 noundef %22, i32 noundef %24, i32 noundef %26, i32 noundef %28, i32 noundef 1, i32 noundef %31)
  br label %85

._crit_edge:                                      ; preds = %scalar.ph165, %middle.block164
  %indvars.iv.next137 = add nsw i64 %indvars.iv136, 1
  %lftr.wideiv139 = trunc i64 %indvars.iv.next137 to i32
  %exitcond140.not = icmp eq i32 %35, %lftr.wideiv139
  br i1 %exitcond140.not, label %._crit_edge108, label %.preheader98, !llvm.loop !18

scalar.ph165:                                     ; preds = %scalar.ph165.preheader, %scalar.ph165
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %scalar.ph165 ], [ %indvars.iv132.ph, %scalar.ph165.preheader ]
  %57 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %indvars.iv136, i64 %indvars.iv132
  store i32 %31, ptr %57, align 4, !tbaa !7
  %indvars.iv.next133 = add nsw i64 %indvars.iv132, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next133 to i32
  %exitcond135.not = icmp eq i32 %33, %lftr.wideiv
  br i1 %exitcond135.not, label %._crit_edge, label %scalar.ph165, !llvm.loop !19

58:                                               ; preds = %15
  store i32 1073741824, ptr @mn, align 4, !tbaa !7
  store i32 -1073741824, ptr @mx, align 4, !tbaa !7
  store i32 0, ptr @tot, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 1073741824, ptr %7, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 -1073741824, ptr %8, align 4, !tbaa !7
  %.not88119 = icmp sgt i32 %22, %24
  %.not92115 = icmp sgt i32 %26, %28
  %or.cond162 = select i1 %.not88119, i1 true, i1 %.not92115
  br i1 %or.cond162, label %._crit_edge122, label %.preheader.preheader

.preheader.preheader:                             ; preds = %58
  %59 = sext i32 %26 to i64
  %60 = add i32 %28, 1
  %61 = sext i32 %22 to i64
  %62 = add i32 %24, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge118
  %indvars.iv156 = phi i64 [ %61, %.preheader.preheader ], [ %indvars.iv.next157, %._crit_edge118 ]
  %.072120 = phi i32 [ 0, %.preheader.preheader ], [ %72, %._crit_edge118 ]
  br label %65

._crit_edge122:                                   ; preds = %._crit_edge118, %58
  %.072.lcssa = phi i32 [ 0, %58 ], [ %72, %._crit_edge118 ]
  call void @_Z5queryiiiii(i32 noundef %10, i32 noundef %22, i32 noundef %24, i32 noundef %26, i32 noundef %28)
  %63 = load i32, ptr %7, align 4, !tbaa !7
  %64 = load i32, ptr @mn, align 4, !tbaa !7
  %.not89 = icmp eq i32 %63, %64
  br i1 %.not89, label %75, label %73

._crit_edge118:                                   ; preds = %65
  %indvars.iv.next157 = add nsw i64 %indvars.iv156, 1
  %lftr.wideiv159 = trunc i64 %indvars.iv.next157 to i32
  %exitcond160.not = icmp eq i32 %62, %lftr.wideiv159
  br i1 %exitcond160.not, label %._crit_edge122, label %.preheader, !llvm.loop !20

65:                                               ; preds = %.preheader, %65
  %indvars.iv151 = phi i64 [ %59, %.preheader ], [ %indvars.iv.next152, %65 ]
  %.1116 = phi i32 [ %.072120, %.preheader ], [ %72, %65 ]
  %66 = getelementptr inbounds [2000 x [2000 x i32]], ptr @A, i64 0, i64 %indvars.iv156, i64 %indvars.iv151
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %66)
  %68 = load i32, ptr %67, align 4, !tbaa !7
  store i32 %68, ptr %7, align 4, !tbaa !7
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %66)
  %70 = load i32, ptr %69, align 4, !tbaa !7
  store i32 %70, ptr %8, align 4, !tbaa !7
  %71 = load i32, ptr %66, align 4, !tbaa !7
  %72 = add nsw i32 %71, %.1116
  %indvars.iv.next152 = add nsw i64 %indvars.iv151, 1
  %lftr.wideiv154 = trunc i64 %indvars.iv.next152 to i32
  %exitcond155.not = icmp eq i32 %60, %lftr.wideiv154
  br i1 %exitcond155.not, label %._crit_edge118, label %65, !llvm.loop !21

73:                                               ; preds = %._crit_edge122
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %63, i32 noundef %64)
  br label %75

75:                                               ; preds = %73, %._crit_edge122
  %76 = load i32, ptr @mx, align 4, !tbaa !7
  %77 = load i32, ptr %8, align 4, !tbaa !7
  %.not90 = icmp eq i32 %76, %77
  br i1 %.not90, label %80, label %78

78:                                               ; preds = %75
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %77, i32 noundef %76)
  br label %80

80:                                               ; preds = %78, %75
  %81 = load i32, ptr @tot, align 4, !tbaa !7
  %.not91 = icmp eq i32 %81, %.072.lcssa
  br i1 %.not91, label %84, label %82

82:                                               ; preds = %80
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.072.lcssa, i32 noundef %81)
  br label %84

84:                                               ; preds = %82, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %85

85:                                               ; preds = %._crit_edge108, %84, %._crit_edge114
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %86 = add nsw i32 %16, -1
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %87, label %15, !llvm.loop !22

87:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0
}

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

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

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

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 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 #7 = { 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 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6, !14, !13}
!17 = distinct !{!17, !6, !13, !14}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6, !14, !13}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !6}


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