; LLVM IR from kazunetakahashi/atcoder :: 2018/0407_maximum-cup-2018 (H)

; 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_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@d = external dso_local global [310 x [310 x i64]], align 16
@K = external dso_local global i32, align 4
@a = external dso_local global [310 x i32], align 16
@Q = external dso_local global i32, align 4
@b = external dso_local global [310 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL5infty = external hidden constant i64, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5solvex(i64 noundef) #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 i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca [310 x i8], align 16
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i8, 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 i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %21 = 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)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @_ZSt4fillIPxxEvT_S1_RKT0_(ptr noundef @d, ptr noundef getelementptr inbounds (i64, ptr @d, i64 96100), ptr noundef nonnull align 8 dereferenceable(8) @_ZL5infty)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %35, %0
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr @N, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %30
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [310 x i64], ptr %31, i64 0, i64 %33
  store i64 0, ptr %34, align 8, !tbaa !9
  br label %35

35:                                               ; preds = %28
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !11

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

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

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %68

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %4, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %5, align 4, !tbaa !5
  %52 = load i64, ptr %6, align 8, !tbaa !9
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %54
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [310 x i64], ptr %55, i64 0, i64 %57
  store i64 %52, ptr %58, align 8, !tbaa !9
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %60
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [310 x i64], ptr %61, i64 0, i64 %63
  store i64 %52, ptr %64, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, 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
  br label %65

65:                                               ; preds = %44
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !13

68:                                               ; preds = %43
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %85, %68
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = load i32, ptr @K, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %88

75:                                               ; preds = %70
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [310 x i32], ptr @a, i64 0, i64 %77
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %78)
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [310 x i32], ptr @a, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr %82, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %75
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %7, align 4, !tbaa !5
  br label %70, !llvm.loop !14

88:                                               ; preds = %74
  %89 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 310, ptr %8) #6
  %90 = getelementptr inbounds [310 x i8], ptr %8, i64 0, i64 0
  %91 = getelementptr inbounds [310 x i8], ptr %8, i64 0, i64 0
  %92 = getelementptr inbounds i8, ptr %91, i64 310
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 0, ptr %9, align 1, !tbaa !15
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef %90, ptr noundef %92, ptr noundef nonnull align 1 dereferenceable(1) %9)
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %114, %88
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = load i32, ptr @Q, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %117

98:                                               ; preds = %93
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [310 x i32], ptr @b, i64 0, i64 %100
  %102 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %101)
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [310 x i32], ptr @b, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %105, align 4, !tbaa !5
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [310 x i32], ptr @b, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [310 x i8], ptr %8, i64 0, i64 %112
  store i8 1, ptr %113, align 1, !tbaa !15
  br label %114

114:                                              ; preds = %98
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %10, align 4, !tbaa !5
  br label %93, !llvm.loop !17

117:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  store i8 1, ptr %11, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %134, %117
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = load i32, ptr @K, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 14, ptr %13, align 4
  br label %137

123:                                              ; preds = %118
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [310 x i32], ptr @a, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [310 x i8], ptr %8, i64 0, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !15, !range !18, !noundef !19
  %131 = trunc i8 %130 to i1
  br i1 %131, label %133, label %132

132:                                              ; preds = %123
  store i8 0, ptr %11, align 1, !tbaa !15
  store i32 14, ptr %13, align 4
  br label %137

133:                                              ; preds = %123
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %12, align 4, !tbaa !5
  br label %118, !llvm.loop !20

137:                                              ; preds = %132, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %138

138:                                              ; preds = %137
  %139 = load i8, ptr %11, align 1, !tbaa !15, !range !18, !noundef !19
  %140 = trunc i8 %139 to i1
  br i1 %140, label %141, label %144

141:                                              ; preds = %138
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %225

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

145:                                              ; preds = %200, %144
  %146 = load i32, ptr %14, align 4, !tbaa !5
  %147 = load i32, ptr @N, align 4, !tbaa !5
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %150, label %149

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

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

151:                                              ; preds = %196, %150
  %152 = load i32, ptr %15, align 4, !tbaa !5
  %153 = load i32, ptr @N, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 20, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %199

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

157:                                              ; preds = %192, %156
  %158 = load i32, ptr %16, align 4, !tbaa !5
  %159 = load i32, ptr @N, align 4, !tbaa !5
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %162, label %161

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

162:                                              ; preds = %157
  %163 = load i32, ptr %15, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %164
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [310 x i64], ptr %165, i64 0, i64 %167
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %169 = load i32, ptr %15, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %170
  %172 = load i32, ptr %14, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [310 x i64], ptr %171, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !9
  %176 = load i32, ptr %14, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %177
  %179 = load i32, ptr %16, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [310 x i64], ptr %178, i64 0, i64 %180
  %182 = load i64, ptr %181, align 8, !tbaa !9
  %183 = add nsw i64 %175, %182
  store i64 %183, ptr %17, align 8, !tbaa !9
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %168, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %185 = load i64, ptr %184, align 8, !tbaa !9
  %186 = load i32, ptr %15, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %187
  %189 = load i32, ptr %16, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [310 x i64], ptr %188, i64 0, i64 %190
  store i64 %185, ptr %191, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %192

192:                                              ; preds = %162
  %193 = load i32, ptr %16, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %16, align 4, !tbaa !5
  br label %157, !llvm.loop !21

195:                                              ; preds = %161
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %15, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %15, align 4, !tbaa !5
  br label %151, !llvm.loop !22

199:                                              ; preds = %155
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %14, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %14, align 4, !tbaa !5
  br label %145, !llvm.loop !23

203:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 10000000000007, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %220, %203
  %205 = load i64, ptr %18, align 8, !tbaa !9
  %206 = load i64, ptr %19, align 8, !tbaa !9
  %207 = sub nsw i64 %205, %206
  %208 = icmp sgt i64 %207, 1
  br i1 %208, label %209, label %221

209:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %210 = load i64, ptr %18, align 8, !tbaa !9
  %211 = load i64, ptr %19, align 8, !tbaa !9
  %212 = add nsw i64 %210, %211
  %213 = sdiv i64 %212, 2
  store i64 %213, ptr %20, align 8, !tbaa !9
  %214 = load i64, ptr %20, align 8, !tbaa !9
  %215 = call noundef zeroext i1 @_Z5solvex(i64 noundef %214)
  br i1 %215, label %216, label %218

216:                                              ; preds = %209
  %217 = load i64, ptr %20, align 8, !tbaa !9
  store i64 %217, ptr %18, align 8, !tbaa !9
  br label %220

218:                                              ; preds = %209
  %219 = load i64, ptr %20, align 8, !tbaa !9
  store i64 %219, ptr %19, align 8, !tbaa !9
  br label %220

220:                                              ; preds = %218, %216
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %204, !llvm.loop !24

221:                                              ; preds = %204
  %222 = load i64, ptr %18, align 8, !tbaa !9
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %222)
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %223, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  store i32 0, ptr %13, align 4
  br label %225

225:                                              ; preds = %221, %141
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 310, ptr %8) #6
  %226 = load i32, ptr %13, align 4
  switch i32 %226, label %229 [
    i32 0, label %227
    i32 1, label %227
  ]

227:                                              ; preds = %225, %225
  %228 = load i32, ptr %1, align 4
  ret i32 %228

229:                                              ; preds = %225
  unreachable
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxxEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

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

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

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@d = external dso_local global [310 x [310 x i64]], align 16
@K = external dso_local global i32, align 4
@a = external dso_local global [310 x i32], align 16
@Q = external dso_local global i32, align 4
@b = external dso_local global [310 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL5infty = external hidden constant i64, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5solvex(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca [310 x i8], align 16
  %5 = alloca i8, align 1
  %6 = alloca i64, align 8
  %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 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @M)
  tail call void @_ZSt4fillIPxxEvT_S1_RKT0_(ptr noundef nonnull @d, ptr noundef nonnull getelementptr inbounds (i8, ptr @d, i64 768800), ptr noundef nonnull align 8 dereferenceable(8) @_ZL5infty)
  %9 = load i32, ptr @N, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph.preheader, label %.preheader58

.lr.ph.preheader:                                 ; preds = %0
  %wide.trip.count = zext nneg i32 %9 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %11 = icmp ult i32 %9, 4
  br i1 %11, label %.preheader58.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph

.preheader58.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader58, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader58.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader58.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader58.loopexit.unr-lcssa ]
  %12 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv.epil, i64 %indvars.iv.epil
  store i64 0, ptr %12, align 8, !tbaa !9
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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 %.preheader58, label %.lr.ph.epil, !llvm.loop !11

.preheader58:                                     ; preds = %.preheader58.loopexit.unr-lcssa, %.lr.ph.epil, %0
  %13 = load i32, ptr @M, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph61, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %15 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv, i64 %indvars.iv
  store i64 0, ptr %15, align 16, !tbaa !9
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %16 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next
  store i64 0, ptr %16, align 8, !tbaa !9
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %17 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv.next.1, i64 %indvars.iv.next.1
  store i64 0, ptr %17, align 16, !tbaa !9
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %18 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv.next.2, i64 %indvars.iv.next.2
  store i64 0, ptr %18, align 8, !tbaa !9
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader58.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph61, %.preheader58
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %20 = load i32, ptr @K, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph64, label %._crit_edge65

.lr.ph61:                                         ; preds = %.preheader58, %.lr.ph61
  %.05260 = phi i32 [ %34, %.lr.ph61 ], [ 0, %.preheader58 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, -1
  %29 = load i64, ptr %3, align 8, !tbaa !9
  %30 = sext i32 %28 to i64
  %31 = sext i32 %26 to i64
  %32 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %30, i64 %31
  store i64 %29, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %31, i64 %30
  store i64 %29, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %34 = add nuw nsw i32 %.05260, 1
  %35 = load i32, ptr @M, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph61, label %._crit_edge, !llvm.loop !15

._crit_edge65:                                    ; preds = %.lr.ph64, %._crit_edge
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 310, ptr nonnull %4) #6
  %38 = getelementptr inbounds i8, ptr %4, i64 310
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  store i8 0, ptr %5, align 1, !tbaa !16
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull %4, ptr noundef nonnull %38, ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  %39 = load i32, ptr @Q, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph68, label %.preheader57

.lr.ph64:                                         ; preds = %._crit_edge, %.lr.ph64
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.lr.ph64 ], [ 0, %._crit_edge ]
  %41 = getelementptr inbounds [310 x i32], ptr @a, i64 0, i64 %indvars.iv83
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = load i32, ptr %41, align 4, !tbaa !5
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr %41, align 4, !tbaa !5
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %45 = load i32, ptr @K, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next84, %46
  br i1 %47, label %.lr.ph64, label %._crit_edge65, !llvm.loop !18

.preheader57:                                     ; preds = %.lr.ph68, %._crit_edge65
  %48 = load i32, ptr @K, align 4, !tbaa !5
  %.not69 = icmp sgt i32 %48, 1
  br i1 %.not69, label %.lr.ph71.preheader, label %.critedge

.lr.ph71.preheader:                               ; preds = %.preheader57
  %wide.trip.count92 = zext nneg i32 %48 to i64
  br label %.lr.ph71

.lr.ph68:                                         ; preds = %._crit_edge65, %.lr.ph68
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.lr.ph68 ], [ 0, %._crit_edge65 ]
  %49 = getelementptr inbounds [310 x i32], ptr @b, i64 0, i64 %indvars.iv86
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %49)
  %51 = load i32, ptr %49, align 4, !tbaa !5
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr %49, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [310 x i8], ptr %4, i64 0, i64 %53
  store i8 1, ptr %54, align 1, !tbaa !16
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %55 = load i32, ptr @Q, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next87, %56
  br i1 %57, label %.lr.ph68, label %.preheader57, !llvm.loop !19

58:                                               ; preds = %.lr.ph71
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92
  br i1 %exitcond93.not, label %.critedge, label %.lr.ph71, !llvm.loop !20

.lr.ph71:                                         ; preds = %.lr.ph71.preheader, %58
  %indvars.iv89 = phi i64 [ 1, %.lr.ph71.preheader ], [ %indvars.iv.next90, %58 ]
  %59 = getelementptr inbounds [310 x i32], ptr @a, i64 0, i64 %indvars.iv89
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [310 x i8], ptr %4, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !16, !range !21, !noundef !22
  %64 = trunc nuw i8 %63 to i1
  br i1 %64, label %58, label %.preheader56

.preheader56:                                     ; preds = %.lr.ph71
  %65 = load i32, ptr @N, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.preheader55, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge76, %.preheader56
  br label %.preheader

.critedge:                                        ; preds = %58, %.preheader57
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %98

.preheader55:                                     ; preds = %.preheader56, %._crit_edge76
  %68 = phi i32 [ %74, %._crit_edge76 ], [ %65, %.preheader56 ]
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %._crit_edge76 ], [ 0, %.preheader56 ]
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.preheader54, label %._crit_edge76

.preheader54:                                     ; preds = %.preheader55, %._crit_edge74
  %70 = phi i32 [ %77, %._crit_edge74 ], [ %68, %.preheader55 ]
  %71 = phi i32 [ %78, %._crit_edge74 ], [ %68, %.preheader55 ]
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %._crit_edge74 ], [ 0, %.preheader55 ]
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph73, label %.preheader54.._crit_edge74_crit_edge

.preheader54.._crit_edge74_crit_edge:             ; preds = %.preheader54
  %.pre = sext i32 %71 to i64
  br label %._crit_edge74

.lr.ph73:                                         ; preds = %.preheader54
  %73 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv97, i64 %indvars.iv100
  br label %80

._crit_edge76:                                    ; preds = %._crit_edge74, %.preheader55
  %74 = phi i32 [ %68, %.preheader55 ], [ %77, %._crit_edge74 ]
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next101, %75
  br i1 %76, label %.preheader55, label %.preheader.preheader, !llvm.loop !23

._crit_edge74:                                    ; preds = %80, %.preheader54.._crit_edge74_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader54.._crit_edge74_crit_edge ], [ %89, %80 ]
  %77 = phi i32 [ %70, %.preheader54.._crit_edge74_crit_edge ], [ %88, %80 ]
  %78 = phi i32 [ %71, %.preheader54.._crit_edge74_crit_edge ], [ %88, %80 ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %79 = icmp slt i64 %indvars.iv.next98, %.pre-phi
  br i1 %79, label %.preheader54, label %._crit_edge76, !llvm.loop !25

80:                                               ; preds = %.lr.ph73, %80
  %indvars.iv94 = phi i64 [ 0, %.lr.ph73 ], [ %indvars.iv.next95, %80 ]
  %81 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv97, i64 %indvars.iv94
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %82 = load i64, ptr %73, align 8, !tbaa !9
  %83 = getelementptr inbounds [310 x [310 x i64]], ptr @d, i64 0, i64 %indvars.iv100, i64 %indvars.iv94
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = add nsw i64 %84, %82
  store i64 %85, ptr %6, align 8, !tbaa !9
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %87 = load i64, ptr %86, align 8, !tbaa !9
  store i64 %87, ptr %81, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %88 = load i32, ptr @N, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = icmp slt i64 %indvars.iv.next95, %89
  br i1 %90, label %80, label %._crit_edge74, !llvm.loop !26

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.04279 = phi i64 [ %.042., %.preheader ], [ 0, %.preheader.preheader ]
  %.04378 = phi i64 [ %..043, %.preheader ], [ 10000000000007, %.preheader.preheader ]
  %91 = add nsw i64 %.04279, %.04378
  %92 = sdiv i64 %91, 2
  %93 = call noundef zeroext i1 @_Z5solvex(i64 noundef %92)
  %..043 = select i1 %93, i64 %92, i64 %.04378
  %.042. = select i1 %93, i64 %.04279, i64 %92
  %94 = sub nsw i64 %..043, %.042.
  %95 = icmp sgt i64 %94, 1
  br i1 %95, label %.preheader, label %96, !llvm.loop !27

96:                                               ; preds = %.preheader
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %..043)
  br label %98

98:                                               ; preds = %96, %.critedge
  %.sink = phi ptr [ %97, %96 ], [ %67, %.critedge ]
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 310, ptr nonnull %4) #6
  ret i32 0
}

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 #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxxEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !14, !24}
!24 = !{!"llvm.loop.unswitch.partial.disable"}
!25 = distinct !{!25, !14, !24}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14}


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