; LLVM IR from kazunetakahashi/atcoder :: 2017/0709_AGC017 (C)

; 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
@A = external dso_local global [200010 x i32], align 16
@X = external dso_local global [200010 x i32], align 16
@Y = external dso_local global [200010 x i32], align 16
@C = external dso_local global [200010 x i32], align 16
@S = external dso_local global [200010 x i32], align 16
@_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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %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) @N)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %21

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

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

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr %33, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %26
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !9

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

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

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

45:                                               ; preds = %40
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200010 x i32], ptr @X, i64 0, i64 %47
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200010 x i32], ptr @Y, i64 0, i64 %51
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 4 dereferenceable(4) %52)
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [200010 x i32], ptr @X, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %56, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [200010 x i32], ptr @Y, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %61, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %45
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %40, !llvm.loop !11

67:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @C, ptr noundef getelementptr inbounds (i32, ptr @C, i64 200010), ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %68 = load i32, ptr @N, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr @S, i64 %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @S, ptr noundef %70, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %85, %67
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr @N, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

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

76:                                               ; preds = %71
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200010 x i32], ptr @C, 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 = %76
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %6, align 4, !tbaa !5
  br label %71, !llvm.loop !12

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

89:                                               ; preds = %119, %88
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr @N, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

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

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sub nsw i32 %95, %99
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %11, align 4, !tbaa !5
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %103 = load i32, ptr %102, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  store i32 %103, ptr %9, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %115, %94
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = icmp sle i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %118

109:                                              ; preds = %104
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %112, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %109
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %9, align 4, !tbaa !5
  br label %104, !llvm.loop !13

118:                                              ; preds = %108
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !5
  br label %89, !llvm.loop !14

122:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %138, %122
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = load i32, ptr @N, align 4, !tbaa !5
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

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

128:                                              ; preds = %123
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = icmp eq i32 %132, 0
  br i1 %133, label %134, label %137

134:                                              ; preds = %128
  %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 %137

137:                                              ; preds = %134, %128
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %13, align 4, !tbaa !5
  br label %123, !llvm.loop !15

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

142:                                              ; preds = %233, %141
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = load i32, ptr @M, align 4, !tbaa !5
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %147, label %146

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

147:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %148 = load i32, ptr %14, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [200010 x i32], ptr @X, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  store i32 %154, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %155 = load i32, ptr %14, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [200010 x i32], ptr @Y, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  store i32 %158, ptr %16, align 4, !tbaa !5
  %159 = load i32, ptr %15, align 4, !tbaa !5
  %160 = load i32, ptr %16, align 4, !tbaa !5
  %161 = icmp ne i32 %159, %160
  br i1 %161, label %162, label %229

162:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %163 = load i32, ptr %15, align 4, !tbaa !5
  %164 = load i32, ptr %15, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sub nsw i32 %163, %167
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %170 = load i32, ptr %16, align 4, !tbaa !5
  %171 = load i32, ptr %16, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = sub nsw i32 %170, %174
  store i32 %175, ptr %18, align 4, !tbaa !5
  %176 = load i32, ptr %17, align 4, !tbaa !5
  %177 = icmp sge i32 %176, 0
  br i1 %177, label %178, label %193

178:                                              ; preds = %162
  %179 = load i32, ptr %17, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = add nsw i32 %182, -1
  store i32 %183, ptr %181, align 4, !tbaa !5
  %184 = load i32, ptr %17, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = icmp eq i32 %187, 0
  br i1 %188, label %189, label %192

189:                                              ; preds = %178
  %190 = load i32, ptr %12, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %12, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %189, %178
  br label %193

193:                                              ; preds = %192, %162
  %194 = load i32, ptr %18, align 4, !tbaa !5
  %195 = icmp sge i32 %194, 0
  br i1 %195, label %196, label %211

196:                                              ; preds = %193
  %197 = load i32, ptr %18, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = icmp eq i32 %200, 0
  br i1 %201, label %202, label %205

202:                                              ; preds = %196
  %203 = load i32, ptr %12, align 4, !tbaa !5
  %204 = add nsw i32 %203, -1
  store i32 %204, ptr %12, align 4, !tbaa !5
  br label %205

205:                                              ; preds = %202, %196
  %206 = load i32, ptr %18, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %208, align 4, !tbaa !5
  br label %211

211:                                              ; preds = %205, %193
  %212 = load i32, ptr %15, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = add nsw i32 %215, -1
  store i32 %216, ptr %214, align 4, !tbaa !5
  %217 = load i32, ptr %16, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %219, align 4, !tbaa !5
  %222 = load i32, ptr %16, align 4, !tbaa !5
  %223 = load i32, ptr %14, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [200010 x i32], ptr @X, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %227
  store i32 %222, ptr %228, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %229

229:                                              ; preds = %211, %147
  %230 = load i32, ptr %12, align 4, !tbaa !5
  %231 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %230)
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %231, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %233

233:                                              ; preds = %229
  %234 = load i32, ptr %14, align 4, !tbaa !5
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %14, align 4, !tbaa !5
  br label %142, !llvm.loop !16

236:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %237 = load i32, ptr %1, align 4
  ret i32 %237
}

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

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

; 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 uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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 = { 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 #4 = { 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 #5 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; 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
@A = external dso_local global [200010 x i32], align 16
@X = external dso_local global [200010 x i32], align 16
@Y = external dso_local global [200010 x i32], align 16
@C = external dso_local global [200010 x i32], align 16
@S = external dso_local global [200010 x i32], align 16
@_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 = 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)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %7 = load i32, ptr @N, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.preheader65

.preheader65:                                     ; preds = %.lr.ph, %0
  %9 = load i32, ptr @M, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph68, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %11 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv
  %12 = 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) %11)
  %13 = load i32, ptr %11, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %11, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @N, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader65, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph68, %.preheader65
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @C, ptr noundef nonnull getelementptr inbounds (i8, ptr @C, i64 800040), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %18 = load i32, ptr @N, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr @S, i64 %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @S, ptr noundef nonnull %20, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %21 = load i32, ptr @N, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph71.preheader, label %.preheader

.lr.ph71.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %21 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %23 = icmp ult i32 %21, 4
  br i1 %23, label %.preheader64.unr-lcssa, label %.lr.ph71.preheader.new

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

.lr.ph68:                                         ; preds = %.preheader65, %.lr.ph68
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph68 ], [ 0, %.preheader65 ]
  %24 = getelementptr inbounds [200010 x i32], ptr @X, i64 0, i64 %indvars.iv89
  %25 = 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) %24)
  %26 = getelementptr inbounds [200010 x i32], ptr @Y, i64 0, i64 %indvars.iv89
  %27 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %28 = load i32, ptr %24, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %24, align 4, !tbaa !5
  %30 = load i32, ptr %26, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %26, align 4, !tbaa !5
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %32 = load i32, ptr @M, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next90, %33
  br i1 %34, label %.lr.ph68, label %._crit_edge, !llvm.loop !11

.preheader64.unr-lcssa:                           ; preds = %.lr.ph71, %.lr.ph71.preheader
  %indvars.iv92.unr = phi i64 [ 0, %.lr.ph71.preheader ], [ %indvars.iv.next93.3, %.lr.ph71 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader64, label %.lr.ph71.epil

.lr.ph71.epil:                                    ; preds = %.preheader64.unr-lcssa, %.lr.ph71.epil
  %indvars.iv92.epil = phi i64 [ %indvars.iv.next93.epil, %.lr.ph71.epil ], [ %indvars.iv92.unr, %.preheader64.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph71.epil ], [ 0, %.preheader64.unr-lcssa ]
  %35 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv92.epil
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 4, !tbaa !5
  %indvars.iv.next93.epil = add nuw nsw i64 %indvars.iv92.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 %.preheader64, label %.lr.ph71.epil, !llvm.loop !12

.preheader64:                                     ; preds = %.lr.ph71.epil, %.preheader64.unr-lcssa
  br i1 %22, label %.lr.ph78, label %.preheader

.lr.ph71:                                         ; preds = %.lr.ph71, %.lr.ph71.preheader.new
  %indvars.iv92 = phi i64 [ 0, %.lr.ph71.preheader.new ], [ %indvars.iv.next93.3, %.lr.ph71 ]
  %niter = phi i64 [ 0, %.lr.ph71.preheader.new ], [ %niter.next.3, %.lr.ph71 ]
  %41 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv92
  %42 = load i32, ptr %41, align 16, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !5
  %indvars.iv.next93 = or disjoint i64 %indvars.iv92, 1
  %47 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv.next93
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %50, align 4, !tbaa !5
  %indvars.iv.next93.1 = or disjoint i64 %indvars.iv92, 2
  %53 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv.next93.1
  %54 = load i32, ptr %53, align 8, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %56, align 4, !tbaa !5
  %indvars.iv.next93.2 = or disjoint i64 %indvars.iv92, 3
  %59 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv.next93.2
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 4, !tbaa !5
  %indvars.iv.next93.3 = add nuw nsw i64 %indvars.iv92, 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 %.preheader64.unr-lcssa, label %.lr.ph71, !llvm.loop !14

.preheader63:                                     ; preds = %._crit_edge76
  %65 = icmp sgt i32 %92, 0
  br i1 %65, label %.lr.ph81.preheader, label %.preheader

.lr.ph81.preheader:                               ; preds = %.preheader63
  %wide.trip.count107 = zext nneg i32 %92 to i64
  %min.iters.check116 = icmp ult i32 %92, 8
  br i1 %min.iters.check116, label %.lr.ph81.preheader128, label %vector.ph117

.lr.ph81.preheader128:                            ; preds = %middle.block114, %.lr.ph81.preheader
  %indvars.iv104.ph = phi i64 [ 0, %.lr.ph81.preheader ], [ %n.vec119, %middle.block114 ]
  %.05479.ph = phi i32 [ 0, %.lr.ph81.preheader ], [ %75, %middle.block114 ]
  br label %.lr.ph81

vector.ph117:                                     ; preds = %.lr.ph81.preheader
  %n.vec119 = and i64 %wide.trip.count107, 2147483640
  br label %vector.body121

vector.body121:                                   ; preds = %vector.body121, %vector.ph117
  %index122 = phi i64 [ 0, %vector.ph117 ], [ %index.next126, %vector.body121 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph117 ], [ %72, %vector.body121 ]
  %vec.phi123 = phi <4 x i32> [ zeroinitializer, %vector.ph117 ], [ %73, %vector.body121 ]
  %66 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %index122
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  %wide.load124 = load <4 x i32>, ptr %66, align 16, !tbaa !5
  %wide.load125 = load <4 x i32>, ptr %67, align 16, !tbaa !5
  %68 = icmp eq <4 x i32> %wide.load124, zeroinitializer
  %69 = icmp eq <4 x i32> %wide.load125, zeroinitializer
  %70 = zext <4 x i1> %68 to <4 x i32>
  %71 = zext <4 x i1> %69 to <4 x i32>
  %72 = add <4 x i32> %vec.phi, %70
  %73 = add <4 x i32> %vec.phi123, %71
  %index.next126 = add nuw i64 %index122, 8
  %74 = icmp eq i64 %index.next126, %n.vec119
  br i1 %74, label %middle.block114, label %vector.body121, !llvm.loop !15

middle.block114:                                  ; preds = %vector.body121
  %bin.rdx = add <4 x i32> %73, %72
  %75 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n127 = icmp eq i64 %n.vec119, %wide.trip.count107
  br i1 %cmp.n127, label %.preheader, label %.lr.ph81.preheader128

.lr.ph78:                                         ; preds = %.preheader64, %._crit_edge76
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %._crit_edge76 ], [ 0, %.preheader64 ]
  %indvars.iv98 = phi i32 [ %indvars.iv.next99, %._crit_edge76 ], [ 1, %.preheader64 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %76 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %indvars.iv101
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %78 = trunc nuw nsw i64 %indvars.iv.next102 to i32
  %79 = sub i32 %78, %77
  store i32 %79, ptr %4, align 4, !tbaa !5
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %81 = load i32, ptr %80, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %82 = sext i32 %81 to i64
  %.not6072 = icmp slt i64 %indvars.iv101, %82
  br i1 %.not6072, label %._crit_edge76, label %.lr.ph75.preheader

.lr.ph75.preheader:                               ; preds = %.lr.ph78
  %83 = trunc i64 %indvars.iv101 to i32
  %84 = sub i32 %83, %81
  %85 = zext i32 %84 to i64
  %86 = add nuw nsw i64 %85, 1
  %min.iters.check = icmp ult i32 %84, 7
  br i1 %min.iters.check, label %.lr.ph75.preheader130, label %vector.ph

.lr.ph75.preheader130:                            ; preds = %middle.block, %.lr.ph75.preheader
  %indvars.iv95.ph = phi i64 [ %82, %.lr.ph75.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph75

vector.ph:                                        ; preds = %.lr.ph75.preheader
  %n.vec = and i64 %86, 8589934584
  %ind.end = add nsw i64 %n.vec, %82
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %82
  %87 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %offset.idx
  %88 = getelementptr inbounds i8, ptr %87, i64 16
  %wide.load = load <4 x i32>, ptr %87, align 4, !tbaa !5
  %wide.load113 = load <4 x i32>, ptr %88, align 4, !tbaa !5
  %89 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %90 = add nsw <4 x i32> %wide.load113, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %89, ptr %87, align 4, !tbaa !5
  store <4 x i32> %90, ptr %88, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %91 = icmp eq i64 %index.next, %n.vec
  br i1 %91, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %86, %n.vec
  br i1 %cmp.n, label %._crit_edge76, label %.lr.ph75.preheader130

._crit_edge76:                                    ; preds = %.lr.ph75, %middle.block, %.lr.ph78
  %92 = load i32, ptr @N, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = icmp slt i64 %indvars.iv.next102, %93
  %indvars.iv.next99 = add nuw i32 %indvars.iv98, 1
  br i1 %94, label %.lr.ph78, label %.preheader63, !llvm.loop !19

.lr.ph75:                                         ; preds = %.lr.ph75.preheader130, %.lr.ph75
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %.lr.ph75 ], [ %indvars.iv95.ph, %.lr.ph75.preheader130 ]
  %95 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %indvars.iv95
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %95, align 4, !tbaa !5
  %indvars.iv.next96 = add nsw i64 %indvars.iv95, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next96 to i32
  %exitcond100.not = icmp eq i32 %indvars.iv98, %lftr.wideiv
  br i1 %exitcond100.not, label %._crit_edge76, label %.lr.ph75, !llvm.loop !20

.preheader:                                       ; preds = %.lr.ph81, %middle.block114, %._crit_edge, %.preheader64, %.preheader63
  %.054.lcssa = phi i32 [ 0, %.preheader63 ], [ 0, %.preheader64 ], [ 0, %._crit_edge ], [ %75, %middle.block114 ], [ %spec.select, %.lr.ph81 ]
  %98 = load i32, ptr @M, align 4, !tbaa !5
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %.lr.ph85, label %._crit_edge86

.lr.ph81:                                         ; preds = %.lr.ph81.preheader128, %.lr.ph81
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %.lr.ph81 ], [ %indvars.iv104.ph, %.lr.ph81.preheader128 ]
  %.05479 = phi i32 [ %spec.select, %.lr.ph81 ], [ %.05479.ph, %.lr.ph81.preheader128 ]
  %100 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %indvars.iv104
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp eq i32 %101, 0
  %103 = zext i1 %102 to i32
  %spec.select = add nuw nsw i32 %.05479, %103
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107
  br i1 %exitcond108.not, label %.preheader, label %.lr.ph81, !llvm.loop !21

._crit_edge86:                                    ; preds = %142, %.preheader
  ret i32 0

.lr.ph85:                                         ; preds = %.preheader, %142
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %142 ], [ 0, %.preheader ]
  %.283 = phi i32 [ %.6, %142 ], [ %.054.lcssa, %.preheader ]
  %104 = getelementptr inbounds [200010 x i32], ptr @X, i64 0, i64 %indvars.iv109
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = getelementptr inbounds [200010 x i32], ptr @Y, i64 0, i64 %indvars.iv109
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %.not = icmp eq i32 %108, %110
  br i1 %.not, label %142, label %111

111:                                              ; preds = %.lr.ph85
  %112 = sext i32 %108 to i64
  %113 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = sub nsw i32 %108, %114
  %116 = sext i32 %110 to i64
  %117 = getelementptr inbounds [200010 x i32], ptr @C, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sub nsw i32 %110, %118
  %120 = icmp sgt i32 %115, -2
  br i1 %120, label %121, label %129

121:                                              ; preds = %111
  %122 = add nsw i32 %115, 1
  %123 = zext nneg i32 %122 to i64
  %124 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %124, align 4, !tbaa !5
  %127 = icmp eq i32 %126, 0
  %128 = zext i1 %127 to i32
  %spec.select61 = add nsw i32 %.283, %128
  br label %129

129:                                              ; preds = %121, %111
  %.3 = phi i32 [ %.283, %111 ], [ %spec.select61, %121 ]
  %130 = icmp sgt i32 %119, -1
  br i1 %130, label %131, label %138

131:                                              ; preds = %129
  %132 = zext nneg i32 %119 to i64
  %133 = getelementptr inbounds [200010 x i32], ptr @S, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp eq i32 %134, 0
  %136 = sext i1 %135 to i32
  %spec.select62 = add nsw i32 %.3, %136
  %137 = add nsw i32 %134, 1
  store i32 %137, ptr %133, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %131, %129
  %.5 = phi i32 [ %spec.select62, %131 ], [ %.3, %129 ]
  %139 = add nsw i32 %114, -1
  store i32 %139, ptr %113, align 4, !tbaa !5
  %140 = load i32, ptr %117, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %117, align 4, !tbaa !5
  store i32 %110, ptr %107, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %138, %.lr.ph85
  %.6 = phi i32 [ %.5, %138 ], [ %.283, %.lr.ph85 ]
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.6)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %145 = load i32, ptr @M, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = icmp slt i64 %indvars.iv.next110, %146
  br i1 %147, label %.lr.ph85, label %._crit_edge86, !llvm.loop !22
}

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

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

; 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 uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6

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 = { 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 #4 = { 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !16, !17}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !17, !16}
!21 = distinct !{!21, !10, !17, !16}
!22 = distinct !{!22, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass