; LLVM IR from tangjz/acm-icpc :: codeforces/complete (766C)

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

%struct.Info = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@lim = external dso_local global [27 x i32], align 16
@str = external dso_local global [1003 x i8], align 16
@f = external dso_local global [1001 x %struct.Info], align 16
@.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 [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3updR4InfoS_(ptr noundef nonnull align 4 dereferenceable(12), i64, i32) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Info, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.Info, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.Info, align 4
  %11 = alloca { i64, i32 }, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef getelementptr inbounds (i8, ptr @str, i64 1))
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %22, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 26
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %13
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr @lim, i64 %19
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %20)
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !9

25:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 12, ptr %3) #6
  %26 = getelementptr inbounds %struct.Info, ptr %3, i32 0, i32 0
  store i32 1, ptr %26, align 4, !tbaa !11
  %27 = getelementptr inbounds %struct.Info, ptr %3, i32 0, i32 1
  store i32 0, ptr %27, align 4, !tbaa !13
  %28 = getelementptr inbounds %struct.Info, ptr %3, i32 0, i32 2
  store i32 0, ptr %28, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @f, ptr align 4 %3, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %41, %25
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %44

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #6
  %35 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 0
  store i32 0, ptr %35, align 4, !tbaa !11
  %36 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  store i32 0, ptr %36, align 4, !tbaa !13
  %37 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 2
  store i32 2147483647, ptr %37, align 4, !tbaa !14
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %39
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 4 %5, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #6
  br label %41

41:                                               ; preds = %34
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !16

44:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %110, %44
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %113

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 2147483647, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %105, %50
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = add nsw i32 %52, %53
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %51
  store i32 11, ptr %7, align 4
  br label %108

58:                                               ; preds = %51
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = add nsw i32 %59, %60
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1003 x i8], ptr @str, i64 0, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !17
  %65 = sext i8 %64 to i32
  %66 = sub nsw i32 %65, 97
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [27 x i32], ptr @lim, i64 0, i64 %67
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %68)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %8, align 4, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = icmp sgt i32 %71, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %58
  store i32 11, ptr %7, align 4
  br label %108

75:                                               ; preds = %58
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = add nsw i32 %76, %77
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %79
  %81 = getelementptr inbounds %struct.Info, ptr %10, i32 0, i32 0
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.Info, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 4, !tbaa !11
  store i32 %86, ptr %81, align 4, !tbaa !11
  %87 = getelementptr inbounds %struct.Info, ptr %10, i32 0, i32 1
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %89
  %91 = getelementptr inbounds %struct.Info, ptr %90, i32 0, i32 1
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %91, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %93 = load i32, ptr %92, align 4, !tbaa !5
  store i32 %93, ptr %87, align 4, !tbaa !13
  %94 = getelementptr inbounds %struct.Info, ptr %10, i32 0, i32 2
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.Info, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 4, !tbaa !14
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %94, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %10, i64 12, i1 false)
  %101 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 0
  %102 = load i64, ptr %101, align 4
  %103 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 1
  %104 = load i32, ptr %103, align 4
  call void @_Z3updR4InfoS_(ptr noundef nonnull align 4 dereferenceable(12) %80, i64 %102, i32 %104)
  br label %105

105:                                              ; preds = %75
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %9, align 4, !tbaa !5
  br label %51, !llvm.loop !18

108:                                              ; preds = %74, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %109

109:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %6, align 4, !tbaa !5
  br label %45, !llvm.loop !19

113:                                              ; preds = %49
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.Info, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 4, !tbaa !11
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %120
  %122 = getelementptr inbounds %struct.Info, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 4, !tbaa !13
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.Info, ptr %126, i32 0, i32 2
  %128 = load i32, ptr %127, align 4, !tbaa !14
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %118, i32 noundef %123, i32 noundef %128)
  ret i32 0
}

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

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

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

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

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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 #3 = { 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 #4 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Info", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !6, i64 8}
!15 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!16 = distinct !{!16, !10}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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"

%struct.Info = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@lim = external dso_local global [27 x i32], align 16
@str = external dso_local global [1003 x i8], align 16
@f = external dso_local global [1001 x %struct.Info], align 16
@.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 [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3updR4InfoS_(ptr noundef nonnull align 4 dereferenceable(12), i64, i32) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull getelementptr inbounds (i8, ptr @str, i64 1))
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @lim)
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 4))
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 8))
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 12))
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 16))
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 20))
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 24))
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 28))
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 32))
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 36))
  %14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 40))
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 44))
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 48))
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 52))
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 56))
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 60))
  %20 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 64))
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 68))
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 72))
  %23 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 76))
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 80))
  %25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 84))
  %26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 88))
  %27 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 92))
  %28 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 96))
  %29 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 100))
  store i32 1, ptr @f, align 16, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %.not27 = icmp slt i32 %30, 1
  br i1 %.not27, label %.preheader.._crit_edge34_crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %31 = zext nneg i32 %30 to i64
  %xtraiter = and i64 %31, 3
  %32 = icmp ult i32 %30, 4
  br i1 %32, label %.lr.ph33.preheader.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %31, 2147483644
  br label %.lr.ph

.preheader.._crit_edge34_crit_edge:               ; preds = %0
  %.pre44 = sext i32 %30 to i64
  br label %._crit_edge34

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %33 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %indvars.iv
  store i32 0, ptr %33, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %33, i64 4
  store i32 0, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %33, i64 8
  store i32 2147483647, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %34, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx.1 = getelementptr inbounds i8, ptr %34, i64 4
  store i32 0, ptr %.sroa.4.0..sroa_idx.1, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx.1 = getelementptr inbounds i8, ptr %34, i64 8
  store i32 2147483647, ptr %.sroa.5.0..sroa_idx.1, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %35 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %indvars.iv.next.1
  store i32 0, ptr %35, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx.2 = getelementptr inbounds i8, ptr %35, i64 4
  store i32 0, ptr %.sroa.4.0..sroa_idx.2, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx.2 = getelementptr inbounds i8, ptr %35, i64 8
  store i32 2147483647, ptr %.sroa.5.0..sroa_idx.2, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %36 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %indvars.iv.next.2
  store i32 0, ptr %36, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx.3 = getelementptr inbounds i8, ptr %36, i64 4
  store i32 0, ptr %.sroa.4.0..sroa_idx.3, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx.3 = getelementptr inbounds i8, ptr %36, i64 8
  store i32 2147483647, ptr %.sroa.5.0..sroa_idx.3, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 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 %.lr.ph33.preheader.unr-lcssa, label %.lr.ph, !llvm.loop !9

.lr.ph33.preheader.unr-lcssa:                     ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph33.preheader, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.lr.ph33.preheader.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.lr.ph33.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.lr.ph33.preheader.unr-lcssa ]
  %37 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %indvars.iv.epil
  store i32 0, ptr %37, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx.epil = getelementptr inbounds i8, ptr %37, i64 4
  store i32 0, ptr %.sroa.4.0..sroa_idx.epil, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx.epil = getelementptr inbounds i8, ptr %37, i64 8
  store i32 2147483647, ptr %.sroa.5.0..sroa_idx.epil, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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 %.lr.ph33.preheader, label %.lr.ph.epil, !llvm.loop !11

.lr.ph33.preheader:                               ; preds = %.lr.ph.epil, %.lr.ph33.preheader.unr-lcssa
  br label %.lr.ph33

._crit_edge34:                                    ; preds = %._crit_edge, %.preheader.._crit_edge34_crit_edge
  %.pre-phi45 = phi i64 [ %.pre44, %.preheader.._crit_edge34_crit_edge ], [ %.pre-phi, %._crit_edge ]
  %38 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %.pre-phi45
  %39 = load i32, ptr %38, align 4, !tbaa !13
  %40 = getelementptr inbounds i8, ptr %38, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = getelementptr inbounds i8, ptr %38, i64 8
  %43 = load i32, ptr %42, align 4, !tbaa !16
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %39, i32 noundef %41, i32 noundef %43)
  ret i32 0

.lr.ph33:                                         ; preds = %.lr.ph33.preheader, %._crit_edge
  %45 = phi i32 [ %78, %._crit_edge ], [ %30, %.lr.ph33.preheader ]
  %indvars.iv38 = phi i64 [ %47, %._crit_edge ], [ 0, %.lr.ph33.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 2147483647, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %.not2529.not = icmp slt i64 %indvars.iv38, %46
  %47 = add nuw nsw i64 %indvars.iv38, 1
  br i1 %.not2529.not, label %.lr.ph30, label %._crit_edge

.lr.ph30:                                         ; preds = %.lr.ph33
  %48 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %indvars.iv38
  %49 = getelementptr inbounds i8, ptr %48, i64 4
  %50 = getelementptr inbounds i8, ptr %48, i64 8
  %51 = trunc nuw nsw i64 %47 to i32
  %52 = trunc nuw nsw i64 %indvars.iv38 to i32
  br label %53

53:                                               ; preds = %.lr.ph30, %65
  %54 = phi i32 [ %51, %.lr.ph30 ], [ %76, %65 ]
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1003 x i8], ptr @str, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !17
  %58 = sext i8 %57 to i64
  %59 = add nsw i64 %58, -97
  %60 = getelementptr inbounds [27 x i32], ptr @lim, i64 0, i64 %59
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %60)
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %1, align 4, !tbaa !5
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = icmp sgt i32 %63, %62
  br i1 %64, label %.._crit_edge.loopexit_crit_edge, label %65

.._crit_edge.loopexit_crit_edge:                  ; preds = %53
  %.pre.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge.loopexit

65:                                               ; preds = %53
  %66 = add nsw i32 %63, %52
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1001 x %struct.Info], ptr @f, i64 0, i64 %67
  %69 = load i32, ptr %48, align 4, !tbaa !13
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %49, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load i32, ptr %50, align 4, !tbaa !16
  %73 = add nsw i32 %72, 1
  %.sroa.22.0.insert.ext = zext i32 %71 to i64
  %.sroa.22.0.insert.shift = shl nuw i64 %.sroa.22.0.insert.ext, 32
  %.sroa.01.0.insert.ext = zext i32 %69 to i64
  %.sroa.01.0.insert.insert = or disjoint i64 %.sroa.22.0.insert.shift, %.sroa.01.0.insert.ext
  call void @_Z3updR4InfoS_(ptr noundef nonnull align 4 dereferenceable(12) %68, i64 %.sroa.01.0.insert.insert, i32 %73)
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %2, align 4, !tbaa !5
  %76 = add nsw i32 %75, %52
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %.not25 = icmp sgt i32 %76, %77
  br i1 %.not25, label %._crit_edge.loopexit, label %53, !llvm.loop !18

._crit_edge.loopexit:                             ; preds = %65, %.._crit_edge.loopexit_crit_edge
  %.pre = phi i32 [ %.pre.pre, %.._crit_edge.loopexit_crit_edge ], [ %77, %65 ]
  %.pre42 = sext i32 %.pre to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph33, %._crit_edge.loopexit
  %.pre-phi = phi i64 [ %.pre42, %._crit_edge.loopexit ], [ %46, %.lr.ph33 ]
  %78 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %45, %.lr.ph33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %79 = icmp slt i64 %47, %.pre-phi
  br i1 %79, label %.lr.ph33, label %._crit_edge34, !llvm.loop !19
}

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

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

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

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

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 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 #2 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS4Info", !6, i64 0, !6, i64 4, !6, i64 8}
!15 = !{!14, !6, i64 4}
!16 = !{!14, !6, i64 8}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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