; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/RAINBOW/A.ll (Z5solvev)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }

@g = external dso_local global [51 x [51 x i32]], align 16
@on = external dso_local global [51 x i32], align 16
@vis = external dso_local global [51 x i32], align 16
@n = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %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 i8, align 1
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %34, %0
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %37

27:                                               ; preds = %22
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %29
  store i32 1, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [51 x i32], ptr @vis, i64 0, i64 %32
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %27
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %1, align 4, !tbaa !5
  br label %22, !llvm.loop !9

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

38:                                               ; preds = %61, %37
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

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

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

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

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

49:                                               ; preds = %44
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %51
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [51 x i32], ptr %52, i64 0, i64 %54
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %55)
  br label %57

57:                                               ; preds = %49
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !5
  br label %44, !llvm.loop !11

60:                                               ; preds = %48
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %38, !llvm.loop !12

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

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

69:                                               ; preds = %65
  store i32 11, ptr %3, align 4
  br label %174

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

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

75:                                               ; preds = %71
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %145

76:                                               ; preds = %71
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %83, label %82

82:                                               ; preds = %76
  br label %142

83:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %128, %83
  %85 = load i32, ptr %11, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 17, ptr %3, align 4
  br label %131

89:                                               ; preds = %84
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %99

95:                                               ; preds = %89
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = icmp eq i32 %96, %97
  br i1 %98, label %99, label %100

99:                                               ; preds = %95, %89
  br label %128

100:                                              ; preds = %95
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %113, label %103

103:                                              ; preds = %100
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %10, align 4, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %107
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [51 x i32], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  store i32 %112, ptr %9, align 4, !tbaa !5
  br label %127

113:                                              ; preds = %100
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %115
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [51 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = icmp ne i32 %120, %121
  br i1 %122, label %123, label %126

123:                                              ; preds = %113
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %10, align 4, !tbaa !5
  store i32 17, ptr %3, align 4
  br label %131

126:                                              ; preds = %113
  br label %127

127:                                              ; preds = %126, %103
  br label %128

128:                                              ; preds = %127, %99
  %129 = load i32, ptr %11, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %11, align 4, !tbaa !5
  br label %84, !llvm.loop !15

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

132:                                              ; preds = %131
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = icmp slt i32 %133, 2
  br i1 %134, label %135, label %141

135:                                              ; preds = %132
  store i8 0, ptr %6, align 1, !tbaa !13
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %136 unwind label %137

136:                                              ; preds = %135
  br label %141

137:                                              ; preds = %135
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %12, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %209

141:                                              ; preds = %136, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %142

142:                                              ; preds = %141, %82
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %8, align 4, !tbaa !5
  br label %71, !llvm.loop !16

145:                                              ; preds = %75
  %146 = load i8, ptr %6, align 1, !tbaa !13, !range !17, !noundef !18
  %147 = trunc i8 %146 to i1
  br i1 %147, label %148, label %149

148:                                              ; preds = %145
  store i32 11, ptr %3, align 4
  br label %168

149:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr %7, ptr %14, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %150 = load ptr, ptr %14, align 8, !tbaa !19
  %151 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %150) #6
  %152 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %153 = load ptr, ptr %14, align 8, !tbaa !19
  %154 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %153) #6
  %155 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %154, ptr %155, align 8
  br label %156

156:                                              ; preds = %165, %149
  %157 = 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
  br i1 %157, label %159, label %158

158:                                              ; preds = %156
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %167

159:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %160 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %161 = load i32, ptr %160, align 4, !tbaa !5
  store i32 %161, ptr %17, align 4, !tbaa !5
  %162 = load i32, ptr %17, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %163
  store i32 0, ptr %164, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %165

165:                                              ; preds = %159
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %156

167:                                              ; preds = %158
  store i32 0, ptr %3, align 4
  br label %168

168:                                              ; preds = %167, %148
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  %169 = load i32, ptr %3, align 4
  switch i32 %169, label %174 [
    i32 0, label %170
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %5, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %5, align 4, !tbaa !5
  br label %65, !llvm.loop !21

174:                                              ; preds = %168, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %175

175:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %198, %175
  %177 = load i32, ptr %19, align 4, !tbaa !5
  %178 = load i32, ptr @n, align 4, !tbaa !5
  %179 = icmp sle i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %201

181:                                              ; preds = %176
  %182 = load i32, ptr %19, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %187, label %197

187:                                              ; preds = %181
  %188 = load i32, ptr %19, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [51 x i32], ptr @vis, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %197, label %193

193:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  %194 = load i32, ptr %19, align 4, !tbaa !5
  call void @_Z3dfsiRi(i32 noundef %194, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %195 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %196 = load i32, ptr %195, align 4, !tbaa !5
  store i32 %196, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %197

197:                                              ; preds = %193, %187, %181
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %19, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %19, align 4, !tbaa !5
  br label %176, !llvm.loop !22

201:                                              ; preds = %180
  %202 = load i32, ptr %18, align 4, !tbaa !5
  %203 = icmp slt i32 %202, 3
  br i1 %203, label %204, label %205

204:                                              ; preds = %201
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %205

205:                                              ; preds = %204, %201
  %206 = load i32, ptr %18, align 4, !tbaa !5
  %207 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %206)
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %207, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  ret void

209:                                              ; preds = %137
  %210 = load ptr, ptr %12, align 8
  %211 = load i32, ptr %13, align 4
  %212 = insertvalue { ptr, i32 } poison, ptr %210, 0
  %213 = insertvalue { ptr, i32 } %212, i32 %211, 1
  resume { ptr, i32 } %213
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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)) #3 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)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

@g = external dso_local global [51 x [51 x i32]], align 16
@on = external dso_local local_unnamed_addr global [51 x i32], align 16
@vis = external dso_local local_unnamed_addr global [51 x i32], align 16
@n = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %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 i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not66 = icmp slt i32 %8, 1
  br i1 %.not66, label %.loopexit.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %9 = zext nneg i32 %8 to i64
  %10 = shl nuw nsw i64 %9, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @vis, i64 4), i8 0, i64 %10, i1 false), !tbaa !5
  %11 = add nuw i32 %8, 1
  %wide.trip.count = zext i32 %11 to i64
  %12 = zext nneg i32 %8 to i64
  %min.iters.check = icmp ult i32 %8, 8
  br i1 %min.iters.check, label %.lr.ph.preheader144, label %vector.ph

.lr.ph.preheader144:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %12, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %13 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %offset.idx
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %13, align 4, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %14, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %15 = icmp eq i64 %index.next, %n.vec
  br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %12
  br i1 %cmp.n, label %.preheader63, label %.lr.ph.preheader144

.preheader63:                                     ; preds = %.lr.ph, %middle.block
  br i1 %.not66, label %.loopexit.thread, label %.preheader62

.lr.ph:                                           ; preds = %.lr.ph.preheader144, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader144 ]
  %16 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %indvars.iv
  store i32 1, ptr %16, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader63, label %.lr.ph, !llvm.loop !13

.preheader62:                                     ; preds = %.preheader63, %._crit_edge
  %17 = phi i32 [ %18, %._crit_edge ], [ %8, %.preheader63 ]
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %._crit_edge ], [ 1, %.preheader63 ]
  %.not5968 = icmp slt i32 %17, 1
  br i1 %.not5968, label %.preheader62.._crit_edge_crit_edge, label %.lr.ph70

.preheader62.._crit_edge_crit_edge:               ; preds = %.preheader62
  %.pre116 = sext i32 %17 to i64
  br label %._crit_edge

.preheader61:                                     ; preds = %._crit_edge
  %.not4989 = icmp slt i32 %18, 1
  br i1 %.not4989, label %.loopexit.thread, label %.lr.ph91

._crit_edge:                                      ; preds = %.lr.ph70, %.preheader62.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre116, %.preheader62.._crit_edge_crit_edge ], [ %22, %.lr.ph70 ]
  %18 = phi i32 [ %17, %.preheader62.._crit_edge_crit_edge ], [ %21, %.lr.ph70 ]
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %.not48.not = icmp slt i64 %indvars.iv102, %.pre-phi
  br i1 %.not48.not, label %.preheader62, label %.preheader61, !llvm.loop !14

.lr.ph70:                                         ; preds = %.preheader62, %.lr.ph70
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %.lr.ph70 ], [ 1, %.preheader62 ]
  %19 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %indvars.iv102, i64 %indvars.iv99
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %.not59.not = icmp slt i64 %indvars.iv99, %22
  br i1 %.not59.not, label %.lr.ph70, label %._crit_edge, !llvm.loop !16

.lr.ph91:                                         ; preds = %.preheader61, %._crit_edge88
  %.04590 = phi i32 [ %51, %._crit_edge88 ], [ 1, %.preheader61 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %.not5079 = icmp slt i32 %23, 1
  br i1 %.not5079, label %.critedge.critedge, label %.lr.ph83.outer

.lr.ph83.outer:                                   ; preds = %.lr.ph91, %.thread.thread
  %.ph = phi i32 [ %.pre113, %.thread.thread ], [ %23, %.lr.ph91 ]
  %.04281.ph = phi i1 [ false, %.thread.thread ], [ true, %.lr.ph91 ]
  %storemerge80.ph = phi i32 [ %40, %.thread.thread ], [ 1, %.lr.ph91 ]
  %.not5573 = icmp slt i32 %.ph, 1
  %24 = add nuw i32 %.ph, 1
  %wide.trip.count108 = zext i32 %24 to i64
  br label %.lr.ph83

._crit_edge84:                                    ; preds = %.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br i1 %.04281.ph, label %.critedge, label %41

.lr.ph83:                                         ; preds = %.lr.ph83.outer, %.thread
  %storemerge80 = phi i32 [ %39, %.thread ], [ %storemerge80.ph, %.lr.ph83.outer ]
  %25 = sext i32 %storemerge80 to i64
  %26 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %.not54 = icmp eq i32 %27, 0
  br i1 %.not54, label %.thread, label %.preheader

.preheader:                                       ; preds = %.lr.ph83
  br i1 %.not5573, label %._crit_edge78, label %.lr.ph77.preheader

.lr.ph77.preheader:                               ; preds = %.preheader
  %28 = zext i32 %storemerge80 to i64
  br label %.lr.ph77

.lr.ph77:                                         ; preds = %.lr.ph77.preheader, %36
  %indvars.iv105 = phi i64 [ 1, %.lr.ph77.preheader ], [ %indvars.iv.next106, %36 ]
  %.03975 = phi i32 [ 0, %.lr.ph77.preheader ], [ %.1, %36 ]
  %.04074 = phi i32 [ -1, %.lr.ph77.preheader ], [ %.141, %36 ]
  %29 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %indvars.iv105
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %.not56 = icmp eq i32 %30, 0
  %31 = icmp eq i64 %indvars.iv105, %28
  %or.cond = or i1 %31, %.not56
  br i1 %or.cond, label %36, label %32

32:                                               ; preds = %.lr.ph77
  %.not57 = icmp eq i32 %.03975, 0
  %33 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %25, i64 %indvars.iv105
  %34 = load i32, ptr %33, align 4, !tbaa !5
  br i1 %.not57, label %36, label %35

35:                                               ; preds = %32
  %.not58 = icmp eq i32 %34, %.04074
  br i1 %.not58, label %36, label %.thread

36:                                               ; preds = %32, %35, %.lr.ph77
  %.141 = phi i32 [ %.04074, %35 ], [ %.04074, %.lr.ph77 ], [ %34, %32 ]
  %.1 = phi i32 [ 1, %35 ], [ %.03975, %.lr.ph77 ], [ 1, %32 ]
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
  br i1 %exitcond109.not, label %._crit_edge78, label %.lr.ph77, !llvm.loop !17

._crit_edge78:                                    ; preds = %.preheader, %36
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %.thread.thread unwind label %37

37:                                               ; preds = %._crit_edge78
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  resume { ptr, i32 } %38

.thread:                                          ; preds = %35, %.lr.ph83
  %39 = add nsw i32 %storemerge80, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  %.not50.not = icmp slt i32 %storemerge80, %.ph
  br i1 %.not50.not, label %.lr.ph83, label %._crit_edge84, !llvm.loop !18

.thread.thread:                                   ; preds = %._crit_edge78
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre113 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add nsw i32 %.pre, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  %.not50.not119 = icmp slt i32 %.pre, %.pre113
  br i1 %.not50.not119, label %.lr.ph83.outer, label %._crit_edge84.thread, !llvm.loop !18

._crit_edge84.thread:                             ; preds = %.thread.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %41

41:                                               ; preds = %._crit_edge84.thread, %._crit_edge84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %42 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %42, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %43 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %43, ptr %4, align 8
  %44 = 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
  br i1 %44, label %.lr.ph87, label %._crit_edge88

.lr.ph87:                                         ; preds = %41, %.lr.ph87
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %47
  store i32 0, ptr %48, align 4, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %50 = 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
  br i1 %50, label %.lr.ph87, label %._crit_edge88

._crit_edge88:                                    ; preds = %.lr.ph87, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %51 = add nuw nsw i32 %.04590, 1
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %.not49.not = icmp slt i32 %.04590, %52
  br i1 %.not49.not, label %.lr.ph91, label %.loopexit, !llvm.loop !19

.critedge.critedge:                               ; preds = %.lr.ph91
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %.critedge

.critedge:                                        ; preds = %._crit_edge84, %.critedge.critedge
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %.pre114 = load i32, ptr @n, align 4, !tbaa !5
  br label %.loopexit

.loopexit.thread:                                 ; preds = %.preheader61, %.preheader63, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  br label %._crit_edge96.thread

.loopexit:                                        ; preds = %._crit_edge88, %.critedge
  %53 = phi i32 [ %.pre114, %.critedge ], [ %52, %._crit_edge88 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  %.not5192 = icmp slt i32 %53, 1
  br i1 %.not5192, label %._crit_edge96.thread, label %.lr.ph95

._crit_edge96:                                    ; preds = %66
  %54 = icmp slt i32 %67, 3
  br i1 %54, label %._crit_edge96.thread, label %70

.lr.ph95:                                         ; preds = %.loopexit, %66
  %55 = phi i32 [ %67, %66 ], [ 0, %.loopexit ]
  %56 = phi i32 [ %68, %66 ], [ %53, %.loopexit ]
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %66 ], [ 1, %.loopexit ]
  %57 = getelementptr inbounds [51 x i32], ptr @on, i64 0, i64 %indvars.iv110
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %.not52 = icmp eq i32 %58, 0
  br i1 %.not52, label %66, label %59

59:                                               ; preds = %.lr.ph95
  %60 = getelementptr inbounds [51 x i32], ptr @vis, i64 0, i64 %indvars.iv110
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %.not53 = icmp eq i32 %61, 0
  br i1 %.not53, label %62, label %66

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  %63 = trunc nuw nsw i64 %indvars.iv110 to i32
  call void @_Z3dfsiRi(i32 noundef %63, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %65 = load i32, ptr %64, align 4, !tbaa !5
  store i32 %65, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %.pre115 = load i32, ptr @n, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %.lr.ph95, %59, %62
  %67 = phi i32 [ %55, %.lr.ph95 ], [ %55, %59 ], [ %65, %62 ]
  %68 = phi i32 [ %56, %.lr.ph95 ], [ %56, %59 ], [ %.pre115, %62 ]
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %69 = sext i32 %68 to i64
  %.not51.not = icmp slt i64 %indvars.iv110, %69
  br i1 %.not51.not, label %.lr.ph95, label %._crit_edge96, !llvm.loop !20

._crit_edge96.thread:                             ; preds = %.loopexit.thread, %.loopexit, %._crit_edge96
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %._crit_edge96.thread, %._crit_edge96
  %71 = phi i32 [ 0, %._crit_edge96.thread ], [ %67, %._crit_edge96 ]
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %71)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  ret void
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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 #3 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 #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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


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