; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2019-20/Open/Plat (sprinklers2)

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

%struct.modular = type { i32 }
%"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::allocator" = type { i8 }

@N = external dso_local global i32, align 4
@g = external dso_local global [2005 x [2005 x i8]], align 16
@dpR = external dso_local global [2005 x [2005 x %struct.modular]], align 16
@dpB = external dso_local global [2005 x [2005 x %struct.modular]], align 16
@cumR = external dso_local global [2005 x [2005 x %struct.modular]], align 16
@cumB = external dso_local global [2005 x [2005 x %struct.modular]], align 16
@i2 = external dso_local global %struct.modular, align 4
@.str.15 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32)) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.modular, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.modular, align 4
  %15 = alloca i64, align 8
  %16 = alloca %struct.modular, align 4
  %17 = alloca %struct.modular, align 4
  %18 = alloca %struct.modular, align 4
  %19 = alloca %struct.modular, align 4
  %20 = alloca %struct.modular, align 4
  %21 = alloca %struct.modular, align 4
  %22 = alloca %struct.modular, align 4
  %23 = alloca %struct.modular, align 4
  %24 = alloca %struct.modular, align 4
  %25 = alloca %struct.modular, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %struct.modular, align 4
  %29 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %30 unwind label %38

30:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %31 unwind label %42

31:                                               ; preds = %30
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  call void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %80, %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %47, label %37

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

38:                                               ; preds = %0
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %4, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %5, align 4
  br label %46

42:                                               ; preds = %30
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %4, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %46

46:                                               ; preds = %42, %38
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  br label %309

47:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  invoke void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %48 unwind label %55

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

49:                                               ; preds = %72, %48
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = load i32, ptr @N, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = icmp slt i32 %50, %52
  br i1 %53, label %59, label %54

54:                                               ; preds = %49
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %79

55:                                               ; preds = %47
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %4, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %5, align 4
  br label %83

59:                                               ; preds = %49
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = sub nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 noundef %62)
          to label %64 unwind label %75

64:                                               ; preds = %59
  %65 = load i8, ptr %63, align 1, !tbaa !9
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %67
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [2005 x i8], ptr %68, i64 0, i64 %70
  store i8 %65, ptr %71, align 1, !tbaa !9
  br label %72

72:                                               ; preds = %64
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %9, align 4, !tbaa !5
  br label %49, !llvm.loop !10

75:                                               ; preds = %59
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %4, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %83

79:                                               ; preds = %54
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !5
  br label %32, !llvm.loop !12

83:                                               ; preds = %75, %55
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %309

84:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !13
  call void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %270, %84
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = load i32, ptr @N, align 4, !tbaa !5
  %88 = add nsw i32 %87, 2
  %89 = icmp slt i32 %86, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %85
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %273

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

92:                                               ; preds = %266, %91
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = load i32, ptr @N, align 4, !tbaa !5
  %95 = add nsw i32 %94, 2
  %96 = icmp slt i32 %93, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %92
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %269

98:                                               ; preds = %92
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %101, label %117

101:                                              ; preds = %98
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = icmp eq i32 %102, 1
  br i1 %103, label %104, label %117

104:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 1, ptr %15, align 8, !tbaa !13
  call void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %105 = load i32, ptr %12, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %106
  %108 = load i32, ptr %13, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [2005 x %struct.modular], ptr %107, i64 0, i64 %109
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %110, ptr align 4 %14, i64 4, i1 false), !tbaa.struct !15
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %112
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [2005 x %struct.modular], ptr %113, i64 0, i64 %115
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %116, ptr align 4 %110, i64 4, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %117

117:                                              ; preds = %104, %101, %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = sub nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumR, i64 0, i64 %120
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [2005 x %struct.modular], ptr %121, i64 0, i64 %123
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %124, i64 4, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = sub nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %127
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2005 x %struct.modular], ptr %128, i64 0, i64 %130
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %131, i64 4, i1 false), !tbaa.struct !15
  %132 = getelementptr inbounds %struct.modular, ptr %19, i32 0, i32 0
  %133 = load i32, ptr %132, align 4
  %134 = call i32 @_Zml7modularIiERKS0_(i32 %133, ptr noundef nonnull align 4 dereferenceable(4) @i2)
  %135 = getelementptr inbounds %struct.modular, ptr %18, i32 0, i32 0
  store i32 %134, ptr %135, align 4
  %136 = getelementptr inbounds %struct.modular, ptr %17, i32 0, i32 0
  %137 = load i32, ptr %136, align 4
  %138 = call i32 @_Zpl7modularIiERKS0_(i32 %137, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %139 = getelementptr inbounds %struct.modular, ptr %16, i32 0, i32 0
  store i32 %138, ptr %139, align 4
  %140 = load i32, ptr %12, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumR, i64 0, i64 %141
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [2005 x %struct.modular], ptr %142, i64 0, i64 %144
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %145, ptr align 4 %16, i64 4, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %146 = load i32, ptr %12, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumB, i64 0, i64 %147
  %149 = load i32, ptr %13, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [2005 x %struct.modular], ptr %148, i64 0, i64 %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %152, i64 4, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %154
  %156 = load i32, ptr %13, align 4, !tbaa !5
  %157 = sub nsw i32 %156, 1
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [2005 x %struct.modular], ptr %155, i64 0, i64 %158
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %159, i64 4, i1 false), !tbaa.struct !15
  %160 = getelementptr inbounds %struct.modular, ptr %23, i32 0, i32 0
  %161 = load i32, ptr %160, align 4
  %162 = call i32 @_Zml7modularIiERKS0_(i32 %161, ptr noundef nonnull align 4 dereferenceable(4) @i2)
  %163 = getelementptr inbounds %struct.modular, ptr %22, i32 0, i32 0
  store i32 %162, ptr %163, align 4
  %164 = getelementptr inbounds %struct.modular, ptr %21, i32 0, i32 0
  %165 = load i32, ptr %164, align 4
  %166 = call i32 @_Zpl7modularIiERKS0_(i32 %165, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %167 = getelementptr inbounds %struct.modular, ptr %20, i32 0, i32 0
  store i32 %166, ptr %167, align 4
  %168 = load i32, ptr %12, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumB, i64 0, i64 %169
  %171 = load i32, ptr %13, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [2005 x %struct.modular], ptr %170, i64 0, i64 %172
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %173, ptr align 4 %20, i64 4, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  %174 = load i32, ptr %12, align 4, !tbaa !5
  %175 = icmp sgt i32 %174, 1
  br i1 %175, label %176, label %205

176:                                              ; preds = %117
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = load i32, ptr @N, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  %180 = icmp ne i32 %177, %179
  br i1 %180, label %181, label %205

181:                                              ; preds = %176
  %182 = load i32, ptr %12, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %184
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [2005 x i8], ptr %185, i64 0, i64 %187
  %189 = load i8, ptr %188, align 1, !tbaa !9
  %190 = sext i8 %189 to i32
  %191 = icmp ne i32 %190, 87
  br i1 %191, label %192, label %205

192:                                              ; preds = %181
  %193 = load i32, ptr %12, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumR, i64 0, i64 %194
  %196 = load i32, ptr %13, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [2005 x %struct.modular], ptr %195, i64 0, i64 %197
  %199 = load i32, ptr %12, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %200
  %202 = load i32, ptr %13, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [2005 x %struct.modular], ptr %201, i64 0, i64 %203
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %204, ptr align 4 %198, i64 4, i1 false), !tbaa.struct !15
  br label %205

205:                                              ; preds = %192, %181, %176, %117
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = load i32, ptr @N, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  %209 = icmp ne i32 %206, %208
  br i1 %209, label %210, label %237

210:                                              ; preds = %205
  %211 = load i32, ptr %13, align 4, !tbaa !5
  %212 = icmp sgt i32 %211, 1
  br i1 %212, label %213, label %237

213:                                              ; preds = %210
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %215
  %217 = load i32, ptr %13, align 4, !tbaa !5
  %218 = sub nsw i32 %217, 1
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [2005 x i8], ptr %216, i64 0, i64 %219
  %221 = load i8, ptr %220, align 1, !tbaa !9
  %222 = sext i8 %221 to i32
  %223 = icmp ne i32 %222, 87
  br i1 %223, label %224, label %237

224:                                              ; preds = %213
  %225 = load i32, ptr %12, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumB, i64 0, i64 %226
  %228 = load i32, ptr %13, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [2005 x %struct.modular], ptr %227, i64 0, i64 %229
  %231 = load i32, ptr %12, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %232
  %234 = load i32, ptr %13, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [2005 x %struct.modular], ptr %233, i64 0, i64 %235
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %236, ptr align 4 %230, i64 4, i1 false), !tbaa.struct !15
  br label %237

237:                                              ; preds = %224, %213, %210, %205
  %238 = load i32, ptr %12, align 4, !tbaa !5
  %239 = load i32, ptr @N, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  %241 = icmp eq i32 %238, %240
  br i1 %241, label %247, label %242

242:                                              ; preds = %237
  %243 = load i32, ptr %13, align 4, !tbaa !5
  %244 = load i32, ptr @N, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  %246 = icmp eq i32 %243, %245
  br i1 %246, label %247, label %265

247:                                              ; preds = %242, %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %248 = load i32, ptr %12, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %249
  %251 = load i32, ptr %13, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [2005 x %struct.modular], ptr %250, i64 0, i64 %252
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %253, i64 4, i1 false), !tbaa.struct !15
  %254 = load i32, ptr %12, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %255
  %257 = load i32, ptr %13, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [2005 x %struct.modular], ptr %256, i64 0, i64 %258
  %260 = getelementptr inbounds %struct.modular, ptr %25, i32 0, i32 0
  %261 = load i32, ptr %260, align 4
  %262 = call i32 @_Zpl7modularIiERKS0_(i32 %261, ptr noundef nonnull align 4 dereferenceable(4) %259)
  %263 = getelementptr inbounds %struct.modular, ptr %24, i32 0, i32 0
  store i32 %262, ptr %263, align 4
  %264 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7modularIiEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %24)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %265

265:                                              ; preds = %247, %242
  br label %266

266:                                              ; preds = %265
  %267 = load i32, ptr %13, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %13, align 4, !tbaa !5
  br label %92, !llvm.loop !16

269:                                              ; preds = %97
  br label %270

270:                                              ; preds = %269
  %271 = load i32, ptr %12, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %12, align 4, !tbaa !5
  br label %85, !llvm.loop !17

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

274:                                              ; preds = %304, %273
  %275 = load i32, ptr %26, align 4, !tbaa !5
  %276 = load i32, ptr @N, align 4, !tbaa !5
  %277 = add nsw i32 %276, 1
  %278 = icmp slt i32 %275, %277
  br i1 %278, label %280, label %279

279:                                              ; preds = %274
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %307

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

281:                                              ; preds = %300, %280
  %282 = load i32, ptr %27, align 4, !tbaa !5
  %283 = load i32, ptr @N, align 4, !tbaa !5
  %284 = add nsw i32 %283, 1
  %285 = icmp slt i32 %282, %284
  br i1 %285, label %287, label %286

286:                                              ; preds = %281
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %303

287:                                              ; preds = %281
  %288 = load i32, ptr %26, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %289
  %291 = load i32, ptr %27, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [2005 x i8], ptr %290, i64 0, i64 %292
  %294 = load i8, ptr %293, align 1, !tbaa !9
  %295 = sext i8 %294 to i32
  %296 = icmp eq i32 %295, 46
  br i1 %296, label %297, label %299

297:                                              ; preds = %287
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  store i64 2, ptr %29, align 8, !tbaa !13
  call void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %298 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7modularIiEmLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %28)
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %299

299:                                              ; preds = %297, %287
  br label %300

300:                                              ; preds = %299
  %301 = load i32, ptr %27, align 4, !tbaa !5
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %27, align 4, !tbaa !5
  br label %281, !llvm.loop !18

303:                                              ; preds = %286
  br label %304

304:                                              ; preds = %303
  %305 = load i32, ptr %26, align 4, !tbaa !5
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %26, align 4, !tbaa !5
  br label %274, !llvm.loop !19

307:                                              ; preds = %279
  call void @_ZN6output2psI7modularIiEJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %308 = load i32, ptr %1, align 4
  ret i32 %308

309:                                              ; preds = %83, %46
  %310 = load ptr, ptr %4, align 8
  %311 = load i32, ptr %5, align 4
  %312 = insertvalue { ptr, i32 } poison, ptr %310, 0
  %313 = insertvalue { ptr, i32 } %312, i32 %311, 1
  resume { ptr, i32 } %313
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #2

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zpl7modularIiERKS0_(i32, ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zml7modularIiERKS0_(i32, ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psI7modularIiEJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{i64 0, i64 4, !5}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}


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

%struct.modular = type { i32 }
%"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::allocator" = type { i8 }

@N = external dso_local global i32, align 4
@g = external dso_local local_unnamed_addr global [2005 x [2005 x i8]], align 16
@dpR = external dso_local local_unnamed_addr global [2005 x [2005 x %struct.modular]], align 16
@dpB = external dso_local global [2005 x [2005 x %struct.modular]], align 16
@cumR = external dso_local local_unnamed_addr global [2005 x [2005 x %struct.modular]], align 16
@cumB = external dso_local local_unnamed_addr global [2005 x [2005 x %struct.modular]], align 16
@i2 = external dso_local global %struct.modular, align 4
@.str.15 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %struct.modular, align 4
  %5 = alloca i64, align 8
  %6 = alloca %struct.modular, align 4
  %7 = alloca i64, align 8
  %8 = alloca %struct.modular, align 4
  %9 = alloca %struct.modular, align 4
  %10 = alloca %struct.modular, align 4
  %11 = alloca %struct.modular, align 4
  %12 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %13 unwind label %18

13:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %14 unwind label %20

14:                                               ; preds = %13
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #4
  call void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  %15 = load i32, ptr @N, align 4, !tbaa !5
  %.not92 = icmp slt i32 %15, 1
  br i1 %.not92, label %._crit_edge96, label %.lr.ph95

._crit_edge96:                                    ; preds = %._crit_edge, %14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %16 = load i32, ptr @N, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, -1
  br i1 %17, label %.preheader88, label %._crit_edge107

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %22

20:                                               ; preds = %13
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  br label %22

22:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #4
  br label %116

.lr.ph95:                                         ; preds = %14, %._crit_edge
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %._crit_edge ], [ 1, %14 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  invoke void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %.preheader89 unwind label %26

.preheader89:                                     ; preds = %.lr.ph95
  %23 = load i32, ptr @N, align 4, !tbaa !5
  %.not8590 = icmp slt i32 %23, 1
  br i1 %.not8590, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.preheader89
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %24 = load i32, ptr @N, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %.not.not = icmp slt i64 %indvars.iv113, %25
  br i1 %.not.not, label %.lr.ph95, label %._crit_edge96, !llvm.loop !11

26:                                               ; preds = %.lr.ph95
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  br label %116

.lr.ph:                                           ; preds = %.preheader89, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader89 ]
  %28 = add nsw i64 %indvars.iv, -1
  %29 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %28)
  %30 = load i8, ptr %29, align 1, !tbaa !13
  %31 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %indvars.iv113, i64 %indvars.iv
  store i8 %30, ptr %31, align 1, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = load i32, ptr @N, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %.not85.not = icmp slt i64 %indvars.iv, %33
  br i1 %.not85.not, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader88:                                     ; preds = %._crit_edge96, %._crit_edge99
  %34 = phi i32 [ %67, %._crit_edge99 ], [ %16, %._crit_edge96 ]
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %._crit_edge99 ], [ 1, %._crit_edge96 ]
  %35 = icmp sgt i32 %34, -1
  br i1 %35, label %.lr.ph98, label %._crit_edge99

.lr.ph98:                                         ; preds = %.preheader88
  %36 = icmp eq i64 %indvars.iv120, 1
  %37 = add nsw i64 %indvars.iv120, -1
  %38 = icmp ult i64 %indvars.iv120, 2
  br i1 %36, label %39, label %41

39:                                               ; preds = %.lr.ph98
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  store i64 1, ptr %7, align 8, !tbaa !9
  call void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %40 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %40, ptr getelementptr inbounds (i8, ptr @dpB, i64 8024), align 8, !tbaa !5
  store i32 %40, ptr getelementptr inbounds (i8, ptr @dpR, i64 8024), align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %41

41:                                               ; preds = %39, %.lr.ph98
  %42 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumR, i64 0, i64 %37, i64 1
  %.sroa.013.0.copyload.peel = load i32, ptr %42, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %43 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %37, i64 1
  %.sroa.012.0.copyload.peel = load i32, ptr %43, align 4, !tbaa !5
  %44 = call i32 @_Zml7modularIiERKS0_(i32 %.sroa.012.0.copyload.peel, ptr noundef nonnull align 4 dereferenceable(4) @i2)
  store i32 %44, ptr %8, align 4
  %45 = call i32 @_Zpl7modularIiERKS0_(i32 %.sroa.013.0.copyload.peel, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %46 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumR, i64 0, i64 %indvars.iv120, i64 1
  store i32 %45, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %47 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumB, i64 0, i64 %indvars.iv120, i64 0
  %.sroa.010.0.copyload.peel = load i32, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %48 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %indvars.iv120, i64 0
  %.sroa.09.0.copyload.peel = load i32, ptr %48, align 4, !tbaa !5
  %49 = call i32 @_Zml7modularIiERKS0_(i32 %.sroa.09.0.copyload.peel, ptr noundef nonnull align 4 dereferenceable(4) @i2)
  store i32 %49, ptr %9, align 4
  %50 = call i32 @_Zpl7modularIiERKS0_(i32 %.sroa.010.0.copyload.peel, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %51 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumB, i64 0, i64 %indvars.iv120, i64 1
  store i32 %50, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  br i1 %38, label %._crit_edge147, label %52

52:                                               ; preds = %41
  %.not80.peel = icmp eq i32 %.pre, 0
  br i1 %.not80.peel, label %._crit_edge147.thread, label %53

53:                                               ; preds = %52
  %54 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %37, i64 1
  %55 = load i8, ptr %54, align 1, !tbaa !13
  %.not81.peel = icmp eq i8 %55, 87
  br i1 %.not81.peel, label %._crit_edge147, label %56

56:                                               ; preds = %53
  %57 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %indvars.iv120, i64 1
  %58 = load i32, ptr %46, align 4, !tbaa !5
  store i32 %58, ptr %57, align 4, !tbaa !5
  br label %._crit_edge147

._crit_edge147:                                   ; preds = %53, %56, %41
  %.pre-phi150.in = add nsw i32 %.pre, 1
  %.pre-phi150 = zext i32 %.pre-phi150.in to i64
  %59 = icmp eq i64 %indvars.iv120, %.pre-phi150
  %60 = icmp eq i32 %.pre, 0
  %or.cond86.peel = or i1 %59, %60
  br i1 %or.cond86.peel, label %._crit_edge147.thread, label %65

._crit_edge147.thread:                            ; preds = %52, %._crit_edge147
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %61 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %indvars.iv120, i64 1
  %.sroa.0.0.copyload.peel = load i32, ptr %61, align 4, !tbaa !5
  %62 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %indvars.iv120, i64 1
  %63 = call i32 @_Zpl7modularIiERKS0_(i32 %.sroa.0.0.copyload.peel, ptr noundef nonnull align 4 dereferenceable(4) %62)
  store i32 %63, ptr %10, align 4
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7modularIiEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  %.pre130 = load i32, ptr @N, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %._crit_edge147.thread, %._crit_edge147
  %66 = phi i32 [ %.pre130, %._crit_edge147.thread ], [ %.pre, %._crit_edge147 ]
  %.not108.peel = icmp slt i32 %66, 1
  br i1 %.not108.peel, label %._crit_edge99, label %.peel.next

.preheader87:                                     ; preds = %._crit_edge99
  %.not78105 = icmp slt i32 %67, 1
  br i1 %.not78105, label %._crit_edge107, label %.preheader

._crit_edge99:                                    ; preds = %99, %65, %.preheader88
  %67 = phi i32 [ %34, %.preheader88 ], [ %66, %65 ], [ %100, %99 ]
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %68 = sext i32 %67 to i64
  %.not109 = icmp sgt i64 %indvars.iv120, %68
  br i1 %.not109, label %.preheader87, label %.preheader88, !llvm.loop !15

.peel.next:                                       ; preds = %65, %99
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %99 ], [ 2, %65 ]
  %.phi.trans.insert137 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %37, i64 %indvars.iv116
  %.sroa.012.0.copyload.pre = load i32, ptr %.phi.trans.insert137, align 4, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumR, i64 0, i64 %37, i64 %indvars.iv116
  %.sroa.013.0.copyload.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %69 = call i32 @_Zml7modularIiERKS0_(i32 %.sroa.012.0.copyload.pre, ptr noundef nonnull align 4 dereferenceable(4) @i2)
  store i32 %69, ptr %8, align 4
  %70 = call i32 @_Zpl7modularIiERKS0_(i32 %.sroa.013.0.copyload.pre, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %71 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumR, i64 0, i64 %indvars.iv120, i64 %indvars.iv116
  store i32 %70, ptr %71, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %72 = add nsw i64 %indvars.iv116, -1
  %73 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumB, i64 0, i64 %indvars.iv120, i64 %72
  %.sroa.010.0.copyload = load i32, ptr %73, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %74 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %indvars.iv120, i64 %72
  %.sroa.09.0.copyload = load i32, ptr %74, align 4, !tbaa !5
  %75 = call i32 @_Zml7modularIiERKS0_(i32 %.sroa.09.0.copyload, ptr noundef nonnull align 4 dereferenceable(4) @i2)
  store i32 %75, ptr %9, align 4
  %76 = call i32 @_Zpl7modularIiERKS0_(i32 %.sroa.010.0.copyload, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %77 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @cumB, i64 0, i64 %indvars.iv120, i64 %indvars.iv116
  store i32 %76, ptr %77, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  %.pre143 = load i32, ptr @N, align 4, !tbaa !5
  %78 = add nsw i32 %.pre143, 1
  %79 = zext i32 %78 to i64
  %.not80 = icmp eq i64 %indvars.iv116, %79
  %or.cond = select i1 %38, i1 true, i1 %.not80
  br i1 %or.cond, label %._crit_edge146, label %80

80:                                               ; preds = %.peel.next
  %81 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %37, i64 %indvars.iv116
  %82 = load i8, ptr %81, align 1, !tbaa !13
  %.not81 = icmp eq i8 %82, 87
  br i1 %.not81, label %._crit_edge146, label %83

83:                                               ; preds = %80
  %84 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %indvars.iv120, i64 %indvars.iv116
  %85 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %85, ptr %84, align 4, !tbaa !5
  br label %._crit_edge146

._crit_edge146:                                   ; preds = %.peel.next, %83, %80
  %.not = icmp eq i64 %indvars.iv120, %79
  br i1 %.not, label %91, label %86

86:                                               ; preds = %._crit_edge146
  %87 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %indvars.iv120, i64 %72
  %88 = load i8, ptr %87, align 1, !tbaa !13
  %.not82 = icmp eq i8 %88, 87
  br i1 %.not82, label %91, label %89

89:                                               ; preds = %86
  %90 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %indvars.iv120, i64 %indvars.iv116
  store i32 %76, ptr %90, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %89, %86, %._crit_edge146
  %92 = icmp eq i64 %indvars.iv120, %79
  %93 = icmp eq i64 %indvars.iv116, %79
  %or.cond86 = or i1 %92, %93
  br i1 %or.cond86, label %94, label %99

94:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %95 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpR, i64 0, i64 %indvars.iv120, i64 %indvars.iv116
  %.sroa.0.0.copyload = load i32, ptr %95, align 4, !tbaa !5
  %96 = getelementptr inbounds [2005 x [2005 x %struct.modular]], ptr @dpB, i64 0, i64 %indvars.iv120, i64 %indvars.iv116
  %97 = call i32 @_Zpl7modularIiERKS0_(i32 %.sroa.0.0.copyload, ptr noundef nonnull align 4 dereferenceable(4) %96)
  store i32 %97, ptr %10, align 4
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7modularIiEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  %.pre144 = load i32, ptr @N, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %91, %94
  %100 = phi i32 [ %.pre143, %91 ], [ %.pre144, %94 ]
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %101 = sext i32 %100 to i64
  %.not108 = icmp sgt i64 %indvars.iv116, %101
  br i1 %.not108, label %._crit_edge99, label %.peel.next, !llvm.loop !17

.preheader:                                       ; preds = %.preheader87, %._crit_edge104
  %102 = phi i32 [ %103, %._crit_edge104 ], [ %67, %.preheader87 ]
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %._crit_edge104 ], [ 1, %.preheader87 ]
  %.not79101 = icmp slt i32 %102, 1
  br i1 %.not79101, label %._crit_edge104, label %.lr.ph103

._crit_edge107:                                   ; preds = %._crit_edge104, %._crit_edge96, %.preheader87
  call void @_ZN6output2psI7modularIiEJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  ret i32 0

._crit_edge104:                                   ; preds = %112, %.preheader
  %103 = phi i32 [ %102, %.preheader ], [ %113, %112 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %104 = sext i32 %103 to i64
  %.not78.not = icmp slt i64 %indvars.iv126, %104
  br i1 %.not78.not, label %.preheader, label %._crit_edge107, !llvm.loop !19

.lr.ph103:                                        ; preds = %.preheader, %112
  %105 = phi i32 [ %113, %112 ], [ %102, %.preheader ]
  %106 = phi i32 [ %114, %112 ], [ %102, %.preheader ]
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %112 ], [ 1, %.preheader ]
  %107 = getelementptr inbounds [2005 x [2005 x i8]], ptr @g, i64 0, i64 %indvars.iv126, i64 %indvars.iv123
  %108 = load i8, ptr %107, align 1, !tbaa !13
  %109 = icmp eq i8 %108, 46
  br i1 %109, label %110, label %112

110:                                              ; preds = %.lr.ph103
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  store i64 2, ptr %12, align 8, !tbaa !9
  call void @_ZN7modularIiEC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7modularIiEmLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  %.pre145 = load i32, ptr @N, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %.lr.ph103, %110
  %113 = phi i32 [ %105, %.lr.ph103 ], [ %.pre145, %110 ]
  %114 = phi i32 [ %106, %.lr.ph103 ], [ %.pre145, %110 ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %115 = sext i32 %114 to i64
  %.not79.not = icmp slt i64 %indvars.iv123, %115
  br i1 %.not79.not, label %.lr.ph103, label %._crit_edge104, !llvm.loop !20

116:                                              ; preds = %26, %22
  %.pn83 = phi { ptr, i32 } [ %27, %26 ], [ %.pn, %22 ]
  resume { ptr, i32 } %.pn83
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; 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: mustprogress uwtable
declare dso_local i32 @_Zpl7modularIiERKS0_(i32, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zml7modularIiERKS0_(i32, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psI7modularIiEJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #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 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !12, !18}
!18 = !{!"llvm.loop.peeled.count", i32 1}
!19 = distinct !{!19, !12, !16}
!20 = distinct !{!20, !12}


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