; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/89 Beta Division 2/Problem D (D)

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

@n1 = external dso_local global i32, align 4
@n2 = external dso_local global i32, align 4
@k1 = external dso_local global i32, align 4
@k2 = external dso_local global i32, align 4
@dp = external dso_local global [101 x [101 x [201 x [2 x i64]]]], align 16
@MOD = 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
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n1)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) @n2)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) @k1)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) @k2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %28

28:                                               ; preds = %43, %0
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n1, ptr noundef nonnull align 4 dereferenceable(4) @k1)
  %31 = load i32, ptr %30, align 4, !tbaa !8
  %32 = icmp sle i32 %29, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %28
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %36
  %38 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr %37, i64 0, i64 0
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [201 x [2 x i64]], ptr %38, i64 0, i64 %40
  %42 = getelementptr inbounds [2 x i64], ptr %41, i64 0, i64 0
  store i64 1, ptr %42, align 16, !tbaa !11
  br label %43

43:                                               ; preds = %34
  %44 = load i32, ptr %2, align 4, !tbaa !8
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !8
  br label %28, !llvm.loop !13

46:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %47

47:                                               ; preds = %61, %46
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n2, ptr noundef nonnull align 4 dereferenceable(4) @k2)
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = icmp sle i32 %48, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %64

53:                                               ; preds = %47
  %54 = load i32, ptr %3, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr @dp, i64 0, i64 %55
  %57 = load i32, ptr %3, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [201 x [2 x i64]], ptr %56, i64 0, i64 %58
  %60 = getelementptr inbounds [2 x i64], ptr %59, i64 0, i64 1
  store i64 1, ptr %60, align 8, !tbaa !11
  br label %61

61:                                               ; preds = %53
  %62 = load i32, ptr %3, align 4, !tbaa !8
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !8
  br label %47, !llvm.loop !15

64:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %65

65:                                               ; preds = %191, %64
  %66 = load i32, ptr %4, align 4, !tbaa !8
  %67 = load i32, ptr @n1, align 4, !tbaa !8
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

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

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %187, %70
  %72 = load i32, ptr %6, align 4, !tbaa !8
  %73 = load i32, ptr @n2, align 4, !tbaa !8
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %190

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %77 = load i32, ptr %4, align 4, !tbaa !8
  %78 = load i32, ptr %6, align 4, !tbaa !8
  %79 = add nsw i32 %77, %78
  %80 = load i32, ptr @k1, align 4, !tbaa !8
  %81 = sub nsw i32 %79, %80
  store i32 %81, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %83 = load i32, ptr %82, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  store i32 %83, ptr %7, align 4, !tbaa !8
  br label %84

84:                                               ; preds = %128, %76
  %85 = load i32, ptr %7, align 4, !tbaa !8
  %86 = load i32, ptr %4, align 4, !tbaa !8
  %87 = load i32, ptr %6, align 4, !tbaa !8
  %88 = add nsw i32 %86, %87
  %89 = icmp slt i32 %85, %88
  br i1 %89, label %91, label %90

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

91:                                               ; preds = %84
  %92 = load i32, ptr %7, align 4, !tbaa !8
  %93 = load i32, ptr %6, align 4, !tbaa !8
  %94 = sub nsw i32 %92, %93
  %95 = icmp sge i32 %94, 0
  br i1 %95, label %96, label %127

96:                                               ; preds = %91
  %97 = load i64, ptr @MOD, align 8, !tbaa !11
  %98 = load i32, ptr %7, align 4, !tbaa !8
  %99 = load i32, ptr %6, align 4, !tbaa !8
  %100 = sub nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %101
  %103 = load i32, ptr %6, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr %102, i64 0, i64 %104
  %106 = load i32, ptr %7, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [201 x [2 x i64]], ptr %105, i64 0, i64 %107
  %109 = getelementptr inbounds [2 x i64], ptr %108, i64 0, i64 1
  %110 = load i64, ptr %109, align 8, !tbaa !11
  %111 = load i32, ptr %4, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %112
  %114 = load i32, ptr %6, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %4, align 4, !tbaa !8
  %118 = load i32, ptr %6, align 4, !tbaa !8
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [201 x [2 x i64]], ptr %116, i64 0, i64 %120
  %122 = getelementptr inbounds [2 x i64], ptr %121, i64 0, i64 0
  %123 = load i64, ptr %122, align 16, !tbaa !11
  %124 = add nsw i64 %123, %110
  store i64 %124, ptr %122, align 16, !tbaa !11
  %125 = load i64, ptr %122, align 16, !tbaa !11
  %126 = srem i64 %125, %97
  store i64 %126, ptr %122, align 16, !tbaa !11
  br label %127

127:                                              ; preds = %96, %91
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %7, align 4, !tbaa !8
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %7, align 4, !tbaa !8
  br label %84, !llvm.loop !16

131:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %132 = load i32, ptr %4, align 4, !tbaa !8
  %133 = load i32, ptr %6, align 4, !tbaa !8
  %134 = add nsw i32 %132, %133
  %135 = load i32, ptr @k2, align 4, !tbaa !8
  %136 = sub nsw i32 %134, %135
  store i32 %136, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !8
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %138 = load i32, ptr %137, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  store i32 %138, ptr %10, align 4, !tbaa !8
  br label %139

139:                                              ; preds = %183, %131
  %140 = load i32, ptr %10, align 4, !tbaa !8
  %141 = load i32, ptr %4, align 4, !tbaa !8
  %142 = load i32, ptr %6, align 4, !tbaa !8
  %143 = add nsw i32 %141, %142
  %144 = icmp slt i32 %140, %143
  br i1 %144, label %146, label %145

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

146:                                              ; preds = %139
  %147 = load i32, ptr %10, align 4, !tbaa !8
  %148 = load i32, ptr %4, align 4, !tbaa !8
  %149 = sub nsw i32 %147, %148
  %150 = icmp sge i32 %149, 0
  br i1 %150, label %151, label %182

151:                                              ; preds = %146
  %152 = load i64, ptr @MOD, align 8, !tbaa !11
  %153 = load i32, ptr %4, align 4, !tbaa !8
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %154
  %156 = load i32, ptr %10, align 4, !tbaa !8
  %157 = load i32, ptr %4, align 4, !tbaa !8
  %158 = sub nsw i32 %156, %157
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr %155, i64 0, i64 %159
  %161 = load i32, ptr %10, align 4, !tbaa !8
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [201 x [2 x i64]], ptr %160, i64 0, i64 %162
  %164 = getelementptr inbounds [2 x i64], ptr %163, i64 0, i64 0
  %165 = load i64, ptr %164, align 16, !tbaa !11
  %166 = load i32, ptr %4, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %167
  %169 = load i32, ptr %6, align 4, !tbaa !8
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr %168, i64 0, i64 %170
  %172 = load i32, ptr %4, align 4, !tbaa !8
  %173 = load i32, ptr %6, align 4, !tbaa !8
  %174 = add nsw i32 %172, %173
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [201 x [2 x i64]], ptr %171, i64 0, i64 %175
  %177 = getelementptr inbounds [2 x i64], ptr %176, i64 0, i64 1
  %178 = load i64, ptr %177, align 8, !tbaa !11
  %179 = add nsw i64 %178, %165
  store i64 %179, ptr %177, align 8, !tbaa !11
  %180 = load i64, ptr %177, align 8, !tbaa !11
  %181 = srem i64 %180, %152
  store i64 %181, ptr %177, align 8, !tbaa !11
  br label %182

182:                                              ; preds = %151, %146
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %10, align 4, !tbaa !8
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %10, align 4, !tbaa !8
  br label %139, !llvm.loop !17

186:                                              ; preds = %145
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %6, align 4, !tbaa !8
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %6, align 4, !tbaa !8
  br label %71, !llvm.loop !18

190:                                              ; preds = %75
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %4, align 4, !tbaa !8
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %4, align 4, !tbaa !8
  br label %65, !llvm.loop !19

194:                                              ; preds = %69
  %195 = load i32, ptr @n1, align 4, !tbaa !8
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %196
  %198 = load i32, ptr @n2, align 4, !tbaa !8
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr %197, i64 0, i64 %199
  %201 = load i32, ptr @n1, align 4, !tbaa !8
  %202 = load i32, ptr @n2, align 4, !tbaa !8
  %203 = add nsw i32 %201, %202
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [201 x [2 x i64]], ptr %200, i64 0, i64 %204
  %206 = getelementptr inbounds [2 x i64], ptr %205, i64 0, i64 0
  %207 = load i64, ptr %206, align 16, !tbaa !11
  %208 = load i32, ptr @n1, align 4, !tbaa !8
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %209
  %211 = load i32, ptr @n2, align 4, !tbaa !8
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr %210, i64 0, i64 %212
  %214 = load i32, ptr @n1, align 4, !tbaa !8
  %215 = load i32, ptr @n2, align 4, !tbaa !8
  %216 = add nsw i32 %214, %215
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [201 x [2 x i64]], ptr %213, i64 0, i64 %217
  %219 = getelementptr inbounds [2 x i64], ptr %218, i64 0, i64 1
  %220 = load i64, ptr %219, align 8, !tbaa !11
  %221 = add nsw i64 %207, %220
  %222 = load i64, ptr @MOD, align 8, !tbaa !11
  %223 = srem i64 %221, %222
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %223)
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %224, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

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

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

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

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

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

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


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

@n1 = external dso_local global i32, align 4
@n2 = external dso_local global i32, align 4
@k1 = external dso_local global i32, align 4
@k2 = external dso_local global i32, align 4
@dp = external dso_local local_unnamed_addr global [101 x [101 x [201 x [2 x i64]]]], align 16
@MOD = external dso_local local_unnamed_addr 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 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n1)
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @n2)
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) @k1)
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) @k2)
  %20 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n1, ptr noundef nonnull align 4 dereferenceable(4) @k1)
  %21 = load i32, ptr %20, align 4, !tbaa !8
  %.not58 = icmp slt i32 %21, 1
  br i1 %.not58, label %.preheader57, label %.lr.ph

.preheader57:                                     ; preds = %.lr.ph, %0
  %22 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n2, ptr noundef nonnull align 4 dereferenceable(4) @k2)
  %23 = load i32, ptr %22, align 4, !tbaa !8
  %.not5360 = icmp slt i32 %23, 1
  br i1 %.not5360, label %.preheader56, label %.lr.ph62

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %24 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %indvars.iv
  %25 = getelementptr inbounds [201 x [2 x i64]], ptr %24, i64 0, i64 %indvars.iv
  store i64 1, ptr %25, align 16, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n1, ptr noundef nonnull align 4 dereferenceable(4) @k1)
  %27 = load i32, ptr %26, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %.not.not = icmp slt i64 %indvars.iv, %28
  br i1 %.not.not, label %.lr.ph, label %.preheader57, !llvm.loop !13

.preheader56:                                     ; preds = %.lr.ph62, %.preheader57
  %29 = load i32, ptr @n1, align 4, !tbaa !8
  %.not5473 = icmp slt i32 %29, 1
  %.pre94 = load i32, ptr @n2, align 4, !tbaa !8
  %30 = icmp slt i32 %.pre94, 1
  %or.cond = select i1 %.not5473, i1 true, i1 %30
  br i1 %or.cond, label %._crit_edge75, label %.preheader

.lr.ph62:                                         ; preds = %.preheader57, %.lr.ph62
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %.lr.ph62 ], [ 1, %.preheader57 ]
  %31 = getelementptr inbounds [101 x [201 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv79, i64 %indvars.iv79, i64 1
  store i64 1, ptr %31, align 8, !tbaa !11
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %32 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n2, ptr noundef nonnull align 4 dereferenceable(4) @k2)
  %33 = load i32, ptr %32, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %.not53.not = icmp slt i64 %indvars.iv79, %34
  br i1 %.not53.not, label %.lr.ph62, label %.preheader56, !llvm.loop !15

.preheader:                                       ; preds = %.preheader56, %._crit_edge72
  %35 = phi i32 [ %51, %._crit_edge72 ], [ %29, %.preheader56 ]
  %36 = phi i32 [ %52, %._crit_edge72 ], [ %.pre94, %.preheader56 ]
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %._crit_edge72 ], [ 1, %.preheader56 ]
  %.not5569 = icmp slt i32 %36, 1
  br i1 %.not5569, label %._crit_edge72, label %.lr.ph71

._crit_edge75:                                    ; preds = %._crit_edge72, %.preheader56
  %37 = phi i32 [ %.pre94, %.preheader56 ], [ %52, %._crit_edge72 ]
  %.lcssa = phi i32 [ %29, %.preheader56 ], [ %51, %._crit_edge72 ]
  %38 = sext i32 %.lcssa to i64
  %39 = sext i32 %37 to i64
  %40 = add nsw i32 %37, %.lcssa
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %38, i64 %39, i64 %41
  %43 = load i64, ptr %42, align 16, !tbaa !11
  %44 = getelementptr inbounds i8, ptr %42, i64 8
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = add nsw i64 %45, %43
  %47 = load i64, ptr @MOD, align 8, !tbaa !11
  %48 = srem i64 %46, %47
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %48)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

._crit_edge72.loopexit:                           ; preds = %._crit_edge68
  %.pre = load i32, ptr @n1, align 4, !tbaa !8
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %.preheader
  %51 = phi i32 [ %.pre, %._crit_edge72.loopexit ], [ %35, %.preheader ]
  %52 = phi i32 [ %83, %._crit_edge72.loopexit ], [ %36, %.preheader ]
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %53 = sext i32 %51 to i64
  %.not54.not = icmp slt i64 %indvars.iv91, %53
  br i1 %.not54.not, label %.preheader, label %._crit_edge75, !llvm.loop !16

.lr.ph71:                                         ; preds = %.preheader, %._crit_edge68
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %._crit_edge68 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %54 = add nuw nsw i64 %indvars.iv88, %indvars.iv91
  %55 = load i32, ptr @k1, align 4, !tbaa !8
  %56 = trunc nsw i64 %54 to i32
  %57 = sub nsw i32 %56, %55
  store i32 %57, ptr %1, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 1, ptr %2, align 4, !tbaa !8
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %59 = load i32, ptr %58, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %60 = sext i32 %59 to i64
  %61 = icmp sgt i64 %54, %60
  br i1 %61, label %.lr.ph64, label %._crit_edge

.lr.ph64:                                         ; preds = %.lr.ph71
  %62 = load i64, ptr @MOD, align 8
  %63 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %indvars.iv91, i64 %indvars.iv88, i64 %54
  br label %72

._crit_edge:                                      ; preds = %81, %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %64 = load i32, ptr @k2, align 4, !tbaa !8
  %65 = sub nsw i32 %56, %64
  store i32 %65, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 1, ptr %4, align 4, !tbaa !8
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %67 = load i32, ptr %66, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %68 = sext i32 %67 to i64
  %69 = icmp sgt i64 %54, %68
  br i1 %69, label %.lr.ph67, label %._crit_edge68

.lr.ph67:                                         ; preds = %._crit_edge
  %70 = load i64, ptr @MOD, align 8
  %71 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %indvars.iv91, i64 %indvars.iv88, i64 %54, i64 1
  br label %85

72:                                               ; preds = %.lr.ph64, %81
  %indvars.iv82 = phi i64 [ %60, %.lr.ph64 ], [ %indvars.iv.next83, %81 ]
  %73 = sub nsw i64 %indvars.iv82, %indvars.iv88
  %74 = icmp sgt i64 %73, -1
  br i1 %74, label %75, label %81

75:                                               ; preds = %72
  %76 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %73, i64 %indvars.iv88, i64 %indvars.iv82, i64 1
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = load i64, ptr %63, align 16, !tbaa !11
  %79 = add nsw i64 %78, %77
  %80 = srem i64 %79, %62
  store i64 %80, ptr %63, align 16, !tbaa !11
  br label %81

81:                                               ; preds = %72, %75
  %indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
  %82 = icmp slt i64 %indvars.iv.next83, %54
  br i1 %82, label %72, label %._crit_edge, !llvm.loop !18

._crit_edge68:                                    ; preds = %94, %._crit_edge
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %83 = load i32, ptr @n2, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %.not55.not = icmp slt i64 %indvars.iv88, %84
  br i1 %.not55.not, label %.lr.ph71, label %._crit_edge72.loopexit, !llvm.loop !19

85:                                               ; preds = %.lr.ph67, %94
  %indvars.iv85 = phi i64 [ %68, %.lr.ph67 ], [ %indvars.iv.next86, %94 ]
  %86 = sub nsw i64 %indvars.iv85, %indvars.iv91
  %87 = icmp sgt i64 %86, -1
  br i1 %87, label %88, label %94

88:                                               ; preds = %85
  %89 = getelementptr inbounds [101 x [101 x [201 x [2 x i64]]]], ptr @dp, i64 0, i64 %indvars.iv91, i64 %86, i64 %indvars.iv85
  %90 = load i64, ptr %89, align 16, !tbaa !11
  %91 = load i64, ptr %71, align 8, !tbaa !11
  %92 = add nsw i64 %91, %90
  %93 = srem i64 %92, %70
  store i64 %93, ptr %71, align 8, !tbaa !11
  br label %94

94:                                               ; preds = %85, %88
  %indvars.iv.next86 = add nsw i64 %indvars.iv85, 1
  %95 = icmp slt i64 %indvars.iv.next86, %54
  br i1 %95, label %85, label %._crit_edge68, !llvm.loop !20
}

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

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

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 #1

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

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

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

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

; 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 #5 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 #5 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)) #6

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

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

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


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