; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codeagon 2017/Problem C/C.ll (Z5solvev)

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

@dp = external dso_local global [2100 x [2100 x i64]], align 16
@sum = external dso_local global [2100 x i64], align 16
@csum = external dso_local global [2100 x [2100 x i64]], align 16
@b = external dso_local global [2100 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 uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %23, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %26

18:                                               ; preds = %13
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [2100 x i64], ptr @b, i64 0, i64 %20
  %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) %21)
  br label %23

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !9

26:                                               ; preds = %17
  store i64 1, ptr @dp, align 16, !tbaa !11
  store i64 1, ptr @sum, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %167, %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %170

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

33:                                               ; preds = %129, %32
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [2100 x i64], ptr @b, i64 0, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = sub nsw i64 %40, %44
  %46 = sub nsw i64 %45, 1
  store i64 %46, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 -1, ptr %9, align 8, !tbaa !11
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %48 = load i64, ptr %47, align 8, !tbaa !11
  %49 = trunc i64 %48 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  store i32 %49, ptr %7, align 4, !tbaa !5
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = icmp eq i32 %55, -1
  br i1 %56, label %57, label %58

57:                                               ; preds = %38
  br label %63

58:                                               ; preds = %38
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !11
  br label %63

63:                                               ; preds = %58, %57
  %64 = phi i64 [ 0, %57 ], [ %62, %58 ]
  %65 = sub nsw i64 %54, %64
  %66 = add nsw i64 %65, 1000000007
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2100 x [2100 x i64]], ptr @csum, i64 0, i64 %69
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2100 x i64], ptr %70, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = icmp eq i32 %75, -1
  br i1 %76, label %77, label %78

77:                                               ; preds = %63
  br label %86

78:                                               ; preds = %63
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [2100 x [2100 x i64]], ptr @csum, i64 0, i64 %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [2100 x i64], ptr %81, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !11
  br label %86

86:                                               ; preds = %78, %77
  %87 = phi i64 [ 0, %77 ], [ %85, %78 ]
  %88 = sub nsw i64 %74, %87
  %89 = add nsw i64 %88, 1000000007
  %90 = sub nsw i64 %66, %89
  %91 = add nsw i64 %90, 1000000007
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %93
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2100 x i64], ptr %94, i64 0, i64 %96
  store i64 %91, ptr %97, align 8, !tbaa !11
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %99
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [2100 x i64], ptr %100, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !11
  %105 = srem i64 %104, 1000000007
  store i64 %105, ptr %103, align 8, !tbaa !11
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [2100 x [2100 x i64]], ptr @csum, i64 0, i64 %108
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [2100 x i64], ptr %109, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !11
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %115
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2100 x i64], ptr %116, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = add nsw i64 %113, %120
  %122 = srem i64 %121, 1000000007
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [2100 x [2100 x i64]], ptr @csum, i64 0, i64 %124
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [2100 x i64], ptr %125, i64 0, i64 %127
  store i64 %122, ptr %128, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %129

129:                                              ; preds = %86
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %6, align 4, !tbaa !5
  br label %33, !llvm.loop !13

132:                                              ; preds = %37
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !11
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %139
  store i64 %137, ptr %140, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %163, %132
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = load i32, ptr %2, align 4, !tbaa !5
  %144 = icmp sle i32 %142, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %166

146:                                              ; preds = %141
  %147 = load i32, ptr %4, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !11
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %152
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [2100 x i64], ptr %153, i64 0, i64 %155
  %157 = load i64, ptr %156, align 8, !tbaa !11
  %158 = add nsw i64 %150, %157
  %159 = srem i64 %158, 1000000007
  %160 = load i32, ptr %4, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %161
  store i64 %159, ptr %162, align 8, !tbaa !11
  br label %163

163:                                              ; preds = %146
  %164 = load i32, ptr %10, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %10, align 4, !tbaa !5
  br label %141, !llvm.loop !14

166:                                              ; preds = %145
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %4, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !15

170:                                              ; preds = %31
  %171 = load i32, ptr %1, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !11
  %175 = load i32, ptr %1, align 4, !tbaa !5
  %176 = sub nsw i32 %175, 1
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !11
  %180 = sub nsw i64 %174, %179
  %181 = add nsw i64 %180, 1000000007
  %182 = srem i64 %181, 1000000007
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %182)
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #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)) #0 align 2

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

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

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

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

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

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@dp = external dso_local local_unnamed_addr global [2100 x [2100 x i64]], align 16
@sum = external dso_local local_unnamed_addr global [2100 x i64], align 16
@csum = external dso_local local_unnamed_addr global [2100 x [2100 x i64]], align 16
@b = external dso_local global [2100 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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %.not48 = icmp slt i32 %7, 1
  br i1 %.not48, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %8 = phi i32 [ %7, %0 ], [ %19, %.lr.ph ]
  store i64 1, ptr @dp, align 16, !tbaa !9
  store i64 1, ptr @sum, align 16, !tbaa !9
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %.not4060 = icmp slt i32 %9, 1
  br i1 %.not4060, label %._crit_edge62, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %10 = icmp slt i32 %8, 1
  br i1 %10, label %.preheader.us.us.preheader, label %.preheader

.preheader.us.us.preheader:                       ; preds = %.preheader.lr.ph
  %11 = add nuw i32 %9, 1
  %wide.trip.count95 = zext i32 %11 to i64
  %12 = zext nneg i32 %9 to i64
  %min.iters.check = icmp ult i32 %9, 4
  br i1 %min.iters.check, label %.preheader.us.us.preheader109, label %vector.ph

vector.ph:                                        ; preds = %.preheader.us.us.preheader
  %n.vec = and i64 %12, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %13 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %offset.idx
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  store <2 x i64> <i64 1, i64 1>, ptr %13, align 8, !tbaa !9
  store <2 x i64> <i64 1, i64 1>, ptr %14, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %15 = icmp eq i64 %index.next, %n.vec
  br i1 %15, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %12
  br i1 %cmp.n, label %._crit_edge62, label %.preheader.us.us.preheader109

.preheader.us.us.preheader109:                    ; preds = %middle.block, %.preheader.us.us.preheader
  %indvars.iv91.ph = phi i64 [ 1, %.preheader.us.us.preheader ], [ %ind.end, %middle.block ]
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader109, %.preheader.us.us
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.preheader.us.us ], [ %indvars.iv91.ph, %.preheader.us.us.preheader109 ]
  %16 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %indvars.iv91
  store i64 1, ptr %16, align 8, !tbaa !9
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count95
  br i1 %exitcond96.not, label %._crit_edge62, label %.preheader.us.us, !llvm.loop !15

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %17 = getelementptr inbounds [2100 x i64], ptr @b, i64 0, i64 %indvars.iv
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %.not.not = icmp slt i64 %indvars.iv, %20
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.lr.ph, %74
  %21 = phi i64 [ %76, %74 ], [ 1, %.preheader.lr.ph ]
  %22 = phi i32 [ %75, %74 ], [ %8, %.preheader.lr.ph ]
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %74 ], [ 1, %.preheader.lr.ph ]
  %.not4150 = icmp slt i32 %22, 1
  br i1 %.not4150, label %._crit_edge53.thread, label %.lr.ph52

._crit_edge53.thread:                             ; preds = %.preheader
  %23 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %indvars.iv78
  store i64 %21, ptr %23, align 8, !tbaa !9
  br label %74

.lr.ph52:                                         ; preds = %.preheader
  %24 = add nsw i64 %indvars.iv78, -1
  %25 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %24
  br label %41

._crit_edge62:                                    ; preds = %74, %.preheader.us.us, %middle.block, %._crit_edge
  %.lcssa47 = phi i32 [ %9, %._crit_edge ], [ %9, %middle.block ], [ %9, %.preheader.us.us ], [ %77, %74 ]
  %26 = sext i32 %.lcssa47 to i64
  %27 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = add nsw i32 %.lcssa47, -1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = add i64 %28, 1000000007
  %34 = sub i64 %33, %32
  %35 = srem i64 %34, 1000000007
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %35)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void

._crit_edge53:                                    ; preds = %.thread
  %38 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %indvars.iv78
  store i64 %48, ptr %38, align 8, !tbaa !9
  %.not4254 = icmp slt i32 %68, 1
  br i1 %.not4254, label %74, label %.lr.ph57

.lr.ph57:                                         ; preds = %._crit_edge53
  %39 = zext nneg i32 %68 to i64
  %xtraiter = and i64 %39, 1
  %40 = icmp eq i32 %68, 1
  br i1 %40, label %._crit_edge58.unr-lcssa, label %.lr.ph57.new

.lr.ph57.new:                                     ; preds = %.lr.ph57
  %unroll_iter = and i64 %39, 2147483646
  br label %79

41:                                               ; preds = %.lr.ph52, %.thread
  %indvars.iv72 = phi i64 [ 1, %.lr.ph52 ], [ %indvars.iv.next73, %.thread ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %42 = getelementptr inbounds [2100 x i64], ptr @b, i64 0, i64 %indvars.iv72
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = xor i64 %43, -1
  %45 = add i64 %indvars.iv78, %44
  store i64 %45, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 -1, ptr %4, align 8, !tbaa !9
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %47 = load i64, ptr %46, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %48 = load i64, ptr %25, align 8, !tbaa !9
  %49 = and i64 %47, 4294967295
  %50 = icmp eq i64 %49, 4294967295
  br i1 %50, label %.thread, label %51

51:                                               ; preds = %41
  %sext = shl i64 %47, 32
  %52 = ashr exact i64 %sext, 32
  %53 = getelementptr inbounds [2100 x i64], ptr @sum, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = sub nsw i64 %48, %54
  %56 = getelementptr inbounds [2100 x [2100 x i64]], ptr @csum, i64 0, i64 %52, i64 %indvars.iv72
  %57 = load i64, ptr %56, align 8, !tbaa !9
  br label %.thread

.thread:                                          ; preds = %41, %51
  %58 = phi i64 [ %55, %51 ], [ %48, %41 ]
  %59 = phi i64 [ %57, %51 ], [ 0, %41 ]
  %.in = getelementptr inbounds [2100 x [2100 x i64]], ptr @csum, i64 0, i64 %24, i64 %indvars.iv72
  %60 = load i64, ptr %.in, align 8, !tbaa !9
  %.neg = add i64 %58, 1000000007
  %61 = add i64 %.neg, %59
  %62 = sub i64 %61, %60
  %63 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %indvars.iv78, i64 %indvars.iv72
  %64 = srem i64 %62, 1000000007
  store i64 %64, ptr %63, align 8, !tbaa !9
  %65 = add nsw i64 %64, %60
  %66 = srem i64 %65, 1000000007
  %67 = getelementptr inbounds [2100 x [2100 x i64]], ptr @csum, i64 0, i64 %indvars.iv78, i64 %indvars.iv72
  store i64 %66, ptr %67, align 8, !tbaa !9
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %.not41.not = icmp slt i64 %indvars.iv72, %69
  br i1 %.not41.not, label %41, label %._crit_edge53, !llvm.loop !17

._crit_edge58.unr-lcssa:                          ; preds = %79, %.lr.ph57
  %.lcssa112.ph = phi i64 [ poison, %.lr.ph57 ], [ %88, %79 ]
  %indvars.iv75.unr = phi i64 [ 1, %.lr.ph57 ], [ %indvars.iv.next76.1, %79 ]
  %.unr = phi i64 [ %48, %.lr.ph57 ], [ %88, %79 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge58, label %._crit_edge58.epilog-lcssa

._crit_edge58.epilog-lcssa:                       ; preds = %._crit_edge58.unr-lcssa
  %70 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %indvars.iv78, i64 %indvars.iv75.unr
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = add nsw i64 %71, %.unr
  %73 = srem i64 %72, 1000000007
  br label %._crit_edge58

._crit_edge58:                                    ; preds = %._crit_edge58.unr-lcssa, %._crit_edge58.epilog-lcssa
  %.lcssa112 = phi i64 [ %.lcssa112.ph, %._crit_edge58.unr-lcssa ], [ %73, %._crit_edge58.epilog-lcssa ]
  store i64 %.lcssa112, ptr %38, align 8, !tbaa !9
  br label %74

74:                                               ; preds = %._crit_edge53.thread, %._crit_edge58, %._crit_edge53
  %75 = phi i32 [ %68, %._crit_edge58 ], [ %68, %._crit_edge53 ], [ %22, %._crit_edge53.thread ]
  %76 = phi i64 [ %.lcssa112, %._crit_edge58 ], [ %48, %._crit_edge53 ], [ %21, %._crit_edge53.thread ]
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %77 = load i32, ptr %1, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %.not40.not = icmp slt i64 %indvars.iv78, %78
  br i1 %.not40.not, label %.preheader, label %._crit_edge62, !llvm.loop !18

79:                                               ; preds = %79, %.lr.ph57.new
  %indvars.iv75 = phi i64 [ 1, %.lr.ph57.new ], [ %indvars.iv.next76.1, %79 ]
  %80 = phi i64 [ %48, %.lr.ph57.new ], [ %88, %79 ]
  %niter = phi i64 [ 0, %.lr.ph57.new ], [ %niter.next.1, %79 ]
  %81 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %indvars.iv78, i64 %indvars.iv75
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = add nsw i64 %82, %80
  %84 = srem i64 %83, 1000000007
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %85 = getelementptr inbounds [2100 x [2100 x i64]], ptr @dp, i64 0, i64 %indvars.iv78, i64 %indvars.iv.next76
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = add nsw i64 %86, %84
  %88 = srem i64 %87, 1000000007
  %indvars.iv.next76.1 = add nuw nsw i64 %indvars.iv75, 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 %._crit_edge58.unr-lcssa, label %79, !llvm.loop !20
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 #0 align 2

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = distinct !{!20, !12}


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