; LLVM IR from tangjz/acm-icpc :: codeforces/complete (796C)

; 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
@a = external dso_local global [300001 x i32], align 16
@mx = external dso_local global i32, align 4
@cnt = external dso_local global [2 x i32], align 4
@e = external dso_local global [300001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = 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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 -2000000000, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %39, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %42

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @a, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %25)
  %27 = load i32, ptr @mx, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = icmp slt i32 %27, %31
  br i1 %32, label %33, label %38

33:                                               ; preds = %22
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %37, ptr @mx, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %33, %22
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

42:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %68, %42
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr @mx, align 4, !tbaa !5
  %54 = icmp eq i32 %52, %53
  %55 = zext i1 %54 to i32
  %56 = load i32, ptr @cnt, align 4, !tbaa !5
  %57 = add nsw i32 %56, %55
  store i32 %57, ptr @cnt, align 4, !tbaa !5
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr @mx, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 1
  %64 = icmp eq i32 %61, %63
  %65 = zext i1 %64 to i32
  %66 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %67 = add nsw i32 %66, %65
  store i32 %67, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  br label %68

68:                                               ; preds = %48
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !5
  br label %43, !llvm.loop !11

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

72:                                               ; preds = %85, %71
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %88

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %78 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5, ptr noundef %6)
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %80
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %83
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %84, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %85

85:                                               ; preds = %77
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %4, align 4, !tbaa !5
  br label %72, !llvm.loop !12

88:                                               ; preds = %76
  %89 = load i32, ptr @cnt, align 4, !tbaa !5
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %91, label %150

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

92:                                               ; preds = %144, %91
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 11, ptr %8, align 4
  br label %147

97:                                               ; preds = %92
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr @mx, align 4, !tbaa !5
  %103 = icmp ne i32 %101, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %97
  br label %144

105:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %107
  %109 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #6
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  br label %111

111:                                              ; preds = %131, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %113
  %115 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #6
  %116 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %115, ptr %116, align 8
  %117 = 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 %117, label %119, label %118

118:                                              ; preds = %111
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %133

119:                                              ; preds = %111
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = load i32, ptr @mx, align 4, !tbaa !5
  %126 = sub nsw i32 %125, 1
  %127 = icmp eq i32 %124, %126
  %128 = zext i1 %127 to i32
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = add nsw i32 %129, %128
  store i32 %130, ptr %9, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %119
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br label %111, !llvm.loop !13

133:                                              ; preds = %118
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %136 = icmp eq i32 %134, %135
  br i1 %136, label %137, label %140

137:                                              ; preds = %133
  %138 = load i32, ptr @mx, align 4, !tbaa !5
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %138)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %141

140:                                              ; preds = %133
  store i32 0, ptr %8, align 4
  br label %141

141:                                              ; preds = %140, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %142 = load i32, ptr %8, align 4
  switch i32 %142, label %147 [
    i32 0, label %143
  ]

143:                                              ; preds = %141
  br label %144

144:                                              ; preds = %143, %104
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %7, align 4, !tbaa !5
  br label %92, !llvm.loop !14

147:                                              ; preds = %141, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  %148 = load i32, ptr %8, align 4
  switch i32 %148, label %213 [
    i32 11, label %149
    i32 1, label %211
  ]

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149, %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %202, %150
  %152 = load i32, ptr %12, align 4, !tbaa !5
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %154 = icmp sle i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 17, ptr %8, align 4
  br label %205

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %157 = load i32, ptr %12, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr @mx, align 4, !tbaa !5
  %162 = icmp eq i32 %160, %161
  %163 = zext i1 %162 to i32
  store i32 %163, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %164 = load i32, ptr %12, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %165
  %167 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %166) #6
  %168 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  br label %169

169:                                              ; preds = %188, %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %171
  %173 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %172) #6
  %174 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %173, ptr %174, align 8
  %175 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br i1 %175, label %177, label %176

176:                                              ; preds = %169
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %190

177:                                              ; preds = %169
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = load i32, ptr @mx, align 4, !tbaa !5
  %184 = icmp eq i32 %182, %183
  %185 = zext i1 %184 to i32
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = add nsw i32 %186, %185
  store i32 %187, ptr %13, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %177
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br label %169, !llvm.loop !15

190:                                              ; preds = %176
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = load i32, ptr @cnt, align 4, !tbaa !5
  %193 = icmp eq i32 %191, %192
  br i1 %193, label %194, label %198

194:                                              ; preds = %190
  %195 = load i32, ptr @mx, align 4, !tbaa !5
  %196 = add nsw i32 %195, 1
  %197 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %196)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %199

198:                                              ; preds = %190
  store i32 0, ptr %8, align 4
  br label %199

199:                                              ; preds = %198, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %200 = load i32, ptr %8, align 4
  switch i32 %200, label %205 [
    i32 0, label %201
  ]

201:                                              ; preds = %199
  br label %202

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

205:                                              ; preds = %199, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %206 = load i32, ptr %8, align 4
  switch i32 %206, label %213 [
    i32 17, label %207
    i32 1, label %211
  ]

207:                                              ; preds = %205
  %208 = load i32, ptr @mx, align 4, !tbaa !5
  %209 = add nsw i32 %208, 2
  %210 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %209)
  store i32 0, ptr %1, align 4
  br label %211

211:                                              ; preds = %207, %205, %147
  %212 = load i32, ptr %1, align 4
  ret i32 %212

213:                                              ; preds = %205, %147
  unreachable
}

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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: 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #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
@a = external dso_local global [300001 x i32], align 16
@mx = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global [2 x i32], align 4
@e = external dso_local global [300001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = 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 %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i32 -2000000000, ptr @mx, align 4, !tbaa !5
  %8 = load i32, ptr @n, align 4
  %.not62 = icmp slt i32 %8, 1
  br i1 %.not62, label %._crit_edge87, label %.lr.ph

.preheader61:                                     ; preds = %43
  %.not4364 = icmp slt i32 %45, 1
  br i1 %.not4364, label %._crit_edge87, label %.lr.ph66

.lr.ph66:                                         ; preds = %.preheader61
  %9 = load <2 x i32>, ptr @cnt, align 4, !tbaa !5
  %10 = add nsw i32 %44, -1
  %11 = add nuw i32 %45, 1
  %wide.trip.count = zext i32 %11 to i64
  %12 = zext nneg i32 %45 to i64
  %min.iters.check = icmp ult i32 %45, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph66
  %indvars.iv94.ph = phi i64 [ 1, %.lr.ph66 ], [ %ind.end, %middle.block ]
  %.ph = phi <2 x i32> [ %9, %.lr.ph66 ], [ %36, %middle.block ]
  %13 = insertelement <2 x i32> poison, i32 %44, i64 0
  %14 = insertelement <2 x i32> %13, i32 %10, i64 1
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph66
  %n.vec = and i64 %12, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %15 = shufflevector <2 x i32> %9, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
  %16 = shufflevector <4 x i32> %15, <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
  %17 = shufflevector <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, <4 x i32> %15, <4 x i32> <i32 5, i32 1, i32 2, i32 3>
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %44, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert125 = insertelement <4 x i32> poison, i32 %10, i64 0
  %broadcast.splat126 = shufflevector <4 x i32> %broadcast.splatinsert125, <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 ]
  %vec.phi = phi <4 x i32> [ %16, %vector.ph ], [ %24, %vector.body ]
  %vec.phi121 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
  %vec.phi122 = phi <4 x i32> [ %17, %vector.ph ], [ %30, %vector.body ]
  %vec.phi123 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %18 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %offset.idx
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %wide.load = load <4 x i32>, ptr %18, align 4, !tbaa !5
  %wide.load124 = load <4 x i32>, ptr %19, align 4, !tbaa !5
  %20 = icmp eq <4 x i32> %wide.load, %broadcast.splat
  %21 = icmp eq <4 x i32> %wide.load124, %broadcast.splat
  %22 = zext <4 x i1> %20 to <4 x i32>
  %23 = zext <4 x i1> %21 to <4 x i32>
  %24 = add <4 x i32> %vec.phi, %22
  %25 = add <4 x i32> %vec.phi121, %23
  %26 = icmp eq <4 x i32> %wide.load, %broadcast.splat126
  %27 = icmp eq <4 x i32> %wide.load124, %broadcast.splat126
  %28 = zext <4 x i1> %26 to <4 x i32>
  %29 = zext <4 x i1> %27 to <4 x i32>
  %30 = add <4 x i32> %vec.phi122, %28
  %31 = add <4 x i32> %vec.phi123, %29
  %index.next = add nuw i64 %index, 8
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %25, %24
  %33 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %bin.rdx127 = add <4 x i32> %31, %30
  %34 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx127)
  %cmp.n = icmp eq i64 %n.vec, %12
  %35 = insertelement <2 x i32> poison, i32 %33, i64 0
  %36 = insertelement <2 x i32> %35, i32 %34, i64 1
  br i1 %cmp.n, label %.preheader60, label %scalar.ph.preheader

.lr.ph:                                           ; preds = %0, %43
  %indvars.iv = phi i64 [ %indvars.iv.next, %43 ], [ 1, %0 ]
  %37 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %38 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %37)
  %39 = load i32, ptr @mx, align 4, !tbaa !5
  %40 = load i32, ptr %37, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %.lr.ph
  store i32 %40, ptr @mx, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %.lr.ph, %42
  %44 = phi i32 [ %39, %.lr.ph ], [ %40, %42 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = load i32, ptr @n, align 4
  %46 = sext i32 %45 to i64
  %.not.not = icmp slt i64 %indvars.iv, %46
  br i1 %.not.not, label %.lr.ph, label %.preheader61, !llvm.loop !13

.preheader60:                                     ; preds = %scalar.ph, %middle.block
  %47 = phi <2 x i32> [ %36, %middle.block ], [ %55, %scalar.ph ]
  store <2 x i32> %47, ptr @cnt, align 4, !tbaa !5
  %.not = icmp eq i32 %45, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph70

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %scalar.ph ], [ %indvars.iv94.ph, %scalar.ph.preheader ]
  %48 = phi <2 x i32> [ %55, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %49 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %indvars.iv94
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = insertelement <2 x i32> poison, i32 %50, i64 0
  %52 = shufflevector <2 x i32> %51, <2 x i32> poison, <2 x i32> zeroinitializer
  %53 = icmp eq <2 x i32> %52, %14
  %54 = zext <2 x i1> %53 to <2 x i32>
  %55 = add nsw <2 x i32> %48, %54
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count
  br i1 %exitcond.not, label %.preheader60, label %scalar.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph70, %.preheader60
  %56 = phi i32 [ %45, %.preheader60 ], [ %67, %.lr.ph70 ]
  %57 = load i32, ptr @cnt, align 4, !tbaa !5
  %58 = icmp ne i32 %57, 1
  %.not4476 = icmp slt i32 %56, 1
  %or.cond = or i1 %58, %.not4476
  br i1 %or.cond, label %.thread, label %.lr.ph78

.lr.ph70:                                         ; preds = %.preheader60, %.lr.ph70
  %.03569 = phi i32 [ %66, %.lr.ph70 ], [ 1, %.preheader60 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %61
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %64
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %66 = add nuw nsw i32 %.03569, 1
  %67 = load i32, ptr @n, align 4
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %.lr.ph70, label %._crit_edge, !llvm.loop !15

.lr.ph78:                                         ; preds = %._crit_edge, %.critedge
  %69 = phi i32 [ %92, %.critedge ], [ %56, %._crit_edge ]
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %.critedge ], [ 1, %._crit_edge ]
  %70 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %indvars.iv97
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load i32, ptr @mx, align 4, !tbaa !5
  %.not45 = icmp eq i32 %71, %72
  br i1 %.not45, label %73, label %.critedge

73:                                               ; preds = %.lr.ph78
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %74 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv97
  %75 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #7
  store ptr %75, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %76 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #7
  store ptr %76, ptr %4, align 8
  %77 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %77, label %.lr.ph73, label %._crit_edge74

._crit_edge74:                                    ; preds = %.lr.ph73, %73
  %.032.lcssa = phi i32 [ 0, %73 ], [ %88, %.lr.ph73 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %.not46 = icmp eq i32 %.032.lcssa, %78
  br i1 %.not46, label %94, label %._crit_edge74..critedge_crit_edge

._crit_edge74..critedge_crit_edge:                ; preds = %._crit_edge74
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.critedge

.lr.ph73:                                         ; preds = %73, %.lr.ph73
  %.03271 = phi i32 [ %88, %.lr.ph73 ], [ 0, %73 ]
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = load i32, ptr @mx, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  %86 = icmp eq i32 %83, %85
  %87 = zext i1 %86 to i32
  %88 = add nuw nsw i32 %.03271, %87
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %90 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #7
  store ptr %90, ptr %4, align 8
  %91 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %91, label %.lr.ph73, label %._crit_edge74, !llvm.loop !16

.critedge:                                        ; preds = %._crit_edge74..critedge_crit_edge, %.lr.ph78
  %92 = phi i32 [ %.pre, %._crit_edge74..critedge_crit_edge ], [ %69, %.lr.ph78 ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %93 = sext i32 %92 to i64
  %.not44.not = icmp slt i64 %indvars.iv97, %93
  br i1 %.not44.not, label %.lr.ph78, label %.thread, !llvm.loop !17

94:                                               ; preds = %._crit_edge74
  %95 = load i32, ptr @mx, align 4, !tbaa !5
  br label %127

.thread:                                          ; preds = %.critedge, %._crit_edge
  %96 = phi i32 [ %56, %._crit_edge ], [ %92, %.critedge ]
  %.not4784 = icmp slt i32 %96, 1
  br i1 %.not4784, label %._crit_edge87, label %.lr.ph86

97:                                               ; preds = %.critedge50
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %.not47.not = icmp slt i64 %indvars.iv100, %99
  br i1 %.not47.not, label %.lr.ph86, label %._crit_edge87, !llvm.loop !18

.lr.ph86:                                         ; preds = %.thread, %97
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %97 ], [ 1, %.thread ]
  %100 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %indvars.iv100
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr @mx, align 4, !tbaa !5
  %103 = icmp eq i32 %101, %102
  %104 = zext i1 %103 to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %105 = getelementptr inbounds [300001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv100
  %106 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %105) #7
  store ptr %106, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %107 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %105) #7
  store ptr %107, ptr %6, align 8
  %108 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %108, label %.lr.ph81, label %.critedge50

.critedge50:                                      ; preds = %.lr.ph81, %.lr.ph86
  %.0.lcssa = phi i32 [ %104, %.lr.ph86 ], [ %118, %.lr.ph81 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %109 = load i32, ptr @cnt, align 4, !tbaa !5
  %.not48 = icmp eq i32 %.0.lcssa, %109
  br i1 %.not48, label %122, label %97

.lr.ph81:                                         ; preds = %.lr.ph86, %.lr.ph81
  %.079 = phi i32 [ %118, %.lr.ph81 ], [ %104, %.lr.ph86 ]
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr @mx, align 4, !tbaa !5
  %116 = icmp eq i32 %114, %115
  %117 = zext i1 %116 to i32
  %118 = add nuw nsw i32 %.079, %117
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %120 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %105) #7
  store ptr %120, ptr %6, align 8
  %121 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %121, label %.lr.ph81, label %.critedge50, !llvm.loop !19

122:                                              ; preds = %.critedge50
  %123 = load i32, ptr @mx, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  br label %127

._crit_edge87:                                    ; preds = %97, %0, %.preheader61, %.thread
  %125 = load i32, ptr @mx, align 4, !tbaa !5
  %126 = add nsw i32 %125, 2
  br label %127

127:                                              ; preds = %122, %94, %._crit_edge87
  %.sink = phi i32 [ %124, %122 ], [ %95, %94 ], [ %126, %._crit_edge87 ]
  %128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.sink)
  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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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