; LLVM IR from tangjz/acm-icpc :: hdu (6135)

; 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"

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@b = external dso_local global [100001 x i32], align 16
@w = external dso_local global [100001 x i32], align 16
@ord = external dso_local global [100001 x i32], align 16
@tot = external dso_local global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@pos = external dso_local global [100001 x i32], align 16
@sp = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkd(double noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %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
  store i32 0, ptr %1, align 4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %19

19:                                               ; preds = %272, %121, %0
  %20 = load i32, ptr @t, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @t, align 4, !tbaa !5
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %283

23:                                               ; preds = %19
  store i32 0, ptr @tot, align 4, !tbaa !5
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %43, %23
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %46

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr @a, i64 %32
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %33)
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr @tot, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr @tot, align 4, !tbaa !5
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %41
  store i32 %38, ptr %42, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %30
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !9

46:                                               ; preds = %29
  %47 = load i32, ptr @tot, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i32, ptr @que, i64 %48
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %49)
  %50 = load i32, ptr @tot, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr @que, i64 %51
  %53 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %52)
  %54 = ptrtoint ptr %53 to i64
  %55 = sub i64 %54, ptrtoint (ptr @que to i64)
  %56 = sdiv exact i64 %55, 4
  %57 = trunc i64 %56 to i32
  store i32 %57, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %83, %46
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %86

63:                                               ; preds = %58
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr @b, i64 %65
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %66)
  %68 = load i32, ptr @tot, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr @que, i64 %69
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %72
  %74 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %70, ptr noundef nonnull align 4 dereferenceable(4) %73)
  %75 = ptrtoint ptr %74 to i64
  %76 = sub i64 %75, ptrtoint (ptr @que to i64)
  %77 = sdiv exact i64 %76, 4
  %78 = add nsw i64 %77, 1
  %79 = trunc i64 %78 to i32
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %63
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %3, align 4, !tbaa !5
  br label %58, !llvm.loop !11

86:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %101, %86
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %104

92:                                               ; preds = %87
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds i32, ptr @w, i64 %94
  %96 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %95)
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %99
  store i32 %97, ptr %100, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %92
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %4, align 4, !tbaa !5
  br label %87, !llvm.loop !12

104:                                              ; preds = %91
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr @ord, i64 %106
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %107, ptr noundef @_Z3cmpRKiS0_)
  %108 = load i32, ptr @ord, align 16, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = sub nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp eq i32 %111, %119
  br i1 %120, label %121, label %123

121:                                              ; preds = %104
  %122 = call i32 @puts(ptr noundef @.str.2)
  br label %19, !llvm.loop !13

123:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store double 0.000000e+00, ptr %5, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  store double 0.000000e+00, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %181, %123
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = load i32, ptr @n, align 4, !tbaa !5
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %129, label %128

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

129:                                              ; preds = %124
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr @ord, align 16, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp slt i32 %133, %137
  br i1 %138, label %139, label %180

139:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = load i32, ptr @ord, align 16, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sub nsw i32 %143, %147
  store i32 %148, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %149 = load i32, ptr @ord, align 16, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = load i32, ptr %7, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = sub nsw i32 %152, %156
  store i32 %157, ptr %9, align 4, !tbaa !5
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = icmp slt i32 %158, 0
  br i1 %159, label %160, label %165

160:                                              ; preds = %139
  %161 = load i32, ptr %8, align 4, !tbaa !5
  %162 = sub nsw i32 0, %161
  store i32 %162, ptr %8, align 4, !tbaa !5
  %163 = load i32, ptr %9, align 4, !tbaa !5
  %164 = sub nsw i32 0, %163
  store i32 %164, ptr %9, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %160, %139
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = icmp slt i32 %166, 0
  br i1 %167, label %168, label %172

168:                                              ; preds = %165
  %169 = load i32, ptr @m, align 4, !tbaa !5
  %170 = load i32, ptr %8, align 4, !tbaa !5
  %171 = add nsw i32 %170, %169
  store i32 %171, ptr %8, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %168, %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = sitofp i32 %173 to double
  %175 = load i32, ptr %9, align 4, !tbaa !5
  %176 = sitofp i32 %175 to double
  %177 = fdiv double %174, %176
  store double %177, ptr %10, align 8, !tbaa !14
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %179 = load double, ptr %178, align 8, !tbaa !14
  store double %179, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %180

180:                                              ; preds = %172, %129
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %7, align 4, !tbaa !5
  br label %124, !llvm.loop !16

184:                                              ; preds = %128
  br label %185

185:                                              ; preds = %202, %184
  %186 = load double, ptr %6, align 8, !tbaa !14
  %187 = load double, ptr %5, align 8, !tbaa !14
  %188 = fsub double %186, %187
  %189 = fcmp ogt double %188, 5.000000e-07
  br i1 %189, label %190, label %203

190:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %191 = load double, ptr %5, align 8, !tbaa !14
  %192 = load double, ptr %6, align 8, !tbaa !14
  %193 = load double, ptr %5, align 8, !tbaa !14
  %194 = fsub double %192, %193
  %195 = call double @llvm.fmuladd.f64(double %194, double 5.000000e-01, double %191)
  store double %195, ptr %11, align 8, !tbaa !14
  %196 = load double, ptr %11, align 8, !tbaa !14
  %197 = call noundef zeroext i1 @_Z5checkd(double noundef %196)
  br i1 %197, label %198, label %200

198:                                              ; preds = %190
  %199 = load double, ptr %11, align 8, !tbaa !14
  store double %199, ptr %6, align 8, !tbaa !14
  br label %202

200:                                              ; preds = %190
  %201 = load double, ptr %11, align 8, !tbaa !14
  store double %201, ptr %5, align 8, !tbaa !14
  br label %202

202:                                              ; preds = %200, %198
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %185, !llvm.loop !17

203:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1000000, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 1, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %269, %203
  %205 = load i32, ptr %14, align 4, !tbaa !5
  %206 = load i32, ptr @n, align 4, !tbaa !5
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %209, label %208

208:                                              ; preds = %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %272

209:                                              ; preds = %204
  %210 = load i32, ptr %14, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = load i32, ptr @sp, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = icmp sgt i32 %213, %217
  br i1 %218, label %219, label %268

219:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %220 = load i32, ptr %14, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = load i32, ptr @sp, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = sub nsw i32 %223, %227
  store i32 %228, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %229 = load i32, ptr @sp, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = load i32, ptr %14, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = sub nsw i32 %232, %236
  store i32 %237, ptr %16, align 4, !tbaa !5
  %238 = load i32, ptr %16, align 4, !tbaa !5
  %239 = icmp slt i32 %238, 0
  br i1 %239, label %240, label %245

240:                                              ; preds = %219
  %241 = load i32, ptr %15, align 4, !tbaa !5
  %242 = sub nsw i32 0, %241
  store i32 %242, ptr %15, align 4, !tbaa !5
  %243 = load i32, ptr %16, align 4, !tbaa !5
  %244 = sub nsw i32 0, %243
  store i32 %244, ptr %16, align 4, !tbaa !5
  br label %245

245:                                              ; preds = %240, %219
  %246 = load i32, ptr %15, align 4, !tbaa !5
  %247 = icmp slt i32 %246, 0
  br i1 %247, label %248, label %252

248:                                              ; preds = %245
  %249 = load i32, ptr @m, align 4, !tbaa !5
  %250 = load i32, ptr %15, align 4, !tbaa !5
  %251 = add nsw i32 %250, %249
  store i32 %251, ptr %15, align 4, !tbaa !5
  br label %252

252:                                              ; preds = %248, %245
  %253 = load i32, ptr %15, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = load i32, ptr %13, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = mul nsw i64 %254, %256
  %258 = load i32, ptr %12, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = load i32, ptr %16, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = mul nsw i64 %259, %261
  %263 = icmp slt i64 %257, %262
  br i1 %263, label %264, label %267

264:                                              ; preds = %252
  %265 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %265, ptr %12, align 4, !tbaa !5
  %266 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %266, ptr %13, align 4, !tbaa !5
  br label %267

267:                                              ; preds = %264, %252
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %268

268:                                              ; preds = %267, %209
  br label %269

269:                                              ; preds = %268
  %270 = load i32, ptr %14, align 4, !tbaa !5
  %271 = add nsw i32 %270, 1
  store i32 %271, ptr %14, align 4, !tbaa !5
  br label %204, !llvm.loop !18

272:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %273 = load i32, ptr %12, align 4, !tbaa !5
  %274 = load i32, ptr %13, align 4, !tbaa !5
  %275 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %273, i32 noundef %274)
  store i32 %275, ptr %17, align 4, !tbaa !5
  %276 = load i32, ptr %12, align 4, !tbaa !5
  %277 = load i32, ptr %17, align 4, !tbaa !5
  %278 = sdiv i32 %276, %277
  %279 = load i32, ptr %13, align 4, !tbaa !5
  %280 = load i32, ptr %17, align 4, !tbaa !5
  %281 = sdiv i32 %279, %280
  %282 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %278, i32 noundef %281)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %19, !llvm.loop !13

283:                                              ; preds = %19
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) #7

declare i32 @puts(ptr noundef) #6

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

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

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@b = external dso_local global [100001 x i32], align 16
@w = external dso_local global [100001 x i32], align 16
@ord = external dso_local global [100001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@pos = external dso_local local_unnamed_addr global [100001 x i32], align 16
@sp = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkd(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 {
  %1 = alloca double, align 8
  %2 = alloca double, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr @t, align 4, !tbaa !5
  %.not96 = icmp eq i32 %4, 0
  br i1 %.not96, label %._crit_edge99, label %.lr.ph98

.lr.ph98:                                         ; preds = %0, %.backedge
  store i32 0, ptr @tot, align 4, !tbaa !5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.lr.ph98.._crit_edge_crit_edge

.lr.ph98.._crit_edge_crit_edge:                   ; preds = %.lr.ph98
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph98.._crit_edge_crit_edge
  %9 = phi i32 [ %.pre, %.lr.ph98.._crit_edge_crit_edge ], [ %26, %.lr.ph ]
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds i32, ptr @que, i64 %10
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %11)
  %12 = load i32, ptr @tot, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds i32, ptr @que, i64 %13
  %15 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %14)
  %16 = ptrtoint ptr %15 to i64
  %17 = sub i64 %16, ptrtoint (ptr @que to i64)
  %18 = lshr exact i64 %17, 2
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr @tot, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph80, label %.preheader76.._crit_edge83_crit_edge

.lr.ph:                                           ; preds = %.lr.ph98, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph98 ]
  %22 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %22)
  %24 = load i32, ptr %22, align 4, !tbaa !5
  %25 = load i32, ptr @tot, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @tot, align 4, !tbaa !5
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %27
  store i32 %24, ptr %28, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader76:                                     ; preds = %.lr.ph80
  %32 = icmp sgt i32 %47, 0
  br i1 %32, label %.lr.ph82, label %.preheader76.._crit_edge83_crit_edge

.preheader76.._crit_edge83_crit_edge:             ; preds = %._crit_edge, %.preheader76
  %33 = phi i32 [ %47, %.preheader76 ], [ %20, %._crit_edge ]
  %.pre119 = sext i32 %33 to i64
  br label %._crit_edge83

.lr.ph80:                                         ; preds = %._crit_edge, %.lr.ph80
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %.lr.ph80 ], [ 0, %._crit_edge ]
  %34 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv102
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %34)
  %36 = load i32, ptr @tot, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr @que, i64 %37
  %39 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv102
  %40 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %38, ptr noundef nonnull align 4 dereferenceable(4) %39)
  %41 = ptrtoint ptr %40 to i64
  %42 = sub i64 %41, ptrtoint (ptr @que to i64)
  %43 = lshr exact i64 %42, 2
  %44 = trunc i64 %43 to i32
  %45 = add i32 %44, 1
  %46 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %indvars.iv102
  store i32 %45, ptr %46, align 4, !tbaa !5
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next103, %48
  br i1 %49, label %.lr.ph80, label %.preheader76, !llvm.loop !11

._crit_edge83:                                    ; preds = %.lr.ph82, %.preheader76.._crit_edge83_crit_edge
  %.pre-phi = phi i64 [ %.pre119, %.preheader76.._crit_edge83_crit_edge ], [ %69, %.lr.ph82 ]
  %50 = getelementptr inbounds i32, ptr @ord, i64 %.pre-phi
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %50, ptr noundef nonnull @_Z3cmpRKiS0_)
  %51 = load i32, ptr @ord, align 16, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = add nsw i32 %55, -1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp eq i32 %54, %62
  br i1 %63, label %71, label %75

.lr.ph82:                                         ; preds = %.preheader76, %.lr.ph82
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph82 ], [ 0, %.preheader76 ]
  %64 = getelementptr inbounds i32, ptr @w, i64 %indvars.iv105
  %65 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %64)
  %66 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv105
  %67 = trunc nuw nsw i64 %indvars.iv105 to i32
  store i32 %67, ptr %66, align 4, !tbaa !5
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next106, %69
  br i1 %70, label %.lr.ph82, label %._crit_edge83, !llvm.loop !12

71:                                               ; preds = %._crit_edge83
  %72 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.backedge

.backedge:                                        ; preds = %71, %._crit_edge93
  %73 = load i32, ptr @t, align 4, !tbaa !5
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %73, 0
  br i1 %.not, label %._crit_edge99, label %.lr.ph98, !llvm.loop !13

75:                                               ; preds = %._crit_edge83
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  store double 0.000000e+00, ptr %1, align 8, !tbaa !14
  %76 = icmp sgt i32 %55, 0
  br i1 %76, label %.lr.ph86, label %._crit_edge93

.preheader75:                                     ; preds = %108
  %77 = fcmp ogt double %109, 5.000000e-07
  br i1 %77, label %.lr.ph88, label %.preheader

.lr.ph86:                                         ; preds = %75, %108
  %78 = phi double [ %109, %108 ], [ 0.000000e+00, %75 ]
  %79 = phi i32 [ %110, %108 ], [ %55, %75 ]
  %80 = phi i32 [ %111, %108 ], [ %51, %75 ]
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %108 ], [ 0, %75 ]
  %81 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %indvars.iv108
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %80 to i64
  %84 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp slt i32 %82, %85
  br i1 %86, label %87, label %108

87:                                               ; preds = %.lr.ph86
  %88 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv108
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %83
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sub nsw i32 %89, %91
  %93 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %83
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %indvars.iv108
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sub nsw i32 %94, %96
  %98 = icmp slt i32 %97, 0
  %99 = sub nsw i32 0, %92
  %.063 = select i1 %98, i32 %99, i32 %92
  %.062 = call i32 @llvm.abs.i32(i32 %97, i1 true)
  %100 = icmp slt i32 %.063, 0
  %101 = load i32, ptr @m, align 4
  %102 = select i1 %100, i32 %101, i32 0
  %.164 = add nsw i32 %102, %.063
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  %103 = sitofp i32 %.164 to double
  %104 = uitofp nneg i32 %.062 to double
  %105 = fdiv double %103, %104
  store double %105, ptr %2, align 8, !tbaa !14
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %107 = load double, ptr %106, align 8, !tbaa !14
  store double %107, ptr %1, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  %.pre114 = load i32, ptr @ord, align 16, !tbaa !5
  %.pre116 = load i32, ptr @n, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %.lr.ph86, %87
  %109 = phi double [ %78, %.lr.ph86 ], [ %107, %87 ]
  %110 = phi i32 [ %79, %.lr.ph86 ], [ %.pre116, %87 ]
  %111 = phi i32 [ %80, %.lr.ph86 ], [ %.pre114, %87 ]
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %112 = sext i32 %110 to i64
  %113 = icmp slt i64 %indvars.iv.next109, %112
  br i1 %113, label %.lr.ph86, label %.preheader75, !llvm.loop !16

.preheader.loopexit:                              ; preds = %127
  %.pre118 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader75
  %114 = phi i32 [ %.pre118, %.preheader.loopexit ], [ %110, %.preheader75 ]
  %115 = icmp sgt i32 %114, 0
  br i1 %115, label %.lr.ph92, label %._crit_edge93

.lr.ph92:                                         ; preds = %.preheader
  %116 = load i32, ptr @sp, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %117
  %121 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %117
  %122 = load i32, ptr @m, align 4
  %wide.trip.count = zext nneg i32 %114 to i64
  br label %135

.lr.ph88:                                         ; preds = %.preheader75, %127
  %123 = phi double [ %129, %127 ], [ %109, %.preheader75 ]
  %.06687 = phi double [ %.167, %127 ], [ 0.000000e+00, %.preheader75 ]
  %124 = call double @llvm.fmuladd.f64(double %123, double 5.000000e-01, double %.06687)
  %125 = call noundef zeroext i1 @_Z5checkd(double noundef %124)
  br i1 %125, label %126, label %.lr.ph88._crit_edge

.lr.ph88._crit_edge:                              ; preds = %.lr.ph88
  %.pre117 = load double, ptr %1, align 8, !tbaa !14
  br label %127

126:                                              ; preds = %.lr.ph88
  store double %124, ptr %1, align 8, !tbaa !14
  br label %127

127:                                              ; preds = %.lr.ph88._crit_edge, %126
  %128 = phi double [ %124, %126 ], [ %.pre117, %.lr.ph88._crit_edge ]
  %.167 = phi double [ %.06687, %126 ], [ %124, %.lr.ph88._crit_edge ]
  %129 = fsub double %128, %.167
  %130 = fcmp ogt double %129, 5.000000e-07
  br i1 %130, label %.lr.ph88, label %.preheader.loopexit, !llvm.loop !17

._crit_edge93:                                    ; preds = %159, %75, %.preheader
  %.058.lcssa = phi i32 [ 1000000, %.preheader ], [ 1000000, %75 ], [ %.260, %159 ]
  %.056.lcssa = phi i32 [ 1, %.preheader ], [ 1, %75 ], [ %.2, %159 ]
  %131 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %.058.lcssa, i32 noundef %.056.lcssa)
  %132 = sdiv i32 %.058.lcssa, %131
  %133 = sdiv i32 %.056.lcssa, %131
  %134 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %132, i32 noundef %133)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  br label %.backedge

135:                                              ; preds = %.lr.ph92, %159
  %indvars.iv111 = phi i64 [ 0, %.lr.ph92 ], [ %indvars.iv.next112, %159 ]
  %.05690 = phi i32 [ 1, %.lr.ph92 ], [ %.2, %159 ]
  %.05889 = phi i32 [ 1000000, %.lr.ph92 ], [ %.260, %159 ]
  %136 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %indvars.iv111
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp sgt i32 %137, %119
  br i1 %138, label %139, label %159

139:                                              ; preds = %135
  %140 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv111
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = load i32, ptr %120, align 4, !tbaa !5
  %143 = sub nsw i32 %141, %142
  %144 = load i32, ptr %121, align 4, !tbaa !5
  %145 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %indvars.iv111
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sub nsw i32 %144, %146
  %148 = icmp slt i32 %147, 0
  %149 = sub nsw i32 0, %143
  %.054 = select i1 %148, i32 %149, i32 %143
  %.053 = call i32 @llvm.abs.i32(i32 %147, i1 true)
  %150 = icmp slt i32 %.054, 0
  %151 = select i1 %150, i32 %122, i32 0
  %.1 = add nsw i32 %151, %.054
  %152 = sext i32 %.1 to i64
  %153 = zext nneg i32 %.05690 to i64
  %154 = mul nsw i64 %152, %153
  %155 = sext i32 %.05889 to i64
  %156 = zext nneg i32 %.053 to i64
  %157 = mul nsw i64 %156, %155
  %158 = icmp slt i64 %154, %157
  %.159 = select i1 %158, i32 %.1, i32 %.05889
  %.157 = select i1 %158, i32 %.053, i32 %.05690
  br label %159

159:                                              ; preds = %135, %139
  %.260 = phi i32 [ %.159, %139 ], [ %.05889, %135 ]
  %.2 = phi i32 [ %.157, %139 ], [ %.05690, %135 ]
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge93, label %135, !llvm.loop !18

._crit_edge99:                                    ; preds = %.backedge, %0
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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