; LLVM IR from tangjz/acm-icpc :: codeforces/complete/1551D2.ll (Z5solvev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.anon = type { ptr, ptr }
%class.anon.0 = type { i8 }
%class.anon.1 = type { i8 }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZZ5solvevE3ans = external hidden global [109 x [109 x i8]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.anon, align 8
  %10 = alloca %class.anon.0, align 1
  %11 = alloca %class.anon.1, align 1
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #4
  store i8 0, ptr %4, align 1, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = and i32 %21, 1
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %31

24:                                               ; preds = %0
  store i8 1, ptr %4, align 1, !tbaa !5
  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) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #4
  %25 = load i32, ptr %1, align 4, !tbaa !9
  %26 = load i32, ptr %2, align 4, !tbaa !9
  %27 = mul nsw i32 %25, %26
  %28 = sdiv i32 %27, 2
  %29 = load i32, ptr %3, align 4, !tbaa !9
  %30 = sub nsw i32 %28, %29
  store i32 %30, ptr %3, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %24, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %32 = load i32, ptr %1, align 4, !tbaa !9
  %33 = and i32 %32, 1
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = ashr i32 %34, 1
  %36 = mul nsw i32 %33, %35
  store i32 %36, ptr %5, align 4, !tbaa !9
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %46, label %40

40:                                               ; preds = %31
  %41 = load i32, ptr %3, align 4, !tbaa !9
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = sub nsw i32 %41, %42
  %44 = and i32 %43, 1
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %40, %31
  %47 = call i32 @puts(ptr noundef @.str.2)
  store i32 1, ptr %6, align 4
  br label %330

48:                                               ; preds = %40
  %49 = call i32 @puts(ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %72, %48
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = load i32, ptr %1, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

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

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %68, %55
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %2, align 4, !tbaa !9
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %56
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %63
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [109 x i8], ptr %64, i64 0, i64 %66
  store i8 0, ptr %67, align 1, !tbaa !11
  br label %68

68:                                               ; preds = %61
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %8, align 4, !tbaa !9
  br label %56, !llvm.loop !12

71:                                               ; preds = %60
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %7, align 4, !tbaa !9
  br label %50, !llvm.loop !14

75:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  %76 = getelementptr inbounds %class.anon, ptr %9, i32 0, i32 0
  store ptr %1, ptr %76, align 8, !tbaa !15
  %77 = getelementptr inbounds %class.anon, ptr %9, i32 0, i32 1
  store ptr %2, ptr %77, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  %78 = load i32, ptr %1, align 4, !tbaa !9
  %79 = and i32 %78, 1
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %120

81:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %116, %81
  %83 = load i32, ptr %12, align 4, !tbaa !9
  %84 = load i32, ptr %2, align 4, !tbaa !9
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %119

87:                                               ; preds = %82
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %10)
  %88 = load i32, ptr %1, align 4, !tbaa !9
  %89 = sub nsw i32 %88, 1
  %90 = load i32, ptr %12, align 4, !tbaa !9
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %89, i32 noundef %90)
  %91 = load i32, ptr %1, align 4, !tbaa !9
  %92 = sub nsw i32 %91, 1
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %92, i32 noundef %94)
  %95 = load i32, ptr %1, align 4, !tbaa !9
  %96 = sub nsw i32 %95, 1
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %11, i32 noundef %96, i32 noundef %97)
  %99 = load i32, ptr %1, align 4, !tbaa !9
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %101
  %103 = load i32, ptr %12, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [109 x i8], ptr %102, i64 0, i64 %105
  store i8 %98, ptr %106, align 1, !tbaa !11
  %107 = load i32, ptr %1, align 4, !tbaa !9
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %109
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [109 x i8], ptr %110, i64 0, i64 %112
  store i8 %98, ptr %113, align 1, !tbaa !11
  %114 = load i32, ptr %3, align 4, !tbaa !9
  %115 = add nsw i32 %114, -1
  store i32 %115, ptr %3, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %87
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = add nsw i32 %117, 2
  store i32 %118, ptr %12, align 4, !tbaa !9
  br label %82, !llvm.loop !17

119:                                              ; preds = %86
  br label %120

120:                                              ; preds = %119, %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %199, %120
  %122 = load i32, ptr %13, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  %124 = load i32, ptr %1, align 4, !tbaa !9
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %126, label %129

126:                                              ; preds = %121
  %127 = load i32, ptr %3, align 4, !tbaa !9
  %128 = icmp sgt i32 %127, 0
  br label %129

129:                                              ; preds = %126, %121
  %130 = phi i1 [ false, %121 ], [ %128, %126 ]
  br i1 %130, label %132, label %131

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

132:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %195, %132
  %134 = load i32, ptr %14, align 4, !tbaa !9
  %135 = load i32, ptr %2, align 4, !tbaa !9
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %140

137:                                              ; preds = %133
  %138 = load i32, ptr %3, align 4, !tbaa !9
  %139 = icmp sgt i32 %138, 0
  br label %140

140:                                              ; preds = %137, %133
  %141 = phi i1 [ false, %133 ], [ %139, %137 ]
  br i1 %141, label %143, label %142

142:                                              ; preds = %140
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %198

143:                                              ; preds = %140
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %10)
  %144 = load i32, ptr %13, align 4, !tbaa !9
  %145 = load i32, ptr %14, align 4, !tbaa !9
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %144, i32 noundef %145)
  %146 = load i32, ptr %13, align 4, !tbaa !9
  %147 = load i32, ptr %14, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %146, i32 noundef %148)
  %149 = load i32, ptr %13, align 4, !tbaa !9
  %150 = load i32, ptr %14, align 4, !tbaa !9
  %151 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %11, i32 noundef %149, i32 noundef %150)
  %152 = load i32, ptr %13, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %153
  %155 = load i32, ptr %14, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [109 x i8], ptr %154, i64 0, i64 %157
  store i8 %151, ptr %158, align 1, !tbaa !11
  %159 = load i32, ptr %13, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %160
  %162 = load i32, ptr %14, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [109 x i8], ptr %161, i64 0, i64 %163
  store i8 %151, ptr %164, align 1, !tbaa !11
  %165 = load i32, ptr %3, align 4, !tbaa !9
  %166 = add nsw i32 %165, -1
  store i32 %166, ptr %3, align 4, !tbaa !9
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %10)
  %167 = load i32, ptr %13, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  %169 = load i32, ptr %14, align 4, !tbaa !9
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %168, i32 noundef %169)
  %170 = load i32, ptr %13, align 4, !tbaa !9
  %171 = add nsw i32 %170, 1
  %172 = load i32, ptr %14, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %171, i32 noundef %173)
  %174 = load i32, ptr %13, align 4, !tbaa !9
  %175 = add nsw i32 %174, 1
  %176 = load i32, ptr %14, align 4, !tbaa !9
  %177 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %11, i32 noundef %175, i32 noundef %176)
  %178 = load i32, ptr %13, align 4, !tbaa !9
  %179 = add nsw i32 %178, 1
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %180
  %182 = load i32, ptr %14, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [109 x i8], ptr %181, i64 0, i64 %184
  store i8 %177, ptr %185, align 1, !tbaa !11
  %186 = load i32, ptr %13, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %188
  %190 = load i32, ptr %14, align 4, !tbaa !9
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [109 x i8], ptr %189, i64 0, i64 %191
  store i8 %177, ptr %192, align 1, !tbaa !11
  %193 = load i32, ptr %3, align 4, !tbaa !9
  %194 = add nsw i32 %193, -1
  store i32 %194, ptr %3, align 4, !tbaa !9
  br label %195

195:                                              ; preds = %143
  %196 = load i32, ptr %14, align 4, !tbaa !9
  %197 = add nsw i32 %196, 2
  store i32 %197, ptr %14, align 4, !tbaa !9
  br label %133, !llvm.loop !18

198:                                              ; preds = %142
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %13, align 4, !tbaa !9
  %201 = add nsw i32 %200, 2
  store i32 %201, ptr %13, align 4, !tbaa !9
  br label %121, !llvm.loop !19

202:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %263, %202
  %204 = load i32, ptr %15, align 4, !tbaa !9
  %205 = add nsw i32 %204, 1
  %206 = load i32, ptr %1, align 4, !tbaa !9
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %209, label %208

208:                                              ; preds = %203
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %266

209:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %210

210:                                              ; preds = %259, %209
  %211 = load i32, ptr %16, align 4, !tbaa !9
  %212 = load i32, ptr %2, align 4, !tbaa !9
  %213 = icmp slt i32 %211, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %210
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %262

215:                                              ; preds = %210
  %216 = load i32, ptr %15, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %217
  %219 = load i32, ptr %16, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [109 x i8], ptr %218, i64 0, i64 %220
  %222 = load i8, ptr %221, align 1, !tbaa !11
  %223 = sext i8 %222 to i32
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %236, label %225

225:                                              ; preds = %215
  %226 = load i32, ptr %15, align 4, !tbaa !9
  %227 = add nsw i32 %226, 1
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %228
  %230 = load i32, ptr %16, align 4, !tbaa !9
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [109 x i8], ptr %229, i64 0, i64 %231
  %233 = load i8, ptr %232, align 1, !tbaa !11
  %234 = sext i8 %233 to i32
  %235 = icmp ne i32 %234, 0
  br i1 %235, label %236, label %237

236:                                              ; preds = %225, %215
  br label %259

237:                                              ; preds = %225
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %10)
  %238 = load i32, ptr %15, align 4, !tbaa !9
  %239 = load i32, ptr %16, align 4, !tbaa !9
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %238, i32 noundef %239)
  %240 = load i32, ptr %15, align 4, !tbaa !9
  %241 = add nsw i32 %240, 1
  %242 = load i32, ptr %16, align 4, !tbaa !9
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %241, i32 noundef %242)
  %243 = load i32, ptr %15, align 4, !tbaa !9
  %244 = load i32, ptr %16, align 4, !tbaa !9
  %245 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %11, i32 noundef %243, i32 noundef %244)
  %246 = load i32, ptr %15, align 4, !tbaa !9
  %247 = add nsw i32 %246, 1
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %248
  %250 = load i32, ptr %16, align 4, !tbaa !9
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [109 x i8], ptr %249, i64 0, i64 %251
  store i8 %245, ptr %252, align 1, !tbaa !11
  %253 = load i32, ptr %15, align 4, !tbaa !9
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %254
  %256 = load i32, ptr %16, align 4, !tbaa !9
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [109 x i8], ptr %255, i64 0, i64 %257
  store i8 %245, ptr %258, align 1, !tbaa !11
  br label %259

259:                                              ; preds = %237, %236
  %260 = load i32, ptr %16, align 4, !tbaa !9
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %16, align 4, !tbaa !9
  br label %210, !llvm.loop !20

262:                                              ; preds = %214
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %15, align 4, !tbaa !9
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %15, align 4, !tbaa !9
  br label %203, !llvm.loop !21

266:                                              ; preds = %208
  %267 = load i8, ptr %4, align 1, !tbaa !5, !range !22, !noundef !23
  %268 = trunc i8 %267 to i1
  br i1 %268, label %269, label %308

269:                                              ; preds = %266
  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) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %270

270:                                              ; preds = %304, %269
  %271 = load i32, ptr %17, align 4, !tbaa !9
  %272 = load i32, ptr %1, align 4, !tbaa !9
  %273 = icmp slt i32 %271, %272
  br i1 %273, label %278, label %274

274:                                              ; preds = %270
  %275 = load i32, ptr %17, align 4, !tbaa !9
  %276 = load i32, ptr %2, align 4, !tbaa !9
  %277 = icmp slt i32 %275, %276
  br label %278

278:                                              ; preds = %274, %270
  %279 = phi i1 [ true, %270 ], [ %277, %274 ]
  br i1 %279, label %281, label %280

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

281:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %282

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

286:                                              ; preds = %282
  store i32 26, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %303

287:                                              ; preds = %282
  %288 = load i32, ptr %17, align 4, !tbaa !9
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %289
  %291 = load i32, ptr %18, align 4, !tbaa !9
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [109 x i8], ptr %290, i64 0, i64 %292
  %294 = load i32, ptr %18, align 4, !tbaa !9
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %295
  %297 = load i32, ptr %17, align 4, !tbaa !9
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [109 x i8], ptr %296, i64 0, i64 %298
  call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %293, ptr noundef nonnull align 1 dereferenceable(1) %299) #4
  br label %300

300:                                              ; preds = %287
  %301 = load i32, ptr %18, align 4, !tbaa !9
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %18, align 4, !tbaa !9
  br label %282, !llvm.loop !24

303:                                              ; preds = %286
  br label %304

304:                                              ; preds = %303
  %305 = load i32, ptr %17, align 4, !tbaa !9
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %17, align 4, !tbaa !9
  br label %270, !llvm.loop !25

307:                                              ; preds = %280
  br label %308

308:                                              ; preds = %307, %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %309

309:                                              ; preds = %326, %308
  %310 = load i32, ptr %19, align 4, !tbaa !9
  %311 = load i32, ptr %1, align 4, !tbaa !9
  %312 = icmp slt i32 %310, %311
  br i1 %312, label %314, label %313

313:                                              ; preds = %309
  store i32 29, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %329

314:                                              ; preds = %309
  %315 = load i32, ptr %19, align 4, !tbaa !9
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %316
  %318 = load i32, ptr %2, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [109 x i8], ptr %317, i64 0, i64 %319
  store i8 0, ptr %320, align 1, !tbaa !11
  %321 = load i32, ptr %19, align 4, !tbaa !9
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %322
  %324 = getelementptr inbounds [109 x i8], ptr %323, i64 0, i64 0
  %325 = call i32 @puts(ptr noundef %324)
  br label %326

326:                                              ; preds = %314
  %327 = load i32, ptr %19, align 4, !tbaa !9
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %19, align 4, !tbaa !9
  br label %309, !llvm.loop !26

329:                                              ; preds = %313
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  store i32 0, ptr %6, align 4
  br label %330

330:                                              ; preds = %329, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  %331 = load i32, ptr %6, align 4
  switch i32 %331, label %333 [
    i32 0, label %332
    i32 1, label %332
  ]

332:                                              ; preds = %330, %330
  ret void

333:                                              ; preds = %330
  unreachable
}

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

declare i32 @puts(ptr noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #3 align 2

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

attributes #0 = { 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 #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 = { 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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.anon = type { ptr, ptr }
%class.anon.0 = type { i8 }
%class.anon.1 = type { i8 }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZZ5solvevE3ans = external hidden global [109 x [109 x i8]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %class.anon, align 8
  %5 = alloca %class.anon.0, align 1
  %6 = alloca %class.anon.1, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = and i32 %8, 1
  %.not.not = icmp eq i32 %9, 0
  br i1 %.not.not, label %._crit_edge149, label %10

._crit_edge149:                                   ; preds = %0
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.pre150 = load i32, ptr %3, align 4, !tbaa !5
  br label %17

10:                                               ; preds = %0
  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) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #5
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = mul nsw i32 %12, %11
  %14 = sdiv i32 %13, 2
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = sub nsw i32 %14, %15
  store i32 %16, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %._crit_edge149, %10
  %18 = phi i32 [ %.pre150, %._crit_edge149 ], [ %16, %10 ]
  %19 = phi i32 [ %8, %._crit_edge149 ], [ %12, %10 ]
  %20 = phi i32 [ %.pre, %._crit_edge149 ], [ %11, %10 ]
  %21 = ashr i32 %19, 1
  %22 = trunc i32 %20 to i1
  %23 = select i1 %22, i32 %21, i32 0
  %24 = icmp slt i32 %18, %23
  br i1 %24, label %28, label %25

25:                                               ; preds = %17
  %26 = sub nsw i32 %18, %23
  %27 = and i32 %26, 1
  %.not86 = icmp eq i32 %27, 0
  br i1 %.not86, label %30, label %28

28:                                               ; preds = %25, %17
  %29 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %166

30:                                               ; preds = %25
  %31 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  %.pre151 = load i32, ptr %2, align 4
  br i1 %33, label %.preheader95.lr.ph, label %._crit_edge98

.preheader95.lr.ph:                               ; preds = %30
  %34 = icmp sgt i32 %.pre151, 0
  br i1 %34, label %.preheader95.us.preheader, label %._crit_edge98.thread

._crit_edge98.thread:                             ; preds = %.preheader95.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  store ptr %1, ptr %4, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %2, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  br label %._crit_edge98..loopexit94_crit_edge

.preheader95.us.preheader:                        ; preds = %.preheader95.lr.ph
  %36 = zext nneg i32 %.pre151 to i64
  %wide.trip.count = zext nneg i32 %32 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %37 = icmp ult i32 %32, 8
  br i1 %37, label %._crit_edge98.loopexit.unr-lcssa, label %.preheader95.us.preheader.new

.preheader95.us.preheader.new:                    ; preds = %.preheader95.us.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  br label %.preheader95.us

.preheader95.us:                                  ; preds = %.preheader95.us, %.preheader95.us.preheader.new
  %indvar = phi i64 [ 0, %.preheader95.us.preheader.new ], [ %indvar.next.7, %.preheader95.us ]
  %niter = phi i64 [ 0, %.preheader95.us.preheader.new ], [ %niter.next.7, %.preheader95.us ]
  %38 = mul nuw nsw i64 %indvar, 109
  %scevgep = getelementptr i8, ptr @_ZZ5solvevE3ans, i64 %38
  call void @llvm.memset.p0.i64(ptr align 8 %scevgep, i8 0, i64 %36, i1 false), !tbaa !11
  %39 = mul nuw i64 %indvar, 109
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ5solvevE3ans, i64 109), i64 %39
  call void @llvm.memset.p0.i64(ptr align 1 %gep, i8 0, i64 %36, i1 false), !tbaa !11
  %40 = mul nuw i64 %indvar, 109
  %gep197 = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ5solvevE3ans, i64 218), i64 %40
  call void @llvm.memset.p0.i64(ptr align 2 %gep197, i8 0, i64 %36, i1 false), !tbaa !11
  %41 = mul nuw i64 %indvar, 109
  %gep198 = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ5solvevE3ans, i64 327), i64 %41
  call void @llvm.memset.p0.i64(ptr align 1 %gep198, i8 0, i64 %36, i1 false), !tbaa !11
  %42 = mul nuw i64 %indvar, 109
  %gep199 = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ5solvevE3ans, i64 436), i64 %42
  call void @llvm.memset.p0.i64(ptr align 4 %gep199, i8 0, i64 %36, i1 false), !tbaa !11
  %43 = mul nuw i64 %indvar, 109
  %gep200 = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ5solvevE3ans, i64 545), i64 %43
  call void @llvm.memset.p0.i64(ptr align 1 %gep200, i8 0, i64 %36, i1 false), !tbaa !11
  %44 = mul nuw i64 %indvar, 109
  %gep201 = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ5solvevE3ans, i64 654), i64 %44
  call void @llvm.memset.p0.i64(ptr align 2 %gep201, i8 0, i64 %36, i1 false), !tbaa !11
  %45 = mul nuw i64 %indvar, 109
  %gep202 = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ5solvevE3ans, i64 763), i64 %45
  call void @llvm.memset.p0.i64(ptr align 1 %gep202, i8 0, i64 %36, i1 false), !tbaa !11
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge98.loopexit.unr-lcssa, label %.preheader95.us, !llvm.loop !12

._crit_edge98.loopexit.unr-lcssa:                 ; preds = %.preheader95.us, %.preheader95.us.preheader
  %indvar.unr = phi i64 [ 0, %.preheader95.us.preheader ], [ %indvar.next.7, %.preheader95.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge98, label %.preheader95.us.epil

.preheader95.us.epil:                             ; preds = %._crit_edge98.loopexit.unr-lcssa, %.preheader95.us.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader95.us.epil ], [ %indvar.unr, %._crit_edge98.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader95.us.epil ], [ 0, %._crit_edge98.loopexit.unr-lcssa ]
  %46 = mul nuw nsw i64 %indvar.epil, 109
  %scevgep.epil = getelementptr i8, ptr @_ZZ5solvevE3ans, i64 %46
  call void @llvm.memset.p0.i64(ptr align 1 %scevgep.epil, i8 0, i64 %36, i1 false), !tbaa !11
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge98, label %.preheader95.us.epil, !llvm.loop !14

._crit_edge98:                                    ; preds = %._crit_edge98.loopexit.unr-lcssa, %.preheader95.us.epil, %30
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  store ptr %1, ptr %4, align 8, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %2, ptr %47, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  %48 = and i32 %32, 1
  %.not87 = icmp ne i32 %48, 0
  %49 = icmp sgt i32 %.pre151, 0
  %or.cond = select i1 %.not87, i1 %49, i1 false
  br i1 %or.cond, label %.lr.ph, label %._crit_edge98..loopexit94_crit_edge

._crit_edge98..loopexit94_crit_edge:              ; preds = %._crit_edge98.thread, %._crit_edge98
  %.pre152 = load i32, ptr %3, align 4
  br label %.loopexit94

.lr.ph:                                           ; preds = %._crit_edge98, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %._crit_edge98 ]
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %5)
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  %52 = trunc nuw nsw i64 %indvars.iv to i32
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %51, i32 noundef %52)
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  %55 = or disjoint i64 %indvars.iv, 1
  %56 = trunc nuw nsw i64 %55 to i32
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %54, i32 noundef %56)
  %57 = load i32, ptr %1, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  %59 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %58, i32 noundef %52)
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %62, i64 %55
  store i8 %59, ptr %63, align 1, !tbaa !11
  %64 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %62, i64 %indvars.iv
  store i8 %59, ptr %64, align 1, !tbaa !11
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %3, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = trunc nuw i64 %indvars.iv.next to i32
  %69 = icmp sgt i32 %67, %68
  br i1 %69, label %.lr.ph, label %.loopexit94, !llvm.loop !16

.loopexit94:                                      ; preds = %.lr.ph, %._crit_edge98..loopexit94_crit_edge
  %70 = phi i32 [ %.pre151, %._crit_edge98..loopexit94_crit_edge ], [ %67, %.lr.ph ]
  %71 = phi i32 [ %.pre152, %._crit_edge98..loopexit94_crit_edge ], [ %66, %.lr.ph ]
  %72 = phi i32 [ %32, %._crit_edge98..loopexit94_crit_edge ], [ %60, %.lr.ph ]
  %73 = icmp sgt i32 %72, 1
  %74 = icmp sgt i32 %71, 0
  %75 = select i1 %73, i1 %74, i1 false
  br i1 %75, label %.preheader92, label %.preheader91

.preheader92:                                     ; preds = %.loopexit94, %._crit_edge
  %76 = phi i32 [ %87, %._crit_edge ], [ %71, %.loopexit94 ]
  %77 = phi i32 [ %88, %._crit_edge ], [ %72, %.loopexit94 ]
  %78 = phi i32 [ %89, %._crit_edge ], [ %70, %.loopexit94 ]
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %._crit_edge ], [ 0, %.loopexit94 ]
  %79 = or disjoint i64 %indvars.iv125, 1
  %80 = icmp sgt i32 %78, 0
  br i1 %80, label %.lr.ph101, label %._crit_edge

.lr.ph101:                                        ; preds = %.preheader92
  %81 = trunc nuw nsw i64 %indvars.iv125 to i32
  %82 = trunc nuw nsw i64 %79 to i32
  br label %95

.preheader91:                                     ; preds = %._crit_edge, %.loopexit94
  %83 = phi i32 [ %70, %.loopexit94 ], [ %89, %._crit_edge ]
  %84 = phi i32 [ %72, %.loopexit94 ], [ %88, %._crit_edge ]
  %85 = icmp sgt i32 %84, 1
  %86 = icmp sgt i32 %83, 0
  %or.cond169 = select i1 %85, i1 %86, i1 false
  br i1 %or.cond169, label %.preheader89, label %._crit_edge106

._crit_edge.loopexit:                             ; preds = %95
  %.pre153 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader92
  %87 = phi i32 [ %108, %._crit_edge.loopexit ], [ %76, %.preheader92 ]
  %88 = phi i32 [ %.pre153, %._crit_edge.loopexit ], [ %77, %.preheader92 ]
  %89 = phi i32 [ %109, %._crit_edge.loopexit ], [ %78, %.preheader92 ]
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 2
  %90 = trunc i64 %indvars.iv.next126 to i32
  %91 = or disjoint i32 %90, 1
  %92 = icmp slt i32 %91, %88
  %93 = icmp sgt i32 %87, 0
  %94 = select i1 %92, i1 %93, i1 false
  br i1 %94, label %.preheader92, label %.preheader91, !llvm.loop !17

95:                                               ; preds = %.lr.ph101, %95
  %indvars.iv122 = phi i64 [ 0, %.lr.ph101 ], [ %indvars.iv.next123, %95 ]
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %5)
  %96 = trunc nuw nsw i64 %indvars.iv122 to i32
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %81, i32 noundef %96)
  %97 = or disjoint i64 %indvars.iv122, 1
  %98 = trunc nuw nsw i64 %97 to i32
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %81, i32 noundef %98)
  %99 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %81, i32 noundef %96)
  %100 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv125, i64 %97
  store i8 %99, ptr %100, align 1, !tbaa !11
  %101 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv125, i64 %indvars.iv122
  store i8 %99, ptr %101, align 2, !tbaa !11
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = add nsw i32 %102, -1
  store i32 %103, ptr %3, align 4, !tbaa !5
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %82, i32 noundef %96)
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %82, i32 noundef %98)
  %104 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %82, i32 noundef %96)
  %105 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %79, i64 %97
  store i8 %104, ptr %105, align 2, !tbaa !11
  %106 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %79, i64 %indvars.iv122
  store i8 %104, ptr %106, align 1, !tbaa !11
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr %3, align 4, !tbaa !5
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 2
  %109 = load i32, ptr %2, align 4, !tbaa !5
  %110 = trunc nuw i64 %indvars.iv.next123 to i32
  %111 = icmp sgt i32 %109, %110
  %112 = icmp sgt i32 %107, 1
  %113 = select i1 %111, i1 %112, i1 false
  br i1 %113, label %95, label %._crit_edge.loopexit, !llvm.loop !18

.loopexit90.loopexit:                             ; preds = %136
  %.pre155 = load i32, ptr %1, align 4, !tbaa !5
  br label %.loopexit90

.loopexit90:                                      ; preds = %.loopexit90.loopexit, %.preheader89
  %114 = phi i32 [ %.pre155, %.loopexit90.loopexit ], [ %119, %.preheader89 ]
  %115 = phi i32 [ %137, %.loopexit90.loopexit ], [ %120, %.preheader89 ]
  %116 = phi i32 [ %137, %.loopexit90.loopexit ], [ %121, %.preheader89 ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %117 = sext i32 %114 to i64
  %118 = icmp slt i64 %indvars.iv.next132, %117
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  br i1 %118, label %.preheader89, label %._crit_edge106, !llvm.loop !19

.preheader89:                                     ; preds = %.preheader91, %.loopexit90
  %119 = phi i32 [ %114, %.loopexit90 ], [ %84, %.preheader91 ]
  %120 = phi i32 [ %115, %.loopexit90 ], [ %83, %.preheader91 ]
  %121 = phi i32 [ %116, %.loopexit90 ], [ %83, %.preheader91 ]
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %.loopexit90 ], [ 0, %.preheader91 ]
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %.loopexit90 ], [ 1, %.preheader91 ]
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %.lr.ph104, label %.loopexit90

.lr.ph104:                                        ; preds = %.preheader89
  %123 = trunc nuw nsw i64 %indvars.iv133 to i32
  %124 = trunc nuw nsw i64 %indvars.iv131 to i32
  br label %126

._crit_edge106:                                   ; preds = %.loopexit90, %.preheader91
  %125 = phi i32 [ %84, %.preheader91 ], [ %114, %.loopexit90 ]
  br i1 %.not.not, label %.loopexit, label %140

126:                                              ; preds = %.lr.ph104, %136
  %127 = phi i32 [ %120, %.lr.ph104 ], [ %137, %136 ]
  %indvars.iv128 = phi i64 [ 0, %.lr.ph104 ], [ %indvars.iv.next129, %136 ]
  %128 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv133, i64 %indvars.iv128
  %129 = load i8, ptr %128, align 1, !tbaa !11
  %.not = icmp eq i8 %129, 0
  br i1 %.not, label %130, label %136

130:                                              ; preds = %126
  %131 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv131, i64 %indvars.iv128
  %132 = load i8, ptr %131, align 1, !tbaa !11
  %.not88 = icmp eq i8 %132, 0
  br i1 %.not88, label %133, label %136

133:                                              ; preds = %130
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %5)
  %134 = trunc nuw nsw i64 %indvars.iv128 to i32
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %123, i32 noundef %134)
  call void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %124, i32 noundef %134)
  %135 = call noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %123, i32 noundef %134)
  store i8 %135, ptr %131, align 1, !tbaa !11
  store i8 %135, ptr %128, align 1, !tbaa !11
  %.pre154 = load i32, ptr %2, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %126, %130, %133
  %137 = phi i32 [ %127, %126 ], [ %127, %130 ], [ %.pre154, %133 ]
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %138 = sext i32 %137 to i64
  %139 = icmp slt i64 %indvars.iv.next129, %138
  br i1 %139, label %126, label %.loopexit90.loopexit, !llvm.loop !21

140:                                              ; preds = %._crit_edge106
  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) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #5
  %141 = load i32, ptr %1, align 4, !tbaa !5
  %142 = icmp sgt i32 %141, 0
  %143 = load i32, ptr %2, align 4
  %144 = icmp sgt i32 %143, 0
  %145 = select i1 %142, i1 true, i1 %144
  br i1 %145, label %.preheader, label %._crit_edge114

.preheader:                                       ; preds = %140, %._crit_edge109
  %146 = phi i32 [ %148, %._crit_edge109 ], [ %143, %140 ]
  %147 = phi i32 [ %149, %._crit_edge109 ], [ %141, %140 ]
  %indvars.iv143 = phi i64 [ %indvars.iv.next144, %._crit_edge109 ], [ 0, %140 ]
  %.not116 = icmp eq i64 %indvars.iv143, 0
  br i1 %.not116, label %._crit_edge109, label %.lr.ph108

._crit_edge109.loopexit:                          ; preds = %.lr.ph108
  %.pre156 = load i32, ptr %1, align 4, !tbaa !5
  %.pre157 = load i32, ptr %2, align 4
  br label %._crit_edge109

._crit_edge109:                                   ; preds = %._crit_edge109.loopexit, %.preheader
  %148 = phi i32 [ %.pre157, %._crit_edge109.loopexit ], [ %146, %.preheader ]
  %149 = phi i32 [ %.pre156, %._crit_edge109.loopexit ], [ %147, %.preheader ]
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %150 = trunc nuw i64 %indvars.iv.next144 to i32
  %151 = icmp sgt i32 %149, %150
  %152 = icmp sgt i32 %148, %150
  %153 = select i1 %151, i1 true, i1 %152
  br i1 %153, label %.preheader, label %.loopexit, !llvm.loop !22

.lr.ph108:                                        ; preds = %.preheader, %.lr.ph108
  %indvars.iv138 = phi i64 [ %indvars.iv.next139, %.lr.ph108 ], [ 0, %.preheader ]
  %154 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv143, i64 %indvars.iv138
  %155 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv138, i64 %indvars.iv143
  call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %154, ptr noundef nonnull align 1 dereferenceable(1) %155) #5
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %exitcond142.not = icmp eq i64 %indvars.iv.next139, %indvars.iv143
  br i1 %exitcond142.not, label %._crit_edge109.loopexit, label %.lr.ph108, !llvm.loop !23

.loopexit:                                        ; preds = %._crit_edge109, %._crit_edge106
  %156 = phi i32 [ %125, %._crit_edge106 ], [ %149, %._crit_edge109 ]
  %157 = icmp sgt i32 %156, 0
  br i1 %157, label %.lr.ph113, label %._crit_edge114

._crit_edge114:                                   ; preds = %.lr.ph113, %140, %.loopexit
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %166

.lr.ph113:                                        ; preds = %.loopexit, %.lr.ph113
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %.lr.ph113 ], [ 0, %.loopexit ]
  %158 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv146
  %159 = load i32, ptr %2, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [109 x [109 x i8]], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv146, i64 %160
  store i8 0, ptr %161, align 1, !tbaa !11
  %162 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %158)
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %163 = load i32, ptr %1, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = icmp slt i64 %indvars.iv.next147, %164
  br i1 %165, label %.lr.ph113, label %._crit_edge114, !llvm.loop !24

166:                                              ; preds = %._crit_edge114, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void
}

; 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: 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: nofree nounwind
declare noundef i32 @puts(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: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef signext i8 @"_ZZ5solvevENK3$_2clEii"(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13, !20}
!20 = !{!"llvm.loop.unswitch.partial.disable"}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}


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