; LLVM IR from eyangch/competitive-programming :: Codeforces/1622 (e)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }
%class.anon = type { i8 }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@X = external dso_local global [10 x i64], align 16
@W = external dso_local global [10000 x i64], align 16
@P = external dso_local global [10000 x i64], align 16
@bP = external dso_local global [10000 x i64], align 16
@ans = external dso_local global [10000 x i64], align 16
@_Z1SB5cxx11 = external dso_local global [10 x %"class.std::__cxx11::basic_string"], 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %class.anon, align 1
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %23

23:                                               ; preds = %195, %0
  %24 = load i64, ptr @T, align 8, !tbaa !8
  %25 = add nsw i64 %24, -1
  store i64 %25, ptr @T, align 8, !tbaa !8
  %26 = icmp ne i64 %24, 0
  br i1 %26, label %27, label %197

27:                                               ; preds = %23
  %28 = 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)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %30

30:                                               ; preds = %39, %27
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %42

35:                                               ; preds = %30
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = getelementptr inbounds [10 x i64], ptr @X, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %37)
  br label %39

39:                                               ; preds = %35
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %2, align 8, !tbaa !8
  br label %30, !llvm.loop !11

42:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %43

43:                                               ; preds = %52, %42
  %44 = load i64, ptr %3, align 8, !tbaa !8
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i64, ptr %3, align 8, !tbaa !8
  %50 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %49
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %50)
  br label %52

52:                                               ; preds = %48
  %53 = load i64, ptr %3, align 8, !tbaa !8
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr %3, align 8, !tbaa !8
  br label %43, !llvm.loop !13

55:                                               ; preds = %47
  %56 = load i64, ptr @M, align 8, !tbaa !8
  %57 = getelementptr inbounds i64, ptr @P, i64 %56
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @P, ptr noundef %57, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 -1, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %161, %55
  %59 = load i64, ptr %5, align 8, !tbaa !8
  %60 = load i64, ptr @N, align 8, !tbaa !8
  %61 = trunc i64 %60 to i32
  %62 = shl i32 1, %61
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %59, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %58
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %164

66:                                               ; preds = %58
  %67 = load i64, ptr @M, align 8, !tbaa !8
  %68 = getelementptr inbounds i64, ptr @W, i64 %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !14
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @W, ptr noundef %68, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %69

69:                                               ; preds = %104, %66
  %70 = load i64, ptr %8, align 8, !tbaa !8
  %71 = load i64, ptr @M, align 8, !tbaa !8
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %75

75:                                               ; preds = %100, %74
  %76 = load i64, ptr %9, align 8, !tbaa !8
  %77 = load i64, ptr @N, align 8, !tbaa !8
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 16, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %103

80:                                               ; preds = %75
  %81 = load i64, ptr %9, align 8, !tbaa !8
  %82 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %81
  %83 = load i64, ptr %8, align 8, !tbaa !8
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %82, i64 noundef %83)
  %85 = load i8, ptr %84, align 1, !tbaa !16
  %86 = sext i8 %85 to i32
  %87 = sub nsw i32 %86, 48
  %88 = sext i32 %87 to i64
  %89 = load i64, ptr %5, align 8, !tbaa !8
  %90 = load i64, ptr %9, align 8, !tbaa !8
  %91 = ashr i64 %89, %90
  %92 = and i64 %91, 1
  %93 = mul nsw i64 %92, 2
  %94 = sub nsw i64 %93, 1
  %95 = mul nsw i64 %88, %94
  %96 = load i64, ptr %8, align 8, !tbaa !8
  %97 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !8
  %99 = sub nsw i64 %98, %95
  store i64 %99, ptr %97, align 8, !tbaa !8
  br label %100

100:                                              ; preds = %80
  %101 = load i64, ptr %9, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %9, align 8, !tbaa !8
  br label %75, !llvm.loop !17

103:                                              ; preds = %79
  br label %104

104:                                              ; preds = %103
  %105 = load i64, ptr %8, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %8, align 8, !tbaa !8
  br label %69, !llvm.loop !18

107:                                              ; preds = %73
  %108 = load i64, ptr @M, align 8, !tbaa !8
  %109 = getelementptr inbounds i64, ptr @P, i64 %108
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @P, ptr noundef %109)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %110

110:                                              ; preds = %128, %107
  %111 = load i64, ptr %12, align 8, !tbaa !8
  %112 = load i64, ptr @N, align 8, !tbaa !8
  %113 = icmp slt i64 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  store i32 19, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %131

115:                                              ; preds = %110
  %116 = load i64, ptr %12, align 8, !tbaa !8
  %117 = getelementptr inbounds [10 x i64], ptr @X, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %119 = load i64, ptr %5, align 8, !tbaa !8
  %120 = load i64, ptr %12, align 8, !tbaa !8
  %121 = ashr i64 %119, %120
  %122 = and i64 %121, 1
  %123 = mul nsw i64 %122, 2
  %124 = sub nsw i64 %123, 1
  %125 = mul nsw i64 %118, %124
  %126 = load i64, ptr %11, align 8, !tbaa !8
  %127 = add nsw i64 %126, %125
  store i64 %127, ptr %11, align 8, !tbaa !8
  br label %128

128:                                              ; preds = %115
  %129 = load i64, ptr %12, align 8, !tbaa !8
  %130 = add nsw i64 %129, 1
  store i64 %130, ptr %12, align 8, !tbaa !8
  br label %110, !llvm.loop !19

131:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %132

132:                                              ; preds = %148, %131
  %133 = load i64, ptr %13, align 8, !tbaa !8
  %134 = load i64, ptr @M, align 8, !tbaa !8
  %135 = icmp slt i64 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 22, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %151

137:                                              ; preds = %132
  %138 = load i64, ptr %13, align 8, !tbaa !8
  %139 = add nsw i64 %138, 1
  %140 = load i64, ptr %13, align 8, !tbaa !8
  %141 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %145 = mul nsw i64 %139, %144
  %146 = load i64, ptr %11, align 8, !tbaa !8
  %147 = add nsw i64 %146, %145
  store i64 %147, ptr %11, align 8, !tbaa !8
  br label %148

148:                                              ; preds = %137
  %149 = load i64, ptr %13, align 8, !tbaa !8
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %13, align 8, !tbaa !8
  br label %132, !llvm.loop !20

151:                                              ; preds = %136
  %152 = load i64, ptr %11, align 8, !tbaa !8
  %153 = load i64, ptr %4, align 8, !tbaa !8
  %154 = icmp sgt i64 %152, %153
  br i1 %154, label %155, label %160

155:                                              ; preds = %151
  %156 = load i64, ptr %11, align 8, !tbaa !8
  store i64 %156, ptr %4, align 8, !tbaa !8
  %157 = load i64, ptr @M, align 8, !tbaa !8
  %158 = getelementptr inbounds i64, ptr @P, i64 %157
  %159 = call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef @P, ptr noundef %158, ptr noundef @bP)
  br label %160

160:                                              ; preds = %155, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %161

161:                                              ; preds = %160
  %162 = load i64, ptr %5, align 8, !tbaa !8
  %163 = add nsw i64 %162, 1
  store i64 %163, ptr %5, align 8, !tbaa !8
  br label %58, !llvm.loop !21

164:                                              ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %165

165:                                              ; preds = %177, %164
  %166 = load i64, ptr %14, align 8, !tbaa !8
  %167 = load i64, ptr @M, align 8, !tbaa !8
  %168 = icmp slt i64 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  store i32 25, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %180

170:                                              ; preds = %165
  %171 = load i64, ptr %14, align 8, !tbaa !8
  %172 = add nsw i64 %171, 1
  %173 = load i64, ptr %14, align 8, !tbaa !8
  %174 = getelementptr inbounds [10000 x i64], ptr @bP, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !8
  %176 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %175
  store i64 %172, ptr %176, align 8, !tbaa !8
  br label %177

177:                                              ; preds = %170
  %178 = load i64, ptr %14, align 8, !tbaa !8
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %14, align 8, !tbaa !8
  br label %165, !llvm.loop !22

180:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !8
  br label %181

181:                                              ; preds = %192, %180
  %182 = load i64, ptr %15, align 8, !tbaa !8
  %183 = load i64, ptr @M, align 8, !tbaa !8
  %184 = icmp slt i64 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 28, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %195

186:                                              ; preds = %181
  %187 = load i64, ptr %15, align 8, !tbaa !8
  %188 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %187
  %189 = load i64, ptr %188, align 8, !tbaa !8
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %189)
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %190, i8 noundef signext 32)
  br label %192

192:                                              ; preds = %186
  %193 = load i64, ptr %15, align 8, !tbaa !8
  %194 = add nsw i64 %193, 1
  store i64 %194, ptr %15, align 8, !tbaa !8
  br label %181, !llvm.loop !23

195:                                              ; preds = %185
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %23, !llvm.loop !24

197:                                              ; preds = %23
  %198 = load i32, ptr %1, align 4
  ret i32 %198
}

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@X = external dso_local global [10 x i64], align 16
@W = external dso_local global [10000 x i64], align 16
@P = external dso_local global [10000 x i64], align 16
@bP = external dso_local global [10000 x i64], align 16
@ans = external dso_local local_unnamed_addr global [10000 x i64], align 16
@_Z1SB5cxx11 = external dso_local global [10 x %"class.std::__cxx11::basic_string"], 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 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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) @T)
  %9 = load i64, ptr @T, align 8, !tbaa !8
  %10 = add nsw i64 %9, -1
  store i64 %10, ptr @T, align 8, !tbaa !8
  %.not86 = icmp eq i64 %9, 0
  br i1 %.not86, label %._crit_edge89, label %.lr.ph88

.lr.ph88:                                         ; preds = %0, %._crit_edge85
  %11 = 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)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %13 = load i64, ptr @N, align 8, !tbaa !8
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.preheader55:                                     ; preds = %.lr.ph
  %15 = icmp sgt i64 %19, 0
  br i1 %15, label %.lr.ph59, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph88, %.lr.ph
  %.04957 = phi i64 [ %18, %.lr.ph ], [ 0, %.lr.ph88 ]
  %16 = getelementptr inbounds [10 x i64], ptr @X, i64 0, i64 %.04957
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %18 = add nuw nsw i64 %.04957, 1
  %19 = load i64, ptr @N, align 8, !tbaa !8
  %20 = icmp slt i64 %18, %19
  br i1 %20, label %.lr.ph, label %.preheader55, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph59, %.lr.ph88, %.preheader55
  %21 = load i64, ptr @M, align 8, !tbaa !8
  %22 = getelementptr inbounds i64, ptr @P, i64 %21
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @P, ptr noundef nonnull %22, i32 noundef 0)
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = and i64 %23, 4294967295
  %.not90 = icmp eq i64 %24, 31
  %.pre100 = load i64, ptr @M, align 8, !tbaa !8
  br i1 %.not90, label %.preheader54, label %.lr.ph80

.lr.ph59:                                         ; preds = %.preheader55, %.lr.ph59
  %.04858 = phi i64 [ %27, %.lr.ph59 ], [ 0, %.preheader55 ]
  %25 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %.04858
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %25)
  %27 = add nuw nsw i64 %.04858, 1
  %28 = load i64, ptr @N, align 8, !tbaa !8
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %.lr.ph59, label %._crit_edge, !llvm.loop !13

.preheader54:                                     ; preds = %133, %._crit_edge
  %30 = phi i64 [ %.pre100, %._crit_edge ], [ %135, %133 ]
  %31 = icmp sgt i64 %30, 0
  br i1 %31, label %.lr.ph82.preheader, label %._crit_edge85

.lr.ph82.preheader:                               ; preds = %.preheader54
  %xtraiter127 = and i64 %30, 3
  %32 = icmp ult i64 %30, 4
  br i1 %32, label %.preheader53.unr-lcssa, label %.lr.ph82.preheader.new

.lr.ph82.preheader.new:                           ; preds = %.lr.ph82.preheader
  %unroll_iter130 = and i64 %30, 9223372036854775804
  br label %.lr.ph82

.lr.ph80:                                         ; preds = %._crit_edge, %133
  %33 = phi i64 [ %135, %133 ], [ %.pre100, %._crit_edge ]
  %.04577 = phi i64 [ %136, %133 ], [ 0, %._crit_edge ]
  %.04676 = phi i64 [ %.147, %133 ], [ -1, %._crit_edge ]
  %34 = getelementptr inbounds i64, ptr @W, i64 %33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !14
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @W, ptr noundef nonnull %34, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %35 = load i64, ptr @M, align 8, !tbaa !8
  %36 = icmp sgt i64 %35, 0
  %37 = load i64, ptr @N, align 8
  %38 = icmp sgt i64 %37, 0
  %or.cond = select i1 %36, i1 %38, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge64

.preheader:                                       ; preds = %.lr.ph80, %._crit_edge62
  %39 = phi i64 [ %62, %._crit_edge62 ], [ %35, %.lr.ph80 ]
  %40 = phi i64 [ %63, %._crit_edge62 ], [ %37, %.lr.ph80 ]
  %.04463 = phi i64 [ %64, %._crit_edge62 ], [ 0, %.lr.ph80 ]
  %41 = icmp sgt i64 %40, 0
  br i1 %41, label %.lr.ph61, label %._crit_edge62

.lr.ph61:                                         ; preds = %.preheader
  %42 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %.04463
  br label %66

._crit_edge64:                                    ; preds = %._crit_edge62, %.lr.ph80
  %.lcssa = phi i64 [ %35, %.lr.ph80 ], [ %62, %._crit_edge62 ]
  %43 = getelementptr inbounds i64, ptr @P, i64 %.lcssa
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @P, ptr noundef nonnull %43)
  %44 = load i64, ptr @N, align 8, !tbaa !8
  %45 = icmp sgt i64 %44, 0
  br i1 %45, label %.lr.ph68.preheader, label %.preheader52

.lr.ph68.preheader:                               ; preds = %._crit_edge64
  %min.iters.check = icmp ult i64 %44, 4
  br i1 %min.iters.check, label %.lr.ph68.preheader117, label %vector.ph

.lr.ph68.preheader117:                            ; preds = %middle.block, %.lr.ph68.preheader
  %.04166.ph = phi i64 [ 0, %.lr.ph68.preheader ], [ %n.vec, %middle.block ]
  %.04265.ph = phi i64 [ 0, %.lr.ph68.preheader ], [ %61, %middle.block ]
  br label %.lr.ph68

vector.ph:                                        ; preds = %.lr.ph68.preheader
  %n.vec = and i64 %44, 9223372036854775804
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %.04577, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %58, %vector.body ]
  %vec.phi115 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %59, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %46 = getelementptr inbounds [10 x i64], ptr @X, i64 0, i64 %index
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load = load <2 x i64>, ptr %46, align 16, !tbaa !8
  %wide.load116 = load <2 x i64>, ptr %47, align 16, !tbaa !8
  %48 = lshr <2 x i64> %broadcast.splat, %vec.ind
  %49 = lshr <2 x i64> %broadcast.splat, %step.add
  %50 = shl nuw <2 x i64> %48, <i64 1, i64 1>
  %51 = shl nuw <2 x i64> %49, <i64 1, i64 1>
  %52 = and <2 x i64> %50, <i64 2, i64 2>
  %53 = and <2 x i64> %51, <i64 2, i64 2>
  %54 = add nsw <2 x i64> %52, <i64 -1, i64 -1>
  %55 = add nsw <2 x i64> %53, <i64 -1, i64 -1>
  %56 = mul nsw <2 x i64> %wide.load, %54
  %57 = mul nsw <2 x i64> %wide.load116, %55
  %58 = add <2 x i64> %56, %vec.phi
  %59 = add <2 x i64> %57, %vec.phi115
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %59, %58
  %61 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %44, %n.vec
  br i1 %cmp.n, label %.preheader52, label %.lr.ph68.preheader117

._crit_edge62.loopexit:                           ; preds = %66
  %.pre98 = load i64, ptr @M, align 8, !tbaa !8
  br label %._crit_edge62

._crit_edge62:                                    ; preds = %._crit_edge62.loopexit, %.preheader
  %62 = phi i64 [ %.pre98, %._crit_edge62.loopexit ], [ %39, %.preheader ]
  %63 = phi i64 [ %80, %._crit_edge62.loopexit ], [ %40, %.preheader ]
  %64 = add nuw nsw i64 %.04463, 1
  %65 = icmp slt i64 %64, %62
  br i1 %65, label %.preheader, label %._crit_edge64, !llvm.loop !19

66:                                               ; preds = %.lr.ph61, %66
  %.04360 = phi i64 [ 0, %.lr.ph61 ], [ %79, %66 ]
  %67 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %.04360
  %68 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %67, i64 noundef %.04463)
  %69 = load i8, ptr %68, align 1, !tbaa !21
  %70 = sext i8 %69 to i64
  %71 = add nsw i64 %70, -48
  %72 = lshr i64 %.04577, %.04360
  %73 = shl nuw i64 %72, 1
  %74 = and i64 %73, 2
  %75 = add nsw i64 %74, -1
  %76 = mul nsw i64 %71, %75
  %77 = load i64, ptr %42, align 8, !tbaa !8
  %78 = sub nsw i64 %77, %76
  store i64 %78, ptr %42, align 8, !tbaa !8
  %79 = add nuw nsw i64 %.04360, 1
  %80 = load i64, ptr @N, align 8, !tbaa !8
  %81 = icmp slt i64 %79, %80
  br i1 %81, label %66, label %._crit_edge62.loopexit, !llvm.loop !22

.preheader52:                                     ; preds = %.lr.ph68, %middle.block, %._crit_edge64
  %.042.lcssa = phi i64 [ 0, %._crit_edge64 ], [ %61, %middle.block ], [ %92, %.lr.ph68 ]
  %82 = load i64, ptr @M, align 8, !tbaa !8
  %83 = icmp sgt i64 %82, 0
  br i1 %83, label %.lr.ph72.preheader, label %._crit_edge73

.lr.ph72.preheader:                               ; preds = %.preheader52
  %xtraiter = and i64 %82, 3
  %84 = icmp ult i64 %82, 4
  br i1 %84, label %._crit_edge73.loopexit.unr-lcssa, label %.lr.ph72.preheader.new

.lr.ph72.preheader.new:                           ; preds = %.lr.ph72.preheader
  %unroll_iter = and i64 %82, 9223372036854775804
  br label %.lr.ph72

.lr.ph68:                                         ; preds = %.lr.ph68.preheader117, %.lr.ph68
  %.04166 = phi i64 [ %93, %.lr.ph68 ], [ %.04166.ph, %.lr.ph68.preheader117 ]
  %.04265 = phi i64 [ %92, %.lr.ph68 ], [ %.04265.ph, %.lr.ph68.preheader117 ]
  %85 = getelementptr inbounds [10 x i64], ptr @X, i64 0, i64 %.04166
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = lshr i64 %.04577, %.04166
  %88 = shl nuw i64 %87, 1
  %89 = and i64 %88, 2
  %90 = add nsw i64 %89, -1
  %91 = mul nsw i64 %86, %90
  %92 = add nsw i64 %91, %.04265
  %93 = add nuw nsw i64 %.04166, 1
  %exitcond.not = icmp eq i64 %93, %44
  br i1 %exitcond.not, label %.preheader52, label %.lr.ph68, !llvm.loop !23

._crit_edge73.loopexit.unr-lcssa:                 ; preds = %.lr.ph72, %.lr.ph72.preheader
  %.lcssa124.ph = phi i64 [ poison, %.lr.ph72.preheader ], [ %129, %.lr.ph72 ]
  %.04071.unr = phi i64 [ 0, %.lr.ph72.preheader ], [ %123, %.lr.ph72 ]
  %.170.unr = phi i64 [ %.042.lcssa, %.lr.ph72.preheader ], [ %129, %.lr.ph72 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge73, label %.lr.ph72.epil

.lr.ph72.epil:                                    ; preds = %._crit_edge73.loopexit.unr-lcssa, %.lr.ph72.epil
  %.04071.epil = phi i64 [ %94, %.lr.ph72.epil ], [ %.04071.unr, %._crit_edge73.loopexit.unr-lcssa ]
  %.170.epil = phi i64 [ %100, %.lr.ph72.epil ], [ %.170.unr, %._crit_edge73.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph72.epil ], [ 0, %._crit_edge73.loopexit.unr-lcssa ]
  %94 = add nuw nsw i64 %.04071.epil, 1
  %95 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %.04071.epil
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !8
  %99 = mul nsw i64 %98, %94
  %100 = add nsw i64 %99, %.170.epil
  %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_edge73, label %.lr.ph72.epil, !llvm.loop !24

._crit_edge73:                                    ; preds = %._crit_edge73.loopexit.unr-lcssa, %.lr.ph72.epil, %.preheader52
  %.1.lcssa = phi i64 [ %.042.lcssa, %.preheader52 ], [ %.lcssa124.ph, %._crit_edge73.loopexit.unr-lcssa ], [ %100, %.lr.ph72.epil ]
  %101 = icmp sgt i64 %.1.lcssa, %.04676
  br i1 %101, label %130, label %133

.lr.ph72:                                         ; preds = %.lr.ph72, %.lr.ph72.preheader.new
  %.04071 = phi i64 [ 0, %.lr.ph72.preheader.new ], [ %123, %.lr.ph72 ]
  %.170 = phi i64 [ %.042.lcssa, %.lr.ph72.preheader.new ], [ %129, %.lr.ph72 ]
  %niter = phi i64 [ 0, %.lr.ph72.preheader.new ], [ %niter.next.3, %.lr.ph72 ]
  %102 = or disjoint i64 %.04071, 1
  %103 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %.04071
  %104 = load i64, ptr %103, align 16, !tbaa !8
  %105 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %104
  %106 = load i64, ptr %105, align 8, !tbaa !8
  %107 = mul nsw i64 %106, %102
  %108 = add nsw i64 %107, %.170
  %109 = or disjoint i64 %.04071, 2
  %110 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %102
  %111 = load i64, ptr %110, align 8, !tbaa !8
  %112 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = mul nsw i64 %113, %109
  %115 = add nsw i64 %114, %108
  %116 = or disjoint i64 %.04071, 3
  %117 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %109
  %118 = load i64, ptr %117, align 16, !tbaa !8
  %119 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !8
  %121 = mul nsw i64 %120, %116
  %122 = add nsw i64 %121, %115
  %123 = add nuw nsw i64 %.04071, 4
  %124 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %116
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = getelementptr inbounds [10000 x i64], ptr @W, i64 0, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !8
  %128 = mul nsw i64 %127, %123
  %129 = add nsw i64 %128, %122
  %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_edge73.loopexit.unr-lcssa, label %.lr.ph72, !llvm.loop !26

130:                                              ; preds = %._crit_edge73
  %131 = getelementptr inbounds i64, ptr @P, i64 %82
  %132 = call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef nonnull @P, ptr noundef nonnull %131, ptr noundef nonnull @bP)
  %.pre = load i64, ptr @M, align 8, !tbaa !8
  %.pre99 = load i64, ptr @N, align 8, !tbaa !8
  br label %133

133:                                              ; preds = %130, %._crit_edge73
  %134 = phi i64 [ %.pre99, %130 ], [ %44, %._crit_edge73 ]
  %135 = phi i64 [ %.pre, %130 ], [ %82, %._crit_edge73 ]
  %.147 = phi i64 [ %.1.lcssa, %130 ], [ %.04676, %._crit_edge73 ]
  %136 = add nuw nsw i64 %.04577, 1
  %137 = trunc i64 %134 to i32
  %138 = shl nuw i32 1, %137
  %139 = sext i32 %138 to i64
  %140 = icmp slt i64 %136, %139
  br i1 %140, label %.lr.ph80, label %.preheader54, !llvm.loop !27

.preheader53.unr-lcssa:                           ; preds = %.lr.ph82, %.lr.ph82.preheader
  %.03981.unr = phi i64 [ 0, %.lr.ph82.preheader ], [ %157, %.lr.ph82 ]
  %lcmp.mod129.not = icmp eq i64 %xtraiter127, 0
  br i1 %lcmp.mod129.not, label %.preheader53, label %.lr.ph82.epil

.lr.ph82.epil:                                    ; preds = %.preheader53.unr-lcssa, %.lr.ph82.epil
  %.03981.epil = phi i64 [ %141, %.lr.ph82.epil ], [ %.03981.unr, %.preheader53.unr-lcssa ]
  %epil.iter128 = phi i64 [ %epil.iter128.next, %.lr.ph82.epil ], [ 0, %.preheader53.unr-lcssa ]
  %141 = add nuw nsw i64 %.03981.epil, 1
  %142 = getelementptr inbounds [10000 x i64], ptr @bP, i64 0, i64 %.03981.epil
  %143 = load i64, ptr %142, align 8, !tbaa !8
  %144 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %143
  store i64 %141, ptr %144, align 8, !tbaa !8
  %epil.iter128.next = add i64 %epil.iter128, 1
  %epil.iter128.cmp.not = icmp eq i64 %epil.iter128.next, %xtraiter127
  br i1 %epil.iter128.cmp.not, label %.preheader53, label %.lr.ph82.epil, !llvm.loop !28

.preheader53:                                     ; preds = %.lr.ph82.epil, %.preheader53.unr-lcssa
  br i1 %31, label %.lr.ph84, label %._crit_edge85

.lr.ph82:                                         ; preds = %.lr.ph82, %.lr.ph82.preheader.new
  %.03981 = phi i64 [ 0, %.lr.ph82.preheader.new ], [ %157, %.lr.ph82 ]
  %niter131 = phi i64 [ 0, %.lr.ph82.preheader.new ], [ %niter131.next.3, %.lr.ph82 ]
  %145 = or disjoint i64 %.03981, 1
  %146 = getelementptr inbounds [10000 x i64], ptr @bP, i64 0, i64 %.03981
  %147 = load i64, ptr %146, align 16, !tbaa !8
  %148 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %147
  store i64 %145, ptr %148, align 8, !tbaa !8
  %149 = or disjoint i64 %.03981, 2
  %150 = getelementptr inbounds [10000 x i64], ptr @bP, i64 0, i64 %145
  %151 = load i64, ptr %150, align 8, !tbaa !8
  %152 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %151
  store i64 %149, ptr %152, align 8, !tbaa !8
  %153 = or disjoint i64 %.03981, 3
  %154 = getelementptr inbounds [10000 x i64], ptr @bP, i64 0, i64 %149
  %155 = load i64, ptr %154, align 16, !tbaa !8
  %156 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %155
  store i64 %153, ptr %156, align 8, !tbaa !8
  %157 = add nuw nsw i64 %.03981, 4
  %158 = getelementptr inbounds [10000 x i64], ptr @bP, i64 0, i64 %153
  %159 = load i64, ptr %158, align 8, !tbaa !8
  %160 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %159
  store i64 %157, ptr %160, align 8, !tbaa !8
  %niter131.next.3 = add i64 %niter131, 4
  %niter131.ncmp.3 = icmp eq i64 %niter131.next.3, %unroll_iter130
  br i1 %niter131.ncmp.3, label %.preheader53.unr-lcssa, label %.lr.ph82, !llvm.loop !29

._crit_edge85:                                    ; preds = %.lr.ph84, %.preheader54, %.preheader53
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %162 = load i64, ptr @T, align 8, !tbaa !8
  %163 = add nsw i64 %162, -1
  store i64 %163, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %162, 0
  br i1 %.not, label %._crit_edge89, label %.lr.ph88, !llvm.loop !30

.lr.ph84:                                         ; preds = %.preheader53, %.lr.ph84
  %.083 = phi i64 [ %168, %.lr.ph84 ], [ 0, %.preheader53 ]
  %164 = getelementptr inbounds [10000 x i64], ptr @ans, i64 0, i64 %.083
  %165 = load i64, ptr %164, align 8, !tbaa !8
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %165)
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %166, i8 noundef signext 32)
  %168 = add nuw nsw i64 %.083, 1
  %169 = load i64, ptr @M, align 8, !tbaa !8
  %170 = icmp slt i64 %168, %169
  br i1 %170, label %.lr.ph84, label %._crit_edge85, !llvm.loop !31

._crit_edge89:                                    ; preds = %._crit_edge85, %0
  ret i32 0
}

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !10, i64 0}
!16 = distinct !{!16, !12, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !12, !20}
!20 = !{!"llvm.loop.unswitch.partial.disable"}
!21 = !{!10, !10, i64 0}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12, !18, !17}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.unroll.disable"}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !25}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}
!31 = distinct !{!31, !12}


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