; LLVM IR from eyangch/competitive-programming :: Codeforces/714 (d)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3qryiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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
  store i32 0, ptr %1, align 4
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %21 = load i32, ptr @N, align 4, !tbaa !8
  store i32 %21, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %22

22:                                               ; preds = %42, %0
  %23 = load i32, ptr %2, align 4, !tbaa !8
  %24 = load i32, ptr %3, align 4, !tbaa !8
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %26, label %43

26:                                               ; preds = %22
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = load i32, ptr %3, align 4, !tbaa !8
  %29 = add nsw i32 %27, %28
  %30 = sdiv i32 %29, 2
  store i32 %30, ptr %4, align 4, !tbaa !8
  %31 = load i32, ptr %4, align 4, !tbaa !8
  %32 = load i32, ptr @N, align 4, !tbaa !8
  %33 = call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef 1, i32 noundef %31, i32 noundef %32)
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %38

35:                                               ; preds = %26
  %36 = load i32, ptr %4, align 4, !tbaa !8
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !8
  br label %42

38:                                               ; preds = %26
  %39 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %39, ptr %5, align 4, !tbaa !8
  %40 = load i32, ptr %4, align 4, !tbaa !8
  %41 = sub nsw i32 %40, 1
  store i32 %41, ptr %3, align 4, !tbaa !8
  br label %42

42:                                               ; preds = %38, %35
  br label %22, !llvm.loop !11

43:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %44 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %44, ptr %6, align 4, !tbaa !8
  store i32 1, ptr %2, align 4, !tbaa !8
  %45 = load i32, ptr %6, align 4, !tbaa !8
  store i32 %45, ptr %3, align 4, !tbaa !8
  br label %46

46:                                               ; preds = %67, %43
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %50, label %68

50:                                               ; preds = %46
  %51 = load i32, ptr %2, align 4, !tbaa !8
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = add nsw i32 %51, %52
  %54 = sdiv i32 %53, 2
  store i32 %54, ptr %4, align 4, !tbaa !8
  %55 = load i32, ptr %4, align 4, !tbaa !8
  %56 = load i32, ptr %6, align 4, !tbaa !8
  %57 = load i32, ptr @N, align 4, !tbaa !8
  %58 = call noundef i32 @_Z3qryiiii(i32 noundef %55, i32 noundef 1, i32 noundef %56, i32 noundef %57)
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %50
  %61 = load i32, ptr %4, align 4, !tbaa !8
  %62 = sub nsw i32 %61, 1
  store i32 %62, ptr %3, align 4, !tbaa !8
  br label %67

63:                                               ; preds = %50
  %64 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %64, ptr %5, align 4, !tbaa !8
  %65 = load i32, ptr %4, align 4, !tbaa !8
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %2, align 4, !tbaa !8
  br label %67

67:                                               ; preds = %63, %60
  br label %46, !llvm.loop !13

68:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %69 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %69, ptr %7, align 4, !tbaa !8
  store i32 1, ptr %2, align 4, !tbaa !8
  %70 = load i32, ptr @N, align 4, !tbaa !8
  store i32 %70, ptr %3, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %92, %68
  %72 = load i32, ptr %2, align 4, !tbaa !8
  %73 = load i32, ptr %3, align 4, !tbaa !8
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %75, label %93

75:                                               ; preds = %71
  %76 = load i32, ptr %2, align 4, !tbaa !8
  %77 = load i32, ptr %3, align 4, !tbaa !8
  %78 = add nsw i32 %76, %77
  %79 = sdiv i32 %78, 2
  store i32 %79, ptr %4, align 4, !tbaa !8
  %80 = load i32, ptr %7, align 4, !tbaa !8
  %81 = load i32, ptr %6, align 4, !tbaa !8
  %82 = load i32, ptr %4, align 4, !tbaa !8
  %83 = call noundef i32 @_Z3qryiiii(i32 noundef %80, i32 noundef 1, i32 noundef %81, i32 noundef %82)
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %75
  %86 = load i32, ptr %4, align 4, !tbaa !8
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %2, align 4, !tbaa !8
  br label %92

88:                                               ; preds = %75
  %89 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %89, ptr %5, align 4, !tbaa !8
  %90 = load i32, ptr %4, align 4, !tbaa !8
  %91 = sub nsw i32 %90, 1
  store i32 %91, ptr %3, align 4, !tbaa !8
  br label %92

92:                                               ; preds = %88, %85
  br label %71, !llvm.loop !14

93:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %94 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %94, ptr %8, align 4, !tbaa !8
  store i32 1, ptr %2, align 4, !tbaa !8
  %95 = load i32, ptr %8, align 4, !tbaa !8
  store i32 %95, ptr %3, align 4, !tbaa !8
  br label %96

96:                                               ; preds = %118, %93
  %97 = load i32, ptr %2, align 4, !tbaa !8
  %98 = load i32, ptr %3, align 4, !tbaa !8
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %100, label %119

100:                                              ; preds = %96
  %101 = load i32, ptr %2, align 4, !tbaa !8
  %102 = load i32, ptr %3, align 4, !tbaa !8
  %103 = add nsw i32 %101, %102
  %104 = sdiv i32 %103, 2
  store i32 %104, ptr %4, align 4, !tbaa !8
  %105 = load i32, ptr %7, align 4, !tbaa !8
  %106 = load i32, ptr %4, align 4, !tbaa !8
  %107 = load i32, ptr %6, align 4, !tbaa !8
  %108 = load i32, ptr %8, align 4, !tbaa !8
  %109 = call noundef i32 @_Z3qryiiii(i32 noundef %105, i32 noundef %106, i32 noundef %107, i32 noundef %108)
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %114

111:                                              ; preds = %100
  %112 = load i32, ptr %4, align 4, !tbaa !8
  %113 = sub nsw i32 %112, 1
  store i32 %113, ptr %3, align 4, !tbaa !8
  br label %118

114:                                              ; preds = %100
  %115 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %115, ptr %5, align 4, !tbaa !8
  %116 = load i32, ptr %4, align 4, !tbaa !8
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %2, align 4, !tbaa !8
  br label %118

118:                                              ; preds = %114, %111
  br label %96, !llvm.loop !15

119:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %120 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %120, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %121 = load i32, ptr @N, align 4, !tbaa !8
  store i32 %121, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %122 = load i32, ptr @N, align 4, !tbaa !8
  store i32 %122, ptr %13, align 4, !tbaa !8
  %123 = load i32, ptr %6, align 4, !tbaa !8
  %124 = add nsw i32 %123, 1
  %125 = load i32, ptr @N, align 4, !tbaa !8
  %126 = load i32, ptr @N, align 4, !tbaa !8
  %127 = call noundef i32 @_Z3qryiiii(i32 noundef %124, i32 noundef 1, i32 noundef %125, i32 noundef %126)
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %132

129:                                              ; preds = %119
  %130 = load i32, ptr %6, align 4, !tbaa !8
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %10, align 4, !tbaa !8
  br label %163

132:                                              ; preds = %119
  %133 = load i32, ptr %8, align 4, !tbaa !8
  %134 = add nsw i32 %133, 1
  %135 = load i32, ptr @N, align 4, !tbaa !8
  %136 = load i32, ptr @N, align 4, !tbaa !8
  %137 = call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef %134, i32 noundef %135, i32 noundef %136)
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %142

139:                                              ; preds = %132
  %140 = load i32, ptr %8, align 4, !tbaa !8
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %12, align 4, !tbaa !8
  br label %162

142:                                              ; preds = %132
  %143 = load i32, ptr @N, align 4, !tbaa !8
  %144 = load i32, ptr %9, align 4, !tbaa !8
  %145 = sub nsw i32 %144, 1
  %146 = call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef 1, i32 noundef %143, i32 noundef %145)
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %151

148:                                              ; preds = %142
  %149 = load i32, ptr %9, align 4, !tbaa !8
  %150 = sub nsw i32 %149, 1
  store i32 %150, ptr %13, align 4, !tbaa !8
  br label %161

151:                                              ; preds = %142
  %152 = load i32, ptr %7, align 4, !tbaa !8
  %153 = sub nsw i32 %152, 1
  %154 = load i32, ptr @N, align 4, !tbaa !8
  %155 = call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef 1, i32 noundef %153, i32 noundef %154)
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %160

157:                                              ; preds = %151
  %158 = load i32, ptr %7, align 4, !tbaa !8
  %159 = sub nsw i32 %158, 1
  store i32 %159, ptr %11, align 4, !tbaa !8
  br label %160

160:                                              ; preds = %157, %151
  br label %161

161:                                              ; preds = %160, %148
  br label %162

162:                                              ; preds = %161, %139
  br label %163

163:                                              ; preds = %162, %129
  %164 = load i32, ptr %10, align 4, !tbaa !8
  store i32 %164, ptr %2, align 4, !tbaa !8
  %165 = load i32, ptr %11, align 4, !tbaa !8
  store i32 %165, ptr %3, align 4, !tbaa !8
  br label %166

166:                                              ; preds = %188, %163
  %167 = load i32, ptr %2, align 4, !tbaa !8
  %168 = load i32, ptr %3, align 4, !tbaa !8
  %169 = icmp sle i32 %167, %168
  br i1 %169, label %170, label %189

170:                                              ; preds = %166
  %171 = load i32, ptr %2, align 4, !tbaa !8
  %172 = load i32, ptr %3, align 4, !tbaa !8
  %173 = add nsw i32 %171, %172
  %174 = sdiv i32 %173, 2
  store i32 %174, ptr %4, align 4, !tbaa !8
  %175 = load i32, ptr %10, align 4, !tbaa !8
  %176 = load i32, ptr %12, align 4, !tbaa !8
  %177 = load i32, ptr %4, align 4, !tbaa !8
  %178 = load i32, ptr %13, align 4, !tbaa !8
  %179 = call noundef i32 @_Z3qryiiii(i32 noundef %175, i32 noundef %176, i32 noundef %177, i32 noundef %178)
  %180 = icmp eq i32 %179, 0
  br i1 %180, label %181, label %184

181:                                              ; preds = %170
  %182 = load i32, ptr %4, align 4, !tbaa !8
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %2, align 4, !tbaa !8
  br label %188

184:                                              ; preds = %170
  %185 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %185, ptr %5, align 4, !tbaa !8
  %186 = load i32, ptr %4, align 4, !tbaa !8
  %187 = sub nsw i32 %186, 1
  store i32 %187, ptr %3, align 4, !tbaa !8
  br label %188

188:                                              ; preds = %184, %181
  br label %166, !llvm.loop !16

189:                                              ; preds = %166
  %190 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %190, ptr %11, align 4, !tbaa !8
  %191 = load i32, ptr %10, align 4, !tbaa !8
  store i32 %191, ptr %2, align 4, !tbaa !8
  %192 = load i32, ptr %11, align 4, !tbaa !8
  store i32 %192, ptr %3, align 4, !tbaa !8
  br label %193

193:                                              ; preds = %215, %189
  %194 = load i32, ptr %2, align 4, !tbaa !8
  %195 = load i32, ptr %3, align 4, !tbaa !8
  %196 = icmp sle i32 %194, %195
  br i1 %196, label %197, label %216

197:                                              ; preds = %193
  %198 = load i32, ptr %2, align 4, !tbaa !8
  %199 = load i32, ptr %3, align 4, !tbaa !8
  %200 = add nsw i32 %198, %199
  %201 = sdiv i32 %200, 2
  store i32 %201, ptr %4, align 4, !tbaa !8
  %202 = load i32, ptr %4, align 4, !tbaa !8
  %203 = load i32, ptr %12, align 4, !tbaa !8
  %204 = load i32, ptr %11, align 4, !tbaa !8
  %205 = load i32, ptr %13, align 4, !tbaa !8
  %206 = call noundef i32 @_Z3qryiiii(i32 noundef %202, i32 noundef %203, i32 noundef %204, i32 noundef %205)
  %207 = icmp eq i32 %206, 0
  br i1 %207, label %208, label %211

208:                                              ; preds = %197
  %209 = load i32, ptr %4, align 4, !tbaa !8
  %210 = sub nsw i32 %209, 1
  store i32 %210, ptr %3, align 4, !tbaa !8
  br label %215

211:                                              ; preds = %197
  %212 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %212, ptr %5, align 4, !tbaa !8
  %213 = load i32, ptr %4, align 4, !tbaa !8
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %2, align 4, !tbaa !8
  br label %215

215:                                              ; preds = %211, %208
  br label %193, !llvm.loop !17

216:                                              ; preds = %193
  %217 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %217, ptr %10, align 4, !tbaa !8
  %218 = load i32, ptr %12, align 4, !tbaa !8
  store i32 %218, ptr %2, align 4, !tbaa !8
  %219 = load i32, ptr %13, align 4, !tbaa !8
  store i32 %219, ptr %3, align 4, !tbaa !8
  br label %220

220:                                              ; preds = %242, %216
  %221 = load i32, ptr %2, align 4, !tbaa !8
  %222 = load i32, ptr %3, align 4, !tbaa !8
  %223 = icmp sle i32 %221, %222
  br i1 %223, label %224, label %243

224:                                              ; preds = %220
  %225 = load i32, ptr %2, align 4, !tbaa !8
  %226 = load i32, ptr %3, align 4, !tbaa !8
  %227 = add nsw i32 %225, %226
  %228 = sdiv i32 %227, 2
  store i32 %228, ptr %4, align 4, !tbaa !8
  %229 = load i32, ptr %10, align 4, !tbaa !8
  %230 = load i32, ptr %12, align 4, !tbaa !8
  %231 = load i32, ptr %11, align 4, !tbaa !8
  %232 = load i32, ptr %4, align 4, !tbaa !8
  %233 = call noundef i32 @_Z3qryiiii(i32 noundef %229, i32 noundef %230, i32 noundef %231, i32 noundef %232)
  %234 = icmp eq i32 %233, 0
  br i1 %234, label %235, label %238

235:                                              ; preds = %224
  %236 = load i32, ptr %4, align 4, !tbaa !8
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %2, align 4, !tbaa !8
  br label %242

238:                                              ; preds = %224
  %239 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %239, ptr %5, align 4, !tbaa !8
  %240 = load i32, ptr %4, align 4, !tbaa !8
  %241 = sub nsw i32 %240, 1
  store i32 %241, ptr %3, align 4, !tbaa !8
  br label %242

242:                                              ; preds = %238, %235
  br label %220, !llvm.loop !18

243:                                              ; preds = %220
  %244 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %244, ptr %13, align 4, !tbaa !8
  %245 = load i32, ptr %12, align 4, !tbaa !8
  store i32 %245, ptr %2, align 4, !tbaa !8
  %246 = load i32, ptr %13, align 4, !tbaa !8
  store i32 %246, ptr %3, align 4, !tbaa !8
  br label %247

247:                                              ; preds = %269, %243
  %248 = load i32, ptr %2, align 4, !tbaa !8
  %249 = load i32, ptr %3, align 4, !tbaa !8
  %250 = icmp sle i32 %248, %249
  br i1 %250, label %251, label %270

251:                                              ; preds = %247
  %252 = load i32, ptr %2, align 4, !tbaa !8
  %253 = load i32, ptr %3, align 4, !tbaa !8
  %254 = add nsw i32 %252, %253
  %255 = sdiv i32 %254, 2
  store i32 %255, ptr %4, align 4, !tbaa !8
  %256 = load i32, ptr %10, align 4, !tbaa !8
  %257 = load i32, ptr %4, align 4, !tbaa !8
  %258 = load i32, ptr %11, align 4, !tbaa !8
  %259 = load i32, ptr %13, align 4, !tbaa !8
  %260 = call noundef i32 @_Z3qryiiii(i32 noundef %256, i32 noundef %257, i32 noundef %258, i32 noundef %259)
  %261 = icmp eq i32 %260, 0
  br i1 %261, label %262, label %265

262:                                              ; preds = %251
  %263 = load i32, ptr %4, align 4, !tbaa !8
  %264 = sub nsw i32 %263, 1
  store i32 %264, ptr %3, align 4, !tbaa !8
  br label %269

265:                                              ; preds = %251
  %266 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %266, ptr %5, align 4, !tbaa !8
  %267 = load i32, ptr %4, align 4, !tbaa !8
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %2, align 4, !tbaa !8
  br label %269

269:                                              ; preds = %265, %262
  br label %247, !llvm.loop !19

270:                                              ; preds = %247
  %271 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %271, ptr %12, align 4, !tbaa !8
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %273 = load i32, ptr %7, align 4, !tbaa !8
  %274 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %272, i32 noundef %273)
  %275 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %274, ptr noundef @.str.1)
  %276 = load i32, ptr %9, align 4, !tbaa !8
  %277 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %275, i32 noundef %276)
  %278 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %277, ptr noundef @.str.1)
  %279 = load i32, ptr %6, align 4, !tbaa !8
  %280 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %278, i32 noundef %279)
  %281 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %280, ptr noundef @.str.1)
  %282 = load i32, ptr %8, align 4, !tbaa !8
  %283 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %281, i32 noundef %282)
  %284 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %283, ptr noundef @.str.1)
  %285 = load i32, ptr %10, align 4, !tbaa !8
  %286 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %284, i32 noundef %285)
  %287 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %286, ptr noundef @.str.1)
  %288 = load i32, ptr %12, align 4, !tbaa !8
  %289 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %287, i32 noundef %288)
  %290 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %289, ptr noundef @.str.1)
  %291 = load i32, ptr %11, align 4, !tbaa !8
  %292 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %290, i32 noundef %291)
  %293 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %292, ptr noundef @.str.1)
  %294 = load i32, ptr %13, align 4, !tbaa !8
  %295 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %293, i32 noundef %294)
  %296 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %295, ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %297 = load i32, ptr %1, align 4
  ret i32 %297
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #5 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

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


; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3qryiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %8 = load i32, ptr @N, align 4, !tbaa !8
  %.not168 = icmp slt i32 %8, 1
  br i1 %.not168, label %._crit_edge190, label %.lr.ph

.preheader167:                                    ; preds = %.lr.ph
  %.not153172 = icmp slt i32 %.1138, 1
  br i1 %.not153172, label %._crit_edge, label %.lr.ph176

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.0120171 = phi i32 [ %.1, %.lr.ph ], [ 1, %0 ]
  %.0121170 = phi i32 [ %.1122, %.lr.ph ], [ %8, %0 ]
  %.0137169 = phi i32 [ %.1138, %.lr.ph ], [ 0, %0 ]
  %9 = add nuw nsw i32 %.0120171, %.0121170
  %10 = lshr i32 %9, 1
  %11 = load i32, ptr @N, align 4, !tbaa !8
  %12 = tail call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef 1, i32 noundef %10, i32 noundef %11)
  %13 = icmp eq i32 %12, 0
  %14 = add nuw nsw i32 %10, 1
  %15 = add nsw i32 %10, -1
  %.1138 = select i1 %13, i32 %.0137169, i32 %10
  %.1122 = select i1 %13, i32 %.0121170, i32 %15
  %.1 = select i1 %13, i32 %14, i32 %.0120171
  %.not = icmp sgt i32 %.1, %.1122
  br i1 %.not, label %.preheader167, label %.lr.ph, !llvm.loop !11

.lr.ph176:                                        ; preds = %.preheader167, %.lr.ph176
  %.2175 = phi i32 [ %.3, %.lr.ph176 ], [ 1, %.preheader167 ]
  %.2123174 = phi i32 [ %.3124, %.lr.ph176 ], [ %.1138, %.preheader167 ]
  %.2139173 = phi i32 [ %.3140, %.lr.ph176 ], [ %.1138, %.preheader167 ]
  %16 = add nsw i32 %.2175, %.2123174
  %17 = lshr i32 %16, 1
  %18 = load i32, ptr @N, align 4, !tbaa !8
  %19 = tail call noundef i32 @_Z3qryiiii(i32 noundef %17, i32 noundef 1, i32 noundef %.1138, i32 noundef %18)
  %20 = icmp eq i32 %19, 0
  %21 = add nsw i32 %17, -1
  %22 = add nuw nsw i32 %17, 1
  %.3140 = select i1 %20, i32 %.2139173, i32 %17
  %.3124 = select i1 %20, i32 %21, i32 %.2123174
  %.3 = select i1 %20, i32 %.2175, i32 %22
  %.not153 = icmp sgt i32 %.3, %.3124
  br i1 %.not153, label %._crit_edge, label %.lr.ph176, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph176, %.preheader167
  %.2139.lcssa.ph = phi i32 [ %.1138, %.preheader167 ], [ %.3140, %.lr.ph176 ]
  %.pr = load i32, ptr @N, align 4, !tbaa !8
  %.not154178 = icmp slt i32 %.pr, 1
  br i1 %.not154178, label %.preheader166, label %.lr.ph183

.preheader166:                                    ; preds = %.lr.ph183, %._crit_edge
  %.4141.lcssa = phi i32 [ %.2139.lcssa.ph, %._crit_edge ], [ %.5142, %.lr.ph183 ]
  %.not155185 = icmp slt i32 %.4141.lcssa, 1
  br i1 %.not155185, label %._crit_edge190, label %.lr.ph189

.lr.ph183:                                        ; preds = %._crit_edge, %.lr.ph183
  %.4181 = phi i32 [ %.5, %.lr.ph183 ], [ 1, %._crit_edge ]
  %.4125180 = phi i32 [ %.5126, %.lr.ph183 ], [ %.pr, %._crit_edge ]
  %.4141179 = phi i32 [ %.5142, %.lr.ph183 ], [ %.2139.lcssa.ph, %._crit_edge ]
  %23 = add nuw nsw i32 %.4181, %.4125180
  %24 = lshr i32 %23, 1
  %25 = tail call noundef i32 @_Z3qryiiii(i32 noundef %.2139.lcssa.ph, i32 noundef 1, i32 noundef %.1138, i32 noundef %24)
  %26 = icmp eq i32 %25, 0
  %27 = add nuw nsw i32 %24, 1
  %28 = add nsw i32 %24, -1
  %.5142 = select i1 %26, i32 %.4141179, i32 %24
  %.5126 = select i1 %26, i32 %.4125180, i32 %28
  %.5 = select i1 %26, i32 %27, i32 %.4181
  %.not154 = icmp sgt i32 %.5, %.5126
  br i1 %.not154, label %.preheader166, label %.lr.ph183, !llvm.loop !14

.lr.ph189:                                        ; preds = %.preheader166, %.lr.ph189
  %.6188 = phi i32 [ %.7, %.lr.ph189 ], [ 1, %.preheader166 ]
  %.6127187 = phi i32 [ %.7128, %.lr.ph189 ], [ %.4141.lcssa, %.preheader166 ]
  %.6143186 = phi i32 [ %.7144, %.lr.ph189 ], [ %.4141.lcssa, %.preheader166 ]
  %29 = add nsw i32 %.6188, %.6127187
  %30 = lshr i32 %29, 1
  %31 = tail call noundef i32 @_Z3qryiiii(i32 noundef %.2139.lcssa.ph, i32 noundef %30, i32 noundef %.1138, i32 noundef %.4141.lcssa)
  %32 = icmp eq i32 %31, 0
  %33 = add nsw i32 %30, -1
  %34 = add nuw nsw i32 %30, 1
  %.7144 = select i1 %32, i32 %.6143186, i32 %30
  %.7128 = select i1 %32, i32 %33, i32 %.6127187
  %.7 = select i1 %32, i32 %.6188, i32 %34
  %.not155 = icmp sgt i32 %.7, %.7128
  br i1 %.not155, label %._crit_edge190, label %.lr.ph189, !llvm.loop !15

._crit_edge190:                                   ; preds = %.lr.ph189, %0, %.preheader166
  %.4141.lcssa232 = phi i32 [ %.4141.lcssa, %.preheader166 ], [ 0, %0 ], [ %.4141.lcssa, %.lr.ph189 ]
  %.0137.lcssa220224231 = phi i32 [ %.1138, %.preheader166 ], [ 0, %0 ], [ %.1138, %.lr.ph189 ]
  %.2139.lcssa225230 = phi i32 [ %.2139.lcssa.ph, %.preheader166 ], [ 0, %0 ], [ %.2139.lcssa.ph, %.lr.ph189 ]
  %.6143.lcssa = phi i32 [ %.4141.lcssa, %.preheader166 ], [ 0, %0 ], [ %.7144, %.lr.ph189 ]
  %35 = load i32, ptr @N, align 4, !tbaa !8
  %36 = add nuw nsw i32 %.0137.lcssa220224231, 1
  %37 = tail call noundef i32 @_Z3qryiiii(i32 noundef %36, i32 noundef 1, i32 noundef %35, i32 noundef %35)
  %.not156 = icmp eq i32 %37, 0
  br i1 %.not156, label %38, label %50

38:                                               ; preds = %._crit_edge190
  %39 = add nuw nsw i32 %.4141.lcssa232, 1
  %40 = load i32, ptr @N, align 4, !tbaa !8
  %41 = tail call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef %39, i32 noundef %40, i32 noundef %40)
  %.not157 = icmp eq i32 %41, 0
  br i1 %.not157, label %42, label %50

42:                                               ; preds = %38
  %43 = load i32, ptr @N, align 4, !tbaa !8
  %44 = add nsw i32 %.6143.lcssa, -1
  %45 = tail call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef 1, i32 noundef %43, i32 noundef %44)
  %.not158 = icmp eq i32 %45, 0
  br i1 %.not158, label %46, label %50

46:                                               ; preds = %42
  %47 = add nsw i32 %.2139.lcssa225230, -1
  %48 = load i32, ptr @N, align 4, !tbaa !8
  %49 = tail call noundef i32 @_Z3qryiiii(i32 noundef 1, i32 noundef 1, i32 noundef %47, i32 noundef %48)
  %.not159 = icmp eq i32 %49, 0
  %spec.select = select i1 %.not159, i32 %35, i32 %47
  br label %50

50:                                               ; preds = %46, %42, %38, %._crit_edge190
  %.0119 = phi i32 [ %36, %._crit_edge190 ], [ 1, %38 ], [ 1, %42 ], [ 1, %46 ]
  %.0118 = phi i32 [ %35, %._crit_edge190 ], [ %35, %38 ], [ %35, %42 ], [ %spec.select, %46 ]
  %.0117 = phi i32 [ 1, %._crit_edge190 ], [ %39, %38 ], [ 1, %42 ], [ 1, %46 ]
  %.0 = phi i32 [ %35, %._crit_edge190 ], [ %35, %38 ], [ %44, %42 ], [ %35, %46 ]
  %.not160192 = icmp sgt i32 %.0119, %.0118
  br i1 %.not160192, label %.preheader165, label %.lr.ph197

.preheader165:                                    ; preds = %.lr.ph197, %50
  %.8145.lcssa = phi i32 [ %.6143.lcssa, %50 ], [ %.9146, %.lr.ph197 ]
  %.not161199 = icmp sgt i32 %.0119, %.8145.lcssa
  br i1 %.not161199, label %.preheader164, label %.lr.ph203

.lr.ph197:                                        ; preds = %50, %.lr.ph197
  %.8195 = phi i32 [ %.9, %.lr.ph197 ], [ %.0119, %50 ]
  %.8129194 = phi i32 [ %.9130, %.lr.ph197 ], [ %.0118, %50 ]
  %.8145193 = phi i32 [ %.9146, %.lr.ph197 ], [ %.6143.lcssa, %50 ]
  %51 = add nuw nsw i32 %.8195, %.8129194
  %52 = lshr i32 %51, 1
  %53 = tail call noundef i32 @_Z3qryiiii(i32 noundef %.0119, i32 noundef %.0117, i32 noundef %52, i32 noundef %.0)
  %54 = icmp eq i32 %53, 0
  %55 = add nuw nsw i32 %52, 1
  %56 = add nsw i32 %52, -1
  %.9146 = select i1 %54, i32 %.8145193, i32 %52
  %.9130 = select i1 %54, i32 %.8129194, i32 %56
  %.9 = select i1 %54, i32 %55, i32 %.8195
  %.not160 = icmp sgt i32 %.9, %.9130
  br i1 %.not160, label %.preheader165, label %.lr.ph197, !llvm.loop !16

.preheader164:                                    ; preds = %.lr.ph203, %.preheader165
  %.10147.lcssa = phi i32 [ %.8145.lcssa, %.preheader165 ], [ %.11148, %.lr.ph203 ]
  %.not162205 = icmp sgt i32 %.0117, %.0
  br i1 %.not162205, label %.preheader, label %.lr.ph209

.lr.ph203:                                        ; preds = %.preheader165, %.lr.ph203
  %.10202 = phi i32 [ %.11, %.lr.ph203 ], [ %.0119, %.preheader165 ]
  %.10131201 = phi i32 [ %.11132, %.lr.ph203 ], [ %.8145.lcssa, %.preheader165 ]
  %.10147200 = phi i32 [ %.11148, %.lr.ph203 ], [ %.8145.lcssa, %.preheader165 ]
  %57 = add nuw nsw i32 %.10202, %.10131201
  %58 = lshr i32 %57, 1
  %59 = tail call noundef i32 @_Z3qryiiii(i32 noundef %58, i32 noundef %.0117, i32 noundef %.8145.lcssa, i32 noundef %.0)
  %60 = icmp eq i32 %59, 0
  %61 = add nsw i32 %58, -1
  %62 = add nuw nsw i32 %58, 1
  %.11148 = select i1 %60, i32 %.10147200, i32 %58
  %.11132 = select i1 %60, i32 %61, i32 %.10131201
  %.11 = select i1 %60, i32 %.10202, i32 %62
  %.not161 = icmp sgt i32 %.11, %.11132
  br i1 %.not161, label %.preheader164, label %.lr.ph203, !llvm.loop !17

.preheader:                                       ; preds = %.lr.ph209, %.preheader164
  %.12149.lcssa = phi i32 [ %.10147.lcssa, %.preheader164 ], [ %.13150, %.lr.ph209 ]
  %.not163211 = icmp sgt i32 %.0117, %.12149.lcssa
  br i1 %.not163211, label %._crit_edge216, label %.lr.ph215

.lr.ph209:                                        ; preds = %.preheader164, %.lr.ph209
  %.12208 = phi i32 [ %.13, %.lr.ph209 ], [ %.0117, %.preheader164 ]
  %.12133207 = phi i32 [ %.13134, %.lr.ph209 ], [ %.0, %.preheader164 ]
  %.12149206 = phi i32 [ %.13150, %.lr.ph209 ], [ %.10147.lcssa, %.preheader164 ]
  %63 = add nsw i32 %.12208, %.12133207
  %64 = sdiv i32 %63, 2
  %65 = tail call noundef i32 @_Z3qryiiii(i32 noundef %.10147.lcssa, i32 noundef %.0117, i32 noundef %.8145.lcssa, i32 noundef %64)
  %66 = icmp eq i32 %65, 0
  %67 = add nsw i32 %64, 1
  %68 = add nsw i32 %64, -1
  %.13150 = select i1 %66, i32 %.12149206, i32 %64
  %.13134 = select i1 %66, i32 %.12133207, i32 %68
  %.13 = select i1 %66, i32 %67, i32 %.12208
  %.not162 = icmp sgt i32 %.13, %.13134
  br i1 %.not162, label %.preheader, label %.lr.ph209, !llvm.loop !18

.lr.ph215:                                        ; preds = %.preheader, %.lr.ph215
  %.14214 = phi i32 [ %.15, %.lr.ph215 ], [ %.0117, %.preheader ]
  %.14135213 = phi i32 [ %.15136, %.lr.ph215 ], [ %.12149.lcssa, %.preheader ]
  %.14151212 = phi i32 [ %.15152, %.lr.ph215 ], [ %.12149.lcssa, %.preheader ]
  %69 = add nsw i32 %.14214, %.14135213
  %70 = sdiv i32 %69, 2
  %71 = tail call noundef i32 @_Z3qryiiii(i32 noundef %.10147.lcssa, i32 noundef %70, i32 noundef %.8145.lcssa, i32 noundef %.12149.lcssa)
  %72 = icmp eq i32 %71, 0
  %73 = add nsw i32 %70, -1
  %74 = add nsw i32 %70, 1
  %.15152 = select i1 %72, i32 %.14151212, i32 %70
  %.15136 = select i1 %72, i32 %73, i32 %.14135213
  %.15 = select i1 %72, i32 %.14214, i32 %74
  %.not163 = icmp sgt i32 %.15, %.15136
  br i1 %.not163, label %._crit_edge216, label %.lr.ph215, !llvm.loop !19

._crit_edge216:                                   ; preds = %.lr.ph215, %.preheader
  %.14151.lcssa = phi i32 [ %.12149.lcssa, %.preheader ], [ %.15152, %.lr.ph215 ]
  %75 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %76 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %75, i32 noundef %.2139.lcssa225230)
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str.1)
  %78 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %77, i32 noundef %.6143.lcssa)
  %79 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef nonnull @.str.1)
  %80 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %79, i32 noundef %.0137.lcssa220224231)
  %81 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull @.str.1)
  %82 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %81, i32 noundef %.4141.lcssa232)
  %83 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull @.str.1)
  %84 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %83, i32 noundef %.10147.lcssa)
  %85 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @.str.1)
  %86 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %.14151.lcssa)
  %87 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull @.str.1)
  %88 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %87, i32 noundef %.8145.lcssa)
  %89 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull @.str.1)
  %90 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %89, i32 noundef %.12149.lcssa)
  %91 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull @.str.2)
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #4 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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