; LLVM IR from DionysiosB/CodeForces :: 0800-0899 (817B-MakesAndTheProduct)

; 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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = 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 %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %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 i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %17 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %17, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %18 unwind label %24

18:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 2000000000, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 2000000000, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 2000000000, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %84, %18
  %20 = load i64, ptr %10, align 8, !tbaa !5
  %21 = load i64, ptr %2, align 8, !tbaa !5
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %28, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %87

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

28:                                               ; preds = %19
  %29 = load i64, ptr %10, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %29) #5
  %31 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %30)
          to label %32 unwind label %44

32:                                               ; preds = %28
  %33 = load i64, ptr %10, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %33) #5
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = load i64, ptr %7, align 8, !tbaa !9
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %38, label %48

38:                                               ; preds = %32
  %39 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %39, ptr %9, align 8, !tbaa !9
  %40 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %40, ptr %8, align 8, !tbaa !9
  %41 = load i64, ptr %10, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %41) #5
  %43 = load i64, ptr %42, align 8, !tbaa !9
  store i64 %43, ptr %7, align 8, !tbaa !9
  br label %83

44:                                               ; preds = %28
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %5, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %176

48:                                               ; preds = %32
  %49 = load i64, ptr %7, align 8, !tbaa !9
  %50 = load i64, ptr %10, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50) #5
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = icmp slt i64 %49, %52
  br i1 %53, label %54, label %65

54:                                               ; preds = %48
  %55 = load i64, ptr %10, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %55) #5
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = load i64, ptr %8, align 8, !tbaa !9
  %59 = icmp slt i64 %57, %58
  br i1 %59, label %60, label %65

60:                                               ; preds = %54
  %61 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %61, ptr %9, align 8, !tbaa !9
  %62 = load i64, ptr %10, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %62) #5
  %64 = load i64, ptr %63, align 8, !tbaa !9
  store i64 %64, ptr %8, align 8, !tbaa !9
  br label %82

65:                                               ; preds = %54, %48
  %66 = load i64, ptr %8, align 8, !tbaa !9
  %67 = load i64, ptr %10, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %67) #5
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = icmp slt i64 %66, %69
  br i1 %70, label %71, label %81

71:                                               ; preds = %65
  %72 = load i64, ptr %10, align 8, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %72) #5
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = load i64, ptr %9, align 8, !tbaa !9
  %76 = icmp slt i64 %74, %75
  br i1 %76, label %77, label %81

77:                                               ; preds = %71
  %78 = load i64, ptr %10, align 8, !tbaa !5
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %78) #5
  %80 = load i64, ptr %79, align 8, !tbaa !9
  store i64 %80, ptr %9, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %77, %71, %65
  br label %82

82:                                               ; preds = %81, %60
  br label %83

83:                                               ; preds = %82, %38
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %10, align 8, !tbaa !5
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %10, align 8, !tbaa !5
  br label %19, !llvm.loop !11

87:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %123, %87
  %89 = load i64, ptr %14, align 8, !tbaa !5
  %90 = load i64, ptr %2, align 8, !tbaa !5
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %126

93:                                               ; preds = %88
  %94 = load i64, ptr %14, align 8, !tbaa !5
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %94) #5
  %96 = load i64, ptr %95, align 8, !tbaa !9
  %97 = load i64, ptr %7, align 8, !tbaa !9
  %98 = icmp eq i64 %96, %97
  br i1 %98, label %99, label %102

99:                                               ; preds = %93
  %100 = load i64, ptr %11, align 8, !tbaa !9
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %11, align 8, !tbaa !9
  br label %122

102:                                              ; preds = %93
  %103 = load i64, ptr %14, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %103) #5
  %105 = load i64, ptr %104, align 8, !tbaa !9
  %106 = load i64, ptr %8, align 8, !tbaa !9
  %107 = icmp eq i64 %105, %106
  br i1 %107, label %108, label %111

108:                                              ; preds = %102
  %109 = load i64, ptr %12, align 8, !tbaa !9
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %12, align 8, !tbaa !9
  br label %121

111:                                              ; preds = %102
  %112 = load i64, ptr %14, align 8, !tbaa !5
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %112) #5
  %114 = load i64, ptr %113, align 8, !tbaa !9
  %115 = load i64, ptr %9, align 8, !tbaa !9
  %116 = icmp eq i64 %114, %115
  br i1 %116, label %117, label %120

117:                                              ; preds = %111
  %118 = load i64, ptr %13, align 8, !tbaa !9
  %119 = add nsw i64 %118, 1
  store i64 %119, ptr %13, align 8, !tbaa !9
  br label %120

120:                                              ; preds = %117, %111
  br label %121

121:                                              ; preds = %120, %108
  br label %122

122:                                              ; preds = %121, %99
  br label %123

123:                                              ; preds = %122
  %124 = load i64, ptr %14, align 8, !tbaa !5
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %14, align 8, !tbaa !5
  br label %88, !llvm.loop !13

126:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !9
  %127 = load i64, ptr %11, align 8, !tbaa !9
  %128 = icmp sge i64 %127, 3
  br i1 %128, label %129, label %138

129:                                              ; preds = %126
  %130 = load i64, ptr %11, align 8, !tbaa !9
  %131 = load i64, ptr %11, align 8, !tbaa !9
  %132 = sub nsw i64 %131, 1
  %133 = mul nsw i64 %130, %132
  %134 = load i64, ptr %11, align 8, !tbaa !9
  %135 = sub nsw i64 %134, 2
  %136 = mul nsw i64 %133, %135
  %137 = sdiv i64 %136, 6
  store i64 %137, ptr %15, align 8, !tbaa !9
  br label %167

138:                                              ; preds = %126
  %139 = load i64, ptr %11, align 8, !tbaa !9
  %140 = icmp eq i64 %139, 2
  br i1 %140, label %141, label %143

141:                                              ; preds = %138
  %142 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %142, ptr %15, align 8, !tbaa !9
  br label %166

143:                                              ; preds = %138
  %144 = load i64, ptr %11, align 8, !tbaa !9
  %145 = icmp eq i64 %144, 1
  br i1 %145, label %146, label %155

146:                                              ; preds = %143
  %147 = load i64, ptr %12, align 8, !tbaa !9
  %148 = icmp sgt i64 %147, 1
  br i1 %148, label %149, label %155

149:                                              ; preds = %146
  %150 = load i64, ptr %12, align 8, !tbaa !9
  %151 = load i64, ptr %12, align 8, !tbaa !9
  %152 = sub nsw i64 %151, 1
  %153 = mul nsw i64 %150, %152
  %154 = sdiv i64 %153, 2
  store i64 %154, ptr %15, align 8, !tbaa !9
  br label %165

155:                                              ; preds = %146, %143
  %156 = load i64, ptr %11, align 8, !tbaa !9
  %157 = icmp eq i64 %156, 1
  br i1 %157, label %158, label %163

158:                                              ; preds = %155
  %159 = load i64, ptr %12, align 8, !tbaa !9
  %160 = icmp eq i64 %159, 1
  br i1 %160, label %161, label %163

161:                                              ; preds = %158
  %162 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %162, ptr %15, align 8, !tbaa !9
  br label %164

163:                                              ; preds = %158, %155
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %164

164:                                              ; preds = %163, %161
  br label %165

165:                                              ; preds = %164, %149
  br label %166

166:                                              ; preds = %165, %141
  br label %167

167:                                              ; preds = %166, %129
  %168 = load i64, ptr %15, align 8, !tbaa !9
  %169 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %168)
          to label %170 unwind label %172

170:                                              ; preds = %167
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %171 = load i32, ptr %1, align 4
  ret i32 %171

172:                                              ; preds = %167
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %5, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %176

176:                                              ; preds = %172, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %177

177:                                              ; preds = %176, %24
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %5, align 8
  %180 = load i32, ptr %6, align 4
  %181 = insertvalue { ptr, i32 } poison, ptr %179, 0
  %182 = insertvalue { ptr, i32 } %181, i32 %180, 1
  resume { ptr, i32 } %182
}

; 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 @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = 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 %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %5 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %5, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %6 unwind label %10

6:                                                ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %.lr.ph, label %.thread91

.preheader:                                       ; preds = %39
  %9 = icmp sgt i64 %41, 0
  br i1 %9, label %.lr.ph72, label %.thread91

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

.lr.ph:                                           ; preds = %6, %39
  %.05565 = phi i64 [ %40, %39 ], [ 0, %6 ]
  %.05664 = phi i64 [ %.157, %39 ], [ 2000000000, %6 ]
  %.05863 = phi i64 [ %.159, %39 ], [ 2000000000, %6 ]
  %.06062 = phi i64 [ %.161, %39 ], [ 2000000000, %6 ]
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %12)
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %16 = icmp slt i64 %15, %.06062
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %18 = load i64, ptr %17, align 8, !tbaa !9
  br i1 %16, label %39, label %19

19:                                               ; preds = %.lr.ph
  %20 = icmp slt i64 %.06062, %18
  br i1 %20, label %21, label %28

21:                                               ; preds = %19
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %23 = load i64, ptr %22, align 8, !tbaa !9
  %24 = icmp slt i64 %23, %.05863
  br i1 %24, label %25, label %28

25:                                               ; preds = %21
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %27 = load i64, ptr %26, align 8, !tbaa !9
  br label %39

28:                                               ; preds = %21, %19
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = icmp slt i64 %.05863, %30
  br i1 %31, label %32, label %39

32:                                               ; preds = %28
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = icmp slt i64 %34, %.05664
  br i1 %35, label %36, label %39

36:                                               ; preds = %32
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05565) #5
  %38 = load i64, ptr %37, align 8, !tbaa !9
  br label %39

39:                                               ; preds = %.lr.ph, %28, %32, %36, %25
  %.161 = phi i64 [ %.06062, %25 ], [ %.06062, %36 ], [ %.06062, %32 ], [ %.06062, %28 ], [ %18, %.lr.ph ]
  %.159 = phi i64 [ %27, %25 ], [ %.05863, %36 ], [ %.05863, %32 ], [ %.05863, %28 ], [ %.06062, %.lr.ph ]
  %.157 = phi i64 [ %.05863, %25 ], [ %38, %36 ], [ %.05664, %32 ], [ %.05664, %28 ], [ %.05863, %.lr.ph ]
  %40 = add nuw nsw i64 %.05565, 1
  %41 = load i64, ptr %1, align 8, !tbaa !5
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %.lr.ph, label %.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %60
  %43 = icmp sgt i64 %.154, 2
  br i1 %43, label %64, label %70

.lr.ph72:                                         ; preds = %.preheader, %60
  %.04971 = phi i64 [ %61, %60 ], [ 0, %.preheader ]
  %.05070 = phi i64 [ %.1, %60 ], [ 0, %.preheader ]
  %.05169 = phi i64 [ %.152, %60 ], [ 0, %.preheader ]
  %.05368 = phi i64 [ %.154, %60 ], [ 0, %.preheader ]
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04971) #5
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = icmp eq i64 %45, %.161
  br i1 %46, label %47, label %49

47:                                               ; preds = %.lr.ph72
  %48 = add nsw i64 %.05368, 1
  br label %60

49:                                               ; preds = %.lr.ph72
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04971) #5
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = icmp eq i64 %51, %.159
  br i1 %52, label %53, label %55

53:                                               ; preds = %49
  %54 = add nsw i64 %.05169, 1
  br label %60

55:                                               ; preds = %49
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04971) #5
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = icmp eq i64 %57, %.157
  %59 = zext i1 %58 to i64
  %spec.select = add nsw i64 %.05070, %59
  br label %60

60:                                               ; preds = %55, %47, %53
  %.154 = phi i64 [ %48, %47 ], [ %.05368, %53 ], [ %.05368, %55 ]
  %.152 = phi i64 [ %.05169, %47 ], [ %54, %53 ], [ %.05169, %55 ]
  %.1 = phi i64 [ %.05070, %47 ], [ %.05070, %53 ], [ %spec.select, %55 ]
  %61 = add nuw nsw i64 %.04971, 1
  %62 = load i64, ptr %1, align 8, !tbaa !5
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %.lr.ph72, label %._crit_edge, !llvm.loop !13

64:                                               ; preds = %._crit_edge
  %65 = add nsw i64 %.154, -1
  %66 = mul nsw i64 %65, %.154
  %67 = add nsw i64 %.154, -2
  %68 = mul nsw i64 %66, %67
  %69 = udiv i64 %68, 6
  br label %81

70:                                               ; preds = %._crit_edge
  %71 = icmp eq i64 %.154, 2
  br i1 %71, label %81, label %72

72:                                               ; preds = %70
  %73 = icmp eq i64 %.154, 1
  %74 = icmp sgt i64 %.152, 1
  %or.cond = select i1 %73, i1 %74, i1 false
  br i1 %or.cond, label %75, label %.thread91

75:                                               ; preds = %72
  %76 = add nsw i64 %.152, -1
  %77 = mul nsw i64 %76, %.152
  %78 = lshr i64 %77, 1
  br label %81

.thread91:                                        ; preds = %6, %.preheader, %72
  %79 = phi i1 [ %73, %72 ], [ false, %.preheader ], [ false, %6 ]
  %.050.lcssa848897 = phi i64 [ %.1, %72 ], [ 0, %.preheader ], [ 0, %6 ]
  %.051.lcssa838996 = phi i64 [ %.152, %72 ], [ 0, %.preheader ], [ 0, %6 ]
  %80 = icmp eq i64 %.051.lcssa838996, 1
  %or.cond3 = select i1 %79, i1 %80, i1 false
  %.050. = select i1 %or.cond3, i64 %.050.lcssa848897, i64 0
  br label %81

81:                                               ; preds = %.thread91, %70, %75, %64
  %.0 = phi i64 [ %69, %64 ], [ %78, %75 ], [ %.152, %70 ], [ %.050., %.thread91 ]
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.0)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  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 @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, 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

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 = { 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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