; LLVM IR from kazunetakahashi/atcoder :: 2018/0602_codeFlyer (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 i64, align 8
@D = external dso_local global i64, align 8
@X = external dso_local global [100010 x i64], align 16
@L = external dso_local global [100010 x i64], align 16
@R = external dso_local global [100010 x i64], align 16
@sumR = external dso_local global [100010 x i64], align 16
@sumL = external dso_local global [100010 x i64], align 16
@cnt = external dso_local global [100010 x i64], 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 i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @D)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %25, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = load i64, ptr @N, align 8, !tbaa !9
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %28

20:                                               ; preds = %14
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !11

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store i64 0, ptr %4, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %58, %28
  %30 = load i64, ptr %4, align 8, !tbaa !9
  %31 = load i64, ptr @N, align 8, !tbaa !9
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %33, label %59

33:                                               ; preds = %29
  %34 = load i64, ptr %4, align 8, !tbaa !9
  %35 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = load i64, ptr %3, align 8, !tbaa !9
  %38 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = sub nsw i64 %36, %39
  %41 = load i64, ptr @D, align 8, !tbaa !9
  %42 = icmp sle i64 %40, %41
  br i1 %42, label %43, label %49

43:                                               ; preds = %33
  %44 = load i64, ptr %4, align 8, !tbaa !9
  %45 = load i64, ptr %3, align 8, !tbaa !9
  %46 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %45
  store i64 %44, ptr %46, align 8, !tbaa !9
  %47 = load i64, ptr %4, align 8, !tbaa !9
  %48 = add nsw i64 %47, 1
  store i64 %48, ptr %4, align 8, !tbaa !9
  br label %58

49:                                               ; preds = %33
  %50 = load i64, ptr %3, align 8, !tbaa !9
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %3, align 8, !tbaa !9
  %52 = load i64, ptr %3, align 8, !tbaa !9
  %53 = sub nsw i64 %52, 1
  %54 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = load i64, ptr %3, align 8, !tbaa !9
  %57 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %56
  store i64 %55, ptr %57, align 8, !tbaa !9
  br label %58

58:                                               ; preds = %49, %43
  br label %29, !llvm.loop !13

59:                                               ; preds = %29
  %60 = load i64, ptr @N, align 8, !tbaa !9
  %61 = sub nsw i64 %60, 1
  store i64 %61, ptr %4, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %91, %59
  %63 = load i64, ptr %3, align 8, !tbaa !9
  %64 = load i64, ptr @N, align 8, !tbaa !9
  %65 = icmp slt i64 %63, %64
  br i1 %65, label %66, label %92

66:                                               ; preds = %62
  %67 = load i64, ptr %4, align 8, !tbaa !9
  %68 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = load i64, ptr %3, align 8, !tbaa !9
  %71 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = sub nsw i64 %69, %72
  %74 = load i64, ptr @D, align 8, !tbaa !9
  %75 = icmp sle i64 %73, %74
  br i1 %75, label %76, label %82

76:                                               ; preds = %66
  %77 = load i64, ptr %4, align 8, !tbaa !9
  %78 = load i64, ptr %3, align 8, !tbaa !9
  %79 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %78
  store i64 %77, ptr %79, align 8, !tbaa !9
  %80 = load i64, ptr %3, align 8, !tbaa !9
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %3, align 8, !tbaa !9
  br label %91

82:                                               ; preds = %66
  %83 = load i64, ptr %3, align 8, !tbaa !9
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %3, align 8, !tbaa !9
  %85 = load i64, ptr %3, align 8, !tbaa !9
  %86 = sub nsw i64 %85, 1
  %87 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !9
  %89 = load i64, ptr %3, align 8, !tbaa !9
  %90 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %89
  store i64 %88, ptr %90, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %82, %76
  br label %62, !llvm.loop !14

92:                                               ; preds = %62
  %93 = load i64, ptr @N, align 8, !tbaa !9
  %94 = sub nsw i64 %93, 1
  store i64 %94, ptr %3, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %123, %92
  %96 = load i64, ptr %3, align 8, !tbaa !9
  %97 = icmp sge i64 %96, 0
  br i1 %97, label %98, label %124

98:                                               ; preds = %95
  %99 = load i64, ptr %4, align 8, !tbaa !9
  %100 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !9
  %102 = load i64, ptr %3, align 8, !tbaa !9
  %103 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !9
  %105 = sub nsw i64 %101, %104
  %106 = load i64, ptr @D, align 8, !tbaa !9
  %107 = icmp sle i64 %105, %106
  br i1 %107, label %108, label %114

108:                                              ; preds = %98
  %109 = load i64, ptr %3, align 8, !tbaa !9
  %110 = load i64, ptr %4, align 8, !tbaa !9
  %111 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %110
  store i64 %109, ptr %111, align 8, !tbaa !9
  %112 = load i64, ptr %3, align 8, !tbaa !9
  %113 = add nsw i64 %112, -1
  store i64 %113, ptr %3, align 8, !tbaa !9
  br label %123

114:                                              ; preds = %98
  %115 = load i64, ptr %4, align 8, !tbaa !9
  %116 = add nsw i64 %115, -1
  store i64 %116, ptr %4, align 8, !tbaa !9
  %117 = load i64, ptr %4, align 8, !tbaa !9
  %118 = add nsw i64 %117, 1
  %119 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = load i64, ptr %4, align 8, !tbaa !9
  %122 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %121
  store i64 %120, ptr %122, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %114, %108
  br label %95, !llvm.loop !15

124:                                              ; preds = %95
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %125

125:                                              ; preds = %153, %124
  %126 = load i64, ptr %4, align 8, !tbaa !9
  %127 = icmp sge i64 %126, 0
  br i1 %127, label %128, label %154

128:                                              ; preds = %125
  %129 = load i64, ptr %4, align 8, !tbaa !9
  %130 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !9
  %132 = load i64, ptr %3, align 8, !tbaa !9
  %133 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = sub nsw i64 %131, %134
  %136 = load i64, ptr @D, align 8, !tbaa !9
  %137 = icmp sle i64 %135, %136
  br i1 %137, label %138, label %144

138:                                              ; preds = %128
  %139 = load i64, ptr %3, align 8, !tbaa !9
  %140 = load i64, ptr %4, align 8, !tbaa !9
  %141 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %140
  store i64 %139, ptr %141, align 8, !tbaa !9
  %142 = load i64, ptr %4, align 8, !tbaa !9
  %143 = add nsw i64 %142, -1
  store i64 %143, ptr %4, align 8, !tbaa !9
  br label %153

144:                                              ; preds = %128
  %145 = load i64, ptr %4, align 8, !tbaa !9
  %146 = add nsw i64 %145, -1
  store i64 %146, ptr %4, align 8, !tbaa !9
  %147 = load i64, ptr %4, align 8, !tbaa !9
  %148 = add nsw i64 %147, 1
  %149 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !9
  %151 = load i64, ptr %4, align 8, !tbaa !9
  %152 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %151
  store i64 %150, ptr %152, align 8, !tbaa !9
  br label %153

153:                                              ; preds = %144, %138
  br label %125, !llvm.loop !16

154:                                              ; preds = %125
  store i64 0, ptr @sumL, align 16, !tbaa !9
  store i64 0, ptr @sumR, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %180, %154
  %156 = load i32, ptr %5, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = load i64, ptr @N, align 8, !tbaa !9
  %159 = icmp sle i64 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %183

161:                                              ; preds = %155
  %162 = load i32, ptr %5, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100010 x i64], ptr @sumR, i64 0, i64 %164
  %166 = load i64, ptr %165, align 8, !tbaa !9
  %167 = load i32, ptr %5, align 4, !tbaa !5
  %168 = sub nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %172 = load i32, ptr %5, align 4, !tbaa !5
  %173 = sub nsw i32 %172, 1
  %174 = sext i32 %173 to i64
  %175 = sub nsw i64 %171, %174
  %176 = add nsw i64 %166, %175
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100010 x i64], ptr @sumR, i64 0, i64 %178
  store i64 %176, ptr %179, align 8, !tbaa !9
  br label %180

180:                                              ; preds = %161
  %181 = load i32, ptr %5, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %5, align 4, !tbaa !5
  br label %155, !llvm.loop !17

183:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %209, %183
  %185 = load i32, ptr %6, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = load i64, ptr @N, align 8, !tbaa !9
  %188 = icmp sle i64 %186, %187
  br i1 %188, label %190, label %189

189:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %212

190:                                              ; preds = %184
  %191 = load i32, ptr %6, align 4, !tbaa !5
  %192 = sub nsw i32 %191, 1
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [100010 x i64], ptr @sumL, i64 0, i64 %193
  %195 = load i64, ptr %194, align 8, !tbaa !9
  %196 = load i32, ptr %6, align 4, !tbaa !5
  %197 = sub nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = sub nsw i32 %199, 1
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %201
  %203 = load i64, ptr %202, align 8, !tbaa !9
  %204 = sub nsw i64 %198, %203
  %205 = add nsw i64 %195, %204
  %206 = load i32, ptr %6, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [100010 x i64], ptr @sumL, i64 0, i64 %207
  store i64 %205, ptr %208, align 8, !tbaa !9
  br label %209

209:                                              ; preds = %190
  %210 = load i32, ptr %6, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %6, align 4, !tbaa !5
  br label %184, !llvm.loop !18

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

213:                                              ; preds = %261, %212
  %214 = load i32, ptr %7, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = load i64, ptr @N, align 8, !tbaa !9
  %217 = icmp slt i64 %215, %216
  br i1 %217, label %219, label %218

218:                                              ; preds = %213
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %264

219:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %220 = load i32, ptr %7, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %221
  %223 = load i64, ptr %222, align 8, !tbaa !9
  %224 = load i32, ptr %7, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %225
  %227 = load i64, ptr %226, align 8, !tbaa !9
  %228 = sub nsw i64 %227, 1
  %229 = sub nsw i64 %223, %228
  %230 = sub nsw i64 %229, 1
  store i64 %230, ptr %8, align 8, !tbaa !9
  %231 = load i64, ptr %8, align 8, !tbaa !9
  %232 = load i64, ptr %8, align 8, !tbaa !9
  %233 = sub nsw i64 %232, 1
  %234 = mul nsw i64 %231, %233
  %235 = sdiv i64 %234, 2
  %236 = load i32, ptr %7, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %237
  store i64 %235, ptr %238, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %239 = load i32, ptr %7, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %240
  %242 = load i64, ptr %241, align 8, !tbaa !9
  %243 = add nsw i64 %242, 1
  %244 = getelementptr inbounds [100010 x i64], ptr @sumL, i64 0, i64 %243
  %245 = load i64, ptr %244, align 8, !tbaa !9
  %246 = load i32, ptr %7, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %247
  %249 = load i64, ptr %248, align 8, !tbaa !9
  %250 = getelementptr inbounds [100010 x i64], ptr @sumR, i64 0, i64 %249
  %251 = load i64, ptr %250, align 8, !tbaa !9
  %252 = sub nsw i64 %245, %251
  %253 = load i64, ptr %8, align 8, !tbaa !9
  %254 = sub nsw i64 %252, %253
  store i64 %254, ptr %9, align 8, !tbaa !9
  %255 = load i64, ptr %9, align 8, !tbaa !9
  %256 = load i32, ptr %7, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %257
  %259 = load i64, ptr %258, align 8, !tbaa !9
  %260 = sub nsw i64 %259, %255
  store i64 %260, ptr %258, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %261

261:                                              ; preds = %219
  %262 = load i32, ptr %7, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %7, align 4, !tbaa !5
  br label %213, !llvm.loop !19

264:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %265

265:                                              ; preds = %278, %264
  %266 = load i32, ptr %11, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = load i64, ptr @N, align 8, !tbaa !9
  %269 = icmp slt i64 %267, %268
  br i1 %269, label %271, label %270

270:                                              ; preds = %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %281

271:                                              ; preds = %265
  %272 = load i32, ptr %11, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %273
  %275 = load i64, ptr %274, align 8, !tbaa !9
  %276 = load i64, ptr %10, align 8, !tbaa !9
  %277 = add nsw i64 %276, %275
  store i64 %277, ptr %10, align 8, !tbaa !9
  br label %278

278:                                              ; preds = %271
  %279 = load i32, ptr %11, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr %11, align 4, !tbaa !5
  br label %265, !llvm.loop !20

281:                                              ; preds = %270
  %282 = load i64, ptr %10, align 8, !tbaa !9
  %283 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %282)
  %284 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %283, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  %285 = load i32, ptr %1, align 4
  ret i32 %285
}

; 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)) #1 align 2

; 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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 i64, align 8
@D = external dso_local global i64, align 8
@X = external dso_local global [100010 x i64], align 16
@L = external dso_local local_unnamed_addr global [100010 x i64], align 16
@R = external dso_local local_unnamed_addr global [100010 x i64], align 16
@sumR = external dso_local local_unnamed_addr global [100010 x i64], align 16
@sumL = external dso_local local_unnamed_addr global [100010 x i64], align 16
@cnt = external dso_local local_unnamed_addr global [100010 x i64], 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 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) @D)
  %3 = load i64, ptr @N, align 8, !tbaa !5
  %4 = icmp sgt i64 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

.preheader100:                                    ; preds = %.lr.ph
  %5 = icmp sgt i64 %9, 0
  br i1 %5, label %.lr.ph104, label %._crit_edge

.lr.ph104:                                        ; preds = %.preheader100
  %6 = load i64, ptr @D, align 8, !tbaa !5
  br label %11

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %7 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %indvars.iv
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = load i64, ptr @N, align 8, !tbaa !5
  %10 = icmp sgt i64 %9, %indvars.iv.next
  br i1 %10, label %.lr.ph, label %.preheader100, !llvm.loop !9

11:                                               ; preds = %.lr.ph104, %25
  %.071103 = phi i64 [ 0, %.lr.ph104 ], [ %.1, %25 ]
  %.075102 = phi i64 [ 0, %.lr.ph104 ], [ %.176, %25 ]
  %12 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %.075102
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %.071103
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = sub nsw i64 %13, %15
  %.not92 = icmp sgt i64 %16, %6
  br i1 %.not92, label %20, label %17

17:                                               ; preds = %11
  %18 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %.071103
  store i64 %.075102, ptr %18, align 8, !tbaa !5
  %19 = add nsw i64 %.075102, 1
  br label %25

20:                                               ; preds = %11
  %21 = add nsw i64 %.071103, 1
  %22 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %.071103
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %21
  store i64 %23, ptr %24, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %20, %17
  %.176 = phi i64 [ %19, %17 ], [ %.075102, %20 ]
  %.1 = phi i64 [ %.071103, %17 ], [ %21, %20 ]
  %26 = icmp slt i64 %.176, %9
  br i1 %26, label %11, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %25, %0, %.preheader100
  %27 = phi i1 [ false, %.preheader100 ], [ false, %0 ], [ %5, %25 ]
  %.lcssa149 = phi i64 [ %9, %.preheader100 ], [ %3, %0 ], [ %9, %25 ]
  %.071.lcssa = phi i64 [ 0, %.preheader100 ], [ 0, %0 ], [ %.1, %25 ]
  %28 = add i64 %.lcssa149, -1
  %29 = icmp slt i64 %.071.lcssa, %.lcssa149
  br i1 %29, label %.lr.ph108, label %.preheader99

.lr.ph108:                                        ; preds = %._crit_edge
  %30 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %28
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = load i64, ptr @D, align 8, !tbaa !5
  br label %34

.preheader99:                                     ; preds = %46, %._crit_edge
  br i1 %27, label %.lr.ph111, label %.preheader98

.lr.ph111:                                        ; preds = %.preheader99
  %33 = load i64, ptr @D, align 8, !tbaa !5
  br label %51

34:                                               ; preds = %.lr.ph108, %46
  %.2106 = phi i64 [ %.071.lcssa, %.lr.ph108 ], [ %.3, %46 ]
  %35 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %.2106
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = sub nsw i64 %31, %36
  %.not91 = icmp sgt i64 %37, %32
  br i1 %.not91, label %41, label %38

38:                                               ; preds = %34
  %39 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %.2106
  store i64 %28, ptr %39, align 8, !tbaa !5
  %40 = add nsw i64 %.2106, 1
  br label %46

41:                                               ; preds = %34
  %42 = add nsw i64 %.2106, 1
  %43 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %.2106
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %42
  store i64 %44, ptr %45, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %41, %38
  %.3 = phi i64 [ %40, %38 ], [ %42, %41 ]
  %47 = icmp slt i64 %.3, %.lcssa149
  br i1 %47, label %34, label %.preheader99, !llvm.loop !12

.preheader98:                                     ; preds = %65, %.preheader99
  %.277.lcssa = phi i64 [ %28, %.preheader99 ], [ %.378, %65 ]
  %48 = icmp sgt i64 %.277.lcssa, -1
  br i1 %48, label %.lr.ph114, label %._crit_edge115

.lr.ph114:                                        ; preds = %.preheader98
  %49 = load i64, ptr @X, align 16, !tbaa !5
  %50 = load i64, ptr @D, align 8, !tbaa !5
  br label %67

51:                                               ; preds = %.lr.ph111, %65
  %.4110 = phi i64 [ %28, %.lr.ph111 ], [ %.5, %65 ]
  %.277109 = phi i64 [ %28, %.lr.ph111 ], [ %.378, %65 ]
  %52 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %.277109
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %.4110
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = sub nsw i64 %53, %55
  %.not90 = icmp sgt i64 %56, %33
  br i1 %.not90, label %60, label %57

57:                                               ; preds = %51
  %58 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %.277109
  store i64 %.4110, ptr %58, align 8, !tbaa !5
  %59 = add nsw i64 %.4110, -1
  br label %65

60:                                               ; preds = %51
  %61 = add nsw i64 %.277109, -1
  %62 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %.277109
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %61
  store i64 %63, ptr %64, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %60, %57
  %.378 = phi i64 [ %.277109, %57 ], [ %61, %60 ]
  %.5 = phi i64 [ %59, %57 ], [ %.4110, %60 ]
  %66 = icmp sgt i64 %.5, -1
  br i1 %66, label %51, label %.preheader98, !llvm.loop !13

67:                                               ; preds = %.lr.ph114, %79
  %.479113 = phi i64 [ %.277.lcssa, %.lr.ph114 ], [ %.580, %79 ]
  %68 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %.479113
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = sub nsw i64 %69, %49
  %.not89 = icmp sgt i64 %70, %50
  br i1 %.not89, label %74, label %71

71:                                               ; preds = %67
  %72 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %.479113
  store i64 0, ptr %72, align 8, !tbaa !5
  %73 = add nsw i64 %.479113, -1
  br label %79

74:                                               ; preds = %67
  %75 = add nsw i64 %.479113, -1
  %76 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %.479113
  %77 = load i64, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %75
  store i64 %77, ptr %78, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %74, %71
  %.580 = phi i64 [ %73, %71 ], [ %75, %74 ]
  %80 = icmp sgt i64 %.580, -1
  br i1 %80, label %67, label %._crit_edge115, !llvm.loop !14

._crit_edge115:                                   ; preds = %79, %.preheader98
  store i64 0, ptr @sumL, align 16, !tbaa !5
  store i64 0, ptr @sumR, align 16, !tbaa !5
  %.not116 = icmp slt i64 %.lcssa149, 1
  br i1 %.not116, label %.preheader96, label %.lr.ph119.preheader

.lr.ph119.preheader:                              ; preds = %._crit_edge115
  %xtraiter = and i64 %.lcssa149, 1
  %81 = icmp eq i64 %28, 0
  br i1 %81, label %.preheader97.unr-lcssa, label %.lr.ph119.preheader.new

.lr.ph119.preheader.new:                          ; preds = %.lr.ph119.preheader
  %unroll_iter = and i64 %.lcssa149, 9223372036854775806
  br label %.lr.ph119

.preheader97.unr-lcssa:                           ; preds = %.lr.ph119, %.lr.ph119.preheader
  %.unr = phi i64 [ 0, %.lr.ph119.preheader ], [ %99, %.lr.ph119 ]
  %indvars.iv133.unr = phi i64 [ 1, %.lr.ph119.preheader ], [ %indvars.iv.next134.1, %.lr.ph119 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader97, label %.lr.ph119.epil

.lr.ph119.epil:                                   ; preds = %.preheader97.unr-lcssa
  %82 = add nsw i64 %indvars.iv133.unr, -1
  %83 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = sub i64 %.unr, %82
  %86 = add i64 %85, %84
  %87 = getelementptr inbounds [100010 x i64], ptr @sumR, i64 0, i64 %indvars.iv133.unr
  store i64 %86, ptr %87, align 8, !tbaa !5
  br label %.preheader97

.preheader97:                                     ; preds = %.preheader97.unr-lcssa, %.lr.ph119.epil
  br i1 %.not116, label %.preheader96, label %.lr.ph122.preheader

.lr.ph122.preheader:                              ; preds = %.preheader97
  %xtraiter158 = and i64 %.lcssa149, 1
  %88 = icmp eq i64 %28, 0
  br i1 %88, label %.preheader96.loopexit.unr-lcssa, label %.lr.ph122.preheader.new

.lr.ph122.preheader.new:                          ; preds = %.lr.ph122.preheader
  %unroll_iter161 = and i64 %.lcssa149, 9223372036854775806
  br label %.lr.ph122

.lr.ph119:                                        ; preds = %.lr.ph119, %.lr.ph119.preheader.new
  %89 = phi i64 [ 0, %.lr.ph119.preheader.new ], [ %99, %.lr.ph119 ]
  %indvars.iv133 = phi i64 [ 1, %.lr.ph119.preheader.new ], [ %indvars.iv.next134.1, %.lr.ph119 ]
  %niter = phi i64 [ 0, %.lr.ph119.preheader.new ], [ %niter.next.1, %.lr.ph119 ]
  %90 = add nsw i64 %indvars.iv133, -1
  %91 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !5
  %93 = sub i64 %89, %90
  %94 = add i64 %93, %92
  %95 = getelementptr inbounds [100010 x i64], ptr @sumR, i64 0, i64 %indvars.iv133
  store i64 %94, ptr %95, align 8, !tbaa !5
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %96 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv133
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = sub i64 %94, %indvars.iv133
  %99 = add i64 %98, %97
  %100 = getelementptr inbounds [100010 x i64], ptr @sumR, i64 0, i64 %indvars.iv.next134
  store i64 %99, ptr %100, align 8, !tbaa !5
  %indvars.iv.next134.1 = add nuw nsw i64 %indvars.iv133, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader97.unr-lcssa, label %.lr.ph119, !llvm.loop !15

.preheader96.loopexit.unr-lcssa:                  ; preds = %.lr.ph122, %.lr.ph122.preheader
  %.unr159 = phi i64 [ 0, %.lr.ph122.preheader ], [ %117, %.lr.ph122 ]
  %indvars.iv136.unr = phi i64 [ 1, %.lr.ph122.preheader ], [ %indvars.iv.next137.1, %.lr.ph122 ]
  %lcmp.mod160.not = icmp eq i64 %xtraiter158, 0
  br i1 %lcmp.mod160.not, label %.preheader96, label %.lr.ph122.epil

.lr.ph122.epil:                                   ; preds = %.preheader96.loopexit.unr-lcssa
  %101 = add nsw i64 %indvars.iv136.unr, -1
  %102 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = add i64 %.unr159, %101
  %105 = sub i64 %104, %103
  %106 = getelementptr inbounds [100010 x i64], ptr @sumL, i64 0, i64 %indvars.iv136.unr
  store i64 %105, ptr %106, align 8, !tbaa !5
  br label %.preheader96

.preheader96:                                     ; preds = %.lr.ph122.epil, %.preheader96.loopexit.unr-lcssa, %._crit_edge115, %.preheader97
  br i1 %27, label %.lr.ph124, label %._crit_edge128

.lr.ph122:                                        ; preds = %.lr.ph122, %.lr.ph122.preheader.new
  %107 = phi i64 [ 0, %.lr.ph122.preheader.new ], [ %117, %.lr.ph122 ]
  %indvars.iv136 = phi i64 [ 1, %.lr.ph122.preheader.new ], [ %indvars.iv.next137.1, %.lr.ph122 ]
  %niter162 = phi i64 [ 0, %.lr.ph122.preheader.new ], [ %niter162.next.1, %.lr.ph122 ]
  %108 = add nsw i64 %indvars.iv136, -1
  %109 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = add i64 %107, %108
  %112 = sub i64 %111, %110
  %113 = getelementptr inbounds [100010 x i64], ptr @sumL, i64 0, i64 %indvars.iv136
  store i64 %112, ptr %113, align 8, !tbaa !5
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %114 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %indvars.iv136
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = add i64 %112, %indvars.iv136
  %117 = sub i64 %116, %115
  %118 = getelementptr inbounds [100010 x i64], ptr @sumL, i64 0, i64 %indvars.iv.next137
  store i64 %117, ptr %118, align 8, !tbaa !5
  %indvars.iv.next137.1 = add nuw nsw i64 %indvars.iv136, 2
  %niter162.next.1 = add i64 %niter162, 2
  %niter162.ncmp.1 = icmp eq i64 %niter162.next.1, %unroll_iter161
  br i1 %niter162.ncmp.1, label %.preheader96.loopexit.unr-lcssa, label %.lr.ph122, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph124
  br i1 %27, label %.lr.ph127.preheader, label %._crit_edge128

.lr.ph127.preheader:                              ; preds = %.preheader
  %min.iters.check = icmp ult i64 %.lcssa149, 4
  br i1 %min.iters.check, label %.lr.ph127.preheader154, label %vector.ph

.lr.ph127.preheader154:                           ; preds = %middle.block, %.lr.ph127.preheader
  %indvars.iv144.ph = phi i64 [ 0, %.lr.ph127.preheader ], [ %n.vec, %middle.block ]
  %.069125.ph = phi i64 [ 0, %.lr.ph127.preheader ], [ %124, %middle.block ]
  br label %.lr.ph127

vector.ph:                                        ; preds = %.lr.ph127.preheader
  %n.vec = and i64 %.lcssa149, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %121, %vector.body ]
  %vec.phi152 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %122, %vector.body ]
  %119 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %index
  %120 = getelementptr inbounds i8, ptr %119, i64 16
  %wide.load = load <2 x i64>, ptr %119, align 16, !tbaa !5
  %wide.load153 = load <2 x i64>, ptr %120, align 16, !tbaa !5
  %121 = add <2 x i64> %wide.load, %vec.phi
  %122 = add <2 x i64> %wide.load153, %vec.phi152
  %index.next = add nuw i64 %index, 4
  %123 = icmp eq i64 %index.next, %n.vec
  br i1 %123, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %122, %121
  %124 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %.lcssa149, %n.vec
  br i1 %cmp.n, label %._crit_edge128, label %.lr.ph127.preheader154

.lr.ph124:                                        ; preds = %.preheader96, %.lr.ph124
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.lr.ph124 ], [ 0, %.preheader96 ]
  %125 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv140
  %126 = load i64, ptr %125, align 8, !tbaa !5
  %127 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %indvars.iv140
  %128 = load i64, ptr %127, align 8, !tbaa !5
  %129 = sub i64 %126, %128
  %130 = add nsw i64 %129, -1
  %131 = mul nsw i64 %130, %129
  %132 = sdiv i64 %131, 2
  %133 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %indvars.iv140
  %134 = add nsw i64 %126, 1
  %135 = getelementptr inbounds [100010 x i64], ptr @sumL, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !5
  %137 = getelementptr inbounds [100010 x i64], ptr @sumR, i64 0, i64 %128
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %139 = sub i64 %129, %136
  %.neg = add i64 %139, %138
  %140 = add i64 %.neg, %132
  store i64 %140, ptr %133, align 8, !tbaa !5
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %exitcond143.not = icmp eq i64 %indvars.iv.next141, %.lcssa149
  br i1 %exitcond143.not, label %.preheader, label %.lr.ph124, !llvm.loop !20

._crit_edge128:                                   ; preds = %.lr.ph127, %middle.block, %.preheader96, %.preheader
  %.069.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.preheader96 ], [ %124, %middle.block ], [ %145, %.lr.ph127 ]
  %141 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.069.lcssa)
  %142 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph127:                                        ; preds = %.lr.ph127.preheader154, %.lr.ph127
  %indvars.iv144 = phi i64 [ %indvars.iv.next145, %.lr.ph127 ], [ %indvars.iv144.ph, %.lr.ph127.preheader154 ]
  %.069125 = phi i64 [ %145, %.lr.ph127 ], [ %.069125.ph, %.lr.ph127.preheader154 ]
  %143 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %indvars.iv144
  %144 = load i64, ptr %143, align 8, !tbaa !5
  %145 = add nsw i64 %144, %.069125
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
  %exitcond147.not = icmp eq i64 %indvars.iv.next145, %.lcssa149
  br i1 %exitcond147.not, label %._crit_edge128, label %.lr.ph127, !llvm.loop !21
}

; 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 #1 align 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 #1 align 2

; 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 #1 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"long long", !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}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !19, !18}


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