; LLVM IR from TLE-MEC/Hack-CP-DSA :: Hackerrank/Grid Challenge (solution)

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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [105 x [105 x i8]], align 16
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca [26 x i64], align 16
  %9 = alloca i64, align 8
  %10 = alloca [105 x [105 x i64]], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 11025, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 208, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 88200, ptr %10) #4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  br label %12

12:                                               ; preds = %136, %0
  %13 = load i64, ptr %3, align 8, !tbaa !5
  %14 = add nsw i64 %13, -1
  store i64 %14, ptr %3, align 8, !tbaa !5
  %15 = icmp ne i64 %13, 0
  br i1 %15, label %16, label %137

16:                                               ; preds = %12
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4)
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %27, %16
  %19 = load i64, ptr %5, align 8, !tbaa !5
  %20 = load i64, ptr %4, align 8, !tbaa !5
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %22, label %30

22:                                               ; preds = %18
  %23 = load i64, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds [105 x [105 x i8]], ptr %2, i64 0, i64 %23
  %25 = getelementptr inbounds [105 x i8], ptr %24, i64 0, i64 0
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25)
  br label %27

27:                                               ; preds = %22
  %28 = load i64, ptr %5, align 8, !tbaa !5
  %29 = add nsw i64 %28, 1
  store i64 %29, ptr %5, align 8, !tbaa !5
  br label %18, !llvm.loop !9

30:                                               ; preds = %18
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %83, %30
  %32 = load i64, ptr %5, align 8, !tbaa !5
  %33 = load i64, ptr %4, align 8, !tbaa !5
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %35, label %86

35:                                               ; preds = %31
  %36 = getelementptr inbounds [26 x i64], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %36, i8 0, i64 208, i1 false)
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %53, %35
  %38 = load i64, ptr %6, align 8, !tbaa !5
  %39 = load i64, ptr %4, align 8, !tbaa !5
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %41, label %56

41:                                               ; preds = %37
  %42 = load i64, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds [105 x [105 x i8]], ptr %2, i64 0, i64 %42
  %44 = load i64, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds [105 x i8], ptr %43, i64 0, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = sext i8 %46 to i32
  %48 = sub nsw i32 %47, 97
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [26 x i64], ptr %8, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = add nsw i64 %51, 1
  store i64 %52, ptr %50, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %41
  %54 = load i64, ptr %6, align 8, !tbaa !5
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %6, align 8, !tbaa !5
  br label %37, !llvm.loop !12

56:                                               ; preds = %37
  store i64 0, ptr %6, align 8, !tbaa !5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %79, %56
  %58 = load i64, ptr %9, align 8, !tbaa !5
  %59 = icmp slt i64 %58, 26
  br i1 %59, label %60, label %82

60:                                               ; preds = %57
  br label %61

61:                                               ; preds = %66, %60
  %62 = load i64, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds [26 x i64], ptr %8, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = icmp sgt i64 %64, 0
  br i1 %65, label %66, label %78

66:                                               ; preds = %61
  %67 = load i64, ptr %9, align 8, !tbaa !5
  %68 = load i64, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds [105 x [105 x i64]], ptr %10, i64 0, i64 %68
  %70 = load i64, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds [105 x i64], ptr %69, i64 0, i64 %70
  store i64 %67, ptr %71, align 8, !tbaa !5
  %72 = load i64, ptr %6, align 8, !tbaa !5
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %6, align 8, !tbaa !5
  %74 = load i64, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds [26 x i64], ptr %8, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = add nsw i64 %76, -1
  store i64 %77, ptr %75, align 8, !tbaa !5
  br label %61, !llvm.loop !13

78:                                               ; preds = %61
  br label %79

79:                                               ; preds = %78
  %80 = load i64, ptr %9, align 8, !tbaa !5
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %9, align 8, !tbaa !5
  br label %57, !llvm.loop !14

82:                                               ; preds = %57
  br label %83

83:                                               ; preds = %82
  %84 = load i64, ptr %5, align 8, !tbaa !5
  %85 = add nsw i64 %84, 1
  store i64 %85, ptr %5, align 8, !tbaa !5
  br label %31, !llvm.loop !15

86:                                               ; preds = %31
  store i64 0, ptr %7, align 8, !tbaa !5
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %126, %86
  %88 = load i64, ptr %6, align 8, !tbaa !5
  %89 = load i64, ptr %4, align 8, !tbaa !5
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %87
  %92 = load i64, ptr %7, align 8, !tbaa !5
  %93 = icmp eq i64 %92, 0
  br label %94

94:                                               ; preds = %91, %87
  %95 = phi i1 [ false, %87 ], [ %93, %91 ]
  br i1 %95, label %96, label %129

96:                                               ; preds = %94
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %122, %96
  %98 = load i64, ptr %5, align 8, !tbaa !5
  %99 = add nsw i64 %98, 1
  %100 = load i64, ptr %4, align 8, !tbaa !5
  %101 = icmp slt i64 %99, %100
  br i1 %101, label %102, label %105

102:                                              ; preds = %97
  %103 = load i64, ptr %7, align 8, !tbaa !5
  %104 = icmp eq i64 %103, 0
  br label %105

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

107:                                              ; preds = %105
  %108 = load i64, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds [105 x [105 x i64]], ptr %10, i64 0, i64 %108
  %110 = load i64, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds [105 x i64], ptr %109, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !5
  %113 = load i64, ptr %5, align 8, !tbaa !5
  %114 = add nsw i64 %113, 1
  %115 = getelementptr inbounds [105 x [105 x i64]], ptr %10, i64 0, i64 %114
  %116 = load i64, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds [105 x i64], ptr %115, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %119 = icmp sgt i64 %112, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %107
  store i64 1, ptr %7, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %120, %107
  br label %122

122:                                              ; preds = %121
  %123 = load i64, ptr %5, align 8, !tbaa !5
  %124 = add nsw i64 %123, 1
  store i64 %124, ptr %5, align 8, !tbaa !5
  br label %97, !llvm.loop !16

125:                                              ; preds = %105
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %6, align 8, !tbaa !5
  %128 = add nsw i64 %127, 1
  store i64 %128, ptr %6, align 8, !tbaa !5
  br label %87, !llvm.loop !17

129:                                              ; preds = %94
  %130 = load i64, ptr %7, align 8, !tbaa !5
  %131 = icmp eq i64 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %136

134:                                              ; preds = %129
  %135 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %136

136:                                              ; preds = %134, %132
  br label %12, !llvm.loop !18

137:                                              ; preds = %12
  call void @llvm.lifetime.end.p0(i64 88200, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 208, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 11025, ptr %2) #4
  ret i32 0
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

declare i32 @printf(ptr noundef, ...) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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"

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [105 x [105 x i8]], align 16
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca [26 x i64], align 16
  %5 = alloca [105 x [105 x i64]], align 16
  call void @llvm.lifetime.start.p0(i64 11025, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 88200, ptr nonnull %5) #4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %7 = load i64, ptr %2, align 8, !tbaa !5
  %8 = add nsw i64 %7, -1
  store i64 %8, ptr %2, align 8, !tbaa !5
  %.not60 = icmp eq i64 %7, 0
  br i1 %.not60, label %._crit_edge63, label %.lr.ph62

.lr.ph62:                                         ; preds = %0, %.critedge
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %10 = load i64, ptr %3, align 8, !tbaa !5
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %.critedge

.preheader39:                                     ; preds = %.lr.ph
  %12 = icmp slt i64 %17, 1
  br i1 %12, label %.critedge, label %.lr.ph52.preheader

.lr.ph52.preheader:                               ; preds = %.preheader39
  %xtraiter = and i64 %17, 1
  %13 = icmp eq i64 %17, 1
  %unroll_iter = and i64 %17, 9223372036854775806
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph52

.lr.ph:                                           ; preds = %.lr.ph62, %.lr.ph
  %.03241 = phi i64 [ %16, %.lr.ph ], [ 0, %.lr.ph62 ]
  %14 = getelementptr inbounds [105 x [105 x i8]], ptr %1, i64 0, i64 %.03241
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %14)
  %16 = add nuw nsw i64 %.03241, 1
  %17 = load i64, ptr %3, align 8, !tbaa !5
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %.lr.ph, label %.preheader39, !llvm.loop !9

.preheader38:                                     ; preds = %61
  %or.cond = icmp eq i64 %17, 1
  br i1 %or.cond, label %.critedge, label %.preheader36.us

.preheader36.us:                                  ; preds = %.preheader38, %._crit_edge55.us
  %.357.us = phi i64 [ %27, %._crit_edge55.us ], [ 0, %.preheader38 ]
  %.phi.trans.insert = getelementptr inbounds [105 x [105 x i64]], ptr %5, i64 0, i64 0, i64 %.357.us
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %.preheader36.us, %19
  %20 = phi i64 [ %.pre, %.preheader36.us ], [ %23, %19 ]
  %21 = phi i64 [ 1, %.preheader36.us ], [ %25, %19 ]
  %22 = getelementptr inbounds [105 x [105 x i64]], ptr %5, i64 0, i64 %21, i64 %.357.us
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = icmp sgt i64 %20, %23
  %25 = add nuw nsw i64 %21, 1
  %26 = icmp sge i64 %25, %17
  %.not66 = or i1 %26, %24
  br i1 %.not66, label %._crit_edge55.us, label %19, !llvm.loop !11

._crit_edge55.us:                                 ; preds = %19
  %27 = add nuw nsw i64 %.357.us, 1
  %28 = icmp sge i64 %27, %17
  %.not68 = or i1 %28, %24
  br i1 %.not68, label %._crit_edge58, label %.preheader36.us, !llvm.loop !12

.lr.ph52:                                         ; preds = %.lr.ph52.preheader, %61
  %.13351 = phi i64 [ %62, %61 ], [ 0, %.lr.ph52.preheader ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %4, i8 0, i64 208, i1 false)
  br i1 %13, label %.preheader.preheader.unr-lcssa, label %.lr.ph52.new

.lr.ph52.new:                                     ; preds = %.lr.ph52, %.lr.ph52.new
  %.02942 = phi i64 [ %44, %.lr.ph52.new ], [ 0, %.lr.ph52 ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph52.new ], [ 0, %.lr.ph52 ]
  %29 = getelementptr inbounds [105 x [105 x i8]], ptr %1, i64 0, i64 %.13351, i64 %.02942
  %30 = load i8, ptr %29, align 1, !tbaa !13
  %31 = sext i8 %30 to i64
  %32 = add nsw i64 %31, -97
  %33 = getelementptr inbounds [26 x i64], ptr %4, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add nsw i64 %34, 1
  store i64 %35, ptr %33, align 8, !tbaa !5
  %36 = or disjoint i64 %.02942, 1
  %37 = getelementptr inbounds [105 x [105 x i8]], ptr %1, i64 0, i64 %.13351, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !13
  %39 = sext i8 %38 to i64
  %40 = add nsw i64 %39, -97
  %41 = getelementptr inbounds [26 x i64], ptr %4, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %41, align 8, !tbaa !5
  %44 = add nuw nsw i64 %.02942, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.preheader.unr-lcssa, label %.lr.ph52.new, !llvm.loop !14

.preheader.preheader.unr-lcssa:                   ; preds = %.lr.ph52.new, %.lr.ph52
  %.02942.unr = phi i64 [ 0, %.lr.ph52 ], [ %44, %.lr.ph52.new ]
  br i1 %lcmp.mod.not, label %.preheader.preheader, label %.preheader.preheader.epilog-lcssa

.preheader.preheader.epilog-lcssa:                ; preds = %.preheader.preheader.unr-lcssa
  %45 = getelementptr inbounds [105 x [105 x i8]], ptr %1, i64 0, i64 %.13351, i64 %.02942.unr
  %46 = load i8, ptr %45, align 1, !tbaa !13
  %47 = sext i8 %46 to i64
  %48 = add nsw i64 %47, -97
  %49 = getelementptr inbounds [26 x i64], ptr %4, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %49, align 8, !tbaa !5
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.preheader.unr-lcssa, %.preheader.preheader.epilog-lcssa
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %.050 = phi i64 [ %60, %._crit_edge ], [ 0, %.preheader.preheader ]
  %.13049 = phi i64 [ %.231.lcssa, %._crit_edge ], [ 0, %.preheader.preheader ]
  %52 = getelementptr inbounds [26 x i64], ptr %4, i64 0, i64 %.050
  %.promoted = load i64, ptr %52, align 8, !tbaa !5
  %53 = icmp sgt i64 %.promoted, 0
  br i1 %53, label %.lr.ph46.preheader, label %._crit_edge

.lr.ph46.preheader:                               ; preds = %.preheader
  %54 = add i64 %.13049, %.promoted
  %min.iters.check = icmp ult i64 %.promoted, 4
  br i1 %min.iters.check, label %.lr.ph46.preheader82, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph46.preheader
  %n.vec = and i64 %.promoted, 9223372036854775804
  %ind.end = add i64 %.13049, %n.vec
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %.050, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %.13049, %index
  %55 = getelementptr inbounds [105 x [105 x i64]], ptr %5, i64 0, i64 %.13351, i64 %offset.idx
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  store <2 x i64> %broadcast.splat, ptr %55, align 8, !tbaa !5
  store <2 x i64> %broadcast.splat, ptr %56, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %.promoted, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph46.preheader82

.lr.ph46.preheader82:                             ; preds = %middle.block, %.lr.ph46.preheader
  %.23145.ph = phi i64 [ %.13049, %.lr.ph46.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph46

.lr.ph46:                                         ; preds = %.lr.ph46.preheader82, %.lr.ph46
  %.23145 = phi i64 [ %59, %.lr.ph46 ], [ %.23145.ph, %.lr.ph46.preheader82 ]
  %58 = getelementptr inbounds [105 x [105 x i64]], ptr %5, i64 0, i64 %.13351, i64 %.23145
  store i64 %.050, ptr %58, align 8, !tbaa !5
  %59 = add i64 %.23145, 1
  %exitcond73.not = icmp eq i64 %59, %54
  br i1 %exitcond73.not, label %._crit_edge, label %.lr.ph46, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph46, %middle.block, %.preheader
  %.lcssa44 = phi i64 [ %.promoted, %.preheader ], [ 0, %middle.block ], [ 0, %.lr.ph46 ]
  %.231.lcssa = phi i64 [ %.13049, %.preheader ], [ %54, %middle.block ], [ %54, %.lr.ph46 ]
  store i64 %.lcssa44, ptr %52, align 8, !tbaa !5
  %60 = add nuw nsw i64 %.050, 1
  %exitcond74.not = icmp eq i64 %60, 26
  br i1 %exitcond74.not, label %61, label %.preheader, !llvm.loop !19

61:                                               ; preds = %._crit_edge
  %62 = add nuw nsw i64 %.13351, 1
  %exitcond75.not = icmp eq i64 %62, %17
  br i1 %exitcond75.not, label %.preheader38, label %.lr.ph52, !llvm.loop !20

._crit_edge58:                                    ; preds = %._crit_edge55.us
  %spec.select = select i1 %24, ptr @.str.3, ptr @.str.2
  br label %.critedge

.critedge:                                        ; preds = %._crit_edge58, %.preheader38, %.preheader39, %.lr.ph62
  %.str.3.sink = phi ptr [ @.str.2, %.lr.ph62 ], [ @.str.2, %.preheader39 ], [ @.str.2, %.preheader38 ], [ %spec.select, %._crit_edge58 ]
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  %64 = load i64, ptr %2, align 8, !tbaa !5
  %65 = add nsw i64 %64, -1
  store i64 %65, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %64, 0
  br i1 %.not, label %._crit_edge63, label %.lr.ph62, !llvm.loop !21

._crit_edge63:                                    ; preds = %.critedge, %0
  call void @llvm.lifetime.end.p0(i64 88200, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 11025, ptr nonnull %1) #4
  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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !17, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass