; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x28-IDA-Star/182. 破坏正方形 (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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@e = external dso_local global i32, align 4
@st = external dso_local global [100 x i32], align 16
@squares = external dso_local global [100 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsi(i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @t)
  br label %15

15:                                               ; preds = %148, %0
  %16 = load i32, ptr @t, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr @t, align 4, !tbaa !5
  %18 = icmp ne i32 %16, 0
  br i1 %18, label %19, label %152

19:                                               ; preds = %15
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %123, %19
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %126

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

27:                                               ; preds = %119, %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %28, %29
  %31 = sub nsw i32 %30, 1
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %27
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %122

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

36:                                               ; preds = %115, %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %37, %38
  %40 = sub nsw i32 %39, 1
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp sle i32 %40, %41
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %36
  %45 = load i32, ptr @cnt, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %46
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %109, %44
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

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

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = mul nsw i32 2, %54
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %7, align 4, !tbaa !5
  %57 = load i32, ptr @cnt, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = mul nsw i32 %60, %62
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = add nsw i32 %65, %66
  store i32 %67, ptr %8, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %68 = load i32, ptr @cnt, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %72, %73
  %75 = sub nsw i32 %74, 1
  %76 = mul nsw i32 %71, %75
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = add nsw i32 %76, %77
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = add nsw i32 %78, %79
  store i32 %80, ptr %9, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %81 = load i32, ptr @cnt, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %86, %87
  %89 = sub nsw i32 %88, 1
  %90 = mul nsw i32 %85, %89
  %91 = add nsw i32 %84, %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = add nsw i32 %91, %92
  store i32 %93, ptr %10, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %83, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %94 = load i32, ptr @cnt, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add nsw i32 %99, %100
  %102 = sub nsw i32 %101, 1
  %103 = mul nsw i32 %98, %102
  %104 = add nsw i32 %97, %103
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = add nsw i32 %106, %107
  store i32 %108, ptr %11, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %109

109:                                              ; preds = %53
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %6, align 4, !tbaa !5
  br label %48, !llvm.loop !9

112:                                              ; preds = %52
  %113 = load i32, ptr @cnt, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr @cnt, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %112
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !11

118:                                              ; preds = %43
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !12

122:                                              ; preds = %34
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %2, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !13

126:                                              ; preds = %25
  call void @llvm.memset.p0.i64(ptr align 16 @st, i8 0, i64 400, i1 false)
  %127 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  br label %128

128:                                              ; preds = %138, %126
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = load i32, ptr @k, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %141

133:                                              ; preds = %128
  %134 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %135 = load i32, ptr %13, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100 x i32], ptr @st, i64 0, i64 %136
  store i32 1, ptr %137, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %133
  %139 = load i32, ptr %12, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %12, align 4, !tbaa !5
  br label %128, !llvm.loop !14

141:                                              ; preds = %132
  store i32 0, ptr @e, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %145, %141
  %143 = call noundef zeroext i1 @_Z3dfsi(i32 noundef 0)
  %144 = xor i1 %143, true
  br i1 %144, label %145, label %148

145:                                              ; preds = %142
  %146 = load i32, ptr @e, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr @e, align 4, !tbaa !5
  br label %142, !llvm.loop !15

148:                                              ; preds = %142
  %149 = load i32, ptr @e, align 4, !tbaa !5
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %149)
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %150, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %15, !llvm.loop !16

152:                                              ; preds = %15
  ret i32 0
}

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local local_unnamed_addr global i32, align 4
@st = external dso_local local_unnamed_addr global [100 x i32], align 16
@squares = external dso_local global [100 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @t)
  %7 = load i32, ptr @t, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @t, align 4, !tbaa !5
  %.not57 = icmp eq i32 %7, 0
  br i1 %.not57, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %0, %._crit_edge56
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not3646 = icmp slt i32 %10, 1
  br i1 %.not3646, label %._crit_edge49, label %.preheader39

.preheader39:                                     ; preds = %.lr.ph59, %._crit_edge45
  %11 = phi i32 [ %21, %._crit_edge45 ], [ %10, %.lr.ph59 ]
  %12 = phi i32 [ %22, %._crit_edge45 ], [ 0, %.lr.ph59 ]
  %.03147 = phi i32 [ %23, %._crit_edge45 ], [ 1, %.lr.ph59 ]
  %.not3743 = icmp sgt i32 %.03147, %11
  br i1 %.not3743, label %._crit_edge45, label %.preheader

._crit_edge49:                                    ; preds = %._crit_edge45, %.lr.ph59
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) @st, i8 0, i64 400, i1 false)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %14 = load i32, ptr @k, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph52, label %._crit_edge53

.preheader:                                       ; preds = %.preheader39, %._crit_edge
  %16 = phi i32 [ %24, %._crit_edge ], [ %11, %.preheader39 ]
  %17 = phi i32 [ %25, %._crit_edge ], [ %11, %.preheader39 ]
  %18 = phi i32 [ %26, %._crit_edge ], [ %12, %.preheader39 ]
  %19 = phi i32 [ %28, %._crit_edge ], [ %.03147, %.preheader39 ]
  %.03444 = phi i32 [ %27, %._crit_edge ], [ 1, %.preheader39 ]
  %.not3841 = icmp sgt i32 %.03147, %17
  br i1 %.not3841, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %20 = add nsw i32 %.03444, -1
  br label %29

._crit_edge45:                                    ; preds = %._crit_edge, %.preheader39
  %21 = phi i32 [ %11, %.preheader39 ], [ %24, %._crit_edge ]
  %22 = phi i32 [ %12, %.preheader39 ], [ %26, %._crit_edge ]
  %23 = add nuw nsw i32 %.03147, 1
  %.not36.not = icmp slt i32 %.03147, %21
  br i1 %.not36.not, label %.preheader39, label %._crit_edge49, !llvm.loop !9

._crit_edge:                                      ; preds = %34, %.preheader
  %24 = phi i32 [ %16, %.preheader ], [ %38, %34 ]
  %25 = phi i32 [ %17, %.preheader ], [ %38, %34 ]
  %26 = phi i32 [ %18, %.preheader ], [ %36, %34 ]
  %27 = add nuw nsw i32 %.03444, 1
  %28 = add nuw i32 %.03147, %.03444
  %.not37 = icmp sgt i32 %28, %25
  br i1 %.not37, label %._crit_edge45, label %.preheader, !llvm.loop !11

29:                                               ; preds = %.lr.ph, %34
  %30 = phi i32 [ %18, %.lr.ph ], [ %36, %34 ]
  %.03342 = phi i32 [ 1, %.lr.ph ], [ %37, %34 ]
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %31
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #7
  %33 = add nuw i32 %.03342, %.03147
  br label %39

34:                                               ; preds = %39
  %35 = load i32, ptr @cnt, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @cnt, align 4, !tbaa !5
  %37 = add nuw nsw i32 %.03342, 1
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %.not38 = icmp sgt i32 %33, %38
  br i1 %.not38, label %._crit_edge, label %29, !llvm.loop !13

39:                                               ; preds = %29, %39
  %.03240 = phi i32 [ 0, %29 ], [ %68, %39 ]
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = shl nsw i32 %40, 1
  %42 = or disjoint i32 %41, 1
  %43 = load i32, ptr @cnt, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %46 = mul nsw i32 %42, %20
  %47 = add nuw i32 %.03240, %.03342
  %48 = add i32 %47, %46
  store i32 %48, ptr %1, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %49 = load i32, ptr @cnt, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %52 = mul nsw i32 %42, %19
  %53 = add i32 %47, %52
  store i32 %53, ptr %2, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %54 = load i32, ptr @cnt, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %55
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = add nuw i32 %20, %.03240
  %59 = mul nsw i32 %42, %58
  %60 = add i32 %59, %.03342
  %61 = add i32 %60, %57
  store i32 %61, ptr %3, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %62 = load i32, ptr @cnt, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100 x %"class.std::vector"], ptr @squares, i64 0, i64 %63
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %66 = add i32 %33, %59
  %67 = add i32 %66, %65
  store i32 %67, ptr %4, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %68 = add nuw nsw i32 %.03240, 1
  %exitcond.not = icmp eq i32 %68, %.03147
  br i1 %exitcond.not, label %34, label %39, !llvm.loop !14

._crit_edge53:                                    ; preds = %.lr.ph52, %._crit_edge49
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr @e, align 4, !tbaa !5
  %69 = call noundef zeroext i1 @_Z3dfsi(i32 noundef 0)
  br i1 %69, label %._crit_edge56, label %.lr.ph55

.lr.ph52:                                         ; preds = %._crit_edge49, %.lr.ph52
  %.050 = phi i32 [ %74, %.lr.ph52 ], [ 0, %._crit_edge49 ]
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100 x i32], ptr @st, i64 0, i64 %72
  store i32 1, ptr %73, align 4, !tbaa !5
  %74 = add nuw nsw i32 %.050, 1
  %75 = load i32, ptr @k, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %.lr.ph52, label %._crit_edge53, !llvm.loop !15

.lr.ph55:                                         ; preds = %._crit_edge53, %.lr.ph55
  %77 = load i32, ptr @e, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @e, align 4, !tbaa !5
  %79 = call noundef zeroext i1 @_Z3dfsi(i32 noundef 0)
  br i1 %79, label %._crit_edge56, label %.lr.ph55, !llvm.loop !16

._crit_edge56:                                    ; preds = %.lr.ph55, %._crit_edge53
  %80 = load i32, ptr @e, align 4, !tbaa !5
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %80)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %83 = load i32, ptr @t, align 4, !tbaa !5
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %83, 0
  br i1 %.not, label %._crit_edge60, label %.lr.ph59, !llvm.loop !17

._crit_edge60:                                    ; preds = %._crit_edge56, %0
  ret i32 0
}

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass