; LLVM IR from tangjz/acm-icpc :: codeforces/complete (543C)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@c = external dso_local global [21 x [26 x i32]], align 16
@id = external dso_local global [21 x i32], align 16
@f = external dso_local global [2097152 x i32], align 16
@str = external dso_local global [21 x [26 x i8]], align 16
@que = external dso_local global [21 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; 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)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, 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
  %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
  store i32 0, ptr %1, align 4
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %29, %0
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %32

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %25
  %27 = getelementptr inbounds [26 x i8], ptr %26, i64 0, i64 0
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %27)
  br label %29

29:                                               ; preds = %23
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

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

33:                                               ; preds = %57, %32
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %60

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %53, %38
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %56

44:                                               ; preds = %39
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %46
  %48 = getelementptr inbounds [26 x i32], ptr %47, i64 0, i64 0
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %51)
  br label %53

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

56:                                               ; preds = %43
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !5
  br label %33, !llvm.loop !12

60:                                               ; preds = %37
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 63, i64 8388608, i1 false)
  store i32 0, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %292, %60
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = load i32, ptr @m, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %295

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %87, %66
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %90

72:                                               ; preds = %67
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %74
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [26 x i8], ptr %75, i64 0, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !13
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [21 x i8], ptr @que, i64 0, i64 %81
  store i8 %79, ptr %82, align 1, !tbaa !13
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %85
  store i32 %83, ptr %86, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %72
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %7, align 4, !tbaa !5
  br label %67, !llvm.loop !14

90:                                               ; preds = %71
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr @id, i64 %92
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @id, ptr noundef %93, ptr noundef @_Z3cmpRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  br label %94

94:                                               ; preds = %289, %90
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %291

99:                                               ; preds = %94
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %9, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %128, %99
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %106, label %125

106:                                              ; preds = %102
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [21 x i8], ptr @que, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = sext i8 %114 to i32
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [21 x i8], ptr @que, i64 0, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !13
  %123 = sext i8 %122 to i32
  %124 = icmp eq i32 %115, %123
  br label %125

125:                                              ; preds = %106, %102
  %126 = phi i1 [ false, %102 ], [ %124, %106 ]
  br i1 %126, label %127, label %131

127:                                              ; preds = %125
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %9, align 4, !tbaa !5
  br label %102, !llvm.loop !15

131:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %132 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %132, ptr %13, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %182, %131
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %185

138:                                              ; preds = %133
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %143
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [26 x i32], ptr %144, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = add nsw i32 %149, %148
  store i32 %150, ptr %10, align 4, !tbaa !5
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %156
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [26 x i32], ptr %157, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = icmp slt i32 %151, %161
  br i1 %162, label %163, label %174

163:                                              ; preds = %138
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %168
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [26 x i32], ptr %169, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  store i32 %173, ptr %11, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %163, %138
  %175 = load i32, ptr %13, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = shl i32 1, %178
  %180 = load i32, ptr %12, align 4, !tbaa !5
  %181 = or i32 %180, %179
  store i32 %181, ptr %12, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %174
  %183 = load i32, ptr %13, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %13, align 4, !tbaa !5
  br label %133, !llvm.loop !16

185:                                              ; preds = %137
  %186 = load i32, ptr %11, align 4, !tbaa !5
  %187 = load i32, ptr %10, align 4, !tbaa !5
  %188 = sub nsw i32 %187, %186
  store i32 %188, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %222, %185
  %190 = load i32, ptr %14, align 4, !tbaa !5
  %191 = load i32, ptr @n, align 4, !tbaa !5
  %192 = shl i32 1, %191
  %193 = icmp slt i32 %190, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %189
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %225

195:                                              ; preds = %189
  %196 = load i32, ptr %14, align 4, !tbaa !5
  %197 = load i32, ptr %12, align 4, !tbaa !5
  %198 = or i32 %196, %197
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = load i32, ptr %14, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = load i32, ptr %10, align 4, !tbaa !5
  %207 = add nsw i32 %205, %206
  %208 = icmp sgt i32 %201, %207
  br i1 %208, label %209, label %221

209:                                              ; preds = %195
  %210 = load i32, ptr %14, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = load i32, ptr %10, align 4, !tbaa !5
  %215 = add nsw i32 %213, %214
  %216 = load i32, ptr %14, align 4, !tbaa !5
  %217 = load i32, ptr %12, align 4, !tbaa !5
  %218 = or i32 %216, %217
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %219
  store i32 %215, ptr %220, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %209, %195
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %14, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %14, align 4, !tbaa !5
  br label %189, !llvm.loop !17

225:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %226 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %226, ptr %15, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %285, %225
  %228 = load i32, ptr %15, align 4, !tbaa !5
  %229 = load i32, ptr %9, align 4, !tbaa !5
  %230 = icmp slt i32 %228, %229
  br i1 %230, label %232, label %231

231:                                              ; preds = %227
  store i32 29, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %288

232:                                              ; preds = %227
  %233 = load i32, ptr %15, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %237
  %239 = load i32, ptr %6, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [26 x i32], ptr %238, i64 0, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !5
  store i32 %242, ptr %10, align 4, !tbaa !5
  %243 = load i32, ptr %15, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %244
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = shl i32 1, %246
  store i32 %247, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %281, %232
  %249 = load i32, ptr %16, align 4, !tbaa !5
  %250 = load i32, ptr @n, align 4, !tbaa !5
  %251 = shl i32 1, %250
  %252 = icmp slt i32 %249, %251
  br i1 %252, label %254, label %253

253:                                              ; preds = %248
  store i32 32, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %284

254:                                              ; preds = %248
  %255 = load i32, ptr %16, align 4, !tbaa !5
  %256 = load i32, ptr %12, align 4, !tbaa !5
  %257 = or i32 %255, %256
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = load i32, ptr %16, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = load i32, ptr %10, align 4, !tbaa !5
  %266 = add nsw i32 %264, %265
  %267 = icmp sgt i32 %260, %266
  br i1 %267, label %268, label %280

268:                                              ; preds = %254
  %269 = load i32, ptr %16, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !5
  %273 = load i32, ptr %10, align 4, !tbaa !5
  %274 = add nsw i32 %272, %273
  %275 = load i32, ptr %16, align 4, !tbaa !5
  %276 = load i32, ptr %12, align 4, !tbaa !5
  %277 = or i32 %275, %276
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %278
  store i32 %274, ptr %279, align 4, !tbaa !5
  br label %280

280:                                              ; preds = %268, %254
  br label %281

281:                                              ; preds = %280
  %282 = load i32, ptr %16, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %16, align 4, !tbaa !5
  br label %248, !llvm.loop !18

284:                                              ; preds = %253
  br label %285

285:                                              ; preds = %284
  %286 = load i32, ptr %15, align 4, !tbaa !5
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %15, align 4, !tbaa !5
  br label %227, !llvm.loop !19

288:                                              ; preds = %231
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %289

289:                                              ; preds = %288
  %290 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %290, ptr %8, align 4, !tbaa !5
  br label %94, !llvm.loop !20

291:                                              ; preds = %98
  br label %292

292:                                              ; preds = %291
  %293 = load i32, ptr %6, align 4, !tbaa !5
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr %6, align 4, !tbaa !5
  br label %61, !llvm.loop !21

295:                                              ; preds = %65
  %296 = load i32, ptr @n, align 4, !tbaa !5
  %297 = shl i32 1, %296
  %298 = sub nsw i32 %297, 1
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %299
  %301 = load i32, ptr %300, align 4, !tbaa !5
  %302 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %301)
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !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"

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@c = external dso_local global [21 x [26 x i32]], align 16
@id = external dso_local global [21 x i32], align 16
@f = external dso_local local_unnamed_addr global [2097152 x i32], align 16
@str = external dso_local global [21 x [26 x i8]], align 16
@que = external dso_local local_unnamed_addr global [21 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; 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)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.preheader89.thread

.preheader89.thread:                              ; preds = %0
  %.pre166167 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge95

.preheader89:                                     ; preds = %.lr.ph
  %4 = icmp sgt i32 %8, 0
  %.pre166 = load i32, ptr @m, align 4, !tbaa !5
  br i1 %4, label %.preheader88.lr.ph, label %._crit_edge95

.preheader88.lr.ph:                               ; preds = %.preheader89
  %5 = icmp sgt i32 %.pre166, 0
  br i1 %5, label %.preheader88, label %._crit_edge95.thread

._crit_edge95.thread:                             ; preds = %.preheader88.lr.ph
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8388608) @f, i8 63, i64 8388608, i1 false)
  store i32 0, ptr @f, align 16, !tbaa !5
  br label %._crit_edge123

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %6 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %indvars.iv
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = icmp slt i64 %indvars.iv.next, %9
  br i1 %10, label %.lr.ph, label %.preheader89, !llvm.loop !9

.preheader88:                                     ; preds = %.preheader88.lr.ph, %._crit_edge
  %11 = phi i32 [ %18, %._crit_edge ], [ %8, %.preheader88.lr.ph ]
  %12 = phi i32 [ %19, %._crit_edge ], [ %.pre166, %.preheader88.lr.ph ]
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %._crit_edge ], [ 0, %.preheader88.lr.ph ]
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph93, label %._crit_edge

.lr.ph93:                                         ; preds = %.preheader88
  %14 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %indvars.iv133
  br label %22

._crit_edge95:                                    ; preds = %._crit_edge, %.preheader89.thread, %.preheader89
  %15 = phi i32 [ %8, %.preheader89 ], [ %2, %.preheader89.thread ], [ %18, %._crit_edge ]
  %16 = phi i32 [ %.pre166, %.preheader89 ], [ %.pre166167, %.preheader89.thread ], [ %19, %._crit_edge ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8388608) @f, i8 63, i64 8388608, i1 false)
  store i32 0, ptr @f, align 16, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader87, label %._crit_edge123

._crit_edge.loopexit:                             ; preds = %22
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader88
  %18 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %11, %.preheader88 ]
  %19 = phi i32 [ %25, %._crit_edge.loopexit ], [ %12, %.preheader88 ]
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %20 = sext i32 %18 to i64
  %21 = icmp slt i64 %indvars.iv.next134, %20
  br i1 %21, label %.preheader88, label %._crit_edge95, !llvm.loop !11

22:                                               ; preds = %.lr.ph93, %22
  %indvars.iv130 = phi i64 [ 0, %.lr.ph93 ], [ %indvars.iv.next131, %22 ]
  %23 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv130
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %23)
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next131, %26
  br i1 %27, label %22, label %._crit_edge.loopexit, !llvm.loop !13

.preheader87:                                     ; preds = %._crit_edge95, %._crit_edge121
  %28 = phi i32 [ %74, %._crit_edge121 ], [ %15, %._crit_edge95 ]
  %indvars.iv163 = phi i64 [ %indvars.iv.next164, %._crit_edge121 ], [ 0, %._crit_edge95 ]
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph97, label %._crit_edge98

.lr.ph97:                                         ; preds = %.preheader87
  %wide.trip.count = zext nneg i32 %28 to i64
  %min.iters.check = icmp ult i32 %28, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph97
  %indvars.iv136.ph = phi i64 [ 0, %.lr.ph97 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph97
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %30 = or disjoint i64 %index, 1
  %31 = or disjoint i64 %index, 2
  %32 = or disjoint i64 %index, 3
  %33 = or disjoint i64 %index, 4
  %34 = or disjoint i64 %index, 5
  %35 = or disjoint i64 %index, 6
  %36 = or disjoint i64 %index, 7
  %37 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %index, i64 %indvars.iv163
  %38 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %30, i64 %indvars.iv163
  %39 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %31, i64 %indvars.iv163
  %40 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %32, i64 %indvars.iv163
  %41 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %33, i64 %indvars.iv163
  %42 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %34, i64 %indvars.iv163
  %43 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %35, i64 %indvars.iv163
  %44 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %36, i64 %indvars.iv163
  %45 = load i8, ptr %37, align 1, !tbaa !14
  %46 = load i8, ptr %38, align 1, !tbaa !14
  %47 = load i8, ptr %39, align 1, !tbaa !14
  %48 = load i8, ptr %40, align 1, !tbaa !14
  %49 = insertelement <4 x i8> poison, i8 %45, i64 0
  %50 = insertelement <4 x i8> %49, i8 %46, i64 1
  %51 = insertelement <4 x i8> %50, i8 %47, i64 2
  %52 = insertelement <4 x i8> %51, i8 %48, i64 3
  %53 = load i8, ptr %41, align 1, !tbaa !14
  %54 = load i8, ptr %42, align 1, !tbaa !14
  %55 = load i8, ptr %43, align 1, !tbaa !14
  %56 = load i8, ptr %44, align 1, !tbaa !14
  %57 = insertelement <4 x i8> poison, i8 %53, i64 0
  %58 = insertelement <4 x i8> %57, i8 %54, i64 1
  %59 = insertelement <4 x i8> %58, i8 %55, i64 2
  %60 = insertelement <4 x i8> %59, i8 %56, i64 3
  %61 = getelementptr inbounds [21 x i8], ptr @que, i64 0, i64 %index
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  store <4 x i8> %52, ptr %61, align 8, !tbaa !14
  store <4 x i8> %60, ptr %62, align 4, !tbaa !14
  %63 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %index
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  store <4 x i32> %vec.ind, ptr %63, align 16, !tbaa !5
  store <4 x i32> %step.add, ptr %64, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %65 = icmp eq i64 %index.next, %n.vec
  br i1 %65, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge98, label %scalar.ph.preheader

._crit_edge123:                                   ; preds = %._crit_edge121, %._crit_edge95.thread, %._crit_edge95
  %66 = phi i32 [ %15, %._crit_edge95 ], [ %8, %._crit_edge95.thread ], [ %74, %._crit_edge121 ]
  %notmask = shl nsw i32 -1, %66
  %67 = xor i32 %notmask, -1
  %68 = zext nneg i32 %67 to i64
  %69 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %70)
  ret i32 0

._crit_edge98:                                    ; preds = %scalar.ph, %middle.block, %.preheader87
  %72 = sext i32 %28 to i64
  %73 = getelementptr inbounds i32, ptr @id, i64 %72
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @id, ptr noundef nonnull %73, ptr noundef nonnull @_Z3cmpRKiS0_)
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.preheader86.lr.ph, label %._crit_edge121

.preheader86.lr.ph:                               ; preds = %._crit_edge98
  %76 = shl nuw i32 1, %74
  %.not124 = icmp eq i32 %74, 31
  %77 = zext nneg i32 %74 to i64
  %smax149 = tail call i32 @llvm.smax.i32(i32 %76, i32 1)
  %wide.trip.count150 = zext nneg i32 %smax149 to i64
  %78 = add nsw i64 %wide.trip.count150, -1
  %xtraiter199 = and i64 %wide.trip.count150, 1
  %79 = icmp eq i64 %78, 0
  %unroll_iter201 = and i64 %wide.trip.count150, 2147483646
  %lcmp.mod200.not = icmp eq i64 %xtraiter199, 0
  %xtraiter203 = and i64 %wide.trip.count150, 1
  %80 = icmp eq i64 %78, 0
  %unroll_iter205 = and i64 %wide.trip.count150, 2147483646
  %lcmp.mod204.not = icmp eq i64 %xtraiter203, 0
  br label %.preheader86

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv136 = phi i64 [ %indvars.iv.next137, %scalar.ph ], [ %indvars.iv136.ph, %scalar.ph.preheader ]
  %81 = getelementptr inbounds [21 x [26 x i8]], ptr @str, i64 0, i64 %indvars.iv136, i64 %indvars.iv163
  %82 = load i8, ptr %81, align 1, !tbaa !14
  %83 = getelementptr inbounds [21 x i8], ptr @que, i64 0, i64 %indvars.iv136
  store i8 %82, ptr %83, align 1, !tbaa !14
  %84 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %indvars.iv136
  %85 = trunc nuw nsw i64 %indvars.iv136 to i32
  store i32 %85, ptr %84, align 4, !tbaa !5
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge98, label %scalar.ph, !llvm.loop !18

.loopexit:                                        ; preds = %._crit_edge116.us, %.preheader, %._crit_edge105, %._crit_edge105.thread
  %86 = icmp slt i32 %.074.lcssa, %74
  br i1 %86, label %.preheader86, label %._crit_edge121, !llvm.loop !19

.preheader86:                                     ; preds = %.preheader86.lr.ph, %.loopexit
  %.075120 = phi i32 [ 0, %.preheader86.lr.ph ], [ %.074.lcssa, %.loopexit ]
  %87 = sext i32 %.075120 to i64
  %88 = add nsw i32 %.075120, 1
  %smax = tail call i32 @llvm.smax.i32(i32 %74, i32 %88)
  %89 = add nsw i32 %smax, -1
  br label %93

._crit_edge121:                                   ; preds = %.loopexit, %._crit_edge98
  %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
  %90 = load i32, ptr @m, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = icmp slt i64 %indvars.iv.next164, %91
  br i1 %92, label %.preheader87, label %._crit_edge123, !llvm.loop !20

93:                                               ; preds = %.preheader86, %95
  %indvars.iv139 = phi i64 [ %87, %.preheader86 ], [ %indvars.iv.next140, %95 ]
  %indvars.iv.next140 = add nsw i64 %indvars.iv139, 1
  %94 = icmp slt i64 %indvars.iv.next140, %77
  br i1 %94, label %95, label %.critedge

95:                                               ; preds = %93
  %96 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %indvars.iv139
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [21 x i8], ptr @que, i64 0, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !14
  %101 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %indvars.iv.next140
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [21 x i8], ptr @que, i64 0, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !14
  %106 = icmp eq i8 %100, %105
  br i1 %106, label %93, label %.critedge.split.loop.exit176, !llvm.loop !21

.critedge.split.loop.exit176:                     ; preds = %95
  %107 = trunc nsw i64 %indvars.iv139 to i32
  %108 = trunc nsw i64 %indvars.iv.next140 to i32
  br label %.critedge

.critedge:                                        ; preds = %93, %.critedge.split.loop.exit176
  %.074.in.lcssa = phi i32 [ %107, %.critedge.split.loop.exit176 ], [ %89, %93 ]
  %.074.lcssa = phi i32 [ %108, %.critedge.split.loop.exit176 ], [ %smax, %93 ]
  %.not99 = icmp sgt i32 %.075120, %.074.in.lcssa
  br i1 %.not99, label %._crit_edge105.thread, label %.lr.ph104.preheader

.lr.ph104.preheader:                              ; preds = %.critedge
  %109 = add i32 %.074.in.lcssa, 1
  %110 = sub i32 %109, %.075120
  %xtraiter = and i32 %110, 1
  %111 = icmp eq i32 %.074.in.lcssa, %.075120
  br i1 %111, label %._crit_edge105.unr-lcssa, label %.lr.ph104.preheader.new

.lr.ph104.preheader.new:                          ; preds = %.lr.ph104.preheader
  %unroll_iter = and i32 %110, -2
  br label %.lr.ph104

._crit_edge105.unr-lcssa:                         ; preds = %.lr.ph104, %.lr.ph104.preheader
  %.lcssa190.ph = phi i32 [ poison, %.lr.ph104.preheader ], [ %135, %.lr.ph104 ]
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph104.preheader ], [ %spec.select.1, %.lr.ph104 ]
  %.lcssa.ph = phi i32 [ poison, %.lr.ph104.preheader ], [ %137, %.lr.ph104 ]
  %indvars.iv142.unr = phi i64 [ %87, %.lr.ph104.preheader ], [ %indvars.iv.next143.1, %.lr.ph104 ]
  %.071102.unr = phi i32 [ 0, %.lr.ph104.preheader ], [ %137, %.lr.ph104 ]
  %.072101.unr = phi i32 [ 0, %.lr.ph104.preheader ], [ %spec.select.1, %.lr.ph104 ]
  %.073100.unr = phi i32 [ 0, %.lr.ph104.preheader ], [ %135, %.lr.ph104 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge105, label %.lr.ph104.epil

.lr.ph104.epil:                                   ; preds = %._crit_edge105.unr-lcssa
  %112 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %indvars.iv142.unr
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %114, i64 %indvars.iv163
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = add nsw i32 %116, %.073100.unr
  %spec.select.epil = tail call i32 @llvm.smax.i32(i32 %.072101.unr, i32 %116)
  %118 = shl nuw i32 1, %113
  %119 = or i32 %118, %.071102.unr
  br label %._crit_edge105

._crit_edge105:                                   ; preds = %._crit_edge105.unr-lcssa, %.lr.ph104.epil
  %.lcssa190 = phi i32 [ %.lcssa190.ph, %._crit_edge105.unr-lcssa ], [ %117, %.lr.ph104.epil ]
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %._crit_edge105.unr-lcssa ], [ %spec.select.epil, %.lr.ph104.epil ]
  %.lcssa = phi i32 [ %.lcssa.ph, %._crit_edge105.unr-lcssa ], [ %119, %.lr.ph104.epil ]
  %120 = sub nsw i32 %.lcssa190, %spec.select.lcssa
  br i1 %.not124, label %.loopexit, label %.lr.ph111.preheader

._crit_edge105.thread:                            ; preds = %.critedge
  br i1 %.not124, label %.loopexit, label %.lr.ph111.preheader

.lr.ph111.preheader:                              ; preds = %._crit_edge105.thread, %._crit_edge105
  %121 = phi i32 [ 0, %._crit_edge105.thread ], [ %120, %._crit_edge105 ]
  %.071.lcssa169 = phi i32 [ 0, %._crit_edge105.thread ], [ %.lcssa, %._crit_edge105 ]
  br i1 %79, label %.preheader.unr-lcssa, label %.lr.ph111

.lr.ph104:                                        ; preds = %.lr.ph104, %.lr.ph104.preheader.new
  %indvars.iv142 = phi i64 [ %87, %.lr.ph104.preheader.new ], [ %indvars.iv.next143.1, %.lr.ph104 ]
  %.071102 = phi i32 [ 0, %.lr.ph104.preheader.new ], [ %137, %.lr.ph104 ]
  %.072101 = phi i32 [ 0, %.lr.ph104.preheader.new ], [ %spec.select.1, %.lr.ph104 ]
  %.073100 = phi i32 [ 0, %.lr.ph104.preheader.new ], [ %135, %.lr.ph104 ]
  %niter = phi i32 [ 0, %.lr.ph104.preheader.new ], [ %niter.next.1, %.lr.ph104 ]
  %122 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %indvars.iv142
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %124, i64 %indvars.iv163
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = add nsw i32 %126, %.073100
  %spec.select = tail call i32 @llvm.smax.i32(i32 %.072101, i32 %126)
  %128 = shl nuw i32 1, %123
  %129 = or i32 %128, %.071102
  %indvars.iv.next143 = add nsw i64 %indvars.iv142, 1
  %130 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %indvars.iv.next143
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %132, i64 %indvars.iv163
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = add nsw i32 %134, %127
  %spec.select.1 = tail call i32 @llvm.smax.i32(i32 %spec.select, i32 %134)
  %136 = shl nuw i32 1, %131
  %137 = or i32 %136, %129
  %indvars.iv.next143.1 = add nsw i64 %indvars.iv142, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge105.unr-lcssa, label %.lr.ph104, !llvm.loop !22

.preheader.unr-lcssa:                             ; preds = %207, %.lr.ph111.preheader
  %indvars.iv146.unr = phi i64 [ 0, %.lr.ph111.preheader ], [ %indvars.iv.next147.1, %207 ]
  br i1 %lcmp.mod200.not, label %.preheader, label %.lr.ph111.epil

.lr.ph111.epil:                                   ; preds = %.preheader.unr-lcssa
  %138 = trunc nuw nsw i64 %indvars.iv146.unr to i32
  %139 = or i32 %.071.lcssa169, %138
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %indvars.iv146.unr
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = add nsw i32 %144, %121
  %146 = icmp sgt i32 %142, %145
  br i1 %146, label %147, label %.preheader

147:                                              ; preds = %.lr.ph111.epil
  store i32 %145, ptr %141, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph111.epil, %147, %.preheader.unr-lcssa
  %brmerge = or i1 %.not99, %.not124
  br i1 %brmerge, label %.loopexit, label %.lr.ph115.us.preheader

.lr.ph115.us.preheader:                           ; preds = %.preheader
  %148 = add i32 %.074.in.lcssa, 1
  br label %.lr.ph115.us

.lr.ph115.us:                                     ; preds = %.lr.ph115.us.preheader, %._crit_edge116.us
  %indvars.iv158 = phi i64 [ %87, %.lr.ph115.us.preheader ], [ %indvars.iv.next159, %._crit_edge116.us ]
  %149 = getelementptr inbounds [21 x i32], ptr @id, i64 0, i64 %indvars.iv158
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [21 x [26 x i32]], ptr @c, i64 0, i64 %151, i64 %indvars.iv163
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = shl nuw i32 1, %150
  br i1 %80, label %._crit_edge116.us.unr-lcssa, label %.lr.ph115.us.new

.lr.ph115.us.new:                                 ; preds = %.lr.ph115.us, %176
  %indvars.iv152 = phi i64 [ %indvars.iv.next153.1, %176 ], [ 0, %.lr.ph115.us ]
  %niter206 = phi i64 [ %niter206.next.1, %176 ], [ 0, %.lr.ph115.us ]
  %155 = trunc nuw nsw i64 %indvars.iv152 to i32
  %156 = or i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %indvars.iv152
  %161 = load i32, ptr %160, align 8, !tbaa !5
  %162 = add nsw i32 %161, %153
  %163 = icmp sgt i32 %159, %162
  br i1 %163, label %164, label %165

164:                                              ; preds = %.lr.ph115.us.new
  store i32 %162, ptr %158, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %164, %.lr.ph115.us.new
  %indvars.iv.next153 = or disjoint i64 %indvars.iv152, 1
  %166 = trunc nuw nsw i64 %indvars.iv.next153 to i32
  %167 = or i32 %154, %166
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %indvars.iv.next153
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = add nsw i32 %172, %153
  %174 = icmp sgt i32 %170, %173
  br i1 %174, label %175, label %176

175:                                              ; preds = %165
  store i32 %173, ptr %169, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %175, %165
  %indvars.iv.next153.1 = add nuw nsw i64 %indvars.iv152, 2
  %niter206.next.1 = add i64 %niter206, 2
  %niter206.ncmp.1 = icmp eq i64 %niter206.next.1, %unroll_iter205
  br i1 %niter206.ncmp.1, label %._crit_edge116.us.unr-lcssa, label %.lr.ph115.us.new, !llvm.loop !23

._crit_edge116.us.unr-lcssa:                      ; preds = %176, %.lr.ph115.us
  %indvars.iv152.unr = phi i64 [ 0, %.lr.ph115.us ], [ %indvars.iv.next153.1, %176 ]
  br i1 %lcmp.mod204.not, label %._crit_edge116.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge116.us.unr-lcssa
  %177 = trunc nuw nsw i64 %indvars.iv152.unr to i32
  %178 = or i32 %154, %177
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %indvars.iv152.unr
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = add nsw i32 %183, %153
  %185 = icmp sgt i32 %181, %184
  br i1 %185, label %186, label %._crit_edge116.us

186:                                              ; preds = %.epil.preheader
  store i32 %184, ptr %180, align 4, !tbaa !5
  br label %._crit_edge116.us

._crit_edge116.us:                                ; preds = %.epil.preheader, %186, %._crit_edge116.us.unr-lcssa
  %indvars.iv.next159 = add nsw i64 %indvars.iv158, 1
  %lftr.wideiv161 = trunc i64 %indvars.iv.next159 to i32
  %exitcond162.not = icmp eq i32 %148, %lftr.wideiv161
  br i1 %exitcond162.not, label %.loopexit, label %.lr.ph115.us, !llvm.loop !24

.lr.ph111:                                        ; preds = %.lr.ph111.preheader, %207
  %indvars.iv146 = phi i64 [ %indvars.iv.next147.1, %207 ], [ 0, %.lr.ph111.preheader ]
  %niter202 = phi i64 [ %niter202.next.1, %207 ], [ 0, %.lr.ph111.preheader ]
  %187 = trunc nuw nsw i64 %indvars.iv146 to i32
  %188 = or i32 %.071.lcssa169, %187
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %indvars.iv146
  %193 = load i32, ptr %192, align 8, !tbaa !5
  %194 = add nsw i32 %193, %121
  %195 = icmp sgt i32 %191, %194
  br i1 %195, label %196, label %.lr.ph111.1

196:                                              ; preds = %.lr.ph111
  store i32 %194, ptr %190, align 4, !tbaa !5
  br label %.lr.ph111.1

.lr.ph111.1:                                      ; preds = %.lr.ph111, %196
  %indvars.iv.next147 = or disjoint i64 %indvars.iv146, 1
  %197 = trunc nuw nsw i64 %indvars.iv.next147 to i32
  %198 = or i32 %.071.lcssa169, %197
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %indvars.iv.next147
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = add nsw i32 %203, %121
  %205 = icmp sgt i32 %201, %204
  br i1 %205, label %206, label %207

206:                                              ; preds = %.lr.ph111.1
  store i32 %204, ptr %200, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %206, %.lr.ph111.1
  %indvars.iv.next147.1 = add nuw nsw i64 %indvars.iv146, 2
  %niter202.next.1 = add i64 %niter202, 2
  %niter202.ncmp.1 = icmp eq i64 %niter202.next.1, %unroll_iter201
  br i1 %niter202.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph111, !llvm.loop !25
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !17, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass