; LLVM IR from jakobkogler/Algorithm-DataStructures :: CodingExercise (chess_bottom_up)

; 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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [15 x [15 x i8]], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 225, ptr %2) #6
  call void @llvm.memset.p0.i64(ptr align 16 %2, i8 0, i64 225, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %142, %0
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 29
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %145

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 15
  br i1 %16, label %17, label %19

17:                                               ; preds = %14
  %18 = load i32, ptr %3, align 4, !tbaa !5
  br label %20

19:                                               ; preds = %14
  br label %20

20:                                               ; preds = %19, %17
  %21 = phi i32 [ %18, %17 ], [ 14, %19 ]
  store i32 %21, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 15
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  br label %28

25:                                               ; preds = %20
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sub nsw i32 %26, 14
  br label %28

28:                                               ; preds = %25, %24
  %29 = phi i32 [ 0, %24 ], [ %27, %25 ]
  store i32 %29, ptr %5, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %136, %28
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp sge i32 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %30
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 15
  br label %36

36:                                               ; preds = %33, %30
  %37 = phi i1 [ false, %30 ], [ %35, %33 ]
  br i1 %37, label %38, label %141

38:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 0, ptr %6, align 1, !tbaa !9
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sub nsw i32 %39, 2
  %41 = icmp sge i32 %40, 0
  br i1 %41, label %42, label %60

42:                                               ; preds = %38
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = icmp slt i32 %44, 15
  br i1 %45, label %46, label %60

46:                                               ; preds = %42
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 2
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [15 x [15 x i8]], ptr %2, i64 0, i64 %49
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [15 x i8], ptr %50, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !9, !range !11, !noundef !12
  %56 = trunc i8 %55 to i1
  %57 = zext i1 %56 to i32
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %46
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %60

60:                                               ; preds = %59, %46, %42, %38
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 2
  %63 = icmp sge i32 %62, 0
  br i1 %63, label %64, label %82

64:                                               ; preds = %60
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  %67 = icmp sge i32 %66, 0
  br i1 %67, label %68, label %82

68:                                               ; preds = %64
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sub nsw i32 %69, 2
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [15 x [15 x i8]], ptr %2, i64 0, i64 %71
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [15 x i8], ptr %72, i64 0, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !9, !range !11, !noundef !12
  %78 = trunc i8 %77 to i1
  %79 = zext i1 %78 to i32
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %68
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %82

82:                                               ; preds = %81, %68, %64, %60
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = icmp slt i32 %84, 15
  br i1 %85, label %86, label %104

86:                                               ; preds = %82
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 2
  %89 = icmp sge i32 %88, 0
  br i1 %89, label %90, label %104

90:                                               ; preds = %86
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [15 x [15 x i8]], ptr %2, i64 0, i64 %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 2
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [15 x i8], ptr %94, i64 0, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !9, !range !11, !noundef !12
  %100 = trunc i8 %99 to i1
  %101 = zext i1 %100 to i32
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %90
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %104

104:                                              ; preds = %103, %90, %86, %82
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = icmp sge i32 %106, 0
  br i1 %107, label %108, label %126

108:                                              ; preds = %104
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 2
  %111 = icmp sge i32 %110, 0
  br i1 %111, label %112, label %126

112:                                              ; preds = %108
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [15 x [15 x i8]], ptr %2, i64 0, i64 %115
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 2
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [15 x i8], ptr %116, i64 0, i64 %119
  %121 = load i8, ptr %120, align 1, !tbaa !9, !range !11, !noundef !12
  %122 = trunc i8 %121 to i1
  %123 = zext i1 %122 to i32
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %112
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %126

126:                                              ; preds = %125, %112, %108, %104
  %127 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %128 = trunc i8 %127 to i1
  %129 = load i32, ptr %4, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [15 x [15 x i8]], ptr %2, i64 0, i64 %130
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [15 x i8], ptr %131, i64 0, i64 %133
  %135 = zext i1 %128 to i8
  store i8 %135, ptr %134, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %136

136:                                              ; preds = %126
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = add nsw i32 %137, -1
  store i32 %138, ptr %4, align 4, !tbaa !5
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %5, align 4, !tbaa !5
  br label %30, !llvm.loop !13

141:                                              ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %3, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %3, align 4, !tbaa !5
  br label %10, !llvm.loop !15

145:                                              ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %146 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  br label %147

147:                                              ; preds = %151, %145
  %148 = load i32, ptr %7, align 4, !tbaa !5
  %149 = add nsw i32 %148, -1
  store i32 %149, ptr %7, align 4, !tbaa !5
  %150 = icmp sgt i32 %148, 0
  br i1 %150, label %151, label %168

151:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %152 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %152, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = sub nsw i32 %154, 1
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [15 x [15 x i8]], ptr %2, i64 0, i64 %156
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = sub nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [15 x i8], ptr %157, i64 0, i64 %160
  %162 = load i8, ptr %161, align 1, !tbaa !9, !range !11, !noundef !12
  %163 = trunc i8 %162 to i1
  %164 = zext i1 %163 to i64
  %165 = select i1 %163, ptr @.str, ptr @.str.1
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %165)
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %166, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %147, !llvm.loop !16

168:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 225, ptr %2) #6
  %169 = load i32, ptr %1, align 4
  ret i32 %169
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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)) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 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)) #4

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

!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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [15 x [15 x i8]], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 225, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(225) %1, i8 0, i64 225, i1 false)
  br label %10

5:                                                ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %6 = 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)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr %2, align 4, !tbaa !5
  %9 = icmp sgt i32 %7, 0
  br i1 %9, label %.lr.ph51, label %._crit_edge52

10:                                               ; preds = %0, %._crit_edge
  %.03249 = phi i32 [ 0, %0 ], [ %53, %._crit_edge ]
  %11 = icmp ult i32 %.03249, 15
  %12 = add nsw i32 %.03249, -14
  %13 = select i1 %11, i32 0, i32 %12
  %14 = icmp slt i32 %13, 15
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %10
  %15 = select i1 %11, i32 %.03249, i32 14
  %16 = sext i32 %13 to i64
  %17 = zext nneg i32 %15 to i64
  %18 = add nsw i32 %13, 1
  %19 = sub i32 14, %13
  %umin = tail call i32 @llvm.umin.i32(i32 %15, i32 %19)
  %20 = add i32 %18, %umin
  %wide.trip.count = sext i32 %20 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %51
  %indvars.iv53 = phi i64 [ %17, %.lr.ph.preheader ], [ %indvars.iv.next54, %51 ]
  %indvars.iv = phi i64 [ %16, %.lr.ph.preheader ], [ %indvars.iv.next, %51 ]
  %21 = add nsw i64 %indvars.iv53, -2
  %22 = icmp ugt i64 %indvars.iv53, 1
  %23 = icmp slt i64 %indvars.iv, 14
  %or.cond = and i1 %22, %23
  br i1 %or.cond, label %24, label %28

24:                                               ; preds = %.lr.ph
  %25 = add nsw i64 %indvars.iv, 1
  %26 = getelementptr inbounds [15 x [15 x i8]], ptr %1, i64 0, i64 %21, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !9, !range !11, !noundef !12
  %spec.select = xor i8 %27, 1
  br label %28

28:                                               ; preds = %24, %.lr.ph
  %.0 = phi i8 [ 0, %.lr.ph ], [ %spec.select, %24 ]
  %29 = icmp sgt i64 %indvars.iv, 0
  %or.cond41 = and i1 %22, %29
  br i1 %or.cond41, label %30, label %35

30:                                               ; preds = %28
  %31 = add nsw i64 %indvars.iv, -1
  %32 = getelementptr inbounds [15 x [15 x i8]], ptr %1, i64 0, i64 %21, i64 %31
  %33 = load i8, ptr %32, align 1, !tbaa !9, !range !11, !noundef !12
  %34 = icmp eq i8 %33, 0
  %spec.select42 = select i1 %34, i8 1, i8 %.0
  br label %35

35:                                               ; preds = %30, %28
  %.1 = phi i8 [ %.0, %28 ], [ %spec.select42, %30 ]
  %36 = icmp ult i64 %indvars.iv53, 14
  %37 = icmp sgt i64 %indvars.iv, 1
  %or.cond43 = and i1 %36, %37
  br i1 %or.cond43, label %38, label %44

38:                                               ; preds = %35
  %39 = add nuw nsw i64 %indvars.iv53, 1
  %40 = add nsw i64 %indvars.iv, -2
  %41 = getelementptr inbounds [15 x [15 x i8]], ptr %1, i64 0, i64 %39, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !9, !range !11, !noundef !12
  %43 = icmp eq i8 %42, 0
  %spec.select44 = select i1 %43, i8 1, i8 %.1
  br label %44

44:                                               ; preds = %38, %35
  %.2 = phi i8 [ %.1, %35 ], [ %spec.select44, %38 ]
  %indvars.iv.next54 = add nsw i64 %indvars.iv53, -1
  %45 = icmp ne i64 %indvars.iv53, 0
  %or.cond45 = and i1 %45, %37
  br i1 %or.cond45, label %46, label %51

46:                                               ; preds = %44
  %47 = add nsw i64 %indvars.iv, -2
  %48 = getelementptr inbounds [15 x [15 x i8]], ptr %1, i64 0, i64 %indvars.iv.next54, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !9, !range !11, !noundef !12
  %50 = icmp eq i8 %49, 0
  %spec.select46 = select i1 %50, i8 1, i8 %.2
  br label %51

51:                                               ; preds = %46, %44
  %.3 = phi i8 [ %.2, %44 ], [ %spec.select46, %46 ]
  %52 = getelementptr inbounds [15 x [15 x i8]], ptr %1, i64 0, i64 %indvars.iv53, i64 %indvars.iv
  store i8 %.3, ptr %52, align 1, !tbaa !9
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %51, %10
  %53 = add nuw nsw i32 %.03249, 1
  %exitcond58.not = icmp eq i32 %53, 29
  br i1 %exitcond58.not, label %5, label %10, !llvm.loop !15

.lr.ph51:                                         ; preds = %5, %.lr.ph51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  %58 = sext i32 %57 to i64
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [15 x [15 x i8]], ptr %1, i64 0, i64 %58, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !9, !range !11, !noundef !12
  %64 = trunc nuw i8 %63 to i1
  %65 = select i1 %64, ptr @.str, ptr @.str.1
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %65)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr %2, align 4, !tbaa !5
  %70 = icmp sgt i32 %68, 0
  br i1 %70, label %.lr.ph51, label %._crit_edge52, !llvm.loop !16

._crit_edge52:                                    ; preds = %.lr.ph51, %5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 225, ptr nonnull %1) #7
  ret i32 0
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 #3

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

; 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 #5 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)) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #6

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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