; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/人工智能 (主成分分析)

; 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"

%struct.PCA = type { [1001 x [1001 x double]], [1001 x [1001 x double]], [1001 x i32], i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::array" = type { [1001 x double] }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { double, %"struct.std::array" }

@pca = external dso_local global %struct.PCA, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 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 %"class.std::vector", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::array", align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::vector.0", align 8
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @stdin, align 8, !tbaa !5
  %16 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %15)
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #7
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %17 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %3, ptr noundef %4)
          to label %18 unwind label %24

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

19:                                               ; preds = %49, %18
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %28, label %23

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

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
  br label %105

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8008, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 8008, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %40, %28
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = load i32, ptr %4, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm1001EEixEm(ptr noundef nonnull align 8 dereferenceable(8008) %9, i64 noundef %36) #7
  %38 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %37)
          to label %39 unwind label %43

39:                                               ; preds = %34
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %10, align 4, !tbaa !9
  br label %29, !llvm.loop !11

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

47:                                               ; preds = %33
  invoke void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8008) %9)
          to label %48 unwind label %52

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8008, ptr %9) #7
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %7, align 4, !tbaa !9
  br label %19, !llvm.loop !13

52:                                               ; preds = %47
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %5, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %6, align 4
  br label %56

56:                                               ; preds = %52, %43
  call void @llvm.lifetime.end.p0(i64 8008, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %105

57:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %58 = call i64 @clock() #7
  store i64 %58, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  invoke void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %59 unwind label %67

59:                                               ; preds = %57
  %60 = load i32, ptr %4, align 4, !tbaa !9
  invoke void @_ZN3PCA5solveESt6vectorISt5arrayIdLm1001EESaIS2_EEiPS2_(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8 %12, ptr noundef nonnull align 8 dereferenceable(16036024) @pca, ptr noundef %13, i32 noundef %60, ptr noundef null)
          to label %61 unwind label %71

61:                                               ; preds = %59
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %83, %61
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = load i32, ptr %4, align 4, !tbaa !9
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %75, label %66

66:                                               ; preds = %62
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %90

67:                                               ; preds = %57
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %5, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %6, align 4
  br label %104

71:                                               ; preds = %59
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %5, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %6, align 4
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  br label %104

75:                                               ; preds = %62
  %76 = load i32, ptr %14, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 8 dereferenceable(8016) ptr @_ZNSt6vectorISt4pairIdSt5arrayIdLm1001EEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %77) #7
  %79 = getelementptr inbounds %"struct.std::pair", ptr %78, i32 0, i32 0
  %80 = load double, ptr %79, align 8, !tbaa !16
  %81 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %80)
          to label %82 unwind label %86

82:                                               ; preds = %75
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %14, align 4, !tbaa !9
  br label %62, !llvm.loop !20

86:                                               ; preds = %75
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %5, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %103

90:                                               ; preds = %66
  %91 = call i64 @clock() #7
  %92 = load i64, ptr %11, align 8, !tbaa !14
  %93 = sub nsw i64 %91, %92
  %94 = sitofp i64 %93 to double
  %95 = fdiv double %94, 1.000000e+06
  %96 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %95)
          to label %97 unwind label %99

97:                                               ; preds = %90
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @_ZNSt6vectorISt4pairIdSt5arrayIdLm1001EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  %98 = load i32, ptr %1, align 4
  ret i32 %98

99:                                               ; preds = %90
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %5, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %6, align 4
  br label %103

103:                                              ; preds = %99, %86
  call void @_ZNSt6vectorISt4pairIdSt5arrayIdLm1001EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  br label %104

104:                                              ; preds = %103, %71, %67
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %105

105:                                              ; preds = %104, %56, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %5, align 8
  %108 = load i32, ptr %6, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110
}

declare ptr @freopen(ptr noundef, ptr noundef, 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8008)) #5 align 2

; Function Attrs: nounwind
declare i64 @clock() #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3PCA5solveESt6vectorISt5arrayIdLm1001EESaIS2_EEiPS2_(ptr dead_on_unwind noalias writable sret(%"class.std::vector.0") align 8, ptr noundef nonnull align 8 dereferenceable(16036024), ptr noundef, i32 noundef, ptr noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIdSt5arrayIdLm1001EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTSSt4pairIdSt5arrayIdLm1001EEE", !18, i64 0, !19, i64 8}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTSSt5arrayIdLm1001EE", !7, i64 0}
!20 = distinct !{!20, !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"

%struct.PCA = type { [1001 x [1001 x double]], [1001 x [1001 x double]], [1001 x i32], i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<double, 1001>, std::allocator<std::array<double, 1001>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::array" = type { [1001 x double] }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, std::array<double, 1001>>, std::allocator<std::pair<double, std::array<double, 1001>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@pca = external dso_local global %struct.PCA, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 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 %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::array", align 8
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = load ptr, ptr @stdin, align 8, !tbaa !5
  %8 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #8
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %10 = load i32, ptr %2, align 4, !tbaa !9
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph22, label %._crit_edge23

._crit_edge23:                                    ; preds = %20, %0
  %12 = call i64 @clock() #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  invoke void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %26 unwind label %36

.lr.ph22:                                         ; preds = %0, %20
  %.01220 = phi i32 [ %21, %20 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8008, ptr nonnull %4) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(8008) %4, i8 0, i64 8008, i1 false)
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph22
  invoke void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(8008) %4)
          to label %20 unwind label %24

.lr.ph:                                           ; preds = %.lr.ph22, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph22 ]
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm1001EEixEm(ptr noundef nonnull align 8 dereferenceable(8008) %4, i64 noundef %indvars.iv) #8
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !11

20:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8008, ptr nonnull %4) #8
  %21 = add nuw nsw i32 %.01220, 1
  %22 = load i32, ptr %2, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %.lr.ph22, label %._crit_edge23, !llvm.loop !13

24:                                               ; preds = %._crit_edge
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8008, ptr nonnull %4) #8
  br label %47

26:                                               ; preds = %._crit_edge23
  %27 = load i32, ptr %3, align 4, !tbaa !9
  invoke void @_ZN3PCA5solveESt6vectorISt5arrayIdLm1001EESaIS2_EEiPS2_(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.0") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16036024) @pca, ptr noundef nonnull %6, i32 noundef %27, ptr noundef null)
          to label %28 unwind label %38

28:                                               ; preds = %26
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %29 = load i32, ptr %3, align 4, !tbaa !9
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph26, label %._crit_edge27

._crit_edge27:                                    ; preds = %.lr.ph26, %28
  %31 = call i64 @clock() #8
  %32 = sub nsw i64 %31, %12
  %33 = sitofp i64 %32 to double
  %34 = fdiv double %33, 1.000000e+06
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, double noundef %34)
  call void @_ZNSt6vectorISt4pairIdSt5arrayIdLm1001EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #8
  ret i32 0

36:                                               ; preds = %._crit_edge23
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %46

38:                                               ; preds = %26
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  br label %46

.lr.ph26:                                         ; preds = %28, %.lr.ph26
  %indvars.iv29 = phi i64 [ %indvars.iv.next30, %.lr.ph26 ], [ 0, %28 ]
  %40 = call noundef nonnull align 8 dereferenceable(8016) ptr @_ZNSt6vectorISt4pairIdSt5arrayIdLm1001EEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv29) #8
  %41 = load double, ptr %40, align 8, !tbaa !14
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %41)
  %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
  %43 = load i32, ptr %3, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next30, %44
  br i1 %45, label %.lr.ph26, label %._crit_edge27, !llvm.loop !18

46:                                               ; preds = %38, %36
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  br label %47

47:                                               ; preds = %46, %24
  %.pn17 = phi { ptr, i32 } [ %25, %24 ], [ %.pn, %46 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn17
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8008)) local_unnamed_addr #6 align 2

; Function Attrs: nounwind
declare i64 @clock() local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3PCA5solveESt6vectorISt5arrayIdLm1001EESaIS2_EEiPS2_(ptr dead_on_unwind noalias writable sret(%"class.std::vector.0") align 8, ptr noundef nonnull align 8 dereferenceable(16036024), ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm1001EESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #6 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIdSt5arrayIdLm1001EEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { "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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 "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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTSSt4pairIdSt5arrayIdLm1001EEE", !16, i64 0, !17, i64 8}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSSt5arrayIdLm1001EE", !7, i64 0}
!18 = distinct !{!18, !12}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass