; LLVM IR from reyadussalahin/problem-solving :: string/hashing/codeforces/F271D (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 [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [1520 x i8], align 16
  %3 = alloca [32 x i8], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [2310400 x i64], align 16
  %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 i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1520, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 18483200, ptr %6) #5
  %16 = getelementptr inbounds [1520 x i8], ptr %2, i64 0, i64 0
  %17 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %16, ptr noundef %17, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %19 = getelementptr inbounds [1520 x i8], ptr %2, i64 0, i64 0
  %20 = call i64 @strlen(ptr noundef %19) #6
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %84, %0
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %87

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 47, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %28 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %28, ptr %13, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %79, %27
  %30 = load i32, ptr %13, align 4, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 5, ptr %9, align 4
  br label %82

34:                                               ; preds = %29
  %35 = load i32, ptr %13, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1520 x i8], ptr %2, i64 0, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !11
  %39 = sext i8 %38 to i32
  %40 = sub nsw i32 %39, 97
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 48
  br i1 %45, label %46, label %49

46:                                               ; preds = %34
  %47 = load i32, ptr %10, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %10, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %46, %34
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = icmp sgt i32 %50, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %49
  store i32 5, ptr %9, align 4
  br label %82

54:                                               ; preds = %49
  %55 = load i64, ptr %12, align 8, !tbaa !9
  %56 = load i32, ptr %11, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = mul nsw i64 %55, %57
  %59 = load i32, ptr %13, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1520 x i8], ptr %2, i64 0, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !11
  %63 = sext i8 %62 to i32
  %64 = sub nsw i32 %63, 97
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = add nsw i64 %58, %66
  store i64 %67, ptr %12, align 8, !tbaa !9
  %68 = load i64, ptr %12, align 8, !tbaa !9
  %69 = icmp sge i64 %68, 1000000007
  br i1 %69, label %70, label %73

70:                                               ; preds = %54
  %71 = load i64, ptr %12, align 8, !tbaa !9
  %72 = sub nsw i64 %71, 1000000007
  store i64 %72, ptr %12, align 8, !tbaa !9
  br label %73

73:                                               ; preds = %70, %54
  %74 = load i64, ptr %12, align 8, !tbaa !9
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %75 to i64
  %78 = getelementptr inbounds [2310400 x i64], ptr %6, i64 0, i64 %77
  store i64 %74, ptr %78, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %73
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %13, align 4, !tbaa !5
  br label %29, !llvm.loop !12

82:                                               ; preds = %53, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %83

83:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %8, align 4, !tbaa !5
  br label %22, !llvm.loop !14

87:                                               ; preds = %26
  %88 = getelementptr inbounds [2310400 x i64], ptr %6, i64 0, i64 0
  %89 = getelementptr inbounds [2310400 x i64], ptr %6, i64 0, i64 0
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i64, ptr %89, i64 %91
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef %88, ptr noundef %92)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = icmp ne i32 %93, 0
  %95 = zext i1 %94 to i64
  %96 = select i1 %94, i32 1, i32 0
  store i32 %96, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %118, %87
  %98 = load i32, ptr %15, align 4, !tbaa !5
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %121

102:                                              ; preds = %97
  %103 = load i32, ptr %15, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [2310400 x i64], ptr %6, i64 0, i64 %104
  %106 = load i64, ptr %105, align 8, !tbaa !9
  %107 = load i32, ptr %15, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [2310400 x i64], ptr %6, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !9
  %112 = icmp eq i64 %106, %111
  br i1 %112, label %113, label %114

113:                                              ; preds = %102
  br label %118

114:                                              ; preds = %102
  %115 = load i32, ptr %14, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %14, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %114
  br label %118

118:                                              ; preds = %117, %113
  %119 = load i32, ptr %15, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %15, align 4, !tbaa !5
  br label %97, !llvm.loop !15

121:                                              ; preds = %101
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %122)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 18483200, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 1520, ptr %2) #5
  %124 = load i32, ptr %1, align 4
  ret i32 %124
}

; 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: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) #4

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

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

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


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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [1520 x i8], align 16
  %2 = alloca [32 x i8], align 16
  %3 = alloca i32, align 4
  %4 = alloca [2310400 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 1520, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 18483200, ptr nonnull %4) #5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #6
  %7 = trunc i64 %6 to i32
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %0
  %9 = load i32, ptr %3, align 4, !tbaa !5
  %wide.trip.count62 = and i64 %6, 2147483647
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %.split.loop.exit69
  %indvars.iv56 = phi i32 [ %7, %.preheader.lr.ph ], [ %indvars.iv.next57, %.split.loop.exit69 ]
  %indvars.iv = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next, %.split.loop.exit69 ]
  %.03445 = phi i32 [ 0, %.preheader.lr.ph ], [ %.135.lcssa, %.split.loop.exit69 ]
  %10 = sext i32 %.03445 to i64
  %11 = add i32 %.03445, %indvars.iv56
  br label %19

._crit_edge:                                      ; preds = %.split.loop.exit69, %0
  %.034.lcssa = phi i32 [ 0, %0 ], [ %.135.lcssa, %.split.loop.exit69 ]
  %12 = sext i32 %.034.lcssa to i64
  %13 = getelementptr inbounds i64, ptr %4, i64 %12
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull %4, ptr noundef nonnull %13)
  %.not = icmp ne i32 %.034.lcssa, 0
  %14 = zext i1 %.not to i32
  %15 = icmp sgt i32 %.034.lcssa, 1
  br i1 %15, label %.lr.ph.preheader, label %._crit_edge50

.lr.ph.preheader:                                 ; preds = %._crit_edge
  %wide.trip.count67 = zext nneg i32 %.034.lcssa to i64
  %.pre = load i64, ptr %4, align 16, !tbaa !9
  %16 = add nsw i64 %wide.trip.count67, -1
  %17 = add nsw i64 %wide.trip.count67, -2
  %xtraiter = and i64 %16, 3
  %18 = icmp ult i64 %17, 3
  br i1 %18, label %._crit_edge50.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %16, -4
  br label %.lr.ph

19:                                               ; preds = %.preheader, %29
  %indvars.iv54 = phi i64 [ %10, %.preheader ], [ %indvars.iv.next55, %29 ]
  %indvars.iv52 = phi i64 [ %indvars.iv, %.preheader ], [ %indvars.iv.next53, %29 ]
  %.02943 = phi i64 [ 0, %.preheader ], [ %spec.select39, %29 ]
  %.03142 = phi i32 [ 0, %.preheader ], [ %spec.select, %29 ]
  %20 = getelementptr inbounds [1520 x i8], ptr %1, i64 0, i64 %indvars.iv52
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = sext i8 %21 to i64
  %23 = add nsw i64 %22, -97
  %24 = getelementptr inbounds [32 x i8], ptr %2, i64 0, i64 %23
  %25 = load i8, ptr %24, align 1, !tbaa !11
  %26 = icmp eq i8 %25, 48
  %27 = zext i1 %26 to i32
  %spec.select = add nuw nsw i32 %.03142, %27
  %28 = icmp sgt i32 %spec.select, %9
  br i1 %28, label %.split.loop.exit, label %29

29:                                               ; preds = %19
  %30 = mul nsw i64 %.02943, 47
  %31 = add i64 %30, -96
  %32 = add i64 %31, %22
  %33 = icmp sgt i64 %32, 1000000006
  %34 = add nsw i64 %32, -1000000007
  %spec.select39 = select i1 %33, i64 %34, i64 %32
  %indvars.iv.next55 = add nsw i64 %indvars.iv54, 1
  %35 = getelementptr inbounds [2310400 x i64], ptr %4, i64 0, i64 %indvars.iv54
  store i64 %spec.select39, ptr %35, align 8, !tbaa !9
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count62
  br i1 %exitcond.not, label %.split.loop.exit69, label %19, !llvm.loop !12

.split.loop.exit:                                 ; preds = %19
  %36 = trunc nsw i64 %indvars.iv54 to i32
  br label %.split.loop.exit69

.split.loop.exit69:                               ; preds = %29, %.split.loop.exit
  %.135.lcssa = phi i32 [ %36, %.split.loop.exit ], [ %11, %29 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %indvars.iv.next57 = add i32 %indvars.iv56, -1
  %exitcond63.not = icmp eq i64 %indvars.iv.next, %wide.trip.count62
  br i1 %exitcond63.not, label %._crit_edge, label %.preheader, !llvm.loop !14

._crit_edge50.loopexit.unr-lcssa:                 ; preds = %.lr.ph, %.lr.ph.preheader
  %spec.select40.lcssa.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %spec.select40.3, %.lr.ph ]
  %.unr = phi i64 [ %.pre, %.lr.ph.preheader ], [ %57, %.lr.ph ]
  %indvars.iv64.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next65.3, %.lr.ph ]
  %.02747.unr = phi i32 [ %14, %.lr.ph.preheader ], [ %spec.select40.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge50, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge50.loopexit.unr-lcssa, %.lr.ph.epil
  %37 = phi i64 [ %39, %.lr.ph.epil ], [ %.unr, %._crit_edge50.loopexit.unr-lcssa ]
  %indvars.iv64.epil = phi i64 [ %indvars.iv.next65.epil, %.lr.ph.epil ], [ %indvars.iv64.unr, %._crit_edge50.loopexit.unr-lcssa ]
  %.02747.epil = phi i32 [ %spec.select40.epil, %.lr.ph.epil ], [ %.02747.unr, %._crit_edge50.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge50.loopexit.unr-lcssa ]
  %38 = getelementptr inbounds [2310400 x i64], ptr %4, i64 0, i64 %indvars.iv64.epil
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = icmp ne i64 %39, %37
  %41 = zext i1 %40 to i32
  %spec.select40.epil = add nuw nsw i32 %.02747.epil, %41
  %indvars.iv.next65.epil = add nuw nsw i64 %indvars.iv64.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge50, label %.lr.ph.epil, !llvm.loop !15

._crit_edge50:                                    ; preds = %._crit_edge50.loopexit.unr-lcssa, %.lr.ph.epil, %._crit_edge
  %.027.lcssa = phi i32 [ %14, %._crit_edge ], [ %spec.select40.lcssa.ph, %._crit_edge50.loopexit.unr-lcssa ], [ %spec.select40.epil, %.lr.ph.epil ]
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.027.lcssa)
  call void @llvm.lifetime.end.p0(i64 18483200, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 1520, ptr nonnull %1) #5
  ret i32 0

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %43 = phi i64 [ %.pre, %.lr.ph.preheader.new ], [ %57, %.lr.ph ]
  %indvars.iv64 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next65.3, %.lr.ph ]
  %.02747 = phi i32 [ %14, %.lr.ph.preheader.new ], [ %spec.select40.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %44 = getelementptr inbounds [2310400 x i64], ptr %4, i64 0, i64 %indvars.iv64
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = icmp ne i64 %45, %43
  %47 = zext i1 %46 to i32
  %spec.select40 = add nuw nsw i32 %.02747, %47
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %48 = getelementptr inbounds [2310400 x i64], ptr %4, i64 0, i64 %indvars.iv.next65
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = icmp ne i64 %49, %45
  %51 = zext i1 %50 to i32
  %spec.select40.1 = add nuw nsw i32 %spec.select40, %51
  %indvars.iv.next65.1 = add nuw nsw i64 %indvars.iv64, 2
  %52 = getelementptr inbounds [2310400 x i64], ptr %4, i64 0, i64 %indvars.iv.next65.1
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = icmp ne i64 %53, %49
  %55 = zext i1 %54 to i32
  %spec.select40.2 = add nuw nsw i32 %spec.select40.1, %55
  %indvars.iv.next65.2 = add nuw nsw i64 %indvars.iv64, 3
  %56 = getelementptr inbounds [2310400 x i64], ptr %4, i64 0, i64 %indvars.iv.next65.2
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = icmp ne i64 %57, %53
  %59 = zext i1 %58 to i32
  %spec.select40.3 = add nuw nsw i32 %spec.select40.2, %59
  %indvars.iv.next65.3 = add nuw nsw i64 %indvars.iv64, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge50.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !17
}

; 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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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 = { 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 nofree nounwind willreturn memory(argmem: read) "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 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !13}


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