; LLVM IR from TheAlgorithms/C-Plus-Plus :: others/spiral_print.ll (Z11spiralPrintPPiii)

; 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_ostream" = type { ptr, %"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 }

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

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

; 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) #1

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

; 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
define dso_local void @_Z11spiralPrintPPiii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #3 {
  %4 = alloca ptr, align 8
  %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
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = sub nsw i32 %16, 1
  store i32 %17, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = sub nsw i32 %18, 1
  store i32 %19, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %146, %3
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %24, label %28

24:                                               ; preds = %20
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = icmp sle i32 %25, %26
  br label %28

28:                                               ; preds = %24, %20
  %29 = phi i1 [ false, %20 ], [ %27, %24 ]
  br i1 %29, label %30, label %149

30:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %31 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %31, ptr %12, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %49, %30
  %33 = load i32, ptr %12, align 4, !tbaa !9
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %54

37:                                               ; preds = %32
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %38, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr %42, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %46)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef @.str)
  br label %49

49:                                               ; preds = %37
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %12, align 4, !tbaa !9
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %11, align 4, !tbaa !9
  br label %32, !llvm.loop !11

54:                                               ; preds = %36
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %57 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %57, ptr %13, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %75, %54
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %80

63:                                               ; preds = %58
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds ptr, ptr %64, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %68, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %72)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef @.str)
  br label %75

75:                                               ; preds = %63
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %13, align 4, !tbaa !9
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %11, align 4, !tbaa !9
  br label %58, !llvm.loop !13

80:                                               ; preds = %62
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = add nsw i32 %81, -1
  store i32 %82, ptr %10, align 4, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = load i32, ptr %5, align 4, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = mul nsw i32 %84, %85
  %87 = icmp eq i32 %83, %86
  br i1 %87, label %88, label %89

88:                                               ; preds = %80
  br label %149

89:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %90 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %90, ptr %14, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %108, %89
  %92 = load i32, ptr %14, align 4, !tbaa !9
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = icmp sge i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %113

96:                                               ; preds = %91
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds ptr, ptr %97, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = load i32, ptr %14, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %101, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %105)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef @.str)
  br label %108

108:                                              ; preds = %96
  %109 = load i32, ptr %14, align 4, !tbaa !9
  %110 = add nsw i32 %109, -1
  store i32 %110, ptr %14, align 4, !tbaa !9
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %11, align 4, !tbaa !9
  br label %91, !llvm.loop !14

113:                                              ; preds = %95
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = add nsw i32 %114, -1
  store i32 %115, ptr %8, align 4, !tbaa !9
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = load i32, ptr %5, align 4, !tbaa !9
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = mul nsw i32 %117, %118
  %120 = icmp eq i32 %116, %119
  br i1 %120, label %121, label %122

121:                                              ; preds = %113
  br label %149

122:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %123 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %123, ptr %15, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %141, %122
  %125 = load i32, ptr %15, align 4, !tbaa !9
  %126 = load i32, ptr %7, align 4, !tbaa !9
  %127 = icmp sge i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %146

129:                                              ; preds = %124
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds ptr, ptr %130, i64 %132
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %138)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef @.str)
  br label %141

141:                                              ; preds = %129
  %142 = load i32, ptr %15, align 4, !tbaa !9
  %143 = add nsw i32 %142, -1
  store i32 %143, ptr %15, align 4, !tbaa !9
  %144 = load i32, ptr %11, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %11, align 4, !tbaa !9
  br label %124, !llvm.loop !15

146:                                              ; preds = %128
  %147 = load i32, ptr %9, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %9, align 4, !tbaa !9
  br label %20, !llvm.loop !16

149:                                              ; preds = %121, %88, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { 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 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !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::basic_ostream" = type { ptr, %"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 }

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

; 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 #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11spiralPrintPPiii(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = icmp sgt i32 %1, 0
  %5 = icmp sgt i32 %2, 0
  %6 = and i1 %4, %5
  br i1 %6, label %.preheader61.lr.ph, label %._crit_edge84

.preheader61.lr.ph:                               ; preds = %3
  %7 = add nsw i32 %2, -1
  %8 = mul nuw nsw i32 %2, %1
  %9 = add nsw i32 %2, -2
  %10 = sext i32 %9 to i64
  %11 = add nsw i32 %1, -2
  %12 = sext i32 %11 to i64
  %13 = zext nneg i32 %2 to i64
  %14 = add nsw i64 %13, -1
  %15 = zext nneg i32 %1 to i64
  %16 = add nsw i64 %15, -1
  br label %.preheader61

.preheader61:                                     ; preds = %.preheader61.lr.ph, %._crit_edge77
  %indvars.iv119 = phi i64 [ %16, %.preheader61.lr.ph ], [ %indvars.iv.next120, %._crit_edge77 ]
  %indvars.iv117 = phi i64 [ %14, %.preheader61.lr.ph ], [ %indvars.iv.next118, %._crit_edge77 ]
  %indvars.iv112 = phi i64 [ %12, %.preheader61.lr.ph ], [ %indvars.iv.next113, %._crit_edge77 ]
  %indvars.iv109 = phi i32 [ %7, %.preheader61.lr.ph ], [ %indvars.iv.next110, %._crit_edge77 ]
  %indvars.iv105 = phi i64 [ %10, %.preheader61.lr.ph ], [ %indvars.iv.next106, %._crit_edge77 ]
  %indvars.iv102 = phi i32 [ %1, %.preheader61.lr.ph ], [ %indvars.iv.next103, %._crit_edge77 ]
  %indvars.iv97 = phi i64 [ 1, %.preheader61.lr.ph ], [ %indvars.iv.next98, %._crit_edge77 ]
  %indvars.iv95 = phi i32 [ %2, %.preheader61.lr.ph ], [ %indvars.iv.next96, %._crit_edge77 ]
  %indvars.iv92 = phi i32 [ %2, %.preheader61.lr.ph ], [ %indvars.iv.next93, %._crit_edge77 ]
  %indvars.iv = phi i64 [ 0, %.preheader61.lr.ph ], [ %indvars.iv.next, %._crit_edge77 ]
  %.05083 = phi i32 [ 0, %.preheader61.lr.ph ], [ %.4.lcssa, %._crit_edge77 ]
  %17 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv
  %wide.trip.count = zext i32 %indvars.iv95 to i64
  br label %20

18:                                               ; preds = %20
  %19 = add i32 %.05083, %indvars.iv92
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not5764.not = icmp slt i64 %indvars.iv, %indvars.iv119
  br i1 %.not5764.not, label %.lr.ph, label %._crit_edge

20:                                               ; preds = %.preheader61, %20
  %indvars.iv90 = phi i64 [ %indvars.iv, %.preheader61 ], [ %indvars.iv.next91, %20 ]
  %21 = load ptr, ptr %17, align 8, !tbaa !5
  %22 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv90
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %23)
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @.str)
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count
  br i1 %exitcond.not, label %18, label %20, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %18
  %.2.lcssa = phi i32 [ %19, %18 ], [ %34, %.lr.ph ]
  %indvars.iv.next118 = add nsw i64 %indvars.iv117, -1
  %26 = icmp eq i32 %.2.lcssa, %8
  br i1 %26, label %._crit_edge84, label %.preheader60

.preheader60:                                     ; preds = %._crit_edge
  %.not5867.not = icmp sgt i64 %indvars.iv117, %indvars.iv
  br i1 %.not5867.not, label %.lr.ph70, label %._crit_edge71

.lr.ph70:                                         ; preds = %.preheader60
  %27 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv119
  br label %37

.lr.ph:                                           ; preds = %18, %.lr.ph
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %.lr.ph ], [ %indvars.iv97, %18 ]
  %.265 = phi i32 [ %34, %.lr.ph ], [ %19, %18 ]
  %28 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv99
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds i32, ptr %29, i64 %indvars.iv117
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %31)
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull @.str)
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %34 = add nsw i32 %.265, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next100 to i32
  %exitcond104.not = icmp eq i32 %indvars.iv102, %lftr.wideiv
  br i1 %exitcond104.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge71.loopexit:                           ; preds = %37
  %35 = add i32 %.2.lcssa, %indvars.iv109
  br label %._crit_edge71

._crit_edge71:                                    ; preds = %._crit_edge71.loopexit, %.preheader60
  %.3.lcssa = phi i32 [ %.2.lcssa, %.preheader60 ], [ %35, %._crit_edge71.loopexit ]
  %indvars.iv.next120 = add nsw i64 %indvars.iv119, -1
  %36 = icmp eq i32 %.3.lcssa, %8
  br i1 %36, label %._crit_edge84, label %.preheader

.preheader:                                       ; preds = %._crit_edge71
  %.not59.not73 = icmp sgt i64 %indvars.iv.next120, %indvars.iv
  br i1 %.not59.not73, label %.lr.ph76, label %._crit_edge77

37:                                               ; preds = %.lr.ph70, %37
  %indvars.iv107 = phi i64 [ %indvars.iv105, %.lr.ph70 ], [ %indvars.iv.next108, %37 ]
  %38 = load ptr, ptr %27, align 8, !tbaa !5
  %39 = getelementptr inbounds i32, ptr %38, i64 %indvars.iv107
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %40)
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @.str)
  %indvars.iv.next108 = add nsw i64 %indvars.iv107, -1
  %.not58.not = icmp sgt i64 %indvars.iv107, %indvars.iv
  br i1 %.not58.not, label %37, label %._crit_edge71.loopexit, !llvm.loop !14

._crit_edge77:                                    ; preds = %.lr.ph76, %.preheader
  %.4.lcssa = phi i32 [ %.3.lcssa, %.preheader ], [ %51, %.lr.ph76 ]
  %43 = icmp slt i64 %indvars.iv, %indvars.iv.next118
  %44 = select i1 %.not59.not73, i1 %43, i1 false
  %indvars.iv.next93 = add i32 %indvars.iv92, -2
  %indvars.iv.next96 = add i32 %indvars.iv95, -1
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %indvars.iv.next103 = add i32 %indvars.iv102, -1
  %indvars.iv.next106 = add nsw i64 %indvars.iv105, -1
  %indvars.iv.next110 = add i32 %indvars.iv109, -2
  %indvars.iv.next113 = add nsw i64 %indvars.iv112, -1
  br i1 %44, label %.preheader61, label %._crit_edge84, !llvm.loop !15

.lr.ph76:                                         ; preds = %.preheader, %.lr.ph76
  %indvars.iv114 = phi i64 [ %indvars.iv.next115, %.lr.ph76 ], [ %indvars.iv112, %.preheader ]
  %.474 = phi i32 [ %51, %.lr.ph76 ], [ %.3.lcssa, %.preheader ]
  %45 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv114
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %48)
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull @.str)
  %indvars.iv.next115 = add nsw i64 %indvars.iv114, -1
  %51 = add nsw i32 %.474, 1
  %.not59.not = icmp sgt i64 %indvars.iv.next115, %indvars.iv
  br i1 %.not59.not, label %.lr.ph76, label %._crit_edge77, !llvm.loop !16

._crit_edge84:                                    ; preds = %._crit_edge77, %._crit_edge, %._crit_edge71, %3
  ret void
}

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

!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 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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