; LLVM IR from eyangch/competitive-programming :: USACOtraining/2.3 (nocows)

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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %21 = load ptr, ptr @stdin, align 8, !tbaa !5
  %22 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %21)
  %23 = load ptr, ptr @stdout, align 8, !tbaa !5
  %24 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %27 = load i32, ptr %2, align 4, !tbaa !9
  %28 = srem i32 %27, 2
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %0
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %230

33:                                               ; preds = %0
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  %36 = zext i32 %35 to i64
  %37 = load i32, ptr %2, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  %39 = zext i32 %38 to i64
  %40 = call ptr @llvm.stacksave.p0()
  store ptr %40, ptr %5, align 8
  %41 = mul nuw i64 %36, %39
  %42 = alloca i32, i64 %41, align 16
  store i64 %36, ptr %6, align 8
  store i64 %39, ptr %7, align 8
  %43 = mul nsw i64 0, %39
  %44 = getelementptr inbounds i32, ptr %42, i64 %43
  %45 = load i32, ptr %3, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = mul nsw i64 %46, %39
  %48 = getelementptr inbounds i32, ptr %42, i64 %47
  %49 = load i32, ptr %2, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  %52 = getelementptr inbounds i32, ptr %51, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %44, ptr noundef %52, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %53 = mul nsw i64 1, %39
  %54 = getelementptr inbounds i32, ptr %42, i64 %53
  %55 = getelementptr inbounds i32, ptr %54, i64 1
  store i32 1, ptr %55, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 2, ptr %9, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %215, %33
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = load i32, ptr %3, align 4, !tbaa !9
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %218

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = icmp sgt i32 %62, 10
  br i1 %63, label %64, label %66

64:                                               ; preds = %61
  %65 = load i32, ptr %2, align 4, !tbaa !9
  store i32 %65, ptr %10, align 4, !tbaa !9
  br label %73

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 2, i32 noundef %67)
  %69 = fptosi double %68 to i32
  %70 = sub nsw i32 %69, 1
  store i32 %70, ptr %11, align 4, !tbaa !9
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %72 = load i32, ptr %71, align 4, !tbaa !9
  store i32 %72, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %73

73:                                               ; preds = %66, %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = mul nsw i32 %74, 2
  %76 = sub nsw i32 %75, 1
  store i32 %76, ptr %12, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %211, %73
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = icmp sle i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %214

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %207, %82
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = sub nsw i32 %85, 1
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = sub nsw i32 %86, %87
  %89 = icmp sle i32 %84, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %83
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %210

91:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = sub nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = mul nsw i64 %94, %39
  %96 = getelementptr inbounds i32, ptr %42, i64 %95
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %96, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = load i32, ptr %14, align 4, !tbaa !9
  %102 = add nsw i32 %101, %100
  store i32 %102, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %120, %91
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = sub nsw i32 %105, 1
  %107 = icmp slt i32 %104, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %103
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %123

109:                                              ; preds = %103
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = mul nsw i64 %111, %39
  %113 = getelementptr inbounds i32, ptr %42, i64 %112
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %113, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = load i32, ptr %15, align 4, !tbaa !9
  %119 = add nsw i32 %118, %117
  store i32 %119, ptr %15, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %109
  %121 = load i32, ptr %16, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %16, align 4, !tbaa !9
  br label %103, !llvm.loop !11

123:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !9
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = mul nsw i64 %126, %39
  %128 = getelementptr inbounds i32, ptr %42, i64 %127
  %129 = load i32, ptr %12, align 4, !tbaa !9
  %130 = load i32, ptr %13, align 4, !tbaa !9
  %131 = sub nsw i32 %129, %130
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %128, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = load i32, ptr %17, align 4, !tbaa !9
  %137 = add nsw i32 %136, %135
  store i32 %137, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 1, ptr %19, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %158, %123
  %139 = load i32, ptr %19, align 4, !tbaa !9
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = sub nsw i32 %140, 1
  %142 = icmp slt i32 %139, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %138
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %161

144:                                              ; preds = %138
  %145 = load i32, ptr %19, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = mul nsw i64 %146, %39
  %148 = getelementptr inbounds i32, ptr %42, i64 %147
  %149 = load i32, ptr %12, align 4, !tbaa !9
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = sub nsw i32 %149, %150
  %152 = sub nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i32, ptr %148, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !9
  %156 = load i32, ptr %18, align 4, !tbaa !9
  %157 = add nsw i32 %156, %155
  store i32 %157, ptr %18, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %144
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %19, align 4, !tbaa !9
  br label %138, !llvm.loop !13

161:                                              ; preds = %143
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = srem i32 %162, 9901
  store i32 %163, ptr %15, align 4, !tbaa !9
  %164 = load i32, ptr %18, align 4, !tbaa !9
  %165 = srem i32 %164, 9901
  store i32 %165, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %166 = load i32, ptr %14, align 4, !tbaa !9
  %167 = load i32, ptr %17, align 4, !tbaa !9
  %168 = mul nsw i32 %166, %167
  %169 = load i32, ptr %14, align 4, !tbaa !9
  %170 = load i32, ptr %18, align 4, !tbaa !9
  %171 = mul nsw i32 %169, %170
  %172 = add nsw i32 %168, %171
  %173 = load i32, ptr %17, align 4, !tbaa !9
  %174 = load i32, ptr %15, align 4, !tbaa !9
  %175 = mul nsw i32 %173, %174
  %176 = add nsw i32 %172, %175
  %177 = mul nsw i32 2, %176
  store i32 %177, ptr %20, align 4, !tbaa !9
  %178 = load i32, ptr %13, align 4, !tbaa !9
  %179 = load i32, ptr %12, align 4, !tbaa !9
  %180 = sub nsw i32 %179, 1
  %181 = load i32, ptr %13, align 4, !tbaa !9
  %182 = sub nsw i32 %180, %181
  %183 = icmp eq i32 %178, %182
  br i1 %183, label %184, label %187

184:                                              ; preds = %161
  %185 = load i32, ptr %20, align 4, !tbaa !9
  %186 = sdiv i32 %185, 2
  store i32 %186, ptr %20, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %184, %161
  %188 = load i32, ptr %20, align 4, !tbaa !9
  %189 = load i32, ptr %9, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = mul nsw i64 %190, %39
  %192 = getelementptr inbounds i32, ptr %42, i64 %191
  %193 = load i32, ptr %12, align 4, !tbaa !9
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds i32, ptr %192, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !9
  %197 = add nsw i32 %196, %188
  store i32 %197, ptr %195, align 4, !tbaa !9
  %198 = load i32, ptr %9, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = mul nsw i64 %199, %39
  %201 = getelementptr inbounds i32, ptr %42, i64 %200
  %202 = load i32, ptr %12, align 4, !tbaa !9
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds i32, ptr %201, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !9
  %206 = srem i32 %205, 9901
  store i32 %206, ptr %204, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %207

207:                                              ; preds = %187
  %208 = load i32, ptr %13, align 4, !tbaa !9
  %209 = add nsw i32 %208, 2
  store i32 %209, ptr %13, align 4, !tbaa !9
  br label %83, !llvm.loop !14

210:                                              ; preds = %90
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %12, align 4, !tbaa !9
  %213 = add nsw i32 %212, 2
  store i32 %213, ptr %12, align 4, !tbaa !9
  br label %77, !llvm.loop !15

214:                                              ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %215

215:                                              ; preds = %214
  %216 = load i32, ptr %9, align 4, !tbaa !9
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %9, align 4, !tbaa !9
  br label %56, !llvm.loop !16

218:                                              ; preds = %60
  %219 = load i32, ptr %3, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = mul nsw i64 %220, %39
  %222 = getelementptr inbounds i32, ptr %42, i64 %221
  %223 = load i32, ptr %2, align 4, !tbaa !9
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds i32, ptr %222, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !9
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %226)
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %227, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  %229 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %229)
  br label %230

230:                                              ; preds = %218, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %231 = load i32, ptr %1, align 4
  ret i32 %231
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

; 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)) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 noundef) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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


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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = load ptr, ptr @stdin, align 8, !tbaa !5
  %6 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %5)
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  %8 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %9 = 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)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %11 = load i32, ptr %1, align 4, !tbaa !9
  %12 = and i32 %11, 1
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %17

14:                                               ; preds = %0
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %142

17:                                               ; preds = %0
  %18 = load i32, ptr %2, align 4, !tbaa !9
  %19 = add nsw i32 %18, 1
  %20 = zext i32 %19 to i64
  %21 = add nsw i32 %11, 1
  %22 = zext i32 %21 to i64
  %23 = call ptr @llvm.stacksave.p0()
  %24 = mul nuw i64 %20, %22
  %25 = alloca i32, i64 %24, align 16
  %26 = load i32, ptr %2, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = mul nsw i64 %27, %22
  %29 = getelementptr inbounds i32, ptr %25, i64 %28
  %30 = load i32, ptr %1, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %29, i64 %31
  %33 = getelementptr inbounds i8, ptr %32, i64 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %25, ptr noundef nonnull %33, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %34 = getelementptr inbounds i32, ptr %25, i64 %22
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  store i32 1, ptr %35, align 4, !tbaa !9
  %36 = load i32, ptr %2, align 4, !tbaa !9
  %.not82 = icmp slt i32 %36, 2
  br i1 %.not82, label %._crit_edge85, label %.lr.ph

._crit_edge85:                                    ; preds = %._crit_edge, %17
  %.lcssa = phi i32 [ %36, %17 ], [ %130, %._crit_edge ]
  %37 = sext i32 %.lcssa to i64
  %38 = mul nsw i64 %37, %22
  %39 = getelementptr inbounds i32, ptr %25, i64 %38
  %40 = load i32, ptr %1, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %39, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %43)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %23)
  br label %142

.lr.ph:                                           ; preds = %17, %._crit_edge
  %indvars.iv109 = phi i32 [ %indvars.iv.next110, %._crit_edge ], [ 2, %17 ]
  %indvars.iv98 = phi i32 [ %indvars.iv.next99, %._crit_edge ], [ 1, %17 ]
  %indvars.iv96 = phi i32 [ %indvars.iv.next97, %._crit_edge ], [ 1, %17 ]
  %.05783 = phi i32 [ %129, %._crit_edge ], [ 2, %17 ]
  %smax179 = call i32 @llvm.smax.i32(i32 %indvars.iv96, i32 2)
  %46 = zext nneg i32 %smax179 to i64
  %47 = add nsw i64 %46, -1
  %48 = add nsw i64 %46, -2
  %smax = call i32 @llvm.smax.i32(i32 %indvars.iv96, i32 2)
  %49 = zext nneg i32 %smax to i64
  %50 = add nsw i64 %49, -1
  %51 = add nsw i64 %49, -2
  %52 = or disjoint i32 %indvars.iv109, 1
  %53 = sext i32 %52 to i64
  %54 = icmp ugt i32 %.05783, 10
  br i1 %54, label %55, label %57

55:                                               ; preds = %.lr.ph
  %56 = load i32, ptr %1, align 4, !tbaa !9
  br label %63

57:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %58 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 2, i32 noundef %.05783)
  %59 = fptosi double %58 to i32
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr %4, align 4, !tbaa !9
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %62 = load i32, ptr %61, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %63

63:                                               ; preds = %57, %55
  %.056 = phi i32 [ %56, %55 ], [ %62, %57 ]
  %64 = shl nuw nsw i32 %.05783, 1
  %65 = add nsw i32 %64, -1
  %.not6278 = icmp sgt i32 %65, %.056
  br i1 %.not6278, label %._crit_edge, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %63
  %66 = add nsw i32 %.05783, -1
  %67 = sext i32 %66 to i64
  %68 = mul nsw i64 %67, %22
  %69 = getelementptr inbounds i32, ptr %25, i64 %68
  %70 = icmp ugt i32 %.05783, 2
  %71 = zext nneg i32 %.05783 to i64
  %72 = mul nuw nsw i64 %71, %22
  %73 = getelementptr inbounds i32, ptr %25, i64 %72
  %74 = sext i32 %.056 to i64
  br i1 %70, label %.preheader.us.us.preheader, label %.preheader

.preheader.us.us.preheader:                       ; preds = %.preheader.lr.ph
  %xtraiter = and i64 %50, 3
  %75 = icmp ult i64 %51, 3
  %unroll_iter = and i64 %50, -4
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %xtraiter180 = and i64 %47, 3
  %76 = icmp ult i64 %48, 3
  %unroll_iter184 = and i64 %47, -4
  %lcmp.mod182.not = icmp eq i64 %xtraiter180, 0
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader, %._crit_edge77.split.us.us.split.us.us
  %indvars.iv160 = phi i64 [ %53, %.preheader.us.us.preheader ], [ %indvars.iv.next161, %._crit_edge77.split.us.us.split.us.us ]
  %indvars.iv150 = phi i32 [ %indvars.iv98, %.preheader.us.us.preheader ], [ %indvars.iv.next151, %._crit_edge77.split.us.us.split.us.us ]
  %indvars163 = trunc i64 %indvars.iv160 to i32
  %77 = add i32 %indvars163, -2
  %.not6374.us.us = icmp slt i32 %77, 1
  br i1 %.not6374.us.us, label %._crit_edge77.split.us.us.split.us.us, label %.lr.ph76.us.us

._crit_edge77.split.us.us.split.us.us:            ; preds = %._crit_edge72.us.us.us.us, %.preheader.us.us
  %indvars.iv.next161 = add nsw i64 %indvars.iv160, 2
  %.not62.us.us = icmp sgt i64 %indvars.iv.next161, %74
  %indvars.iv.next151 = add i32 %indvars.iv150, 2
  br i1 %.not62.us.us, label %._crit_edge, label %.preheader.us.us, !llvm.loop !11

.lr.ph76.us.us:                                   ; preds = %.preheader.us.us
  %78 = sext i32 %indvars.iv150 to i64
  %79 = getelementptr inbounds i32, ptr %73, i64 %indvars.iv160
  %.promoted.us.us = load i32, ptr %79, align 4, !tbaa !9
  br label %.lr.ph.us.us.us.us

.lr.ph.us.us.us.us:                               ; preds = %._crit_edge72.us.us.us.us, %.lr.ph76.us.us
  %indvars.iv154 = phi i64 [ %indvars.iv.next155, %._crit_edge72.us.us.us.us ], [ 1, %.lr.ph76.us.us ]
  %indvars.iv152 = phi i64 [ %indvars.iv.next153, %._crit_edge72.us.us.us.us ], [ %78, %.lr.ph76.us.us ]
  %80 = phi i32 [ %124, %._crit_edge72.us.us.us.us ], [ %.promoted.us.us, %.lr.ph76.us.us ]
  %81 = getelementptr inbounds i32, ptr %69, i64 %indvars.iv154
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %invariant.gep.us.us.us.us = getelementptr inbounds i32, ptr %25, i64 %indvars.iv154
  br i1 %75, label %._crit_edge.us.us.us.us.unr-lcssa, label %.lr.ph.us.us.us.us.new

._crit_edge.us.us.us.us.new:                      ; preds = %._crit_edge.us.us.us.us, %._crit_edge.us.us.us.us.new
  %indvars.iv143 = phi i64 [ %indvars.iv.next144.3, %._crit_edge.us.us.us.us.new ], [ 1, %._crit_edge.us.us.us.us ]
  %.05168.us.us.us.us = phi i32 [ %94, %._crit_edge.us.us.us.us.new ], [ 0, %._crit_edge.us.us.us.us ]
  %niter185 = phi i64 [ %niter185.next.3, %._crit_edge.us.us.us.us.new ], [ 0, %._crit_edge.us.us.us.us ]
  %83 = mul nuw nsw i64 %indvars.iv143, %22
  %gep67.us.us.us.us = getelementptr i32, ptr %invariant.gep66.us.us.us.us, i64 %83
  %84 = load i32, ptr %gep67.us.us.us.us, align 4, !tbaa !9
  %85 = add nsw i32 %84, %.05168.us.us.us.us
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %86 = mul nuw nsw i64 %indvars.iv.next144, %22
  %gep67.us.us.us.us.1 = getelementptr i32, ptr %invariant.gep66.us.us.us.us, i64 %86
  %87 = load i32, ptr %gep67.us.us.us.us.1, align 4, !tbaa !9
  %88 = add nsw i32 %87, %85
  %indvars.iv.next144.1 = add nuw nsw i64 %indvars.iv143, 2
  %89 = mul nuw nsw i64 %indvars.iv.next144.1, %22
  %gep67.us.us.us.us.2 = getelementptr i32, ptr %invariant.gep66.us.us.us.us, i64 %89
  %90 = load i32, ptr %gep67.us.us.us.us.2, align 4, !tbaa !9
  %91 = add nsw i32 %90, %88
  %indvars.iv.next144.2 = add nuw nsw i64 %indvars.iv143, 3
  %92 = mul nuw nsw i64 %indvars.iv.next144.2, %22
  %gep67.us.us.us.us.3 = getelementptr i32, ptr %invariant.gep66.us.us.us.us, i64 %92
  %93 = load i32, ptr %gep67.us.us.us.us.3, align 4, !tbaa !9
  %94 = add nsw i32 %93, %91
  %indvars.iv.next144.3 = add nuw nsw i64 %indvars.iv143, 4
  %niter185.next.3 = add i64 %niter185, 4
  %niter185.ncmp.3 = icmp eq i64 %niter185.next.3, %unroll_iter184
  br i1 %niter185.ncmp.3, label %._crit_edge72.us.us.us.us.unr-lcssa, label %._crit_edge.us.us.us.us.new, !llvm.loop !13

.lr.ph.us.us.us.us.new:                           ; preds = %.lr.ph.us.us.us.us, %.lr.ph.us.us.us.us.new
  %indvars.iv136 = phi i64 [ %indvars.iv.next137.3, %.lr.ph.us.us.us.us.new ], [ 1, %.lr.ph.us.us.us.us ]
  %.05364.us.us.us.us = phi i32 [ %106, %.lr.ph.us.us.us.us.new ], [ 0, %.lr.ph.us.us.us.us ]
  %niter = phi i64 [ %niter.next.3, %.lr.ph.us.us.us.us.new ], [ 0, %.lr.ph.us.us.us.us ]
  %95 = mul nuw nsw i64 %indvars.iv136, %22
  %gep.us.us.us.us = getelementptr inbounds i32, ptr %invariant.gep.us.us.us.us, i64 %95
  %96 = load i32, ptr %gep.us.us.us.us, align 4, !tbaa !9
  %97 = add nsw i32 %96, %.05364.us.us.us.us
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %98 = mul nuw nsw i64 %indvars.iv.next137, %22
  %gep.us.us.us.us.1 = getelementptr inbounds i32, ptr %invariant.gep.us.us.us.us, i64 %98
  %99 = load i32, ptr %gep.us.us.us.us.1, align 4, !tbaa !9
  %100 = add nsw i32 %99, %97
  %indvars.iv.next137.1 = add nuw nsw i64 %indvars.iv136, 2
  %101 = mul nuw nsw i64 %indvars.iv.next137.1, %22
  %gep.us.us.us.us.2 = getelementptr inbounds i32, ptr %invariant.gep.us.us.us.us, i64 %101
  %102 = load i32, ptr %gep.us.us.us.us.2, align 4, !tbaa !9
  %103 = add nsw i32 %102, %100
  %indvars.iv.next137.2 = add nuw nsw i64 %indvars.iv136, 3
  %104 = mul nuw nsw i64 %indvars.iv.next137.2, %22
  %gep.us.us.us.us.3 = getelementptr inbounds i32, ptr %invariant.gep.us.us.us.us, i64 %104
  %105 = load i32, ptr %gep.us.us.us.us.3, align 4, !tbaa !9
  %106 = add nsw i32 %105, %103
  %indvars.iv.next137.3 = add nuw nsw i64 %indvars.iv136, 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 %._crit_edge.us.us.us.us.unr-lcssa, label %.lr.ph.us.us.us.us.new, !llvm.loop !14

._crit_edge.us.us.us.us.unr-lcssa:                ; preds = %.lr.ph.us.us.us.us.new, %.lr.ph.us.us.us.us
  %.lcssa174.ph = phi i32 [ poison, %.lr.ph.us.us.us.us ], [ %106, %.lr.ph.us.us.us.us.new ]
  %indvars.iv136.unr = phi i64 [ 1, %.lr.ph.us.us.us.us ], [ %indvars.iv.next137.3, %.lr.ph.us.us.us.us.new ]
  %.05364.us.us.us.us.unr = phi i32 [ 0, %.lr.ph.us.us.us.us ], [ %106, %.lr.ph.us.us.us.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us.us.us.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.us.us.us.unr-lcssa, %.epil.preheader
  %indvars.iv136.epil = phi i64 [ %indvars.iv.next137.epil, %.epil.preheader ], [ %indvars.iv136.unr, %._crit_edge.us.us.us.us.unr-lcssa ]
  %.05364.us.us.us.us.epil = phi i32 [ %109, %.epil.preheader ], [ %.05364.us.us.us.us.unr, %._crit_edge.us.us.us.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us.us.us.us.unr-lcssa ]
  %107 = mul nuw nsw i64 %indvars.iv136.epil, %22
  %gep.us.us.us.us.epil = getelementptr inbounds i32, ptr %invariant.gep.us.us.us.us, i64 %107
  %108 = load i32, ptr %gep.us.us.us.us.epil, align 4, !tbaa !9
  %109 = add nsw i32 %108, %.05364.us.us.us.us.epil
  %indvars.iv.next137.epil = add nuw nsw i64 %indvars.iv136.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_edge.us.us.us.us, label %.epil.preheader, !llvm.loop !15

._crit_edge.us.us.us.us:                          ; preds = %.epil.preheader, %._crit_edge.us.us.us.us.unr-lcssa
  %.lcssa174 = phi i32 [ %.lcssa174.ph, %._crit_edge.us.us.us.us.unr-lcssa ], [ %109, %.epil.preheader ]
  %110 = getelementptr inbounds i32, ptr %69, i64 %indvars.iv152
  %111 = load i32, ptr %110, align 4, !tbaa !9
  %invariant.gep66.us.us.us.us = getelementptr i32, ptr %25, i64 %indvars.iv152
  br i1 %76, label %._crit_edge72.us.us.us.us.unr-lcssa, label %._crit_edge.us.us.us.us.new

._crit_edge72.us.us.us.us.unr-lcssa:              ; preds = %._crit_edge.us.us.us.us.new, %._crit_edge.us.us.us.us
  %.lcssa175.ph = phi i32 [ poison, %._crit_edge.us.us.us.us ], [ %94, %._crit_edge.us.us.us.us.new ]
  %indvars.iv143.unr = phi i64 [ 1, %._crit_edge.us.us.us.us ], [ %indvars.iv.next144.3, %._crit_edge.us.us.us.us.new ]
  %.05168.us.us.us.us.unr = phi i32 [ 0, %._crit_edge.us.us.us.us ], [ %94, %._crit_edge.us.us.us.us.new ]
  br i1 %lcmp.mod182.not, label %._crit_edge72.us.us.us.us, label %.epil.preheader178

.epil.preheader178:                               ; preds = %._crit_edge72.us.us.us.us.unr-lcssa, %.epil.preheader178
  %indvars.iv143.epil = phi i64 [ %indvars.iv.next144.epil, %.epil.preheader178 ], [ %indvars.iv143.unr, %._crit_edge72.us.us.us.us.unr-lcssa ]
  %.05168.us.us.us.us.epil = phi i32 [ %114, %.epil.preheader178 ], [ %.05168.us.us.us.us.unr, %._crit_edge72.us.us.us.us.unr-lcssa ]
  %epil.iter181 = phi i64 [ %epil.iter181.next, %.epil.preheader178 ], [ 0, %._crit_edge72.us.us.us.us.unr-lcssa ]
  %112 = mul nuw nsw i64 %indvars.iv143.epil, %22
  %gep67.us.us.us.us.epil = getelementptr i32, ptr %invariant.gep66.us.us.us.us, i64 %112
  %113 = load i32, ptr %gep67.us.us.us.us.epil, align 4, !tbaa !9
  %114 = add nsw i32 %113, %.05168.us.us.us.us.epil
  %indvars.iv.next144.epil = add nuw nsw i64 %indvars.iv143.epil, 1
  %epil.iter181.next = add i64 %epil.iter181, 1
  %epil.iter181.cmp.not = icmp eq i64 %epil.iter181.next, %xtraiter180
  br i1 %epil.iter181.cmp.not, label %._crit_edge72.us.us.us.us, label %.epil.preheader178, !llvm.loop !17

._crit_edge72.us.us.us.us:                        ; preds = %.epil.preheader178, %._crit_edge72.us.us.us.us.unr-lcssa
  %.lcssa175 = phi i32 [ %.lcssa175.ph, %._crit_edge72.us.us.us.us.unr-lcssa ], [ %114, %.epil.preheader178 ]
  %115 = srem i32 %.lcssa174, 9901
  %116 = srem i32 %.lcssa175, 9901
  %117 = add i32 %116, %111
  %118 = mul i32 %117, %82
  %119 = mul nsw i32 %111, %115
  %120 = add nsw i32 %118, %119
  %121 = icmp ne i64 %indvars.iv154, %indvars.iv152
  %122 = zext i1 %121 to i32
  %spec.select.us.us.us.us = shl nsw i32 %120, %122
  %123 = add nsw i32 %80, %spec.select.us.us.us.us
  %124 = srem i32 %123, 9901
  store i32 %124, ptr %79, align 4, !tbaa !9
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 2
  %indvars.iv.next153 = add nsw i64 %indvars.iv152, -2
  %sext164 = shl i64 %indvars.iv.next153, 32
  %125 = ashr exact i64 %sext164, 32
  %.not63.us.us.us.us = icmp sgt i64 %indvars.iv.next155, %125
  br i1 %.not63.us.us.us.us, label %._crit_edge77.split.us.us.split.us.us, label %.lr.ph.us.us.us.us, !llvm.loop !18

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge77.split
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %._crit_edge77.split ], [ %53, %.preheader.lr.ph ]
  %indvars.iv100 = phi i32 [ %indvars.iv.next101, %._crit_edge77.split ], [ %indvars.iv98, %.preheader.lr.ph ]
  %indvars114 = trunc i64 %indvars.iv111 to i32
  %126 = add i32 %indvars114, -2
  %.not6374 = icmp slt i32 %126, 1
  br i1 %.not6374, label %._crit_edge77.split, label %.lr.ph76

.lr.ph76:                                         ; preds = %.preheader
  %127 = sext i32 %indvars.iv100 to i64
  %128 = getelementptr inbounds i32, ptr %73, i64 %indvars.iv111
  %.promoted = load i32, ptr %128, align 4, !tbaa !9
  br label %._crit_edge72

._crit_edge:                                      ; preds = %._crit_edge77.split, %._crit_edge77.split.us.us.split.us.us, %63
  %129 = add i32 %.05783, 1
  %130 = load i32, ptr %2, align 4, !tbaa !9
  %.not = icmp sgt i32 %129, %130
  %indvars.iv.next97 = add i32 %indvars.iv96, 1
  %indvars.iv.next99 = add i32 %indvars.iv98, 2
  %indvars.iv.next110 = add i32 %indvars.iv109, 2
  br i1 %.not, label %._crit_edge85, label %.lr.ph, !llvm.loop !19

._crit_edge77.split:                              ; preds = %._crit_edge72, %.preheader
  %indvars.iv.next112 = add nsw i64 %indvars.iv111, 2
  %.not62 = icmp sgt i64 %indvars.iv.next112, %74
  %indvars.iv.next101 = add i32 %indvars.iv100, 2
  br i1 %.not62, label %._crit_edge, label %.preheader, !llvm.loop !11

._crit_edge72:                                    ; preds = %._crit_edge72, %.lr.ph76
  %indvars.iv104 = phi i64 [ 1, %.lr.ph76 ], [ %indvars.iv.next105, %._crit_edge72 ]
  %indvars.iv102 = phi i64 [ %127, %.lr.ph76 ], [ %indvars.iv.next103, %._crit_edge72 ]
  %131 = phi i32 [ %.promoted, %.lr.ph76 ], [ %140, %._crit_edge72 ]
  %132 = getelementptr inbounds i32, ptr %69, i64 %indvars.iv102
  %133 = load i32, ptr %132, align 4, !tbaa !9
  %134 = getelementptr inbounds i32, ptr %69, i64 %indvars.iv104
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = mul i32 %133, %135
  %137 = icmp ne i64 %indvars.iv104, %indvars.iv102
  %138 = zext i1 %137 to i32
  %spec.select = shl nsw i32 %136, %138
  %139 = add nsw i32 %131, %spec.select
  %140 = srem i32 %139, 9901
  store i32 %140, ptr %128, align 4, !tbaa !9
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 2
  %indvars.iv.next103 = add nsw i64 %indvars.iv102, -2
  %sext = shl i64 %indvars.iv.next103, 32
  %141 = ashr exact i64 %sext, 32
  %.not63 = icmp sgt i64 %indvars.iv.next105, %141
  br i1 %.not63, label %._crit_edge77.split, label %._crit_edge72, !llvm.loop !18

142:                                              ; preds = %._crit_edge85, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; 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)) #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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