; LLVM IR from next-step-for-interview-prep/Coding-Ninjas-DSA-course_code_and_notes_cpp :: Milestone-2=Intro_to_C++/questions and solutions/Lec-10=Character-arrays_and_2D-arra_492e5772 (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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11spiralPrintPPiii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %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
  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
  %15 = load i32, ptr %5, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %20, label %17

17:                                               ; preds = %3
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %17, %3
  br label %159

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = mul nsw i32 %22, %23
  store i32 %24, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = sub nsw i32 %25, 1
  store i32 %26, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = sub nsw i32 %27, 1
  store i32 %28, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %155, %21
  %30 = load i32, ptr %14, align 4, !tbaa !9
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %158

33:                                               ; preds = %29
  %34 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %34, ptr %13, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %59, %33
  %36 = load i32, ptr %14, align 4, !tbaa !9
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %35
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = icmp sle i32 %40, %41
  br label %43

43:                                               ; preds = %39, %35
  %44 = phi i1 [ false, %35 ], [ %42, %39 ]
  br i1 %44, label %45, label %62

45:                                               ; preds = %43
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds ptr, ptr %46, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %50, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %54)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %55, i8 noundef signext 32)
  %57 = load i32, ptr %14, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %14, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %45
  %60 = load i32, ptr %13, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %13, align 4, !tbaa !9
  br label %35, !llvm.loop !11

62:                                               ; preds = %43
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %10, align 4, !tbaa !9
  %65 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %65, ptr %12, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %90, %62
  %67 = load i32, ptr %14, align 4, !tbaa !9
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %66
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = icmp sle i32 %71, %72
  br label %74

74:                                               ; preds = %70, %66
  %75 = phi i1 [ false, %66 ], [ %73, %70 ]
  br i1 %75, label %76, label %93

76:                                               ; preds = %74
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds ptr, ptr %77, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %81, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %85)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %86, i8 noundef signext 32)
  %88 = load i32, ptr %14, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %14, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %76
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %12, align 4, !tbaa !9
  br label %66, !llvm.loop !13

93:                                               ; preds = %74
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %9, align 4, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %96, ptr %13, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %121, %93
  %98 = load i32, ptr %14, align 4, !tbaa !9
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %101, label %105

101:                                              ; preds = %97
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = load i32, ptr %8, align 4, !tbaa !9
  %104 = icmp sge i32 %102, %103
  br label %105

105:                                              ; preds = %101, %97
  %106 = phi i1 [ false, %97 ], [ %104, %101 ]
  br i1 %106, label %107, label %124

107:                                              ; preds = %105
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = load i32, ptr %11, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds ptr, ptr %108, i64 %110
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %116)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %117, i8 noundef signext 32)
  %119 = load i32, ptr %14, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %14, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %107
  %122 = load i32, ptr %13, align 4, !tbaa !9
  %123 = add nsw i32 %122, -1
  store i32 %123, ptr %13, align 4, !tbaa !9
  br label %97, !llvm.loop !14

124:                                              ; preds = %105
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %11, align 4, !tbaa !9
  %127 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %127, ptr %12, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %152, %124
  %129 = load i32, ptr %14, align 4, !tbaa !9
  %130 = load i32, ptr %7, align 4, !tbaa !9
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %136

132:                                              ; preds = %128
  %133 = load i32, ptr %12, align 4, !tbaa !9
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = icmp sge i32 %133, %134
  br label %136

136:                                              ; preds = %132, %128
  %137 = phi i1 [ false, %128 ], [ %135, %132 ]
  br i1 %137, label %138, label %155

138:                                              ; preds = %136
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds ptr, ptr %139, i64 %141
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  %144 = load i32, ptr %8, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds i32, ptr %143, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %147)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %148, i8 noundef signext 32)
  %150 = load i32, ptr %14, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %14, align 4, !tbaa !9
  br label %152

152:                                              ; preds = %138
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = add nsw i32 %153, -1
  store i32 %154, ptr %12, align 4, !tbaa !9
  br label %128, !llvm.loop !15

155:                                              ; preds = %136
  %156 = load i32, ptr %8, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %8, align 4, !tbaa !9
  br label %29, !llvm.loop !16

158:                                              ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  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
  br label %159

159:                                              ; preds = %158, %20
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #2

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

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11spiralPrintPPiii(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq i32 %1, 0
  %5 = icmp eq i32 %2, 0
  %or.cond = or i1 %4, %5
  br i1 %or.cond, label %.loopexit, label %6

6:                                                ; preds = %3
  %7 = mul nsw i32 %2, %1
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %6
  %9 = add i32 %1, -1
  %10 = add i32 %2, -1
  %11 = add i32 %2, -2
  %12 = add i32 %1, -2
  %13 = sext i32 %9 to i64
  %14 = sext i32 %10 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge81
  %indvars.iv111 = phi i64 [ %14, %.preheader.preheader ], [ %indvars.iv.next112, %._crit_edge81 ]
  %indvars.iv109 = phi i64 [ %13, %.preheader.preheader ], [ %indvars.iv.next110, %._crit_edge81 ]
  %indvars.iv104 = phi i32 [ %12, %.preheader.preheader ], [ %indvars.iv.next105, %._crit_edge81 ]
  %indvars.iv99 = phi i32 [ %11, %.preheader.preheader ], [ %indvars.iv.next100, %._crit_edge81 ]
  %indvars.iv94 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next95, %._crit_edge81 ]
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %._crit_edge81 ]
  %.087 = phi i32 [ 0, %.preheader.preheader ], [ %.4.lcssa, %._crit_edge81 ]
  %15 = sext i32 %indvars.iv104 to i64
  %16 = sext i32 %indvars.iv99 to i64
  %.not = icmp sgt i64 %indvars.iv, %indvars.iv111
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %17 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv
  br label %18

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv91 = phi i64 [ %indvars.iv, %.lr.ph ], [ %indvars.iv.next92, %18 ]
  %.164 = phi i32 [ %.087, %.lr.ph ], [ %24, %18 ]
  %19 = load ptr, ptr %17, align 8, !tbaa !5
  %20 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv91
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %21)
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %22, i8 noundef signext 32)
  %24 = add nsw i32 %.164, 1
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %25 = icmp slt i32 %24, %7
  %26 = icmp slt i64 %indvars.iv91, %indvars.iv111
  %27 = and i1 %25, %26
  br i1 %27, label %18, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %18, %.preheader
  %.1.lcssa = phi i32 [ %.087, %.preheader ], [ %24, %18 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = icmp slt i32 %.1.lcssa, %7
  %29 = icmp slt i64 %indvars.iv, %indvars.iv109
  %30 = select i1 %28, i1 %29, i1 false
  br i1 %30, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %._crit_edge, %.lr.ph68
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %.lr.ph68 ], [ %indvars.iv94, %._crit_edge ]
  %.266 = phi i32 [ %37, %.lr.ph68 ], [ %.1.lcssa, %._crit_edge ]
  %31 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv96
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds i32, ptr %32, i64 %indvars.iv111
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %34)
  %36 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %35, i8 noundef signext 32)
  %37 = add nsw i32 %.266, 1
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %38 = icmp slt i32 %37, %7
  %sext = shl i64 %indvars.iv96, 32
  %39 = ashr exact i64 %sext, 32
  %40 = icmp slt i64 %39, %indvars.iv109
  %41 = select i1 %38, i1 %40, i1 false
  br i1 %41, label %.lr.ph68, label %._crit_edge69, !llvm.loop !13

._crit_edge69:                                    ; preds = %.lr.ph68, %._crit_edge
  %.2.lcssa = phi i32 [ %.1.lcssa, %._crit_edge ], [ %37, %.lr.ph68 ]
  %indvars.iv.next112 = add nsw i64 %indvars.iv111, -1
  %42 = icmp slt i32 %.2.lcssa, %7
  %43 = icmp sgt i64 %indvars.iv111, %indvars.iv
  %44 = and i1 %42, %43
  br i1 %44, label %.lr.ph74, label %._crit_edge75

.lr.ph74:                                         ; preds = %._crit_edge69
  %45 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv109
  br label %46

46:                                               ; preds = %.lr.ph74, %46
  %indvars.iv101 = phi i64 [ %16, %.lr.ph74 ], [ %indvars.iv.next102, %46 ]
  %.372 = phi i32 [ %.2.lcssa, %.lr.ph74 ], [ %52, %46 ]
  %47 = load ptr, ptr %45, align 8, !tbaa !5
  %48 = getelementptr inbounds i32, ptr %47, i64 %indvars.iv101
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %49)
  %51 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %50, i8 noundef signext 32)
  %52 = add nsw i32 %.372, 1
  %indvars.iv.next102 = add nsw i64 %indvars.iv101, -1
  %53 = icmp slt i32 %52, %7
  %54 = icmp sgt i64 %indvars.iv101, %indvars.iv
  %55 = and i1 %53, %54
  br i1 %55, label %46, label %._crit_edge75, !llvm.loop !14

._crit_edge75:                                    ; preds = %46, %._crit_edge69
  %.3.lcssa = phi i32 [ %.2.lcssa, %._crit_edge69 ], [ %52, %46 ]
  %indvars.iv.next110 = add nsw i64 %indvars.iv109, -1
  %56 = icmp slt i32 %.3.lcssa, %7
  %57 = icmp sgt i64 %indvars.iv.next110, %indvars.iv
  %58 = select i1 %56, i1 %57, i1 false
  br i1 %58, label %.lr.ph80, label %._crit_edge81

.lr.ph80:                                         ; preds = %._crit_edge75, %.lr.ph80
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %.lr.ph80 ], [ %15, %._crit_edge75 ]
  %.478 = phi i32 [ %65, %.lr.ph80 ], [ %.3.lcssa, %._crit_edge75 ]
  %59 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv106
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds i32, ptr %60, i64 %indvars.iv
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %62)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %63, i8 noundef signext 32)
  %65 = add nsw i32 %.478, 1
  %indvars.iv.next107 = add nsw i64 %indvars.iv106, -1
  %66 = icmp slt i32 %65, %7
  %67 = icmp sgt i64 %indvars.iv.next107, %indvars.iv
  %68 = select i1 %66, i1 %67, i1 false
  br i1 %68, label %.lr.ph80, label %._crit_edge81, !llvm.loop !15

._crit_edge81:                                    ; preds = %.lr.ph80, %._crit_edge75
  %.4.lcssa = phi i32 [ %.3.lcssa, %._crit_edge75 ], [ %65, %.lr.ph80 ]
  %69 = icmp slt i32 %.4.lcssa, %7
  %indvars.iv.next95 = add nuw i64 %indvars.iv94, 1
  %indvars.iv.next100 = add i32 %indvars.iv99, -1
  %indvars.iv.next105 = add i32 %indvars.iv104, -1
  br i1 %69, label %.preheader, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %._crit_edge81, %6, %3
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #1

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

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

!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: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass