; LLVM IR from kazunetakahashi/atcoder :: 2017/1124_code-fes-2016-final (F)

; 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 [310 x [310 x [310 x i64]]], align 16
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = 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)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %51, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = load i64, ptr @M, align 8, !tbaa !9
  %15 = icmp sle i64 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %11
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %54

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

18:                                               ; preds = %47, %17
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  %22 = icmp sle i32 %19, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %18
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %50

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

25:                                               ; preds = %43, %24
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = add nsw i32 %26, %27
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  %31 = icmp sle i32 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %25
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %46

33:                                               ; preds = %25
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [310 x [310 x i64]], ptr %36, i64 0, i64 %38
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [310 x i64], ptr %39, i64 0, i64 %41
  store i64 0, ptr %42, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %33
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %5, align 4, !tbaa !5
  br label %25, !llvm.loop !11

46:                                               ; preds = %32
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %4, align 4, !tbaa !5
  br label %18, !llvm.loop !13

50:                                               ; preds = %23
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !14

54:                                               ; preds = %16
  store i64 1, ptr getelementptr inbounds ([310 x [310 x i64]], ptr @dp, i64 0, i64 1), align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %207, %54
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = load i64, ptr @M, align 8, !tbaa !9
  %59 = icmp sle i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %210

61:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %203, %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = icmp sle i32 %63, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %62
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %206

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %199, %68
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = add nsw i32 %70, %71
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %75 = icmp sle i32 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %69
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %202

77:                                               ; preds = %69
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %79
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [310 x [310 x i64]], ptr %80, i64 0, i64 %82
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [310 x i64], ptr %83, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = load i64, ptr @N, align 8, !tbaa !9
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = sub nsw i64 %88, %90
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = sub nsw i64 %91, %93
  %95 = mul nsw i64 %87, %94
  %96 = srem i64 %95, 1000000007
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %99
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [310 x [310 x i64]], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [310 x i64], ptr %103, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = add nsw i64 %108, %96
  store i64 %109, ptr %107, align 8, !tbaa !9
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %112
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [310 x [310 x i64]], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [310 x i64], ptr %116, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = srem i64 %121, 1000000007
  store i64 %122, ptr %120, align 8, !tbaa !9
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %124
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [310 x [310 x i64]], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [310 x i64], ptr %128, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !9
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = mul nsw i64 %132, %134
  %136 = srem i64 %135, 1000000007
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %139
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [310 x [310 x i64]], ptr %140, i64 0, i64 %142
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [310 x i64], ptr %143, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !9
  %148 = add nsw i64 %147, %136
  store i64 %148, ptr %146, align 8, !tbaa !9
  %149 = load i32, ptr %6, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %151
  %153 = load i32, ptr %7, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [310 x [310 x i64]], ptr %152, i64 0, i64 %154
  %156 = load i32, ptr %8, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [310 x i64], ptr %155, i64 0, i64 %157
  %159 = load i64, ptr %158, align 8, !tbaa !9
  %160 = srem i64 %159, 1000000007
  store i64 %160, ptr %158, align 8, !tbaa !9
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %162
  %164 = load i32, ptr %7, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [310 x [310 x i64]], ptr %163, i64 0, i64 %165
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [310 x i64], ptr %166, i64 0, i64 %168
  %170 = load i64, ptr %169, align 8, !tbaa !9
  %171 = load i32, ptr %7, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = mul nsw i64 %170, %172
  %174 = srem i64 %173, 1000000007
  %175 = load i32, ptr %6, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %177
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = load i32, ptr %8, align 4, !tbaa !5
  %181 = add nsw i32 %179, %180
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [310 x [310 x i64]], ptr %178, i64 0, i64 %182
  %184 = getelementptr inbounds [310 x i64], ptr %183, i64 0, i64 0
  %185 = load i64, ptr %184, align 16, !tbaa !9
  %186 = add nsw i64 %185, %174
  store i64 %186, ptr %184, align 16, !tbaa !9
  %187 = load i32, ptr %6, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %189
  %191 = load i32, ptr %7, align 4, !tbaa !5
  %192 = load i32, ptr %8, align 4, !tbaa !5
  %193 = add nsw i32 %191, %192
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [310 x [310 x i64]], ptr %190, i64 0, i64 %194
  %196 = getelementptr inbounds [310 x i64], ptr %195, i64 0, i64 0
  %197 = load i64, ptr %196, align 16, !tbaa !9
  %198 = srem i64 %197, 1000000007
  store i64 %198, ptr %196, align 16, !tbaa !9
  br label %199

199:                                              ; preds = %77
  %200 = load i32, ptr %8, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %8, align 4, !tbaa !5
  br label %69, !llvm.loop !15

202:                                              ; preds = %76
  br label %203

203:                                              ; preds = %202
  %204 = load i32, ptr %7, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %7, align 4, !tbaa !5
  br label %62, !llvm.loop !16

206:                                              ; preds = %67
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %6, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %6, align 4, !tbaa !5
  br label %55, !llvm.loop !17

210:                                              ; preds = %60
  %211 = load i64, ptr @M, align 8, !tbaa !9
  %212 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %211
  %213 = load i64, ptr @N, align 8, !tbaa !9
  %214 = getelementptr inbounds [310 x [310 x i64]], ptr %212, i64 0, i64 %213
  %215 = getelementptr inbounds [310 x i64], ptr %214, i64 0, i64 0
  %216 = load i64, ptr %215, align 16, !tbaa !9
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %216)
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %217, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %219 = load i32, ptr %1, align 4
  ret i32 %219
}

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


; 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 [310 x [310 x [310 x i64]]], align 16
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = 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) @M)
  %3 = load i64, ptr @M, align 8, !tbaa !5
  %.not79 = icmp slt i64 %3, 0
  br i1 %.not79, label %._crit_edge.thread, label %.preheader73

._crit_edge.thread:                               ; preds = %0
  store i64 1, ptr getelementptr inbounds (i8, ptr @dp, i64 2480), align 16, !tbaa !5
  %.pre116 = load i64, ptr @N, align 8, !tbaa !5
  br label %._crit_edge85

.loopexit74.unr-lcssa:                            ; preds = %.preheader72, %.preheader73
  %indvar86.unr = phi i64 [ 0, %.preheader73 ], [ %indvar.next87.1, %.preheader72 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit74, label %.preheader72.epil

.preheader72.epil:                                ; preds = %.loopexit74.unr-lcssa
  %4 = mul nuw nsw i64 %indvar86.unr, 2480
  %scevgep.epil = getelementptr i8, ptr %gep, i64 %4
  %5 = sub nsw i64 %indvar, %indvar86.unr
  %6 = shl i64 %5, 3
  %7 = and i64 %6, 34359738360
  %8 = add nuw nsw i64 %7, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %scevgep.epil, i8 0, i64 %8, i1 false), !tbaa !5
  br label %.loopexit74

.loopexit74:                                      ; preds = %.loopexit74.unr-lcssa, %.preheader72.epil
  %indvar.next = add nuw nsw i64 %indvar, 1
  %indvars.iv.next90 = add nuw i64 %indvars.iv89, 1
  %exitcond94 = icmp eq i64 %indvar, %3
  br i1 %exitcond94, label %._crit_edge, label %.preheader73, !llvm.loop !9

.preheader73:                                     ; preds = %0, %.loopexit74
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.loopexit74 ], [ 1, %0 ]
  %indvar = phi i64 [ %indvar.next, %.loopexit74 ], [ 0, %0 ]
  %9 = mul nuw nsw i64 %indvar, 768800
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @dp, i64 2480), i64 %9
  %xtraiter = and i64 %indvars.iv89, 1
  %10 = icmp eq i64 %indvar, 0
  br i1 %10, label %.loopexit74.unr-lcssa, label %.preheader73.new

.preheader73.new:                                 ; preds = %.preheader73
  %unroll_iter = and i64 %indvars.iv89, -2
  br label %.preheader72

._crit_edge:                                      ; preds = %.loopexit74
  store i64 1, ptr getelementptr inbounds (i8, ptr @dp, i64 2480), align 16, !tbaa !5
  %.pre = load i64, ptr @N, align 8, !tbaa !5
  br i1 %.not79, label %._crit_edge85, label %.preheader71

.preheader72:                                     ; preds = %.preheader72, %.preheader73.new
  %indvar86 = phi i64 [ 0, %.preheader73.new ], [ %indvar.next87.1, %.preheader72 ]
  %niter = phi i64 [ 0, %.preheader73.new ], [ %niter.next.1, %.preheader72 ]
  %11 = mul nuw nsw i64 %indvar86, 2480
  %scevgep = getelementptr i8, ptr %gep, i64 %11
  %12 = sub nsw i64 %indvar, %indvar86
  %13 = shl i64 %12, 3
  %14 = and i64 %13, 34359738360
  %15 = add nuw nsw i64 %14, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %scevgep, i8 0, i64 %15, i1 false), !tbaa !5
  %indvar.next87 = or disjoint i64 %indvar86, 1
  %16 = mul nuw nsw i64 %indvar.next87, 2480
  %scevgep.1 = getelementptr i8, ptr %gep, i64 %16
  %17 = sub nsw i64 %indvar, %indvar.next87
  %18 = shl i64 %17, 3
  %19 = and i64 %18, 34359738360
  %20 = add nuw nsw i64 %19, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %scevgep.1, i8 0, i64 %20, i1 false), !tbaa !5
  %indvar.next87.1 = add nuw nsw i64 %indvar86, 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 %.loopexit74.unr-lcssa, label %.preheader72, !llvm.loop !11

.loopexit:                                        ; preds = %25
  %indvars.iv.next97 = add nuw i32 %indvars.iv96, 1
  %indvars.iv.next109 = add nuw i64 %indvars.iv108, 1
  %exitcond115 = icmp eq i64 %indvars.iv110, %3
  br i1 %exitcond115, label %._crit_edge85, label %.preheader71, !llvm.loop !12

.preheader71:                                     ; preds = %._crit_edge, %.loopexit
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %.loopexit ], [ 0, %._crit_edge ]
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.loopexit ], [ 2, %._crit_edge ]
  %indvars.iv96 = phi i32 [ %indvars.iv.next97, %.loopexit ], [ 1, %._crit_edge ]
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  br label %.preheader

._crit_edge85:                                    ; preds = %.loopexit, %._crit_edge.thread, %._crit_edge
  %.pre117 = phi i64 [ %.pre116, %._crit_edge.thread ], [ %.pre, %._crit_edge ], [ %.pre, %.loopexit ]
  %21 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %3, i64 %.pre117
  %22 = load i64, ptr %21, align 16, !tbaa !5
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %22)
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.preheader:                                       ; preds = %.preheader71, %25
  %indvars.iv101 = phi i64 [ 1, %.preheader71 ], [ %indvars.iv.next102, %25 ]
  %indvars.iv98 = phi i32 [ %indvars.iv96, %.preheader71 ], [ %indvars.iv.next99, %25 ]
  %wide.trip.count = zext i32 %indvars.iv98 to i64
  br label %26

25:                                               ; preds = %26
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %indvars.iv.next99 = add nsw i32 %indvars.iv98, -1
  %exitcond107 = icmp eq i64 %indvars.iv.next102, %indvars.iv108
  br i1 %exitcond107, label %.loopexit, label %.preheader, !llvm.loop !13

26:                                               ; preds = %.preheader, %26
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %26 ]
  %27 = add nuw nsw i64 %indvars.iv, %indvars.iv101
  %28 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %indvars.iv110, i64 %indvars.iv101, i64 %indvars.iv
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = sub i64 %.pre, %27
  %31 = mul nsw i64 %30, %29
  %32 = srem i64 %31, 1000000007
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next111, i64 %indvars.iv101, i64 %indvars.iv.next
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add nsw i64 %32, %34
  %36 = srem i64 %35, 1000000007
  store i64 %36, ptr %33, align 8, !tbaa !5
  %37 = mul nsw i64 %29, %indvars.iv
  %38 = srem i64 %37, 1000000007
  %39 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next111, i64 %indvars.iv101, i64 %indvars.iv
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = add nsw i64 %40, %38
  %42 = srem i64 %41, 1000000007
  store i64 %42, ptr %39, align 8, !tbaa !5
  %43 = mul nsw i64 %29, %indvars.iv101
  %44 = srem i64 %43, 1000000007
  %45 = getelementptr inbounds [310 x [310 x [310 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next111, i64 %27
  %46 = load i64, ptr %45, align 16, !tbaa !5
  %47 = add nsw i64 %46, %44
  %48 = srem i64 %47, 1000000007
  store i64 %48, ptr %45, align 16, !tbaa !5
  %exitcond100 = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond100, label %25, label %26, !llvm.loop !14
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nounwind willreturn memory(argmem: write) }

!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}


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