; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (2137)

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

@str = external dso_local global [85 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = 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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  br label %19

19:                                               ; preds = %308, %0
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str, ptr noundef %2)
  %21 = icmp ne i32 %20, -1
  br i1 %21, label %22, label %309

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %23 = call i64 @strlen(ptr noundef @str) #5
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %3, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = srem i32 %25, 8
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %46

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

29:                                               ; preds = %41, %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %44

34:                                               ; preds = %29
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = sext i8 %38 to i32
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %39)
  br label %41

41:                                               ; preds = %34
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !10

44:                                               ; preds = %33
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %308

46:                                               ; preds = %22
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = srem i32 %47, 8
  %49 = icmp eq i32 %48, 1
  br i1 %49, label %54, label %50

50:                                               ; preds = %46
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = srem i32 %51, 8
  %53 = icmp eq i32 %52, -7
  br i1 %53, label %54, label %83

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sub nsw i32 %55, 1
  store i32 %56, ptr %5, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %79, %54
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = icmp sge i32 %58, 0
  br i1 %59, label %61, label %60

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

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

62:                                               ; preds = %69, %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %72

67:                                               ; preds = %62
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %69

69:                                               ; preds = %67
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %7, align 4, !tbaa !5
  br label %62, !llvm.loop !12

72:                                               ; preds = %66
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = sext i8 %76 to i32
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %77)
  br label %79

79:                                               ; preds = %72
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = add nsw i32 %80, -1
  store i32 %81, ptr %5, align 4, !tbaa !5
  br label %57, !llvm.loop !13

82:                                               ; preds = %60
  br label %307

83:                                               ; preds = %50
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = srem i32 %84, 8
  %86 = icmp eq i32 %85, 2
  br i1 %86, label %91, label %87

87:                                               ; preds = %83
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = srem i32 %88, 8
  %90 = icmp eq i32 %89, -6
  br i1 %90, label %91, label %123

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

92:                                               ; preds = %119, %91
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

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

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %106, %97
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = sdiv i32 %100, 2
  %102 = icmp slt i32 %99, %101
  br i1 %102, label %104, label %103

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

104:                                              ; preds = %98
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %106

106:                                              ; preds = %104
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %9, align 4, !tbaa !5
  br label %98, !llvm.loop !14

109:                                              ; preds = %103
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = sub nsw i32 %110, 1
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sub nsw i32 %111, %112
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !9
  %117 = sext i8 %116 to i32
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %117)
  br label %119

119:                                              ; preds = %109
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %8, align 4, !tbaa !5
  br label %92, !llvm.loop !15

122:                                              ; preds = %96
  br label %306

123:                                              ; preds = %87
  %124 = load i32, ptr %2, align 4, !tbaa !5
  %125 = srem i32 %124, 8
  %126 = icmp eq i32 %125, 3
  br i1 %126, label %131, label %127

127:                                              ; preds = %123
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = srem i32 %128, 8
  %130 = icmp eq i32 %129, -5
  br i1 %130, label %131, label %162

131:                                              ; preds = %127, %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %158, %131
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 19, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %161

137:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %145, %137
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 22, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %148

143:                                              ; preds = %138
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %145

145:                                              ; preds = %143
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %11, align 4, !tbaa !5
  br label %138, !llvm.loop !16

148:                                              ; preds = %142
  %149 = load i32, ptr %3, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  %151 = load i32, ptr %10, align 4, !tbaa !5
  %152 = sub nsw i32 %150, %151
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !9
  %156 = sext i8 %155 to i32
  %157 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %156)
  br label %158

158:                                              ; preds = %148
  %159 = load i32, ptr %10, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %10, align 4, !tbaa !5
  br label %132, !llvm.loop !17

161:                                              ; preds = %136
  br label %305

162:                                              ; preds = %127
  %163 = load i32, ptr %2, align 4, !tbaa !5
  %164 = srem i32 %163, 8
  %165 = icmp eq i32 %164, 4
  br i1 %165, label %170, label %166

166:                                              ; preds = %162
  %167 = load i32, ptr %2, align 4, !tbaa !5
  %168 = srem i32 %167, 8
  %169 = icmp eq i32 %168, -4
  br i1 %169, label %170, label %189

170:                                              ; preds = %166, %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %171 = load i32, ptr %3, align 4, !tbaa !5
  %172 = sub nsw i32 %171, 1
  store i32 %172, ptr %12, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %184, %170
  %174 = load i32, ptr %12, align 4, !tbaa !5
  %175 = icmp sge i32 %174, 0
  br i1 %175, label %177, label %176

176:                                              ; preds = %173
  store i32 25, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %187

177:                                              ; preds = %173
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %179
  %181 = load i8, ptr %180, align 1, !tbaa !9
  %182 = sext i8 %181 to i32
  %183 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %182)
  br label %184

184:                                              ; preds = %177
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = add nsw i32 %185, -1
  store i32 %186, ptr %12, align 4, !tbaa !5
  br label %173, !llvm.loop !18

187:                                              ; preds = %176
  %188 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %304

189:                                              ; preds = %166
  %190 = load i32, ptr %2, align 4, !tbaa !5
  %191 = srem i32 %190, 8
  %192 = icmp eq i32 %191, 5
  br i1 %192, label %197, label %193

193:                                              ; preds = %189
  %194 = load i32, ptr %2, align 4, !tbaa !5
  %195 = srem i32 %194, 8
  %196 = icmp eq i32 %195, -3
  br i1 %196, label %197, label %228

197:                                              ; preds = %193, %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %224, %197
  %199 = load i32, ptr %13, align 4, !tbaa !5
  %200 = load i32, ptr %3, align 4, !tbaa !5
  %201 = icmp slt i32 %199, %200
  br i1 %201, label %203, label %202

202:                                              ; preds = %198
  store i32 28, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %227

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

204:                                              ; preds = %214, %203
  %205 = load i32, ptr %14, align 4, !tbaa !5
  %206 = load i32, ptr %3, align 4, !tbaa !5
  %207 = load i32, ptr %13, align 4, !tbaa !5
  %208 = sub nsw i32 %206, %207
  %209 = sub nsw i32 %208, 1
  %210 = icmp slt i32 %205, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %204
  store i32 31, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %217

212:                                              ; preds = %204
  %213 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %214

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

217:                                              ; preds = %211
  %218 = load i32, ptr %13, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %219
  %221 = load i8, ptr %220, align 1, !tbaa !9
  %222 = sext i8 %221 to i32
  %223 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %222)
  br label %224

224:                                              ; preds = %217
  %225 = load i32, ptr %13, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %13, align 4, !tbaa !5
  br label %198, !llvm.loop !20

227:                                              ; preds = %202
  br label %303

228:                                              ; preds = %193
  %229 = load i32, ptr %2, align 4, !tbaa !5
  %230 = srem i32 %229, 8
  %231 = icmp eq i32 %230, 6
  br i1 %231, label %236, label %232

232:                                              ; preds = %228
  %233 = load i32, ptr %2, align 4, !tbaa !5
  %234 = srem i32 %233, 8
  %235 = icmp eq i32 %234, -2
  br i1 %235, label %236, label %265

236:                                              ; preds = %232, %228
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %237

237:                                              ; preds = %261, %236
  %238 = load i32, ptr %15, align 4, !tbaa !5
  %239 = load i32, ptr %3, align 4, !tbaa !5
  %240 = icmp slt i32 %238, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %237
  store i32 34, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %264

242:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %243

243:                                              ; preds = %251, %242
  %244 = load i32, ptr %16, align 4, !tbaa !5
  %245 = load i32, ptr %3, align 4, !tbaa !5
  %246 = sdiv i32 %245, 2
  %247 = icmp slt i32 %244, %246
  br i1 %247, label %249, label %248

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

249:                                              ; preds = %243
  %250 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %251

251:                                              ; preds = %249
  %252 = load i32, ptr %16, align 4, !tbaa !5
  %253 = add nsw i32 %252, 1
  store i32 %253, ptr %16, align 4, !tbaa !5
  br label %243, !llvm.loop !21

254:                                              ; preds = %248
  %255 = load i32, ptr %15, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %256
  %258 = load i8, ptr %257, align 1, !tbaa !9
  %259 = sext i8 %258 to i32
  %260 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %259)
  br label %261

261:                                              ; preds = %254
  %262 = load i32, ptr %15, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %15, align 4, !tbaa !5
  br label %237, !llvm.loop !22

264:                                              ; preds = %241
  br label %302

265:                                              ; preds = %232
  %266 = load i32, ptr %2, align 4, !tbaa !5
  %267 = srem i32 %266, 8
  %268 = icmp eq i32 %267, 7
  br i1 %268, label %273, label %269

269:                                              ; preds = %265
  %270 = load i32, ptr %2, align 4, !tbaa !5
  %271 = srem i32 %270, 8
  %272 = icmp eq i32 %271, -1
  br i1 %272, label %273, label %301

273:                                              ; preds = %269, %265
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %274

274:                                              ; preds = %297, %273
  %275 = load i32, ptr %17, align 4, !tbaa !5
  %276 = load i32, ptr %3, align 4, !tbaa !5
  %277 = icmp slt i32 %275, %276
  br i1 %277, label %279, label %278

278:                                              ; preds = %274
  store i32 40, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %300

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

280:                                              ; preds = %287, %279
  %281 = load i32, ptr %18, align 4, !tbaa !5
  %282 = load i32, ptr %17, align 4, !tbaa !5
  %283 = icmp slt i32 %281, %282
  br i1 %283, label %285, label %284

284:                                              ; preds = %280
  store i32 43, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %290

285:                                              ; preds = %280
  %286 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %287

287:                                              ; preds = %285
  %288 = load i32, ptr %18, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr %18, align 4, !tbaa !5
  br label %280, !llvm.loop !23

290:                                              ; preds = %284
  %291 = load i32, ptr %17, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %292
  %294 = load i8, ptr %293, align 1, !tbaa !9
  %295 = sext i8 %294 to i32
  %296 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %295)
  br label %297

297:                                              ; preds = %290
  %298 = load i32, ptr %17, align 4, !tbaa !5
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr %17, align 4, !tbaa !5
  br label %274, !llvm.loop !24

300:                                              ; preds = %278
  br label %301

301:                                              ; preds = %300, %269
  br label %302

302:                                              ; preds = %301, %264
  br label %303

303:                                              ; preds = %302, %227
  br label %304

304:                                              ; preds = %303, %187
  br label %305

305:                                              ; preds = %304, %161
  br label %306

306:                                              ; preds = %305, %122
  br label %307

307:                                              ; preds = %306, %82
  br label %308

308:                                              ; preds = %307, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %19, !llvm.loop !25

309:                                              ; preds = %19
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %310 = load i32, ptr %1, align 4
  ret i32 %310
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind willreturn memory(read) "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 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
!23 = distinct !{!23, !11}
!24 = distinct !{!24, !11}
!25 = distinct !{!25, !11}


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

@str = external dso_local global [85 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str, ptr noundef nonnull %1)
  %.not110 = icmp eq i32 %2, -1
  br i1 %.not110, label %._crit_edge113, label %.lr.ph112

.lr.ph112:                                        ; preds = %0, %.loopexit
  %3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #6
  %4 = trunc i64 %3 to i32
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = srem i32 %5, 8
  switch i32 %6, label %default.unreachable166 [
    i32 0, label %.preheader74
    i32 1, label %13
    i32 -7, label %13
    i32 2, label %27
    i32 -6, label %27
    i32 3, label %39
    i32 -5, label %39
    i32 4, label %51
    i32 -4, label %51
    i32 5, label %60
    i32 -3, label %60
    i32 6, label %71
    i32 -2, label %71
    i32 7, label %80
    i32 -1, label %80
  ]

.preheader74:                                     ; preds = %.lr.ph112
  %7 = icmp sgt i32 %4, 0
  br i1 %7, label %.lr.ph108.preheader, label %._crit_edge109

.lr.ph108.preheader:                              ; preds = %.preheader74
  %wide.trip.count164 = and i64 %3, 2147483647
  br label %.lr.ph108

._crit_edge109:                                   ; preds = %.lr.ph108, %.preheader74
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.loopexit

.lr.ph108:                                        ; preds = %.lr.ph108.preheader, %.lr.ph108
  %indvars.iv161 = phi i64 [ 0, %.lr.ph108.preheader ], [ %indvars.iv.next162, %.lr.ph108 ]
  %9 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %indvars.iv161
  %10 = load i8, ptr %9, align 1, !tbaa !9
  %11 = sext i8 %10 to i32
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11)
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %exitcond165.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count164
  br i1 %exitcond165.not, label %._crit_edge109, label %.lr.ph108, !llvm.loop !10

13:                                               ; preds = %.lr.ph112, %.lr.ph112
  %14 = icmp sgt i32 %4, 0
  br i1 %14, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %13
  %15 = and i64 %3, 2147483647
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge104
  %indvars.iv158 = phi i64 [ %15, %.preheader.preheader ], [ %indvars.iv.next159, %._crit_edge104 ]
  %indvars.iv155.in = phi i32 [ %4, %.preheader.preheader ], [ %indvars.iv155, %._crit_edge104 ]
  %indvars.iv155 = add nsw i32 %indvars.iv155.in, -1
  %indvars.iv.next159 = add nsw i64 %indvars.iv158, -1
  %16 = icmp ugt i64 %indvars.iv158, 1
  br i1 %16, label %.lr.ph103, label %._crit_edge104.thread

._crit_edge104.thread:                            ; preds = %.preheader
  %17 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %indvars.iv.next159
  %18 = load i8, ptr %17, align 1, !tbaa !9
  %19 = sext i8 %18 to i32
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %19)
  br label %.loopexit

._crit_edge104:                                   ; preds = %.lr.ph103
  %21 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %indvars.iv.next159
  %22 = load i8, ptr %21, align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %23)
  br i1 %16, label %.preheader, label %.loopexit, !llvm.loop !12

.lr.ph103:                                        ; preds = %.preheader, %.lr.ph103
  %.064102 = phi i32 [ %26, %.lr.ph103 ], [ 0, %.preheader ]
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %26 = add nuw nsw i32 %.064102, 1
  %exitcond157.not = icmp eq i32 %26, %indvars.iv155
  br i1 %exitcond157.not, label %._crit_edge104, label %.lr.ph103, !llvm.loop !13

27:                                               ; preds = %.lr.ph112, %.lr.ph112
  %28 = icmp sgt i32 %4, 0
  br i1 %28, label %.preheader69.lr.ph, label %.loopexit

.preheader69.lr.ph:                               ; preds = %27
  %29 = lshr i32 %4, 1
  %.not117 = icmp eq i32 %4, 1
  %umax148 = call i32 @llvm.umax.i32(i32 %29, i32 1)
  %30 = and i64 %3, 2147483647
  %wide.trip.count153 = and i64 %3, 2147483647
  br label %.preheader69

.preheader69:                                     ; preds = %.preheader69.lr.ph, %._crit_edge100
  %indvars.iv150 = phi i64 [ 0, %.preheader69.lr.ph ], [ %indvars.iv.next151, %._crit_edge100 ]
  br i1 %.not117, label %._crit_edge100, label %.lr.ph99

._crit_edge100:                                   ; preds = %.lr.ph99, %.preheader69
  %31 = xor i64 %indvars.iv150, -1
  %32 = add nsw i64 %30, %31
  %33 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !9
  %35 = sext i8 %34 to i32
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %35)
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153
  br i1 %exitcond154.not, label %.loopexit, label %.preheader69, !llvm.loop !14

.lr.ph99:                                         ; preds = %.preheader69, %.lr.ph99
  %.06298 = phi i32 [ %38, %.lr.ph99 ], [ 0, %.preheader69 ]
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %38 = add nuw nsw i32 %.06298, 1
  %exitcond149.not = icmp eq i32 %38, %umax148
  br i1 %exitcond149.not, label %._crit_edge100, label %.lr.ph99, !llvm.loop !15

39:                                               ; preds = %.lr.ph112, %.lr.ph112
  %40 = icmp sgt i32 %4, 0
  br i1 %40, label %.preheader70.preheader, label %.loopexit

.preheader70.preheader:                           ; preds = %39
  %41 = and i64 %3, 2147483647
  %wide.trip.count146 = and i64 %3, 2147483647
  br label %.preheader70

.preheader70:                                     ; preds = %.preheader70.preheader, %._crit_edge96
  %indvars.iv143 = phi i64 [ 0, %.preheader70.preheader ], [ %indvars.iv.next144, %._crit_edge96 ]
  %.not116 = icmp eq i64 %indvars.iv143, 0
  br i1 %.not116, label %._crit_edge96, label %.lr.ph95

._crit_edge96:                                    ; preds = %.lr.ph95, %.preheader70
  %42 = xor i64 %indvars.iv143, -1
  %43 = add nsw i64 %41, %42
  %44 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %46 = sext i8 %45 to i32
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %46)
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %exitcond147.not = icmp eq i64 %indvars.iv.next144, %wide.trip.count146
  br i1 %exitcond147.not, label %.loopexit, label %.preheader70, !llvm.loop !16

.lr.ph95:                                         ; preds = %.preheader70, %.lr.ph95
  %.06094 = phi i32 [ %49, %.lr.ph95 ], [ 0, %.preheader70 ]
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %49 = add nuw nsw i32 %.06094, 1
  %50 = zext nneg i32 %49 to i64
  %exitcond142.not = icmp eq i64 %indvars.iv143, %50
  br i1 %exitcond142.not, label %._crit_edge96, label %.lr.ph95, !llvm.loop !17

51:                                               ; preds = %.lr.ph112, %.lr.ph112
  %52 = icmp sgt i32 %4, 0
  br i1 %52, label %.lr.ph92.preheader, label %._crit_edge93

.lr.ph92.preheader:                               ; preds = %51
  %53 = and i64 %3, 2147483647
  br label %.lr.ph92

._crit_edge93:                                    ; preds = %.lr.ph92, %51
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.loopexit

.lr.ph92:                                         ; preds = %.lr.ph92.preheader, %.lr.ph92
  %indvars.iv139 = phi i64 [ %53, %.lr.ph92.preheader ], [ %indvars.iv.next140, %.lr.ph92 ]
  %indvars.iv.next140 = add nsw i64 %indvars.iv139, -1
  %55 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %indvars.iv.next140
  %56 = load i8, ptr %55, align 1, !tbaa !9
  %57 = sext i8 %56 to i32
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %57)
  %59 = icmp ugt i64 %indvars.iv139, 1
  br i1 %59, label %.lr.ph92, label %._crit_edge93, !llvm.loop !18

60:                                               ; preds = %.lr.ph112, %.lr.ph112
  %61 = icmp sgt i32 %4, 0
  br i1 %61, label %.preheader71.preheader, label %.loopexit

.preheader71.preheader:                           ; preds = %60
  %wide.trip.count137 = and i64 %3, 2147483647
  br label %.preheader71

.preheader71:                                     ; preds = %.preheader71.preheader, %._crit_edge88
  %indvars.iv134 = phi i64 [ 0, %.preheader71.preheader ], [ %indvars.iv.next135, %._crit_edge88 ]
  %indvars.iv131.in = phi i32 [ %4, %.preheader71.preheader ], [ %indvars.iv131, %._crit_edge88 ]
  %indvars.iv131 = add i32 %indvars.iv131.in, -1
  %62 = trunc nuw nsw i64 %indvars.iv134 to i32
  %63 = sub i32 %62, %4
  %64 = icmp slt i32 %63, -1
  br i1 %64, label %.lr.ph87, label %._crit_edge88

._crit_edge88:                                    ; preds = %.lr.ph87, %.preheader71
  %65 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %indvars.iv134
  %66 = load i8, ptr %65, align 1, !tbaa !9
  %67 = sext i8 %66 to i32
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %67)
  %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
  %exitcond138.not = icmp eq i64 %indvars.iv.next135, %wide.trip.count137
  br i1 %exitcond138.not, label %.loopexit, label %.preheader71, !llvm.loop !19

.lr.ph87:                                         ; preds = %.preheader71, %.lr.ph87
  %.05786 = phi i32 [ %70, %.lr.ph87 ], [ 0, %.preheader71 ]
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %70 = add nuw nsw i32 %.05786, 1
  %exitcond133.not = icmp eq i32 %70, %indvars.iv131
  br i1 %exitcond133.not, label %._crit_edge88, label %.lr.ph87, !llvm.loop !20

71:                                               ; preds = %.lr.ph112, %.lr.ph112
  %72 = icmp sgt i32 %4, 0
  br i1 %72, label %.preheader72.lr.ph, label %.loopexit

.preheader72.lr.ph:                               ; preds = %71
  %73 = lshr i32 %4, 1
  %.not115 = icmp eq i32 %4, 1
  %umax = call i32 @llvm.umax.i32(i32 %73, i32 1)
  %wide.trip.count129 = and i64 %3, 2147483647
  br label %.preheader72

.preheader72:                                     ; preds = %.preheader72.lr.ph, %._crit_edge84
  %indvars.iv126 = phi i64 [ 0, %.preheader72.lr.ph ], [ %indvars.iv.next127, %._crit_edge84 ]
  br i1 %.not115, label %._crit_edge84, label %.lr.ph83

._crit_edge84:                                    ; preds = %.lr.ph83, %.preheader72
  %74 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %indvars.iv126
  %75 = load i8, ptr %74, align 1, !tbaa !9
  %76 = sext i8 %75 to i32
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %76)
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count129
  br i1 %exitcond130.not, label %.loopexit, label %.preheader72, !llvm.loop !21

.lr.ph83:                                         ; preds = %.preheader72, %.lr.ph83
  %.05582 = phi i32 [ %79, %.lr.ph83 ], [ 0, %.preheader72 ]
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %79 = add nuw nsw i32 %.05582, 1
  %exitcond125.not = icmp eq i32 %79, %umax
  br i1 %exitcond125.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !22

80:                                               ; preds = %.lr.ph112, %.lr.ph112
  %81 = icmp sgt i32 %4, 0
  br i1 %81, label %.preheader73.preheader, label %.loopexit

.preheader73.preheader:                           ; preds = %80
  %wide.trip.count = and i64 %3, 2147483647
  br label %.preheader73

.preheader73:                                     ; preds = %.preheader73.preheader, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.preheader73.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %.not114 = icmp eq i64 %indvars.iv, 0
  br i1 %.not114, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.preheader73
  %82 = getelementptr inbounds [85 x i8], ptr @str, i64 0, i64 %indvars.iv
  %83 = load i8, ptr %82, align 1, !tbaa !9
  %84 = sext i8 %83 to i32
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %84)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond124.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond124.not, label %.loopexit, label %.preheader73, !llvm.loop !23

.lr.ph:                                           ; preds = %.preheader73, %.lr.ph
  %.080 = phi i32 [ %87, %.lr.ph ], [ 0, %.preheader73 ]
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %87 = add nuw nsw i32 %.080, 1
  %88 = zext nneg i32 %87 to i64
  %exitcond.not = icmp eq i64 %indvars.iv, %88
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !24

default.unreachable166:                           ; preds = %.lr.ph112
  unreachable

.loopexit:                                        ; preds = %._crit_edge, %._crit_edge84, %._crit_edge88, %._crit_edge96, %._crit_edge100, %._crit_edge104, %._crit_edge104.thread, %80, %71, %60, %39, %27, %13, %._crit_edge93, %._crit_edge109
  %89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str, ptr noundef nonnull %1)
  %.not = icmp eq i32 %89, -1
  br i1 %.not, label %._crit_edge113, label %.lr.ph112, !llvm.loop !25

._crit_edge113:                                   ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

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

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

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

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
!23 = distinct !{!23, !11}
!24 = distinct !{!24, !11}
!25 = distinct !{!25, !11}


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