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

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

%"class.std::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.std::basic_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@l = external dso_local global [300 x i32], align 16
@c = external dso_local global [300 x i32], align 16
@m = external dso_local global [300 x i32], align 16
@temp = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@INF = external dso_local global i32, align 4
@res = external dso_local global i32, align 4
@dp = external dso_local global [512 x i32], align 16
@factors = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %24, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [300 x i32], ptr @l, i64 0, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %38, %27
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %28
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [300 x i32], ptr @c, i64 0, i64 %35
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %36)
  br label %38

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %3, align 4, !tbaa !5
  br label %28, !llvm.loop !11

41:                                               ; preds = %32
  %42 = load i32, ptr @INF, align 4, !tbaa !5
  store i32 %42, ptr @res, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %43

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

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

48:                                               ; preds = %43
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @factors) #7
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [300 x i32], ptr @l, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  store i32 %52, ptr @temp, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %77, %48
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = mul nsw i32 %54, %55
  %57 = load i32, ptr @temp, align 4, !tbaa !5
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %53
  %61 = load i32, ptr @temp, align 4, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = srem i32 %61, %62
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %65, label %76

65:                                               ; preds = %60
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @factors, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %66

66:                                               ; preds = %71, %65
  %67 = load i32, ptr @temp, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = srem i32 %67, %68
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %66
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr @temp, align 4, !tbaa !5
  %74 = sdiv i32 %73, %72
  store i32 %74, ptr @temp, align 4, !tbaa !5
  br label %66, !llvm.loop !12

75:                                               ; preds = %66
  br label %76

76:                                               ; preds = %75, %60
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %6, align 4, !tbaa !5
  br label %53, !llvm.loop !13

80:                                               ; preds = %59
  %81 = load i32, ptr @temp, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 1
  br i1 %82, label %83, label %84

83:                                               ; preds = %80
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @factors, ptr noundef nonnull align 4 dereferenceable(4) @temp)
  br label %84

84:                                               ; preds = %83, %80
  %85 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @factors) #7
  %86 = trunc i64 %85 to i32
  store i32 %86, ptr @s, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %125, %84
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %128

92:                                               ; preds = %87
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %94
  store i32 0, ptr %95, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %121, %92
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = load i32, ptr @s, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

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

101:                                              ; preds = %96
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [300 x i32], ptr @l, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @factors, i64 noundef %107) #7
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = srem i32 %105, %109
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %120

112:                                              ; preds = %101
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = shl i32 1, %113
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = or i32 %118, %114
  store i32 %119, ptr %117, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %112, %101
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %8, align 4, !tbaa !5
  br label %96, !llvm.loop !14

124:                                              ; preds = %100
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %7, align 4, !tbaa !5
  br label %87, !llvm.loop !15

128:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %140, %128
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = load i32, ptr @s, align 4, !tbaa !5
  %132 = shl i32 1, %131
  %133 = icmp slt i32 %130, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %129
  store i32 22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %143

135:                                              ; preds = %129
  %136 = load i32, ptr @INF, align 4, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %138
  store i32 %136, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %135
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %9, align 4, !tbaa !5
  br label %129, !llvm.loop !16

143:                                              ; preds = %134
  %144 = load i32, ptr %4, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [300 x i32], ptr @c, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = load i32, ptr %4, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %152
  store i32 %147, ptr %153, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %206, %143
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = load i32, ptr @s, align 4, !tbaa !5
  %157 = shl i32 1, %156
  %158 = icmp slt i32 %155, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %154
  store i32 25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %209

160:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %202, %160
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = load i32, ptr @n, align 4, !tbaa !5
  %164 = icmp slt i32 %162, %163
  br i1 %164, label %166, label %165

165:                                              ; preds = %161
  store i32 28, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %205

166:                                              ; preds = %161
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = load i32, ptr @INF, align 4, !tbaa !5
  %172 = icmp ne i32 %170, %171
  br i1 %172, label %173, label %201

173:                                              ; preds = %166
  %174 = load i32, ptr %10, align 4, !tbaa !5
  %175 = load i32, ptr %11, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = or i32 %174, %178
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = load i32, ptr %11, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [300 x i32], ptr @c, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = add nsw i32 %185, %189
  store i32 %190, ptr %12, align 4, !tbaa !5
  %191 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %181, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = load i32, ptr %10, align 4, !tbaa !5
  %194 = load i32, ptr %11, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = or i32 %193, %197
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %199
  store i32 %192, ptr %200, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %201

201:                                              ; preds = %173, %166
  br label %202

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

205:                                              ; preds = %165
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %10, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %10, align 4, !tbaa !5
  br label %154, !llvm.loop !18

209:                                              ; preds = %159
  %210 = load i32, ptr @s, align 4, !tbaa !5
  %211 = shl i32 1, %210
  %212 = sub nsw i32 %211, 1
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %213
  %215 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @res, ptr noundef nonnull align 4 dereferenceable(4) %214)
  %216 = load i32, ptr %215, align 4, !tbaa !5
  store i32 %216, ptr @res, align 4, !tbaa !5
  br label %217

217:                                              ; preds = %209
  %218 = load i32, ptr %4, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %4, align 4, !tbaa !5
  br label %43, !llvm.loop !19

220:                                              ; preds = %47
  %221 = load i32, ptr @res, align 4, !tbaa !5
  %222 = load i32, ptr @INF, align 4, !tbaa !5
  %223 = icmp eq i32 %221, %222
  br i1 %223, label %224, label %227

224:                                              ; preds = %220
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %225, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %231

227:                                              ; preds = %220
  %228 = load i32, ptr @res, align 4, !tbaa !5
  %229 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %228)
  %230 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %229, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %231

231:                                              ; preds = %227, %224
  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: 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 void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #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)) #4 align 2

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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.std::basic_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@l = external dso_local global [300 x i32], align 16
@c = external dso_local global [300 x i32], align 16
@m = external dso_local local_unnamed_addr global [300 x i32], align 16
@temp = external dso_local global i32, align 4
@s = external dso_local local_unnamed_addr global i32, align 4
@INF = external dso_local local_unnamed_addr global i32, align 4
@res = external dso_local global i32, align 4
@dp = external dso_local global [512 x i32], align 16
@factors = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge.thread

.preheader47:                                     ; preds = %.lr.ph
  %6 = icmp sgt i32 %9, 0
  br i1 %6, label %.lr.ph51, label %._crit_edge.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %7 = getelementptr inbounds [300 x i32], ptr @l, i64 0, i64 %indvars.iv
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %7)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = icmp slt i64 %indvars.iv.next, %10
  br i1 %11, label %.lr.ph, label %.preheader47, !llvm.loop !9

._crit_edge.thread:                               ; preds = %.preheader47, %0
  %12 = load i32, ptr @INF, align 4, !tbaa !5
  store i32 %12, ptr @res, align 4, !tbaa !5
  br label %._crit_edge80.thread

._crit_edge:                                      ; preds = %.lr.ph51
  %13 = load i32, ptr @INF, align 4, !tbaa !5
  store i32 %13, ptr @res, align 4, !tbaa !5
  %14 = icmp sgt i32 %17, 0
  br i1 %14, label %.lr.ph79, label %._crit_edge80.thread

.lr.ph51:                                         ; preds = %.preheader47, %.lr.ph51
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph51 ], [ 0, %.preheader47 ]
  %15 = getelementptr inbounds [300 x i32], ptr @c, i64 0, i64 %indvars.iv89
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next90, %18
  br i1 %19, label %.lr.ph51, label %._crit_edge, !llvm.loop !11

._crit_edge80:                                    ; preds = %._crit_edge75
  %.pre120 = load i32, ptr @INF, align 4, !tbaa !5
  %20 = icmp eq i32 %105, %.pre120
  %spec.select = select i1 %20, i32 -1, i32 %105
  br label %._crit_edge80.thread

.lr.ph79:                                         ; preds = %._crit_edge, %._crit_edge75
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %._crit_edge75 ], [ 0, %._crit_edge ]
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @factors) #9
  %21 = getelementptr inbounds [300 x i32], ptr @l, i64 0, i64 %indvars.iv111
  %22 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %22, ptr @temp, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  store i32 2, ptr %1, align 4, !tbaa !5
  %.not55 = icmp slt i32 %22, 4
  br i1 %.not55, label %._crit_edge59, label %.lr.ph58

._crit_edge59:                                    ; preds = %.loopexit, %.lr.ph79
  %.lcssa = phi i32 [ %22, %.lr.ph79 ], [ %.pr, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %23 = icmp sgt i32 %.lcssa, 1
  br i1 %23, label %37, label %38

.lr.ph58:                                         ; preds = %.lr.ph79, %.loopexit
  %.pr114 = phi i32 [ %.pr, %.loopexit ], [ %22, %.lr.ph79 ]
  %storemerge56 = phi i32 [ %35, %.loopexit ], [ 2, %.lr.ph79 ]
  %24 = srem i32 %.pr114, %storemerge56
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %.loopexit

26:                                               ; preds = %.lr.ph58
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @factors, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %temp.promoted = load i32, ptr @temp, align 4, !tbaa !5
  %28 = srem i32 %temp.promoted, %27
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %.lr.ph53, label %.loopexit

.lr.ph53:                                         ; preds = %26, %.lr.ph53
  %30 = phi i32 [ %31, %.lr.ph53 ], [ %temp.promoted, %26 ]
  %31 = sdiv i32 %30, %27
  %32 = srem i32 %31, %27
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %.lr.ph53, label %..loopexit_crit_edge, !llvm.loop !12

..loopexit_crit_edge:                             ; preds = %.lr.ph53
  store i32 %31, ptr @temp, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %26, %..loopexit_crit_edge, %.lr.ph58
  %.pr = phi i32 [ %temp.promoted, %26 ], [ %31, %..loopexit_crit_edge ], [ %.pr114, %.lr.ph58 ]
  %34 = phi i32 [ %27, %26 ], [ %27, %..loopexit_crit_edge ], [ %storemerge56, %.lr.ph58 ]
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %1, align 4, !tbaa !5
  %36 = mul nsw i32 %35, %35
  %.not = icmp sgt i32 %36, %.pr
  br i1 %.not, label %._crit_edge59, label %.lr.ph58, !llvm.loop !13

37:                                               ; preds = %._crit_edge59
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @factors, ptr noundef nonnull align 4 dereferenceable(4) @temp)
  br label %38

38:                                               ; preds = %37, %._crit_edge59
  %39 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @factors) #9
  %40 = trunc i64 %39 to i32
  store i32 %40, ptr @s, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph66, label %.preheader46

.lr.ph66:                                         ; preds = %38
  %43 = icmp sgt i32 %40, 0
  br i1 %43, label %.lr.ph66.split, label %.preheader46.thread

.preheader46.thread:                              ; preds = %.lr.ph66
  %44 = zext nneg i32 %41 to i64
  %45 = shl nuw nsw i64 %44, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @m, i8 0, i64 %45, i1 false), !tbaa !5
  br label %.lr.ph68

.preheader46:                                     ; preds = %._crit_edge63, %38
  %46 = phi i32 [ %41, %38 ], [ %67, %._crit_edge63 ]
  %47 = phi i32 [ %40, %38 ], [ %68, %._crit_edge63 ]
  %.not81 = icmp eq i32 %47, 31
  br i1 %.not81, label %._crit_edge69.thread, label %.lr.ph68

._crit_edge69.thread:                             ; preds = %.preheader46
  %48 = getelementptr inbounds [300 x i32], ptr @c, i64 0, i64 %indvars.iv111
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %indvars.iv111
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %52
  store i32 %49, ptr %53, align 4, !tbaa !5
  br label %._crit_edge75

.lr.ph68:                                         ; preds = %.preheader46.thread, %.preheader46
  %54 = phi i32 [ %40, %.preheader46.thread ], [ %47, %.preheader46 ]
  %55 = phi i32 [ %41, %.preheader46.thread ], [ %46, %.preheader46 ]
  %56 = shl nuw i32 1, %54
  %57 = load i32, ptr @INF, align 4, !tbaa !5
  %min.iters.check = icmp slt i32 %56, 8
  br i1 %min.iters.check, label %scalar.ph, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph68
  %58 = and i32 %56, 2147483640
  %n.vec = zext nneg i32 %58 to i64
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %57, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <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 ]
  %59 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %index
  %60 = getelementptr inbounds i8, ptr %59, i64 16
  store <4 x i32> %broadcast.splat, ptr %59, align 16, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %60, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %61 = icmp eq i64 %index.next, %n.vec
  br i1 %61, label %._crit_edge69, label %vector.body, !llvm.loop !14

.lr.ph66.split:                                   ; preds = %.lr.ph66, %._crit_edge63
  %62 = phi i32 [ %67, %._crit_edge63 ], [ %41, %.lr.ph66 ]
  %63 = phi i32 [ %68, %._crit_edge63 ], [ %40, %.lr.ph66 ]
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %._crit_edge63 ], [ 0, %.lr.ph66 ]
  %64 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %indvars.iv98
  store i32 0, ptr %64, align 4, !tbaa !5
  %65 = icmp sgt i32 %63, 0
  br i1 %65, label %.lr.ph62, label %._crit_edge63

.lr.ph62:                                         ; preds = %.lr.ph66.split
  %66 = getelementptr inbounds [300 x i32], ptr @l, i64 0, i64 %indvars.iv98
  br label %71

._crit_edge63.loopexit:                           ; preds = %81
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.loopexit, %.lr.ph66.split
  %67 = phi i32 [ %.pre, %._crit_edge63.loopexit ], [ %62, %.lr.ph66.split ]
  %68 = phi i32 [ %82, %._crit_edge63.loopexit ], [ %63, %.lr.ph66.split ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %69 = sext i32 %67 to i64
  %70 = icmp slt i64 %indvars.iv.next99, %69
  br i1 %70, label %.lr.ph66.split, label %.preheader46, !llvm.loop !17

71:                                               ; preds = %.lr.ph62, %81
  %indvars.iv95 = phi i64 [ 0, %.lr.ph62 ], [ %indvars.iv.next96, %81 ]
  %72 = load i32, ptr %66, align 4, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @factors, i64 noundef %indvars.iv95) #9
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = srem i32 %72, %74
  %.not45 = icmp eq i32 %75, 0
  br i1 %.not45, label %81, label %76

76:                                               ; preds = %71
  %77 = trunc nuw nsw i64 %indvars.iv95 to i32
  %78 = shl nuw i32 1, %77
  %79 = load i32, ptr %64, align 4, !tbaa !5
  %80 = or i32 %79, %78
  store i32 %80, ptr %64, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %71, %76
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %82 = load i32, ptr @s, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = icmp slt i64 %indvars.iv.next96, %83
  br i1 %84, label %71, label %._crit_edge63.loopexit, !llvm.loop !19

._crit_edge69:                                    ; preds = %vector.body, %scalar.ph, %scalar.ph.1, %scalar.ph.2, %scalar.ph.4
  %85 = getelementptr inbounds [300 x i32], ptr @c, i64 0, i64 %indvars.iv111
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %indvars.iv111
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %89
  store i32 %86, ptr %90, align 4, !tbaa !5
  %91 = icmp sgt i32 %55, 0
  br i1 %91, label %.preheader, label %._crit_edge75

scalar.ph:                                        ; preds = %.lr.ph68
  store i32 %57, ptr @dp, align 16, !tbaa !5
  %exitcond.not = icmp slt i32 %56, 2
  br i1 %exitcond.not, label %._crit_edge69, label %scalar.ph.1, !llvm.loop !20

scalar.ph.1:                                      ; preds = %scalar.ph
  store i32 %57, ptr getelementptr inbounds (i8, ptr @dp, i64 4), align 4, !tbaa !5
  %exitcond.not.1 = icmp eq i32 %54, 1
  br i1 %exitcond.not.1, label %._crit_edge69, label %scalar.ph.2, !llvm.loop !20

scalar.ph.2:                                      ; preds = %scalar.ph.1
  store i32 %57, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !5
  store i32 %57, ptr getelementptr inbounds (i8, ptr @dp, i64 12), align 4, !tbaa !5
  %exitcond.not.3 = icmp eq i32 %54, 2
  br i1 %exitcond.not.3, label %._crit_edge69, label %scalar.ph.4, !llvm.loop !20

scalar.ph.4:                                      ; preds = %scalar.ph.2
  store i32 %57, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !5
  store i32 %57, ptr getelementptr inbounds (i8, ptr @dp, i64 20), align 4, !tbaa !5
  store i32 %57, ptr getelementptr inbounds (i8, ptr @dp, i64 24), align 8, !tbaa !5
  br label %._crit_edge69

.preheader:                                       ; preds = %._crit_edge69, %._crit_edge72
  %92 = phi i32 [ %109, %._crit_edge72 ], [ %54, %._crit_edge69 ]
  %93 = phi i32 [ %110, %._crit_edge72 ], [ %55, %._crit_edge69 ]
  %94 = phi i32 [ %111, %._crit_edge72 ], [ %55, %._crit_edge69 ]
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %._crit_edge72 ], [ 0, %._crit_edge69 ]
  %95 = icmp sgt i32 %94, 0
  br i1 %95, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %.preheader
  %96 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %indvars.iv108
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr @INF, align 4, !tbaa !5
  %99 = icmp eq i32 %97, %98
  br i1 %99, label %._crit_edge72, label %.lr.ph71.split.preheader

.lr.ph71.split.preheader:                         ; preds = %.lr.ph71
  %100 = trunc nuw nsw i64 %indvars.iv108 to i32
  br label %.lr.ph71.split

._crit_edge75:                                    ; preds = %._crit_edge72, %._crit_edge69.thread, %._crit_edge69
  %.lcssa48 = phi i32 [ %56, %._crit_edge69 ], [ -2147483648, %._crit_edge69.thread ], [ %112, %._crit_edge72 ]
  %101 = add nsw i32 %.lcssa48, -1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %102
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @res, ptr noundef nonnull align 4 dereferenceable(4) %103)
  %105 = load i32, ptr %104, align 4, !tbaa !5
  store i32 %105, ptr @res, align 4, !tbaa !5
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = icmp slt i64 %indvars.iv.next112, %107
  br i1 %108, label %.lr.ph79, label %._crit_edge80, !llvm.loop !21

._crit_edge72.loopexit83:                         ; preds = %133
  %.pre119 = load i32, ptr @s, align 4, !tbaa !5
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %.lr.ph71, %._crit_edge72.loopexit83, %.preheader
  %109 = phi i32 [ %.pre119, %._crit_edge72.loopexit83 ], [ %92, %.preheader ], [ %92, %.lr.ph71 ]
  %110 = phi i32 [ %134, %._crit_edge72.loopexit83 ], [ %93, %.preheader ], [ %93, %.lr.ph71 ]
  %111 = phi i32 [ %134, %._crit_edge72.loopexit83 ], [ %94, %.preheader ], [ %94, %.lr.ph71 ]
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %112 = shl nuw i32 1, %109
  %113 = sext i32 %112 to i64
  %114 = icmp slt i64 %indvars.iv.next109, %113
  br i1 %114, label %.preheader, label %._crit_edge75, !llvm.loop !22

.lr.ph71.split:                                   ; preds = %.lr.ph71.split.preheader, %133
  %115 = phi i32 [ %93, %.lr.ph71.split.preheader ], [ %134, %133 ]
  %116 = phi i32 [ %98, %.lr.ph71.split.preheader ], [ %135, %133 ]
  %indvars.iv105 = phi i64 [ 0, %.lr.ph71.split.preheader ], [ %indvars.iv.next106, %133 ]
  %117 = load i32, ptr %96, align 4, !tbaa !5
  %.not44 = icmp eq i32 %117, %116
  br i1 %.not44, label %133, label %118

118:                                              ; preds = %.lr.ph71.split
  %119 = getelementptr inbounds [300 x i32], ptr @m, i64 0, i64 %indvars.iv105
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = or i32 %120, %100
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %122
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %124 = getelementptr inbounds [300 x i32], ptr @c, i64 0, i64 %indvars.iv105
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %125, %117
  store i32 %126, ptr %2, align 4, !tbaa !5
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %123, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = load i32, ptr %119, align 4, !tbaa !5
  %130 = or i32 %129, %100
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [512 x i32], ptr @dp, i64 0, i64 %131
  store i32 %128, ptr %132, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  %.pre116 = load i32, ptr @INF, align 4, !tbaa !5
  %.pre118 = load i32, ptr @n, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %.lr.ph71.split, %118
  %134 = phi i32 [ %115, %.lr.ph71.split ], [ %.pre118, %118 ]
  %135 = phi i32 [ %116, %.lr.ph71.split ], [ %.pre116, %118 ]
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %136 = sext i32 %134 to i64
  %137 = icmp slt i64 %indvars.iv.next106, %136
  br i1 %137, label %.lr.ph71.split, label %._crit_edge72.loopexit83, !llvm.loop !23

._crit_edge80.thread:                             ; preds = %._crit_edge80, %._crit_edge, %._crit_edge.thread
  %.lcssa132.sink = phi i32 [ -1, %._crit_edge.thread ], [ -1, %._crit_edge ], [ %spec.select, %._crit_edge80 ]
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.lcssa132.sink)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_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 #4 align 2

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

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

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

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

; 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 #4 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)) #7

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

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 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 = { 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 #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { 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, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !16, !15}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !18}
!23 = distinct !{!23, !10, !18}


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