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

; 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 [2 x i32], align 4
@mod = external dso_local global i32, align 4
@c = external dso_local global [31 x [31 x i32]], align 16
@pw2 = external dso_local global [961 x i32], align 16
@prb = external dso_local global [31 x [31 x i32]], align 16
@cur = external dso_local global i32, align 4
@pre = external dso_local global i32, align 4
@f = external dso_local global [2 x [31 x [31 x [31 x i64]]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %22

22:                                               ; preds = %441, %0
  %23 = load i32, ptr @t, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr @t, align 4, !tbaa !5
  %25 = icmp ne i32 %23, 0
  br i1 %25, label %26, label %453

26:                                               ; preds = %22
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef getelementptr inbounds (i32, ptr @n, i64 1), ptr noundef @mod)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %99, %26
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %36, label %32

32:                                               ; preds = %28
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @n, i64 0, i64 1), align 4, !tbaa !5
  %35 = icmp sle i32 %33, %34
  br label %36

36:                                               ; preds = %32, %28
  %37 = phi i1 [ true, %28 ], [ %35, %32 ]
  br i1 %37, label %39, label %38

38:                                               ; preds = %36
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %102

39:                                               ; preds = %36
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %41
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [31 x i32], ptr %42, i64 0, i64 %44
  store i32 1, ptr %45, align 4, !tbaa !5
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %47
  %49 = getelementptr inbounds [31 x i32], ptr %48, i64 0, i64 0
  store i32 1, ptr %49, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %95, %39
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %98

55:                                               ; preds = %50
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %58
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [31 x i32], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %66
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [31 x i32], ptr %67, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = add nsw i32 %63, %72
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %75
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [31 x i32], ptr %76, i64 0, i64 %78
  store i32 %73, ptr %79, align 4, !tbaa !5
  %80 = load i32, ptr @mod, align 4, !tbaa !5
  %81 = icmp sge i32 %73, %80
  br i1 %81, label %82, label %93

82:                                               ; preds = %55
  %83 = load i32, ptr @mod, align 4, !tbaa !5
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %85
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [31 x i32], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sub nsw i32 %90, %83
  store i32 %91, ptr %89, align 4, !tbaa !5
  %92 = icmp ne i32 %91, 0
  br label %93

93:                                               ; preds = %82, %55
  %94 = phi i1 [ false, %55 ], [ %92, %82 ]
  br label %95

95:                                               ; preds = %93
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %4, align 4, !tbaa !5
  br label %50, !llvm.loop !9

98:                                               ; preds = %54
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %2, align 4, !tbaa !5
  br label %28, !llvm.loop !11

102:                                              ; preds = %38
  store i32 1, ptr @pw2, align 16, !tbaa !5
  %103 = load i32, ptr @mod, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  %105 = ashr i32 %104, 1
  store i32 %105, ptr getelementptr inbounds ([961 x i32], ptr @pw2, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %130, %102
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @n, i64 0, i64 1), align 4, !tbaa !5
  %110 = mul nsw i32 %108, %109
  %111 = icmp sle i32 %107, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %106
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %133

113:                                              ; preds = %106
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [961 x i32], ptr @pw2, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = load i32, ptr getelementptr inbounds ([961 x i32], ptr @pw2, i64 0, i64 1), align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = mul nsw i64 %119, %121
  %123 = load i32, ptr @mod, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = srem i64 %122, %124
  %126 = trunc i64 %125 to i32
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [961 x i32], ptr @pw2, i64 0, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %113
  %131 = load i32, ptr %5, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %5, align 4, !tbaa !5
  br label %106, !llvm.loop !12

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

134:                                              ; preds = %213, %133
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([2 x i32], ptr @n, i64 0, i64 1))
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp sle i32 %135, %137
  br i1 %138, label %140, label %139

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

140:                                              ; preds = %134
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %142
  %144 = getelementptr inbounds [31 x i32], ptr %143, i64 0, i64 0
  store i32 1, ptr %144, align 4, !tbaa !5
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %156

147:                                              ; preds = %140
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = sub nsw i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %150
  %152 = getelementptr inbounds [31 x i32], ptr %151, i64 0, i64 1
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = shl i32 %153, 1
  %155 = or i32 %154, 1
  br label %157

156:                                              ; preds = %140
  br label %157

157:                                              ; preds = %156, %147
  %158 = phi i32 [ %155, %147 ], [ 0, %156 ]
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %160
  %162 = getelementptr inbounds [31 x i32], ptr %161, i64 0, i64 1
  store i32 %158, ptr %162, align 4, !tbaa !5
  %163 = load i32, ptr @mod, align 4, !tbaa !5
  %164 = icmp sge i32 %158, %163
  br i1 %164, label %165, label %174

165:                                              ; preds = %157
  %166 = load i32, ptr @mod, align 4, !tbaa !5
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %168
  %170 = getelementptr inbounds [31 x i32], ptr %169, i64 0, i64 1
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = sub nsw i32 %171, %166
  store i32 %172, ptr %170, align 4, !tbaa !5
  %173 = icmp ne i32 %172, 0
  br label %174

174:                                              ; preds = %165, %157
  %175 = phi i1 [ false, %157 ], [ %173, %165 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 2, ptr %7, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %209, %174
  %177 = load i32, ptr %7, align 4, !tbaa !5
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([2 x i32], ptr @n, i64 0, i64 1))
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = icmp sle i32 %177, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %176
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %212

182:                                              ; preds = %176
  %183 = load i32, ptr %6, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %184
  %186 = load i32, ptr %7, align 4, !tbaa !5
  %187 = sub nsw i32 %186, 1
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [31 x i32], ptr %185, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = load i32, ptr %6, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %193
  %195 = getelementptr inbounds [31 x i32], ptr %194, i64 0, i64 1
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = mul nsw i64 %191, %197
  %199 = load i32, ptr @mod, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = srem i64 %198, %200
  %202 = trunc i64 %201 to i32
  %203 = load i32, ptr %6, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %204
  %206 = load i32, ptr %7, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [31 x i32], ptr %205, i64 0, i64 %207
  store i32 %202, ptr %208, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %182
  %210 = load i32, ptr %7, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %7, align 4, !tbaa !5
  br label %176, !llvm.loop !13

212:                                              ; preds = %181
  br label %213

213:                                              ; preds = %212
  %214 = load i32, ptr %6, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %6, align 4, !tbaa !5
  br label %134, !llvm.loop !14

216:                                              ; preds = %139
  call void @_Z8dp_cleari(i32 noundef 0)
  %217 = load i32, ptr @cur, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %218
  %220 = getelementptr inbounds [31 x [31 x [31 x i64]]], ptr %219, i64 0, i64 0
  %221 = getelementptr inbounds [31 x [31 x i64]], ptr %220, i64 0, i64 1
  %222 = getelementptr inbounds [31 x i64], ptr %221, i64 0, i64 1
  store i64 1, ptr %222, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %438, %216
  %224 = load i32, ptr %9, align 4, !tbaa !5
  %225 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([2 x i32], ptr @n, i64 0, i64 1))
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = mul nsw i32 %226, 2
  %228 = icmp slt i32 %224, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %223
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %441

230:                                              ; preds = %223
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @cur, ptr noundef nonnull align 4 dereferenceable(4) @pre) #5
  %231 = load i32, ptr %9, align 4, !tbaa !5
  call void @_Z8dp_cleari(i32 noundef %231)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %232 = load i32, ptr %9, align 4, !tbaa !5
  %233 = and i32 %232, 1
  %234 = icmp ne i32 %233, 0
  %235 = xor i1 %234, true
  %236 = zext i1 %235 to i64
  %237 = getelementptr inbounds [2 x i32], ptr @n, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  store i32 %238, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %239 = load i32, ptr %9, align 4, !tbaa !5
  %240 = and i32 %239, 1
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [2 x i32], ptr @n, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  store i32 %243, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %244

244:                                              ; preds = %364, %230
  %245 = load i32, ptr %12, align 4, !tbaa !5
  %246 = load i32, ptr %11, align 4, !tbaa !5
  %247 = icmp slt i32 %245, %246
  br i1 %247, label %249, label %248

248:                                              ; preds = %244
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %367

249:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %250

250:                                              ; preds = %360, %249
  %251 = load i32, ptr %13, align 4, !tbaa !5
  %252 = load i32, ptr %10, align 4, !tbaa !5
  %253 = icmp sle i32 %251, %252
  br i1 %253, label %255, label %254

254:                                              ; preds = %250
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %363

255:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %356, %255
  %257 = load i32, ptr %14, align 4, !tbaa !5
  %258 = load i32, ptr %13, align 4, !tbaa !5
  %259 = icmp sle i32 %257, %258
  br i1 %259, label %261, label %260

260:                                              ; preds = %256
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %359

261:                                              ; preds = %256
  %262 = load i32, ptr @pre, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %263
  %265 = load i32, ptr %12, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [31 x [31 x [31 x i64]]], ptr %264, i64 0, i64 %266
  %268 = load i32, ptr %13, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [31 x [31 x i64]], ptr %267, i64 0, i64 %269
  %271 = load i32, ptr %14, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [31 x i64], ptr %270, i64 0, i64 %272
  %274 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %273)
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %277, label %276

276:                                              ; preds = %261
  br label %356

277:                                              ; preds = %261
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %278 = load i32, ptr %14, align 4, !tbaa !5
  %279 = load i32, ptr %11, align 4, !tbaa !5
  %280 = load i32, ptr %12, align 4, !tbaa !5
  %281 = sub nsw i32 %279, %280
  %282 = mul nsw i32 %278, %281
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [961 x i32], ptr @pw2, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = load i32, ptr @pre, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %288
  %290 = load i32, ptr %12, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [31 x [31 x [31 x i64]]], ptr %289, i64 0, i64 %291
  %293 = load i32, ptr %13, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [31 x [31 x i64]], ptr %292, i64 0, i64 %294
  %296 = load i32, ptr %14, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [31 x i64], ptr %295, i64 0, i64 %297
  %299 = load i64, ptr %298, align 8, !tbaa !15
  %300 = mul nsw i64 %286, %299
  %301 = load i32, ptr @mod, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = srem i64 %300, %302
  %304 = trunc i64 %303 to i32
  store i32 %304, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %305 = load i32, ptr %12, align 4, !tbaa !5
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %17, align 4, !tbaa !5
  br label %307

307:                                              ; preds = %350, %277
  %308 = load i32, ptr %17, align 4, !tbaa !5
  %309 = load i32, ptr %11, align 4, !tbaa !5
  %310 = icmp sle i32 %308, %309
  br i1 %310, label %312, label %311

311:                                              ; preds = %307
  store i32 31, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %355

312:                                              ; preds = %307
  %313 = load i32, ptr @cur, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %314
  %316 = load i32, ptr %13, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [31 x [31 x [31 x i64]]], ptr %315, i64 0, i64 %317
  %319 = load i32, ptr %17, align 4, !tbaa !5
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [31 x [31 x i64]], ptr %318, i64 0, i64 %320
  %322 = load i32, ptr %16, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [31 x i64], ptr %321, i64 0, i64 %323
  %325 = load i32, ptr %15, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = load i32, ptr %11, align 4, !tbaa !5
  %328 = load i32, ptr %12, align 4, !tbaa !5
  %329 = sub nsw i32 %327, %328
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %330
  %332 = load i32, ptr %16, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [31 x i32], ptr %331, i64 0, i64 %333
  %335 = load i32, ptr %334, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = mul nsw i64 %326, %336
  %338 = load i32, ptr @mod, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = srem i64 %337, %339
  %341 = load i32, ptr %14, align 4, !tbaa !5
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %342
  %344 = load i32, ptr %16, align 4, !tbaa !5
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds [31 x i32], ptr %343, i64 0, i64 %345
  %347 = load i32, ptr %346, align 4, !tbaa !5
  %348 = sext i32 %347 to i64
  %349 = mul nsw i64 %340, %348
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %324, i64 noundef %349)
  br label %350

350:                                              ; preds = %312
  %351 = load i32, ptr %16, align 4, !tbaa !5
  %352 = add nsw i32 %351, 1
  store i32 %352, ptr %16, align 4, !tbaa !5
  %353 = load i32, ptr %17, align 4, !tbaa !5
  %354 = add nsw i32 %353, 1
  store i32 %354, ptr %17, align 4, !tbaa !5
  br label %307, !llvm.loop !17

355:                                              ; preds = %311
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %356

356:                                              ; preds = %355, %276
  %357 = load i32, ptr %14, align 4, !tbaa !5
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %14, align 4, !tbaa !5
  br label %256, !llvm.loop !18

359:                                              ; preds = %260
  br label %360

360:                                              ; preds = %359
  %361 = load i32, ptr %13, align 4, !tbaa !5
  %362 = add nsw i32 %361, 1
  store i32 %362, ptr %13, align 4, !tbaa !5
  br label %250, !llvm.loop !19

363:                                              ; preds = %254
  br label %364

364:                                              ; preds = %363
  %365 = load i32, ptr %12, align 4, !tbaa !5
  %366 = add nsw i32 %365, 1
  store i32 %366, ptr %12, align 4, !tbaa !5
  br label %244, !llvm.loop !20

367:                                              ; preds = %248
  %368 = load i32, ptr %9, align 4, !tbaa !5
  %369 = and i32 %368, 1
  %370 = icmp ne i32 %369, 0
  br i1 %370, label %371, label %437

371:                                              ; preds = %367
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %372

372:                                              ; preds = %433, %371
  %373 = load i32, ptr %18, align 4, !tbaa !5
  %374 = load i32, ptr %10, align 4, !tbaa !5
  %375 = icmp sle i32 %373, %374
  br i1 %375, label %377, label %376

376:                                              ; preds = %372
  store i32 34, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %436

377:                                              ; preds = %372
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %378

378:                                              ; preds = %429, %377
  %379 = load i32, ptr %19, align 4, !tbaa !5
  %380 = load i32, ptr %11, align 4, !tbaa !5
  %381 = icmp sle i32 %379, %380
  br i1 %381, label %383, label %382

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

383:                                              ; preds = %378
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %384

384:                                              ; preds = %425, %383
  %385 = load i32, ptr %20, align 4, !tbaa !5
  %386 = load i32, ptr %19, align 4, !tbaa !5
  %387 = icmp sle i32 %385, %386
  br i1 %387, label %389, label %388

388:                                              ; preds = %384
  store i32 40, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %428

389:                                              ; preds = %384
  %390 = load i32, ptr @cur, align 4, !tbaa !5
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %391
  %393 = load i32, ptr %18, align 4, !tbaa !5
  %394 = sext i32 %393 to i64
  %395 = getelementptr inbounds [31 x [31 x [31 x i64]]], ptr %392, i64 0, i64 %394
  %396 = load i32, ptr %19, align 4, !tbaa !5
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds [31 x [31 x i64]], ptr %395, i64 0, i64 %397
  %399 = load i32, ptr %20, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [31 x i64], ptr %398, i64 0, i64 %400
  %402 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %401)
  %403 = icmp ne i32 %402, 0
  br i1 %403, label %405, label %404

404:                                              ; preds = %389
  br label %425

405:                                              ; preds = %389
  %406 = load i32, ptr %20, align 4, !tbaa !5
  %407 = sext i32 %406 to i64
  %408 = load i32, ptr %9, align 4, !tbaa !5
  %409 = sext i32 %408 to i64
  %410 = mul nsw i64 %407, %409
  %411 = load i32, ptr @cur, align 4, !tbaa !5
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %412
  %414 = load i32, ptr %18, align 4, !tbaa !5
  %415 = sext i32 %414 to i64
  %416 = getelementptr inbounds [31 x [31 x [31 x i64]]], ptr %413, i64 0, i64 %415
  %417 = load i32, ptr %19, align 4, !tbaa !5
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds [31 x [31 x i64]], ptr %416, i64 0, i64 %418
  %420 = load i32, ptr %20, align 4, !tbaa !5
  %421 = sext i32 %420 to i64
  %422 = getelementptr inbounds [31 x i64], ptr %419, i64 0, i64 %421
  %423 = load i64, ptr %422, align 8, !tbaa !15
  %424 = mul nsw i64 %410, %423
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %424)
  br label %425

425:                                              ; preds = %405, %404
  %426 = load i32, ptr %20, align 4, !tbaa !5
  %427 = add nsw i32 %426, 1
  store i32 %427, ptr %20, align 4, !tbaa !5
  br label %384, !llvm.loop !21

428:                                              ; preds = %388
  br label %429

429:                                              ; preds = %428
  %430 = load i32, ptr %19, align 4, !tbaa !5
  %431 = add nsw i32 %430, 1
  store i32 %431, ptr %19, align 4, !tbaa !5
  br label %378, !llvm.loop !22

432:                                              ; preds = %382
  br label %433

433:                                              ; preds = %432
  %434 = load i32, ptr %18, align 4, !tbaa !5
  %435 = add nsw i32 %434, 1
  store i32 %435, ptr %18, align 4, !tbaa !5
  br label %372, !llvm.loop !23

436:                                              ; preds = %376
  br label %437

437:                                              ; preds = %436, %367
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %438

438:                                              ; preds = %437
  %439 = load i32, ptr %9, align 4, !tbaa !5
  %440 = add nsw i32 %439, 1
  store i32 %440, ptr %9, align 4, !tbaa !5
  br label %223, !llvm.loop !24

441:                                              ; preds = %229
  %442 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %443 = sext i32 %442 to i64
  %444 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @n, i64 0, i64 1), align 4, !tbaa !5
  %445 = call noundef i32 @_Z7mod_invi(i32 noundef %444)
  %446 = sext i32 %445 to i64
  %447 = mul nsw i64 %443, %446
  %448 = load i32, ptr @mod, align 4, !tbaa !5
  %449 = sext i32 %448 to i64
  %450 = srem i64 %447, %449
  store i64 %450, ptr %8, align 8, !tbaa !15
  %451 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %452 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %451)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %22, !llvm.loop !25

453:                                              ; preds = %22
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z8dp_cleari(i32 noundef) #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!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}


; 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 [2 x i32], align 4
@mod = external dso_local global i32, align 4
@c = external dso_local local_unnamed_addr global [31 x [31 x i32]], align 16
@pw2 = external dso_local local_unnamed_addr global [961 x i32], align 16
@prb = external dso_local local_unnamed_addr global [31 x [31 x i32]], align 16
@cur = external dso_local global i32, align 4
@pre = external dso_local global i32, align 4
@f = external dso_local global [2 x [31 x [31 x [31 x i64]]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

.lr.ph174:                                        ; preds = %0, %._crit_edge171
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull getelementptr inbounds (i8, ptr @n, i64 4), ptr noundef nonnull @mod)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @n, i64 4), align 4
  %.fr = freeze i32 %7
  %invariant.smax = call i32 @llvm.smax.i32(i32 %6, i32 %.fr)
  %8 = icmp sgt i32 %invariant.smax, -1
  %.pre268 = load i32, ptr @mod, align 4
  br i1 %8, label %.lr.ph133, label %._crit_edge134

.lr.ph133:                                        ; preds = %.lr.ph174
  %9 = add nuw i32 %invariant.smax, 1
  %wide.trip.count184 = zext i32 %9 to i64
  br label %16

._crit_edge134:                                   ; preds = %._crit_edge, %.lr.ph174
  store i32 1, ptr @pw2, align 16, !tbaa !5
  %10 = add nsw i32 %.pre268, 1
  %11 = ashr i32 %10, 1
  store i32 %11, ptr getelementptr inbounds (i8, ptr @pw2, i64 4), align 4, !tbaa !5
  %12 = mul nsw i32 %.fr, %6
  %.not108136 = icmp slt i32 %12, 1
  br i1 %.not108136, label %.preheader128, label %.lr.ph139

.lr.ph139:                                        ; preds = %._crit_edge134
  %13 = sext i32 %.pre268 to i64
  %14 = zext nneg i32 %12 to i64
  %xtraiter272 = and i64 %14, 1
  %15 = icmp eq i32 %12, 1
  br i1 %15, label %.preheader128.loopexit.unr-lcssa, label %.lr.ph139.new

.lr.ph139.new:                                    ; preds = %.lr.ph139
  %unroll_iter275 = and i64 %14, 2147483646
  br label %49

16:                                               ; preds = %.lr.ph133, %._crit_edge
  %indvars.iv181 = phi i64 [ 0, %.lr.ph133 ], [ %indvars.iv.next182, %._crit_edge ]
  %17 = add nsw i64 %indvars.iv181, -1
  %18 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %indvars.iv181
  %19 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %indvars.iv181, i64 %indvars.iv181
  store i32 1, ptr %19, align 4, !tbaa !5
  store i32 1, ptr %18, align 4, !tbaa !5
  %20 = icmp ugt i64 %indvars.iv181, 1
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %21 = add nsw i64 %indvars.iv181, -1
  %.phi.trans.insert = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %21, i64 0
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  %xtraiter = and i64 %17, 1
  %22 = icmp eq i64 %indvars.iv181, 2
  br i1 %22, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %17, -2
  br label %28

._crit_edge.loopexit.unr-lcssa:                   ; preds = %28, %.lr.ph
  %.unr = phi i32 [ %.pre, %.lr.ph ], [ %36, %28 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.1, %28 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %23 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %21, i64 %indvars.iv.unr
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %.unr, %24
  %26 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %indvars.iv181, i64 %indvars.iv.unr
  %.not122.epil = icmp slt i32 %25, %.pre268
  %27 = select i1 %.not122.epil, i32 0, i32 %.pre268
  %spec.select.epil = sub nsw i32 %25, %27
  store i32 %spec.select.epil, ptr %26, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %16
  %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
  %exitcond185.not = icmp eq i64 %indvars.iv.next182, %wide.trip.count184
  br i1 %exitcond185.not, label %._crit_edge134, label %16, !llvm.loop !9

28:                                               ; preds = %28, %.lr.ph.new
  %29 = phi i32 [ %.pre, %.lr.ph.new ], [ %36, %28 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %28 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %28 ]
  %30 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %21, i64 %indvars.iv
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = add nsw i32 %29, %31
  %33 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %indvars.iv181, i64 %indvars.iv
  %.not122 = icmp slt i32 %32, %.pre268
  %34 = select i1 %.not122, i32 0, i32 %.pre268
  %spec.select = sub nsw i32 %32, %34
  store i32 %spec.select, ptr %33, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %21, i64 %indvars.iv.next
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %31, %36
  %38 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %indvars.iv181, i64 %indvars.iv.next
  %.not122.1 = icmp slt i32 %37, %.pre268
  %39 = select i1 %.not122.1, i32 0, i32 %.pre268
  %spec.select.1 = sub nsw i32 %37, %39
  store i32 %spec.select.1, ptr %38, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %28, !llvm.loop !11

.preheader128.loopexit.unr-lcssa:                 ; preds = %49, %.lr.ph139
  %.unr273 = phi i64 [ 1, %.lr.ph139 ], [ %62, %49 ]
  %indvars.iv186.unr = phi i64 [ 1, %.lr.ph139 ], [ %indvars.iv.next187.1, %49 ]
  %lcmp.mod274.not = icmp eq i64 %xtraiter272, 0
  br i1 %lcmp.mod274.not, label %.preheader128, label %.preheader128.loopexit.epilog-lcssa

.preheader128.loopexit.epilog-lcssa:              ; preds = %.preheader128.loopexit.unr-lcssa
  %sext.epil = shl i64 %.unr273, 32
  %40 = ashr exact i64 %sext.epil, 32
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @pw2, i64 4), align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = mul nsw i64 %40, %42
  %44 = srem i64 %43, %13
  %45 = trunc nsw i64 %44 to i32
  %46 = getelementptr inbounds [961 x i32], ptr @pw2, i64 0, i64 %indvars.iv186.unr
  store i32 %45, ptr %46, align 4, !tbaa !5
  br label %.preheader128

.preheader128:                                    ; preds = %.preheader128.loopexit.epilog-lcssa, %.preheader128.loopexit.unr-lcssa, %._crit_edge134
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @n, i64 4))
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not109145 = icmp slt i32 %48, 0
  br i1 %.not109145, label %._crit_edge148, label %.lr.ph147

49:                                               ; preds = %49, %.lr.ph139.new
  %50 = phi i64 [ 1, %.lr.ph139.new ], [ %62, %49 ]
  %indvars.iv186 = phi i64 [ 1, %.lr.ph139.new ], [ %indvars.iv.next187.1, %49 ]
  %niter276 = phi i64 [ 0, %.lr.ph139.new ], [ %niter276.next.1, %49 ]
  %sext = shl i64 %50, 32
  %51 = ashr exact i64 %sext, 32
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @pw2, i64 4), align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 %51, %53
  %55 = srem i64 %54, %13
  %56 = trunc nsw i64 %55 to i32
  %57 = getelementptr inbounds [961 x i32], ptr @pw2, i64 0, i64 %indvars.iv186
  store i32 %56, ptr %57, align 4, !tbaa !5
  %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
  %sext.1 = shl i64 %55, 32
  %58 = ashr exact i64 %sext.1, 32
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @pw2, i64 4), align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = mul nsw i64 %58, %60
  %62 = srem i64 %61, %13
  %63 = trunc nsw i64 %62 to i32
  %64 = getelementptr inbounds [961 x i32], ptr @pw2, i64 0, i64 %indvars.iv.next187
  store i32 %63, ptr %64, align 4, !tbaa !5
  %indvars.iv.next187.1 = add nuw nsw i64 %indvars.iv186, 2
  %niter276.next.1 = add i64 %niter276, 2
  %niter276.ncmp.1 = icmp eq i64 %niter276.next.1, %unroll_iter275
  br i1 %niter276.ncmp.1, label %.preheader128.loopexit.unr-lcssa, label %49, !llvm.loop !12

._crit_edge148:                                   ; preds = %._crit_edge144, %.preheader128
  call void @_Z8dp_cleari(i32 noundef 0)
  %65 = load i32, ptr @cur, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %66, i64 0, i64 1, i64 1
  store i64 1, ptr %67, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8, !tbaa !13
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @n, i64 4))
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph170, label %._crit_edge171

.lr.ph147:                                        ; preds = %.preheader128, %._crit_edge144
  %indvars.iv193 = phi i64 [ %indvars.iv.next194, %._crit_edge144 ], [ 0, %.preheader128 ]
  %71 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %indvars.iv193
  store i32 1, ptr %71, align 4, !tbaa !5
  %.not119 = icmp eq i64 %indvars.iv193, 0
  br i1 %.not119, label %78, label %72

72:                                               ; preds = %.lr.ph147
  %73 = add nsw i64 %indvars.iv193, -1
  %74 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %73, i64 1
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = shl i32 %75, 1
  %77 = or disjoint i32 %76, 1
  br label %78

78:                                               ; preds = %.lr.ph147, %72
  %79 = phi i32 [ %77, %72 ], [ 0, %.lr.ph147 ]
  %80 = getelementptr inbounds i8, ptr %71, i64 4
  store i32 %79, ptr %80, align 4, !tbaa !5
  %81 = load i32, ptr @mod, align 4, !tbaa !5
  %.not120 = icmp slt i32 %79, %81
  br i1 %.not120, label %84, label %82

82:                                               ; preds = %78
  %83 = sub nsw i32 %79, %81
  store i32 %83, ptr %80, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %82, %78
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @n, i64 4))
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %.not121140 = icmp slt i32 %86, 2
  br i1 %.not121140, label %._crit_edge144, label %.lr.ph143

._crit_edge144:                                   ; preds = %.lr.ph143, %84
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @n, i64 4))
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %.not109.not = icmp slt i64 %indvars.iv193, %89
  br i1 %.not109.not, label %.lr.ph147, label %._crit_edge148, !llvm.loop !15

.lr.ph143:                                        ; preds = %84, %.lr.ph143
  %indvars.iv190 = phi i64 [ %indvars.iv.next191, %.lr.ph143 ], [ 2, %84 ]
  %90 = add nsw i64 %indvars.iv190, -1
  %91 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %indvars.iv193, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = load i32, ptr %80, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = mul nsw i64 %95, %93
  %97 = load i32, ptr @mod, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = srem i64 %96, %98
  %100 = trunc nsw i64 %99 to i32
  %101 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %indvars.iv193, i64 %indvars.iv190
  store i32 %100, ptr %101, align 4, !tbaa !5
  %indvars.iv.next191 = add nuw nsw i64 %indvars.iv190, 1
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @n, i64 4))
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %.not121.not = icmp slt i64 %indvars.iv190, %104
  br i1 %.not121.not, label %.lr.ph143, label %._crit_edge144, !llvm.loop !16

._crit_edge171:                                   ; preds = %.loopexit127, %._crit_edge148
  %105 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %106 = sext i32 %105 to i64
  %107 = load i32, ptr getelementptr inbounds (i8, ptr @n, i64 4), align 4, !tbaa !5
  %108 = call noundef i32 @_Z7mod_invi(i32 noundef %107)
  %109 = sext i32 %108 to i64
  %110 = mul nsw i64 %109, %106
  %111 = load i32, ptr @mod, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = srem i64 %110, %112
  store i64 %113, ptr %1, align 8, !tbaa !13
  %114 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %114)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %116 = load i32, ptr @t, align 4, !tbaa !5
  %117 = add nsw i32 %116, -1
  store i32 %117, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %116, 0
  br i1 %.not, label %._crit_edge175, label %.lr.ph174, !llvm.loop !17

.lr.ph170:                                        ; preds = %._crit_edge148, %.loopexit127
  %indvars.iv265 = phi i64 [ %indvars.iv.next266, %.loopexit127 ], [ 1, %._crit_edge148 ]
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @cur, ptr noundef nonnull align 4 dereferenceable(4) @pre) #6
  %118 = trunc nuw nsw i64 %indvars.iv265 to i32
  call void @_Z8dp_cleari(i32 noundef %118)
  %119 = and i32 %118, 1
  %.not110 = icmp eq i32 %119, 0
  %120 = xor i32 %119, 1
  %121 = zext nneg i32 %120 to i64
  %122 = getelementptr inbounds [2 x i32], ptr @n, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = and i64 %indvars.iv265, 1
  %125 = getelementptr inbounds [2 x i32], ptr @n, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = icmp slt i32 %126, 1
  %.not115155 = icmp slt i32 %123, 1
  %or.cond269 = select i1 %127, i1 true, i1 %.not115155
  br i1 %or.cond269, label %._crit_edge160, label %.preheader125.preheader

.preheader125.preheader:                          ; preds = %.lr.ph170
  %128 = add nuw i32 %123, 1
  %129 = add nuw i32 %126, 1
  %130 = zext nneg i32 %126 to i64
  %wide.trip.count242 = zext nneg i32 %126 to i64
  %wide.trip.count239 = zext i32 %128 to i64
  br label %.preheader123.us.preheader

.preheader123.us.preheader:                       ; preds = %._crit_edge157, %.preheader125.preheader
  %indvars.iv221 = phi i32 [ %129, %.preheader125.preheader ], [ %indvars.iv.next222, %._crit_edge157 ]
  %indvars.iv212 = phi i64 [ 0, %.preheader125.preheader ], [ %indvars.iv.next213, %._crit_edge157 ]
  %131 = sub nsw i64 %130, %indvars.iv212
  %wide.trip.count223 = zext i32 %indvars.iv221 to i64
  br label %.preheader123.us

.preheader123.us:                                 ; preds = %.preheader123.us.preheader, %.split.us.us
  %indvars.iv234 = phi i64 [ 1, %.preheader123.us.preheader ], [ %indvars.iv.next235, %.split.us.us ]
  %indvars.iv232 = phi i64 [ 2, %.preheader123.us.preheader ], [ %indvars.iv.next233, %.split.us.us ]
  br label %132

132:                                              ; preds = %..loopexit_crit_edge.us.us, %.preheader123.us
  %indvars.iv225 = phi i64 [ %indvars.iv.next226, %..loopexit_crit_edge.us.us ], [ 1, %.preheader123.us ]
  %133 = load i32, ptr @pre, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %134, i64 %indvars.iv212, i64 %indvars.iv234, i64 %indvars.iv225
  %136 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %135)
  %.not117.us.us = icmp eq i32 %136, 0
  br i1 %.not117.us.us, label %..loopexit_crit_edge.us.us, label %.lr.ph153.us.us

.lr.ph153.us.us:                                  ; preds = %132
  %137 = mul nsw i64 %indvars.iv225, %131
  %138 = getelementptr inbounds [961 x i32], ptr @pw2, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = load i32, ptr @pre, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %142, i64 %indvars.iv212, i64 %indvars.iv234, i64 %indvars.iv225
  %144 = load i64, ptr %143, align 8, !tbaa !13
  %145 = mul nsw i64 %144, %140
  %146 = load i32, ptr @mod, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = srem i64 %145, %147
  br label %149

149:                                              ; preds = %149, %.lr.ph153.us.us
  %indvars.iv216 = phi i64 [ %indvars.iv.next217, %149 ], [ 1, %.lr.ph153.us.us ]
  %indvars.iv214 = phi i64 [ %indvars.iv.next215, %149 ], [ %indvars.iv212, %.lr.ph153.us.us ]
  %indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
  %150 = load i32, ptr @cur, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %151, i64 %indvars.iv234, i64 %indvars.iv.next215, i64 %indvars.iv216
  %153 = getelementptr inbounds [31 x [31 x i32]], ptr @c, i64 0, i64 %131, i64 %indvars.iv216
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = mul nsw i64 %148, %155
  %157 = load i32, ptr @mod, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = srem i64 %156, %158
  %160 = getelementptr inbounds [31 x [31 x i32]], ptr @prb, i64 0, i64 %indvars.iv225, i64 %indvars.iv216
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = mul nsw i64 %159, %162
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %152, i64 noundef %163)
  %indvars.iv.next217 = add nuw nsw i64 %indvars.iv216, 1
  %exitcond224.not = icmp eq i64 %indvars.iv.next217, %wide.trip.count223
  br i1 %exitcond224.not, label %..loopexit_crit_edge.us.us, label %149, !llvm.loop !18

..loopexit_crit_edge.us.us:                       ; preds = %149, %132
  %indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
  %exitcond231.not = icmp eq i64 %indvars.iv.next226, %indvars.iv232
  br i1 %exitcond231.not, label %.split.us.us, label %132, !llvm.loop !19

.split.us.us:                                     ; preds = %..loopexit_crit_edge.us.us
  %indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
  %indvars.iv.next233 = add nuw nsw i64 %indvars.iv232, 1
  %exitcond240.not = icmp eq i64 %indvars.iv.next235, %wide.trip.count239
  br i1 %exitcond240.not, label %._crit_edge157, label %.preheader123.us, !llvm.loop !20

._crit_edge160:                                   ; preds = %._crit_edge157, %.lr.ph170
  %.not111165 = icmp slt i32 %123, 0
  %or.cond = select i1 %.not110, i1 true, i1 %.not111165
  %.not112162 = icmp slt i32 %126, 1
  %or.cond270 = or i1 %or.cond, %.not112162
  br i1 %or.cond270, label %.loopexit127, label %.preheader124.preheader

.preheader124.preheader:                          ; preds = %._crit_edge160
  %164 = add nuw i32 %126, 1
  %165 = add nuw i32 %123, 1
  %wide.trip.count263 = zext i32 %165 to i64
  %wide.trip.count258 = zext i32 %164 to i64
  br label %.preheader124

._crit_edge157:                                   ; preds = %.split.us.us
  %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1
  %indvars.iv.next222 = add i32 %indvars.iv221, -1
  %exitcond243.not = icmp eq i64 %indvars.iv.next213, %wide.trip.count242
  br i1 %exitcond243.not, label %._crit_edge160, label %.preheader123.us.preheader, !llvm.loop !21

.preheader124:                                    ; preds = %.preheader124.preheader, %._crit_edge164
  %indvars.iv260 = phi i64 [ 0, %.preheader124.preheader ], [ %indvars.iv.next261, %._crit_edge164 ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader124, %166
  %indvars.iv253 = phi i64 [ 1, %.preheader124 ], [ %indvars.iv.next254, %166 ]
  %indvars.iv251 = phi i64 [ 2, %.preheader124 ], [ %indvars.iv.next252, %166 ]
  br label %167

._crit_edge164:                                   ; preds = %166
  %indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1
  %exitcond264.not = icmp eq i64 %indvars.iv.next261, %wide.trip.count263
  br i1 %exitcond264.not, label %.loopexit127, label %.preheader124, !llvm.loop !22

166:                                              ; preds = %179
  %indvars.iv.next254 = add nuw nsw i64 %indvars.iv253, 1
  %indvars.iv.next252 = add nuw nsw i64 %indvars.iv251, 1
  %exitcond259.not = icmp eq i64 %indvars.iv.next254, %wide.trip.count258
  br i1 %exitcond259.not, label %._crit_edge164, label %.preheader, !llvm.loop !23

167:                                              ; preds = %.preheader, %179
  %indvars.iv244 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next245, %179 ]
  %168 = load i32, ptr @cur, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %169, i64 %indvars.iv260, i64 %indvars.iv253, i64 %indvars.iv244
  %171 = call noundef i32 @_Z7mod_fixRx(ptr noundef nonnull align 8 dereferenceable(8) %170)
  %.not114 = icmp eq i32 %171, 0
  br i1 %.not114, label %179, label %172

172:                                              ; preds = %167
  %173 = mul nuw nsw i64 %indvars.iv244, %indvars.iv265
  %174 = load i32, ptr @cur, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [2 x [31 x [31 x [31 x i64]]]], ptr @f, i64 0, i64 %175, i64 %indvars.iv260, i64 %indvars.iv253, i64 %indvars.iv244
  %177 = load i64, ptr %176, align 8, !tbaa !13
  %178 = mul nsw i64 %173, %177
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %178)
  br label %179

179:                                              ; preds = %167, %172
  %indvars.iv.next245 = add nuw nsw i64 %indvars.iv244, 1
  %exitcond250.not = icmp eq i64 %indvars.iv.next245, %indvars.iv251
  br i1 %exitcond250.not, label %166, label %167, !llvm.loop !24

.loopexit127:                                     ; preds = %._crit_edge164, %._crit_edge160
  %indvars.iv.next266 = add nuw nsw i64 %indvars.iv265, 1
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @n, i64 4))
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = shl nsw i32 %181, 1
  %183 = sext i32 %182 to i64
  %184 = icmp slt i64 %indvars.iv.next266, %183
  br i1 %184, label %.lr.ph170, label %._crit_edge171, !llvm.loop !25

._crit_edge175:                                   ; preds = %._crit_edge171, %0
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z8dp_cleari(i32 noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3

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

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

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

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


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