; LLVM IR from DionysiosB/CodeForces :: 1899B-250ThousandTonsOfTNT (main)

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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %23

23:                                               ; preds = %207, %0
  %24 = load i64, ptr %2, align 8, !tbaa !5
  %25 = add nsw i64 %24, -1
  store i64 %25, ptr %2, align 8, !tbaa !5
  %26 = icmp ne i64 %24, 0
  br i1 %26, label %27, label %214

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = add nsw i64 %29, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %30, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %31 unwind label %37

31:                                               ; preds = %27
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 100000000000000000, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 1, ptr %11, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %70, %31
  %33 = load i64, ptr %11, align 8, !tbaa !5
  %34 = load i64, ptr %3, align 8, !tbaa !5
  %35 = icmp sle i64 %33, %34
  br i1 %35, label %41, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %77

37:                                               ; preds = %27
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %7, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %8, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %213

41:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %42 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %12)
          to label %43 unwind label %73

43:                                               ; preds = %41
  %44 = load i64, ptr %9, align 8, !tbaa !5
  %45 = load i64, ptr %12, align 8, !tbaa !5
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %47, label %49

47:                                               ; preds = %43
  %48 = load i64, ptr %9, align 8, !tbaa !5
  br label %51

49:                                               ; preds = %43
  %50 = load i64, ptr %12, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %49, %47
  %52 = phi i64 [ %48, %47 ], [ %50, %49 ]
  store i64 %52, ptr %9, align 8, !tbaa !5
  %53 = load i64, ptr %10, align 8, !tbaa !5
  %54 = load i64, ptr %12, align 8, !tbaa !5
  %55 = icmp sgt i64 %53, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %51
  %57 = load i64, ptr %10, align 8, !tbaa !5
  br label %60

58:                                               ; preds = %51
  %59 = load i64, ptr %12, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %58, %56
  %61 = phi i64 [ %57, %56 ], [ %59, %58 ]
  store i64 %61, ptr %10, align 8, !tbaa !5
  %62 = load i64, ptr %11, align 8, !tbaa !5
  %63 = sub nsw i64 %62, 1
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %63) #5
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = load i64, ptr %12, align 8, !tbaa !5
  %67 = add nsw i64 %65, %66
  %68 = load i64, ptr %11, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %68) #5
  store i64 %67, ptr %69, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %70

70:                                               ; preds = %60
  %71 = load i64, ptr %11, align 8, !tbaa !5
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %11, align 8, !tbaa !5
  br label %32, !llvm.loop !9

73:                                               ; preds = %41
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %7, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %212

77:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %78 = load i64, ptr %10, align 8, !tbaa !5
  %79 = load i64, ptr %9, align 8, !tbaa !5
  %80 = sub nsw i64 %78, %79
  store i64 %80, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 2, ptr %14, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %201, %77
  %82 = load i64, ptr %14, align 8, !tbaa !5
  %83 = load i64, ptr %14, align 8, !tbaa !5
  %84 = mul nsw i64 %82, %83
  %85 = load i64, ptr %3, align 8, !tbaa !5
  %86 = icmp sle i64 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %81
  store i32 7, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %204

88:                                               ; preds = %81
  %89 = load i64, ptr %3, align 8, !tbaa !5
  %90 = load i64, ptr %14, align 8, !tbaa !5
  %91 = srem i64 %89, %90
  %92 = icmp ne i64 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %88
  br label %201

94:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %95 = load i64, ptr %14, align 8, !tbaa !5
  store i64 %95, ptr %16, align 8, !tbaa !5
  store i64 100000000000000000, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %96 = load i64, ptr %14, align 8, !tbaa !5
  store i64 %96, ptr %17, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %130, %94
  %98 = load i64, ptr %17, align 8, !tbaa !5
  %99 = load i64, ptr %3, align 8, !tbaa !5
  %100 = icmp sle i64 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 10, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %134

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %103 = load i64, ptr %17, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %103) #5
  %105 = load i64, ptr %104, align 8, !tbaa !5
  %106 = load i64, ptr %17, align 8, !tbaa !5
  %107 = load i64, ptr %14, align 8, !tbaa !5
  %108 = sub nsw i64 %106, %107
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %108) #5
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = sub nsw i64 %105, %110
  store i64 %111, ptr %18, align 8, !tbaa !5
  %112 = load i64, ptr %9, align 8, !tbaa !5
  %113 = load i64, ptr %18, align 8, !tbaa !5
  %114 = icmp slt i64 %112, %113
  br i1 %114, label %115, label %117

115:                                              ; preds = %102
  %116 = load i64, ptr %9, align 8, !tbaa !5
  br label %119

117:                                              ; preds = %102
  %118 = load i64, ptr %18, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %117, %115
  %120 = phi i64 [ %116, %115 ], [ %118, %117 ]
  store i64 %120, ptr %9, align 8, !tbaa !5
  %121 = load i64, ptr %10, align 8, !tbaa !5
  %122 = load i64, ptr %18, align 8, !tbaa !5
  %123 = icmp sgt i64 %121, %122
  br i1 %123, label %124, label %126

124:                                              ; preds = %119
  %125 = load i64, ptr %10, align 8, !tbaa !5
  br label %128

126:                                              ; preds = %119
  %127 = load i64, ptr %18, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %126, %124
  %129 = phi i64 [ %125, %124 ], [ %127, %126 ]
  store i64 %129, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %130

130:                                              ; preds = %128
  %131 = load i64, ptr %14, align 8, !tbaa !5
  %132 = load i64, ptr %17, align 8, !tbaa !5
  %133 = add nsw i64 %132, %131
  store i64 %133, ptr %17, align 8, !tbaa !5
  br label %97, !llvm.loop !11

134:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %135 = load i64, ptr %10, align 8, !tbaa !5
  %136 = load i64, ptr %9, align 8, !tbaa !5
  %137 = sub nsw i64 %135, %136
  store i64 %137, ptr %19, align 8, !tbaa !5
  %138 = load i64, ptr %13, align 8, !tbaa !5
  %139 = load i64, ptr %19, align 8, !tbaa !5
  %140 = icmp sgt i64 %138, %139
  br i1 %140, label %141, label %143

141:                                              ; preds = %134
  %142 = load i64, ptr %13, align 8, !tbaa !5
  br label %145

143:                                              ; preds = %134
  %144 = load i64, ptr %19, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %143, %141
  %146 = phi i64 [ %142, %141 ], [ %144, %143 ]
  store i64 %146, ptr %13, align 8, !tbaa !5
  %147 = load i64, ptr %3, align 8, !tbaa !5
  %148 = load i64, ptr %14, align 8, !tbaa !5
  %149 = sdiv i64 %147, %148
  store i64 %149, ptr %16, align 8, !tbaa !5
  store i64 100000000000000000, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %150 = load i64, ptr %16, align 8, !tbaa !5
  store i64 %150, ptr %20, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %184, %145
  %152 = load i64, ptr %20, align 8, !tbaa !5
  %153 = load i64, ptr %3, align 8, !tbaa !5
  %154 = icmp sle i64 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 13, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %188

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %157 = load i64, ptr %20, align 8, !tbaa !5
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %157) #5
  %159 = load i64, ptr %158, align 8, !tbaa !5
  %160 = load i64, ptr %20, align 8, !tbaa !5
  %161 = load i64, ptr %16, align 8, !tbaa !5
  %162 = sub nsw i64 %160, %161
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %162) #5
  %164 = load i64, ptr %163, align 8, !tbaa !5
  %165 = sub nsw i64 %159, %164
  store i64 %165, ptr %21, align 8, !tbaa !5
  %166 = load i64, ptr %9, align 8, !tbaa !5
  %167 = load i64, ptr %21, align 8, !tbaa !5
  %168 = icmp slt i64 %166, %167
  br i1 %168, label %169, label %171

169:                                              ; preds = %156
  %170 = load i64, ptr %9, align 8, !tbaa !5
  br label %173

171:                                              ; preds = %156
  %172 = load i64, ptr %21, align 8, !tbaa !5
  br label %173

173:                                              ; preds = %171, %169
  %174 = phi i64 [ %170, %169 ], [ %172, %171 ]
  store i64 %174, ptr %9, align 8, !tbaa !5
  %175 = load i64, ptr %10, align 8, !tbaa !5
  %176 = load i64, ptr %21, align 8, !tbaa !5
  %177 = icmp sgt i64 %175, %176
  br i1 %177, label %178, label %180

178:                                              ; preds = %173
  %179 = load i64, ptr %10, align 8, !tbaa !5
  br label %182

180:                                              ; preds = %173
  %181 = load i64, ptr %21, align 8, !tbaa !5
  br label %182

182:                                              ; preds = %180, %178
  %183 = phi i64 [ %179, %178 ], [ %181, %180 ]
  store i64 %183, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %184

184:                                              ; preds = %182
  %185 = load i64, ptr %16, align 8, !tbaa !5
  %186 = load i64, ptr %20, align 8, !tbaa !5
  %187 = add nsw i64 %186, %185
  store i64 %187, ptr %20, align 8, !tbaa !5
  br label %151, !llvm.loop !12

188:                                              ; preds = %155
  %189 = load i64, ptr %10, align 8, !tbaa !5
  %190 = load i64, ptr %9, align 8, !tbaa !5
  %191 = sub nsw i64 %189, %190
  store i64 %191, ptr %19, align 8, !tbaa !5
  %192 = load i64, ptr %13, align 8, !tbaa !5
  %193 = load i64, ptr %19, align 8, !tbaa !5
  %194 = icmp sgt i64 %192, %193
  br i1 %194, label %195, label %197

195:                                              ; preds = %188
  %196 = load i64, ptr %13, align 8, !tbaa !5
  br label %199

197:                                              ; preds = %188
  %198 = load i64, ptr %19, align 8, !tbaa !5
  br label %199

199:                                              ; preds = %197, %195
  %200 = phi i64 [ %196, %195 ], [ %198, %197 ]
  store i64 %200, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %201

201:                                              ; preds = %199, %93
  %202 = load i64, ptr %14, align 8, !tbaa !5
  %203 = add nsw i64 %202, 1
  store i64 %203, ptr %14, align 8, !tbaa !5
  br label %81, !llvm.loop !13

204:                                              ; preds = %87
  %205 = load i64, ptr %13, align 8, !tbaa !5
  %206 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %205)
          to label %207 unwind label %208

207:                                              ; preds = %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %23, !llvm.loop !14

208:                                              ; preds = %204
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %7, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %212

212:                                              ; preds = %208, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %213

213:                                              ; preds = %212, %37
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %216

214:                                              ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %215 = load i32, ptr %1, align 4
  ret i32 %215

216:                                              ; preds = %213
  %217 = load ptr, ptr %7, align 8
  %218 = load i32, ptr %8, align 4
  %219 = insertvalue { ptr, i32 } poison, ptr %217, 0
  %220 = insertvalue { ptr, i32 } %219, i32 %218, 1
  resume { ptr, i32 } %220
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 = { 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 = !{!"long long", !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}


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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = add nsw i64 %8, -1
  store i64 %9, ptr %1, align 8, !tbaa !5
  %.not107 = icmp eq i64 %8, 0
  br i1 %.not107, label %._crit_edge110, label %.lr.ph109

.lr.ph109:                                        ; preds = %0, %._crit_edge105
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = add nsw i64 %11, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %12, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %13 unwind label %16

13:                                               ; preds = %.lr.ph109
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %14 = load i64, ptr %2, align 8, !tbaa !5
  %.not7277 = icmp slt i64 %14, 1
  br i1 %.not7277, label %._crit_edge105, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %15 = sub nsw i64 %21, %20
  %.not73100 = icmp slt i64 %29, 4
  br i1 %.not73100, label %._crit_edge105, label %.lr.ph104

16:                                               ; preds = %.lr.ph109
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %17

.lr.ph:                                           ; preds = %13, %.lr.ph
  %.080 = phi i64 [ %20, %.lr.ph ], [ 100000000000000000, %13 ]
  %.06279 = phi i64 [ %21, %.lr.ph ], [ 0, %13 ]
  %.06978 = phi i64 [ %28, %.lr.ph ], [ 1, %13 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %6)
  %19 = load i64, ptr %6, align 8
  %20 = call i64 @llvm.smin.i64(i64 %.080, i64 %19)
  %21 = call i64 @llvm.smax.i64(i64 %.06279, i64 %19)
  %22 = add nsw i64 %.06978, -1
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %22) #6
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = load i64, ptr %6, align 8, !tbaa !5
  %26 = add nsw i64 %25, %24
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.06978) #6
  store i64 %26, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %28 = add nuw nsw i64 %.06978, 1
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %.not72.not = icmp slt i64 %.06978, %29
  br i1 %.not72.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge105:                                   ; preds = %64, %13, %._crit_edge
  %.067.lcssa = phi i64 [ %15, %._crit_edge ], [ -100000000000000000, %13 ], [ %.168, %64 ]
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.067.lcssa)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %31 = load i64, ptr %1, align 8, !tbaa !5
  %32 = add nsw i64 %31, -1
  store i64 %32, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %31, 0
  br i1 %.not, label %._crit_edge110, label %.lr.ph109, !llvm.loop !11

.lr.ph104:                                        ; preds = %._crit_edge, %64
  %33 = phi i64 [ %65, %64 ], [ %29, %._crit_edge ]
  %.066102 = phi i64 [ %66, %64 ], [ 2, %._crit_edge ]
  %.067101 = phi i64 [ %.168, %64 ], [ %15, %._crit_edge ]
  %34 = srem i64 %33, %.066102
  %.not74 = icmp eq i64 %34, 0
  br i1 %.not74, label %.preheader, label %64

.preheader:                                       ; preds = %.lr.ph104
  %.not7582 = icmp sgt i64 %.066102, %33
  br i1 %.not7582, label %._crit_edge87, label %.lr.ph86

._crit_edge87.loopexit:                           ; preds = %.lr.ph86
  %35 = sub nsw i64 %47, %46
  br label %._crit_edge87

._crit_edge87:                                    ; preds = %._crit_edge87.loopexit, %.preheader
  %36 = phi i64 [ %33, %.preheader ], [ %49, %._crit_edge87.loopexit ]
  %37 = phi i64 [ -100000000000000000, %.preheader ], [ %35, %._crit_edge87.loopexit ]
  %38 = call i64 @llvm.smax.i64(i64 %.067101, i64 %37)
  %39 = sdiv i64 %36, %.066102
  %.not7691 = icmp sgt i64 %39, %36
  br i1 %.not7691, label %._crit_edge97, label %.lr.ph96

.lr.ph86:                                         ; preds = %.preheader, %.lr.ph86
  %.185 = phi i64 [ %46, %.lr.ph86 ], [ 100000000000000000, %.preheader ]
  %.16384 = phi i64 [ %47, %.lr.ph86 ], [ 0, %.preheader ]
  %.06583 = phi i64 [ %48, %.lr.ph86 ], [ %.066102, %.preheader ]
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.06583) #6
  %41 = load i64, ptr %40, align 8, !tbaa !5
  %42 = sub nuw nsw i64 %.06583, %.066102
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %42) #6
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = sub nsw i64 %41, %44
  %46 = call i64 @llvm.smin.i64(i64 %.185, i64 %45)
  %47 = call i64 @llvm.smax.i64(i64 %.16384, i64 %45)
  %48 = add nuw nsw i64 %.06583, %.066102
  %49 = load i64, ptr %2, align 8, !tbaa !5
  %.not75 = icmp sgt i64 %48, %49
  br i1 %.not75, label %._crit_edge87.loopexit, label %.lr.ph86, !llvm.loop !12

._crit_edge97.loopexit:                           ; preds = %.lr.ph96
  %50 = sub nsw i64 %61, %60
  br label %._crit_edge97

._crit_edge97:                                    ; preds = %._crit_edge97.loopexit, %._crit_edge87
  %51 = phi i64 [ %36, %._crit_edge87 ], [ %63, %._crit_edge97.loopexit ]
  %52 = phi i64 [ -100000000000000000, %._crit_edge87 ], [ %50, %._crit_edge97.loopexit ]
  %53 = call i64 @llvm.smax.i64(i64 %38, i64 %52)
  br label %64

.lr.ph96:                                         ; preds = %._crit_edge87, %.lr.ph96
  %.294 = phi i64 [ %60, %.lr.ph96 ], [ 100000000000000000, %._crit_edge87 ]
  %.06193 = phi i64 [ %62, %.lr.ph96 ], [ %39, %._crit_edge87 ]
  %.26492 = phi i64 [ %61, %.lr.ph96 ], [ 0, %._crit_edge87 ]
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.06193) #6
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = sub nsw i64 %.06193, %39
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %56) #6
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = sub nsw i64 %55, %58
  %60 = call i64 @llvm.smin.i64(i64 %.294, i64 %59)
  %61 = call i64 @llvm.smax.i64(i64 %.26492, i64 %59)
  %62 = add nsw i64 %.06193, %39
  %63 = load i64, ptr %2, align 8, !tbaa !5
  %.not76 = icmp sgt i64 %62, %63
  br i1 %.not76, label %._crit_edge97.loopexit, label %.lr.ph96, !llvm.loop !13

64:                                               ; preds = %.lr.ph104, %._crit_edge97
  %65 = phi i64 [ %33, %.lr.ph104 ], [ %51, %._crit_edge97 ]
  %.168 = phi i64 [ %.067101, %.lr.ph104 ], [ %53, %._crit_edge97 ]
  %66 = add nuw nsw i64 %.066102, 1
  %67 = mul nuw nsw i64 %66, %66
  %.not73 = icmp sgt i64 %67, %65
  br i1 %.not73, label %._crit_edge105, label %.lr.ph104, !llvm.loop !14

._crit_edge110:                                   ; preds = %._crit_edge105, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #5

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !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}


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