; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Epic Code/Problem G (G)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@sets = external dso_local global [100100 x %"class.std::vector"], align 16
@MOD = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; 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 %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @s, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %48, %0
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr @s, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

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

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

34:                                               ; preds = %44, %32
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %47

39:                                               ; preds = %34
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %5)
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %42
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %44

44:                                               ; preds = %39
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %6, align 4, !tbaa !5
  br label %34, !llvm.loop !9

47:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !11

51:                                               ; preds = %31
  br label %52

52:                                               ; preds = %210, %51
  %53 = load i32, ptr @m, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr @m, align 4, !tbaa !5
  %55 = icmp ne i32 %53, 0
  br i1 %55, label %56, label %211

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %7)
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = icmp eq i32 %58, 1
  br i1 %59, label %60, label %103

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %8, ptr noundef %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %63
  %65 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #6
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %65, ptr %66, align 8
  br label %67

67:                                               ; preds = %99, %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %69
  %71 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #6
  %72 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  %73 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br i1 %73, label %75, label %74

74:                                               ; preds = %67
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %102

75:                                               ; preds = %67
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %81, %76
  store i32 %82, ptr %80, align 4, !tbaa !5
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr @MOD, align 4, !tbaa !5
  %89 = icmp sge i32 %87, %88
  br i1 %89, label %90, label %98

90:                                               ; preds = %75
  %91 = load i32, ptr @MOD, align 4, !tbaa !5
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sub nsw i32 %96, %91
  store i32 %97, ptr %95, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %90, %75
  br label %99

99:                                               ; preds = %98
  %100 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #6
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %100, ptr %101, align 8
  br label %67, !llvm.loop !12

102:                                              ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %210

103:                                              ; preds = %56
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = icmp eq i32 %104, 2
  br i1 %105, label %106, label %143

106:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  %107 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %108 = load i32, ptr %13, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %109
  %111 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %110) #6
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  br label %113

113:                                              ; preds = %137, %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %115
  %117 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %116) #6
  %118 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %117, ptr %118, align 8
  %119 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br i1 %119, label %121, label %120

120:                                              ; preds = %113
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %140

121:                                              ; preds = %113
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = add nsw i32 %127, %126
  store i32 %128, ptr %14, align 4, !tbaa !5
  %129 = load i32, ptr %14, align 4, !tbaa !5
  %130 = load i32, ptr @MOD, align 4, !tbaa !5
  %131 = icmp sge i32 %129, %130
  br i1 %131, label %132, label %136

132:                                              ; preds = %121
  %133 = load i32, ptr @MOD, align 4, !tbaa !5
  %134 = load i32, ptr %14, align 4, !tbaa !5
  %135 = sub nsw i32 %134, %133
  store i32 %135, ptr %14, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %132, %121
  br label %137

137:                                              ; preds = %136
  %138 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 0) #6
  %139 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %138, ptr %139, align 8
  br label %113, !llvm.loop !13

140:                                              ; preds = %120
  %141 = load i32, ptr %14, align 4, !tbaa !5
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %141)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %209

143:                                              ; preds = %103
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = icmp eq i32 %144, 3
  br i1 %145, label %146, label %179

146:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %147 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %18, ptr noundef %19, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %148 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %148, ptr %21, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %175, %146
  %150 = load i32, ptr %21, align 4, !tbaa !5
  %151 = load i32, ptr %19, align 4, !tbaa !5
  %152 = icmp sle i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %178

154:                                              ; preds = %149
  %155 = load i32, ptr %20, align 4, !tbaa !5
  %156 = load i32, ptr %21, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = add nsw i32 %159, %155
  store i32 %160, ptr %158, align 4, !tbaa !5
  %161 = load i32, ptr %21, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr @MOD, align 4, !tbaa !5
  %166 = icmp sge i32 %164, %165
  br i1 %166, label %167, label %174

167:                                              ; preds = %154
  %168 = load i32, ptr @MOD, align 4, !tbaa !5
  %169 = load i32, ptr %21, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sub nsw i32 %172, %168
  store i32 %173, ptr %171, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %167, %154
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %21, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %21, align 4, !tbaa !5
  br label %149, !llvm.loop !14

178:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %208

179:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  %180 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %22, ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %181 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %181, ptr %25, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %202, %179
  %183 = load i32, ptr %25, align 4, !tbaa !5
  %184 = load i32, ptr %23, align 4, !tbaa !5
  %185 = icmp sle i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %205

187:                                              ; preds = %182
  %188 = load i32, ptr %25, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %24, align 4, !tbaa !5
  %193 = add nsw i32 %192, %191
  store i32 %193, ptr %24, align 4, !tbaa !5
  %194 = load i32, ptr %24, align 4, !tbaa !5
  %195 = load i32, ptr @MOD, align 4, !tbaa !5
  %196 = icmp sge i32 %194, %195
  br i1 %196, label %197, label %201

197:                                              ; preds = %187
  %198 = load i32, ptr @MOD, align 4, !tbaa !5
  %199 = load i32, ptr %24, align 4, !tbaa !5
  %200 = sub nsw i32 %199, %198
  store i32 %200, ptr %24, align 4, !tbaa !5
  br label %201

201:                                              ; preds = %197, %187
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %25, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %25, align 4, !tbaa !5
  br label %182, !llvm.loop !15

205:                                              ; preds = %186
  %206 = load i32, ptr %24, align 4, !tbaa !5
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %206)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %208

208:                                              ; preds = %205, %178
  br label %209

209:                                              ; preds = %208, %140
  br label %210

210:                                              ; preds = %209, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %52, !llvm.loop !16

211:                                              ; preds = %52
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #1

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [100100 x i32], align 16
@sets = external dso_local global [100100 x %"class.std::vector"], align 16
@MOD = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; 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 = alloca i32, align 4
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @s, ptr noundef nonnull @m)
  %17 = load i32, ptr @s, align 4, !tbaa !5
  %.not47 = icmp slt i32 %17, 1
  br i1 %.not47, label %.preheader, label %.lr.ph50

.preheader:                                       ; preds = %._crit_edge, %0
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr @m, align 4, !tbaa !5
  %.not3870 = icmp eq i32 %18, 0
  br i1 %.not3870, label %._crit_edge72, label %.lr.ph71

.lr.ph50:                                         ; preds = %0, %._crit_edge
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1)
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph50
  %23 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %indvars.iv
  br label %26

._crit_edge:                                      ; preds = %26, %.lr.ph50
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr @s, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %.not.not = icmp slt i64 %indvars.iv, %25
  br i1 %.not.not, label %.lr.ph50, label %.preheader, !llvm.loop !9

26:                                               ; preds = %.lr.ph, %26
  %.02746 = phi i32 [ 0, %.lr.ph ], [ %28, %26 ]
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2)
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %28 = add nuw nsw i32 %.02746, 1
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %26, label %._crit_edge, !llvm.loop !11

.lr.ph71:                                         ; preds = %.preheader, %155
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %3)
  %32 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %32, label %123 [
    i32 1, label %33
    i32 2, label %71
    i32 3, label %97
  ]

33:                                               ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %36
  %38 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #6
  store ptr %38, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %40
  %42 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  store ptr %42, ptr %7, align 8
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br i1 %43, label %.lr.ph61, label %._crit_edge62

._crit_edge62:                                    ; preds = %64, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %155

.lr.ph61:                                         ; preds = %33, %64
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, %44
  store i32 %50, ptr %48, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr @MOD, align 4, !tbaa !5
  %.not44 = icmp slt i32 %55, %56
  br i1 %.not44, label %64, label %57

57:                                               ; preds = %.lr.ph61
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sub nsw i32 %62, %56
  store i32 %63, ptr %61, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %.lr.ph61, %57
  %65 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %67
  %69 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %68) #6
  store ptr %69, ptr %7, align 8
  %70 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br i1 %70, label %.lr.ph61, label %._crit_edge62, !llvm.loop !12

71:                                               ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %74
  %76 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #6
  store ptr %76, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %78
  %80 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %79) #6
  store ptr %80, ptr %10, align 8
  %81 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %81, label %.lr.ph58, label %._crit_edge59

._crit_edge59:                                    ; preds = %.lr.ph58, %71
  %.025.lcssa = phi i32 [ 0, %71 ], [ %spec.select, %.lr.ph58 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.025.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br label %155

.lr.ph58:                                         ; preds = %71, %.lr.ph58
  %.02556 = phi i32 [ %spec.select, %.lr.ph58 ], [ 0, %71 ]
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %87, %.02556
  %89 = load i32, ptr @MOD, align 4, !tbaa !5
  %.not43 = icmp slt i32 %88, %89
  %90 = select i1 %.not43, i32 0, i32 %89
  %spec.select = sub nsw i32 %88, %90
  %91 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @sets, i64 0, i64 %93
  %95 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %94) #6
  store ptr %95, ptr %10, align 8
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %96, label %.lr.ph58, label %._crit_edge59, !llvm.loop !13

97:                                               ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %98 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13)
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %.not4151 = icmp sgt i32 %99, %100
  br i1 %.not4151, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %97
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = load i32, ptr @MOD, align 4, !tbaa !5
  %103 = sext i32 %99 to i64
  %104 = add i32 %100, 1
  %105 = sub i32 %100, %99
  %106 = zext i32 %105 to i64
  %107 = add nuw nsw i64 %106, 1
  %min.iters.check = icmp ult i32 %105, 7
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph54
  %indvars.iv74.ph = phi i64 [ %103, %.lr.ph54 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph54
  %n.vec = and i64 %107, 8589934584
  %ind.end = add nsw i64 %n.vec, %103
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %101, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert84 = insertelement <4 x i32> poison, i32 %102, i64 0
  %broadcast.splat85 = shufflevector <4 x i32> %broadcast.splatinsert84, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %103
  %108 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %offset.idx
  %109 = getelementptr inbounds i8, ptr %108, i64 16
  %wide.load = load <4 x i32>, ptr %108, align 4, !tbaa !5
  %wide.load83 = load <4 x i32>, ptr %109, align 4, !tbaa !5
  %110 = add nsw <4 x i32> %wide.load, %broadcast.splat
  %111 = add nsw <4 x i32> %wide.load83, %broadcast.splat
  %112 = icmp slt <4 x i32> %110, %broadcast.splat85
  %113 = icmp slt <4 x i32> %111, %broadcast.splat85
  %114 = select <4 x i1> %112, <4 x i32> zeroinitializer, <4 x i32> %broadcast.splat85
  %115 = select <4 x i1> %113, <4 x i32> zeroinitializer, <4 x i32> %broadcast.splat85
  %116 = sub nsw <4 x i32> %110, %114
  %117 = sub nsw <4 x i32> %111, %115
  store <4 x i32> %116, ptr %108, align 4, !tbaa !5
  store <4 x i32> %117, ptr %109, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %118 = icmp eq i64 %index.next, %n.vec
  br i1 %118, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %107, %n.vec
  br i1 %cmp.n, label %._crit_edge55, label %scalar.ph.preheader

._crit_edge55:                                    ; preds = %scalar.ph, %middle.block, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  br label %155

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %scalar.ph ], [ %indvars.iv74.ph, %scalar.ph.preheader ]
  %119 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv74
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = add nsw i32 %120, %101
  %.not42 = icmp slt i32 %121, %102
  %122 = select i1 %.not42, i32 0, i32 %102
  %spec.select82 = sub nsw i32 %121, %122
  store i32 %spec.select82, ptr %119, align 4, !tbaa !5
  %indvars.iv.next75 = add nsw i64 %indvars.iv74, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next75 to i32
  %exitcond.not = icmp eq i32 %104, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge55, label %scalar.ph, !llvm.loop !17

123:                                              ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #6
  %124 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %14, ptr noundef nonnull %15)
  %125 = load i32, ptr %14, align 4, !tbaa !5
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %.not3963 = icmp sgt i32 %125, %126
  br i1 %.not3963, label %._crit_edge68, label %.lr.ph67

.lr.ph67:                                         ; preds = %123
  %127 = load i32, ptr @MOD, align 4, !tbaa !5
  %128 = sext i32 %125 to i64
  %129 = add i32 %126, 1
  %130 = sub i32 %129, %125
  %131 = sub i32 %126, %125
  %xtraiter = and i32 %130, 3
  %132 = icmp ult i32 %131, 3
  br i1 %132, label %._crit_edge68.loopexit.unr-lcssa, label %.lr.ph67.new

.lr.ph67.new:                                     ; preds = %.lr.ph67
  %unroll_iter = and i32 %130, -4
  br label %138

._crit_edge68.loopexit.unr-lcssa:                 ; preds = %138, %.lr.ph67
  %spec.select45.lcssa.ph = phi i32 [ poison, %.lr.ph67 ], [ %spec.select45.3, %138 ]
  %indvars.iv77.unr = phi i64 [ %128, %.lr.ph67 ], [ %indvars.iv.next78.3, %138 ]
  %.02264.unr = phi i32 [ 0, %.lr.ph67 ], [ %spec.select45.3, %138 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge68, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge68.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv77.epil = phi i64 [ %indvars.iv.next78.epil, %.epil.preheader ], [ %indvars.iv77.unr, %._crit_edge68.loopexit.unr-lcssa ]
  %.02264.epil = phi i32 [ %spec.select45.epil, %.epil.preheader ], [ %.02264.unr, %._crit_edge68.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge68.loopexit.unr-lcssa ]
  %133 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv77.epil
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = add nsw i32 %134, %.02264.epil
  %.not40.epil = icmp slt i32 %135, %127
  %136 = select i1 %.not40.epil, i32 0, i32 %127
  %spec.select45.epil = sub nsw i32 %135, %136
  %indvars.iv.next78.epil = add nsw i64 %indvars.iv77.epil, 1
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge68, label %.epil.preheader, !llvm.loop !18

._crit_edge68:                                    ; preds = %._crit_edge68.loopexit.unr-lcssa, %.epil.preheader, %123
  %.022.lcssa = phi i32 [ 0, %123 ], [ %spec.select45.lcssa.ph, %._crit_edge68.loopexit.unr-lcssa ], [ %spec.select45.epil, %.epil.preheader ]
  %137 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.022.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  br label %155

138:                                              ; preds = %138, %.lr.ph67.new
  %indvars.iv77 = phi i64 [ %128, %.lr.ph67.new ], [ %indvars.iv.next78.3, %138 ]
  %.02264 = phi i32 [ 0, %.lr.ph67.new ], [ %spec.select45.3, %138 ]
  %niter = phi i32 [ 0, %.lr.ph67.new ], [ %niter.next.3, %138 ]
  %139 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv77
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = add nsw i32 %140, %.02264
  %.not40 = icmp slt i32 %141, %127
  %142 = select i1 %.not40, i32 0, i32 %127
  %spec.select45 = sub nsw i32 %141, %142
  %indvars.iv.next78 = add nsw i64 %indvars.iv77, 1
  %143 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv.next78
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = add nsw i32 %144, %spec.select45
  %.not40.1 = icmp slt i32 %145, %127
  %146 = select i1 %.not40.1, i32 0, i32 %127
  %spec.select45.1 = sub nsw i32 %145, %146
  %indvars.iv.next78.1 = add nsw i64 %indvars.iv77, 2
  %147 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv.next78.1
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = add nsw i32 %148, %spec.select45.1
  %.not40.2 = icmp slt i32 %149, %127
  %150 = select i1 %.not40.2, i32 0, i32 %127
  %spec.select45.2 = sub nsw i32 %149, %150
  %indvars.iv.next78.2 = add nsw i64 %indvars.iv77, 3
  %151 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv.next78.2
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = add nsw i32 %152, %spec.select45.2
  %.not40.3 = icmp slt i32 %153, %127
  %154 = select i1 %.not40.3, i32 0, i32 %127
  %spec.select45.3 = sub nsw i32 %153, %154
  %indvars.iv.next78.3 = add nsw i64 %indvars.iv77, 4
  %niter.next.3 = add i32 %niter, 4
  %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge68.loopexit.unr-lcssa, label %138, !llvm.loop !20

155:                                              ; preds = %._crit_edge59, %._crit_edge68, %._crit_edge55, %._crit_edge62
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %156 = load i32, ptr @m, align 4, !tbaa !5
  %157 = add nsw i32 %156, -1
  store i32 %157, ptr @m, align 4, !tbaa !5
  %.not38 = icmp eq i32 %156, 0
  br i1 %.not38, label %._crit_edge72, label %.lr.ph71, !llvm.loop !21

._crit_edge72:                                    ; preds = %155, %.preheader
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(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 ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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 = { nofree nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 = { nounwind }

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

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


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