; LLVM IR from eyangch/competitive-programming :: Codeforces/1426 (f)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@MOD = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@dp = external dso_local global [4 x [3 x i64]], align 16
@p3 = external dso_local global [300000 x i64], align 16
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i8, align 1
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store ptr @_Z1sB5cxx11, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %20 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  %21 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %22 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  br label %24

24:                                               ; preds = %36, %0
  %25 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %38

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  %28 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %29 = load i8, ptr %28, align 1, !tbaa !11
  store i8 %29, ptr %5, align 1, !tbaa !11
  %30 = load i8, ptr %5, align 1, !tbaa !11
  %31 = sext i8 %30 to i32
  %32 = icmp eq i32 %31, 63
  %33 = zext i1 %32 to i64
  %34 = load i64, ptr @K, align 8, !tbaa !12
  %35 = add nsw i64 %34, %33
  store i64 %35, ptr @K, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  br label %36

36:                                               ; preds = %27
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  br label %24

38:                                               ; preds = %26
  store i64 1, ptr @p3, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 1, ptr %6, align 8, !tbaa !12
  br label %39

39:                                               ; preds = %53, %38
  %40 = load i64, ptr %6, align 8, !tbaa !12
  %41 = icmp slt i64 %40, 300000
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %39
  %44 = load i64, ptr %6, align 8, !tbaa !12
  %45 = sub nsw i64 %44, 1
  %46 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !12
  %48 = mul nsw i64 3, %47
  %49 = load i64, ptr @MOD, align 8, !tbaa !12
  %50 = srem i64 %48, %49
  %51 = load i64, ptr %6, align 8, !tbaa !12
  %52 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %51
  store i64 %50, ptr %52, align 8, !tbaa !12
  br label %53

53:                                               ; preds = %43
  %54 = load i64, ptr %6, align 8, !tbaa !12
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %6, align 8, !tbaa !12
  br label %39, !llvm.loop !14

56:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !12
  br label %57

57:                                               ; preds = %146, %56
  %58 = load i64, ptr %7, align 8, !tbaa !12
  %59 = load i64, ptr @N, align 8, !tbaa !12
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %149

62:                                               ; preds = %57
  %63 = load i64, ptr %7, align 8, !tbaa !12
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %63)
  %65 = load i8, ptr %64, align 1, !tbaa !11
  %66 = sext i8 %65 to i32
  %67 = icmp eq i32 %66, 97
  br i1 %67, label %68, label %71

68:                                               ; preds = %62
  %69 = load i64, ptr @dp, align 16, !tbaa !12
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr @dp, align 16, !tbaa !12
  br label %120

71:                                               ; preds = %62
  %72 = load i64, ptr %7, align 8, !tbaa !12
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %72)
  %74 = load i8, ptr %73, align 1, !tbaa !11
  %75 = sext i8 %74 to i32
  %76 = icmp eq i32 %75, 98
  br i1 %76, label %77, label %84

77:                                               ; preds = %71
  %78 = load i64, ptr @dp, align 16, !tbaa !12
  %79 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  %80 = add nsw i64 %79, %78
  store i64 %80, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  %81 = load i64, ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  %82 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !12
  %83 = add nsw i64 %82, %81
  store i64 %83, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !12
  br label %119

84:                                               ; preds = %71
  %85 = load i64, ptr %7, align 8, !tbaa !12
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %85)
  %87 = load i8, ptr %86, align 1, !tbaa !11
  %88 = sext i8 %87 to i32
  %89 = icmp eq i32 %88, 99
  br i1 %89, label %90, label %100

90:                                               ; preds = %84
  %91 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  %92 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 2), align 16, !tbaa !12
  %93 = add nsw i64 %92, %91
  store i64 %93, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 2), align 16, !tbaa !12
  %94 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !12
  %95 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 2), align 8, !tbaa !12
  %96 = add nsw i64 %95, %94
  store i64 %96, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 2), align 8, !tbaa !12
  %97 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 1), align 8, !tbaa !12
  %98 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 2), align 16, !tbaa !12
  %99 = add nsw i64 %98, %97
  store i64 %99, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 2), align 16, !tbaa !12
  br label %118

100:                                              ; preds = %84
  %101 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 1), align 8, !tbaa !12
  %102 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 3), i64 0, i64 2), align 8, !tbaa !12
  %103 = add nsw i64 %102, %101
  store i64 %103, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 3), i64 0, i64 2), align 8, !tbaa !12
  %104 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !12
  %105 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 2), align 16, !tbaa !12
  %106 = add nsw i64 %105, %104
  store i64 %106, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 2), align 16, !tbaa !12
  %107 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  %108 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 2), align 8, !tbaa !12
  %109 = add nsw i64 %108, %107
  store i64 %109, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 2), align 8, !tbaa !12
  %110 = load i64, ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  %111 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 1), align 8, !tbaa !12
  %112 = add nsw i64 %111, %110
  store i64 %112, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 1), align 8, !tbaa !12
  %113 = load i64, ptr @dp, align 16, !tbaa !12
  %114 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !12
  %115 = add nsw i64 %114, %113
  store i64 %115, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !12
  %116 = load i64, ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  %117 = add nsw i64 %116, 1
  store i64 %117, ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  br label %118

118:                                              ; preds = %100, %90
  br label %119

119:                                              ; preds = %118, %77
  br label %120

120:                                              ; preds = %119, %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !12
  br label %121

121:                                              ; preds = %142, %120
  %122 = load i64, ptr %9, align 8, !tbaa !12
  %123 = icmp slt i64 %122, 4
  br i1 %123, label %125, label %124

124:                                              ; preds = %121
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %145

125:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !12
  br label %126

126:                                              ; preds = %138, %125
  %127 = load i64, ptr %10, align 8, !tbaa !12
  %128 = icmp slt i64 %127, 3
  br i1 %128, label %130, label %129

129:                                              ; preds = %126
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %141

130:                                              ; preds = %126
  %131 = load i64, ptr @MOD, align 8, !tbaa !12
  %132 = load i64, ptr %9, align 8, !tbaa !12
  %133 = getelementptr inbounds [4 x [3 x i64]], ptr @dp, i64 0, i64 %132
  %134 = load i64, ptr %10, align 8, !tbaa !12
  %135 = getelementptr inbounds [3 x i64], ptr %133, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !12
  %137 = srem i64 %136, %131
  store i64 %137, ptr %135, align 8, !tbaa !12
  br label %138

138:                                              ; preds = %130
  %139 = load i64, ptr %10, align 8, !tbaa !12
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr %10, align 8, !tbaa !12
  br label %126, !llvm.loop !16

141:                                              ; preds = %129
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %9, align 8, !tbaa !12
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %9, align 8, !tbaa !12
  br label %121, !llvm.loop !17

145:                                              ; preds = %124
  br label %146

146:                                              ; preds = %145
  %147 = load i64, ptr %7, align 8, !tbaa !12
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %7, align 8, !tbaa !12
  br label %57, !llvm.loop !18

149:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %150 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 2), align 16, !tbaa !12
  %151 = load i64, ptr @K, align 8, !tbaa !12
  %152 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !12
  %154 = mul nsw i64 %150, %153
  %155 = load i64, ptr @MOD, align 8, !tbaa !12
  %156 = srem i64 %154, %155
  store i64 %156, ptr %11, align 8, !tbaa !12
  %157 = load i64, ptr @K, align 8, !tbaa !12
  %158 = icmp sgt i64 %157, 0
  br i1 %158, label %159, label %170

159:                                              ; preds = %149
  %160 = load i64, ptr %11, align 8, !tbaa !12
  %161 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 2), align 8, !tbaa !12
  %162 = load i64, ptr @K, align 8, !tbaa !12
  %163 = sub nsw i64 %162, 1
  %164 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !12
  %166 = mul nsw i64 %161, %165
  %167 = add nsw i64 %160, %166
  %168 = load i64, ptr @MOD, align 8, !tbaa !12
  %169 = srem i64 %167, %168
  store i64 %169, ptr %11, align 8, !tbaa !12
  br label %170

170:                                              ; preds = %159, %149
  %171 = load i64, ptr @K, align 8, !tbaa !12
  %172 = icmp sgt i64 %171, 1
  br i1 %172, label %173, label %184

173:                                              ; preds = %170
  %174 = load i64, ptr %11, align 8, !tbaa !12
  %175 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 2), align 16, !tbaa !12
  %176 = load i64, ptr @K, align 8, !tbaa !12
  %177 = sub nsw i64 %176, 2
  %178 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !12
  %180 = mul nsw i64 %175, %179
  %181 = add nsw i64 %174, %180
  %182 = load i64, ptr @MOD, align 8, !tbaa !12
  %183 = srem i64 %181, %182
  store i64 %183, ptr %11, align 8, !tbaa !12
  br label %184

184:                                              ; preds = %173, %170
  %185 = load i64, ptr @K, align 8, !tbaa !12
  %186 = icmp sgt i64 %185, 2
  br i1 %186, label %187, label %198

187:                                              ; preds = %184
  %188 = load i64, ptr %11, align 8, !tbaa !12
  %189 = load i64, ptr getelementptr inbounds ([3 x i64], ptr getelementptr inbounds ([4 x [3 x i64]], ptr @dp, i64 0, i64 3), i64 0, i64 2), align 8, !tbaa !12
  %190 = load i64, ptr @K, align 8, !tbaa !12
  %191 = sub nsw i64 %190, 3
  %192 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %191
  %193 = load i64, ptr %192, align 8, !tbaa !12
  %194 = mul nsw i64 %189, %193
  %195 = add nsw i64 %188, %194
  %196 = load i64, ptr @MOD, align 8, !tbaa !12
  %197 = srem i64 %195, %196
  store i64 %197, ptr %11, align 8, !tbaa !12
  br label %198

198:                                              ; preds = %187, %184
  %199 = load i64, ptr %11, align 8, !tbaa !12
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %199)
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %200, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %202 = load i32, ptr %1, align 4
  ret i32 %202
}

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 @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 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) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

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

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


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local local_unnamed_addr global i64, align 8
@dp = external dso_local local_unnamed_addr global [4 x [3 x i64]], align 16
@p3 = external dso_local local_unnamed_addr global [300000 x i64], align 16
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %11 = tail call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  store ptr %11, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %12 = tail call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  store ptr %12, ptr %2, align 8
  %13 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  store i64 1, ptr @p3, align 16, !tbaa !8
  %14 = load i64, ptr @MOD, align 8, !tbaa !8
  br label %25

.lr.ph:                                           ; preds = %0, %.lr.ph
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = icmp eq i8 %16, 63
  %18 = zext i1 %17 to i64
  %19 = load i64, ptr @K, align 8, !tbaa !8
  %20 = add nsw i64 %19, %18
  store i64 %20, ptr @K, align 8, !tbaa !8
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  br i1 %22, label %.lr.ph, label %._crit_edge

.preheader31:                                     ; preds = %25
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph36, label %.preheader31.._crit_edge37_crit_edge

.preheader31.._crit_edge37_crit_edge:             ; preds = %.preheader31
  %.pre42 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !8
  br label %._crit_edge37

25:                                               ; preds = %31, %._crit_edge
  %26 = phi i64 [ 1, %._crit_edge ], [ %33, %31 ]
  %.02432 = phi i64 [ 1, %._crit_edge ], [ %35, %31 ]
  %27 = mul nsw i64 %26, 3
  %28 = srem i64 %27, %14
  %29 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %.02432
  store i64 %28, ptr %29, align 8, !tbaa !8
  %30 = add nuw nsw i64 %.02432, 1
  %exitcond.not = icmp eq i64 %30, 300000
  br i1 %exitcond.not, label %.preheader31, label %31, !llvm.loop !12

31:                                               ; preds = %25
  %32 = mul nsw i64 %28, 3
  %33 = srem i64 %32, %14
  %34 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %30
  store i64 %33, ptr %34, align 8, !tbaa !8
  %35 = add nuw nsw i64 %.02432, 2
  br label %25

._crit_edge37:                                    ; preds = %.preheader, %.preheader31.._crit_edge37_crit_edge
  %36 = phi i64 [ %14, %.preheader31.._crit_edge37_crit_edge ], [ %93, %.preheader ]
  %37 = phi i64 [ %.pre42, %.preheader31.._crit_edge37_crit_edge ], [ %97, %.preheader ]
  %38 = load i64, ptr @K, align 8, !tbaa !8
  %39 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !8
  %41 = mul nsw i64 %40, %37
  %42 = srem i64 %41, %36
  %43 = icmp sgt i64 %38, 0
  br i1 %43, label %118, label %.thread29

.lr.ph36:                                         ; preds = %.preheader31, %.preheader
  %.02335 = phi i64 [ %115, %.preheader ], [ 0, %.preheader31 ]
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %.02335)
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = icmp eq i8 %45, 97
  br i1 %46, label %47, label %50

47:                                               ; preds = %.lr.ph36
  %48 = load i64, ptr @dp, align 16, !tbaa !8
  %49 = add nsw i64 %48, 1
  %.pre40 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !8
  %.pre41 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !8
  br label %.preheader

50:                                               ; preds = %.lr.ph36
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %.02335)
  %52 = load i8, ptr %51, align 1, !tbaa !11
  %53 = icmp eq i8 %52, 98
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  %55 = load i64, ptr @dp, align 16, !tbaa !8
  %56 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !8
  %57 = add nsw i64 %56, %55
  %58 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 24), align 8, !tbaa !8
  %59 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !8
  %60 = add nsw i64 %59, %58
  br label %.preheader

61:                                               ; preds = %50
  %62 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %.02335)
  %63 = load i8, ptr %62, align 1, !tbaa !11
  %64 = icmp eq i8 %63, 99
  br i1 %64, label %65, label %75

65:                                               ; preds = %61
  %66 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !8
  %67 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !8
  %68 = add nsw i64 %67, %66
  store i64 %68, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !8
  %69 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !8
  %70 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !8
  %71 = add nsw i64 %70, %69
  store i64 %71, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !8
  %72 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 56), align 8, !tbaa !8
  %73 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 64), align 16, !tbaa !8
  %74 = add nsw i64 %73, %72
  store i64 %74, ptr getelementptr inbounds (i8, ptr @dp, i64 64), align 16, !tbaa !8
  %.pre = load i64, ptr @dp, align 16, !tbaa !8
  br label %.preheader

75:                                               ; preds = %61
  %76 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 56), align 8, !tbaa !8
  %77 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 88), align 8, !tbaa !8
  %78 = add nsw i64 %77, %76
  store i64 %78, ptr getelementptr inbounds (i8, ptr @dp, i64 88), align 8, !tbaa !8
  %79 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !8
  %80 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 64), align 16, !tbaa !8
  %81 = add nsw i64 %80, %79
  store i64 %81, ptr getelementptr inbounds (i8, ptr @dp, i64 64), align 16, !tbaa !8
  %82 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !8
  %83 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !8
  %84 = add nsw i64 %83, %82
  store i64 %84, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !8
  %85 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 24), align 8, !tbaa !8
  %86 = add nsw i64 %85, %76
  store i64 %86, ptr getelementptr inbounds (i8, ptr @dp, i64 56), align 8, !tbaa !8
  %87 = load i64, ptr @dp, align 16, !tbaa !8
  %88 = add nsw i64 %87, %79
  %89 = add nsw i64 %85, 1
  store i64 %89, ptr getelementptr inbounds (i8, ptr @dp, i64 24), align 8, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %54, %75, %65, %47
  %90 = phi i64 [ %60, %54 ], [ %88, %75 ], [ %69, %65 ], [ %.pre41, %47 ]
  %91 = phi i64 [ %57, %54 ], [ %82, %75 ], [ %66, %65 ], [ %.pre40, %47 ]
  %92 = phi i64 [ %55, %54 ], [ %87, %75 ], [ %.pre, %65 ], [ %49, %47 ]
  %93 = load i64, ptr @MOD, align 8, !tbaa !8
  %94 = srem i64 %92, %93
  store i64 %94, ptr @dp, align 16, !tbaa !8
  %95 = srem i64 %91, %93
  store i64 %95, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !8
  %96 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !8
  %97 = srem i64 %96, %93
  store i64 %97, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !8
  %98 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 24), align 8, !tbaa !8
  %99 = srem i64 %98, %93
  store i64 %99, ptr getelementptr inbounds (i8, ptr @dp, i64 24), align 8, !tbaa !8
  %100 = srem i64 %90, %93
  store i64 %100, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !8
  %101 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !8
  %102 = srem i64 %101, %93
  store i64 %102, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !8
  %103 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 48), align 16, !tbaa !8
  %104 = srem i64 %103, %93
  store i64 %104, ptr getelementptr inbounds (i8, ptr @dp, i64 48), align 16, !tbaa !8
  %105 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 56), align 8, !tbaa !8
  %106 = srem i64 %105, %93
  store i64 %106, ptr getelementptr inbounds (i8, ptr @dp, i64 56), align 8, !tbaa !8
  %107 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 64), align 16, !tbaa !8
  %108 = srem i64 %107, %93
  store i64 %108, ptr getelementptr inbounds (i8, ptr @dp, i64 64), align 16, !tbaa !8
  %109 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 72), align 8, !tbaa !8
  %110 = srem i64 %109, %93
  store i64 %110, ptr getelementptr inbounds (i8, ptr @dp, i64 72), align 8, !tbaa !8
  %111 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 80), align 16, !tbaa !8
  %112 = srem i64 %111, %93
  store i64 %112, ptr getelementptr inbounds (i8, ptr @dp, i64 80), align 16, !tbaa !8
  %113 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 88), align 8, !tbaa !8
  %114 = srem i64 %113, %93
  store i64 %114, ptr getelementptr inbounds (i8, ptr @dp, i64 88), align 8, !tbaa !8
  %115 = add nuw nsw i64 %.02335, 1
  %116 = load i64, ptr @N, align 8, !tbaa !8
  %117 = icmp slt i64 %115, %116
  br i1 %117, label %.lr.ph36, label %._crit_edge37, !llvm.loop !14

118:                                              ; preds = %._crit_edge37
  %119 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !8
  %120 = add nsw i64 %38, -1
  %121 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !8
  %123 = mul nsw i64 %122, %119
  %124 = add nsw i64 %123, %42
  %125 = srem i64 %124, %36
  %.not = icmp eq i64 %38, 1
  br i1 %.not, label %.thread29, label %126

126:                                              ; preds = %118
  %127 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 64), align 16, !tbaa !8
  %128 = add nsw i64 %38, -2
  %129 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = mul nsw i64 %130, %127
  %132 = add nsw i64 %131, %125
  %133 = srem i64 %132, %36
  %134 = icmp ugt i64 %38, 2
  br i1 %134, label %135, label %.thread29

135:                                              ; preds = %126
  %136 = load i64, ptr getelementptr inbounds (i8, ptr @dp, i64 88), align 8, !tbaa !8
  %137 = add nsw i64 %38, -3
  %138 = getelementptr inbounds [300000 x i64], ptr @p3, i64 0, i64 %137
  %139 = load i64, ptr %138, align 8, !tbaa !8
  %140 = mul nsw i64 %139, %136
  %141 = add nsw i64 %140, %133
  %142 = srem i64 %141, %36
  br label %.thread29

.thread29:                                        ; preds = %._crit_edge37, %118, %135, %126
  %.2 = phi i64 [ %142, %135 ], [ %133, %126 ], [ %125, %118 ], [ %42, %._crit_edge37 ]
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.2)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef nonnull @.str)
  ret i32 0
}

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 @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 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 #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

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

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


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