; LLVM IR from next-step-for-interview-prep/Coding-Ninjas-DSA-course_code_and_notes_cpp :: Milestone-1=Intro_to_C++/questions and solutions/Lec-5=Patterns-2 (Diamond-of-stars)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %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) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sdiv i32 %14, 2
  store i32 %15, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %48, %0
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sub nsw i32 %18, 1
  %20 = icmp sle i32 %17, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %51

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %30, %22
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %33

28:                                               ; preds = %23
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %30

30:                                               ; preds = %28
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %6, align 4, !tbaa !5
  br label %23, !llvm.loop !9

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

35:                                               ; preds = %41, %33
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %35
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %41

41:                                               ; preds = %39
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %7, align 4, !tbaa !5
  br label %35, !llvm.loop !11

44:                                               ; preds = %38
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr %3, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = add nsw i32 %49, 2
  store i32 %50, ptr %4, align 4, !tbaa !5
  br label %16, !llvm.loop !12

51:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %59, %51
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %62

57:                                               ; preds = %52
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %59

59:                                               ; preds = %57
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %8, align 4, !tbaa !5
  br label %52, !llvm.loop !13

62:                                               ; preds = %56
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = sdiv i32 %64, 2
  store i32 %65, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sub nsw i32 %66, 1
  store i32 %67, ptr %10, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %100, %62
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %103

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %73 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %73, ptr %11, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %82, %72
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sdiv i32 %76, 2
  %78 = icmp sle i32 %75, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %74
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %85

80:                                               ; preds = %74
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %82

82:                                               ; preds = %80
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %11, align 4, !tbaa !5
  br label %74, !llvm.loop !14

85:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %86 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %86, ptr %12, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %93, %85
  %88 = load i32, ptr %12, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 1
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %96

91:                                               ; preds = %87
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %93

93:                                               ; preds = %91
  %94 = load i32, ptr %12, align 4, !tbaa !5
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %12, align 4, !tbaa !5
  br label %87, !llvm.loop !15

96:                                               ; preds = %90
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = add nsw i32 %98, -1
  store i32 %99, ptr %9, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %96
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 2
  store i32 %102, ptr %10, align 4, !tbaa !5
  br label %68, !llvm.loop !16

103:                                              ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %104 = load i32, ptr %1, align 4
  ret i32 %104
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

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

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

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 = { 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 #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 = !{!"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::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" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not35 = icmp sgt i32 %3, 1
  br i1 %.not.not35, label %.preheader32.preheader, label %.preheader30

.preheader32.preheader:                           ; preds = %0
  %4 = lshr i32 %3, 1
  br label %.preheader32

.preheader32:                                     ; preds = %.preheader32.preheader, %10
  %.02737 = phi i32 [ %13, %10 ], [ 1, %.preheader32.preheader ]
  %.02836 = phi i32 [ %12, %10 ], [ %4, %.preheader32.preheader ]
  %5 = icmp sgt i32 %.02836, 0
  br i1 %5, label %.lr.ph, label %.preheader31.preheader

.preheader31.preheader:                           ; preds = %.lr.ph, %.preheader32
  br label %.preheader31

.preheader30:                                     ; preds = %10, %0
  %6 = phi i32 [ %3, %0 ], [ %14, %10 ]
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph39, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader32, %.lr.ph
  %.02633 = phi i32 [ %9, %.lr.ph ], [ 0, %.preheader32 ]
  %8 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %9 = add nuw nsw i32 %.02633, 1
  %exitcond.not = icmp eq i32 %9, %.02836
  br i1 %exitcond.not, label %.preheader31.preheader, label %.lr.ph, !llvm.loop !9

10:                                               ; preds = %.preheader31
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %12 = add nsw i32 %.02836, -1
  %13 = add nuw nsw i32 %.02737, 2
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %13, %14
  br i1 %.not.not, label %.preheader32, label %.preheader30, !llvm.loop !11

.preheader31:                                     ; preds = %.preheader31.preheader, %.preheader31
  %.02534 = phi i32 [ %16, %.preheader31 ], [ %.02737, %.preheader31.preheader ]
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %16 = add nsw i32 %.02534, -1
  %17 = icmp sgt i32 %.02534, 1
  br i1 %17, label %.preheader31, label %10, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph39, %.preheader30
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %.preheader29.preheader, label %._crit_edge48

.preheader29.preheader:                           ; preds = %._crit_edge
  %21 = add nsw i32 %19, -1
  %22 = lshr i32 %19, 1
  br label %.preheader29

.lr.ph39:                                         ; preds = %.preheader30, %.lr.ph39
  %.02438 = phi i32 [ %24, %.lr.ph39 ], [ 0, %.preheader30 ]
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %24 = add nuw nsw i32 %.02438, 1
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %.lr.ph39, label %._crit_edge, !llvm.loop !13

.preheader29:                                     ; preds = %.preheader29.preheader, %._crit_edge45
  %.02247 = phi i32 [ %36, %._crit_edge45 ], [ %21, %.preheader29.preheader ]
  %.02346 = phi i32 [ %35, %._crit_edge45 ], [ %22, %.preheader29.preheader ]
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = sdiv i32 %27, 2
  %.not40 = icmp sgt i32 %.02346, %28
  br i1 %.not40, label %.preheader, label %.lr.ph42

._crit_edge48:                                    ; preds = %._crit_edge45, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.preheader:                                       ; preds = %.lr.ph42, %.preheader29
  %29 = icmp sgt i32 %.02247, 1
  br i1 %29, label %.lr.ph44, label %._crit_edge45

.lr.ph42:                                         ; preds = %.preheader29, %.lr.ph42
  %.02141 = phi i32 [ %31, %.lr.ph42 ], [ %.02346, %.preheader29 ]
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %31 = add nsw i32 %.02141, 1
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = sdiv i32 %32, 2
  %.not.not49 = icmp slt i32 %.02141, %33
  br i1 %.not.not49, label %.lr.ph42, label %.preheader, !llvm.loop !14

._crit_edge45:                                    ; preds = %.lr.ph44, %.preheader
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %35 = add nsw i32 %.02346, -1
  %36 = add nsw i32 %.02247, -2
  %37 = icmp sgt i32 %.02247, 2
  br i1 %37, label %.preheader29, label %._crit_edge48, !llvm.loop !15

.lr.ph44:                                         ; preds = %.preheader, %.lr.ph44
  %.043 = phi i32 [ %39, %.lr.ph44 ], [ %.02247, %.preheader ]
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %39 = add nsw i32 %.043, -1
  %40 = icmp ugt i32 %.043, 2
  br i1 %40, label %.lr.ph44, label %._crit_edge45, !llvm.loop !16
}

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

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 #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

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

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 = { "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 = { 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 #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 = !{!"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}


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