; LLVM IR from tangjz/acm-icpc :: lydsy (1221)

; 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.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@cc = external dso_local global i32, align 4
@a = external dso_local global [1001 x i32], align 16
@p = external dso_local global [2 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4calci(i32 noundef) #0

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

; Function Attrs: inlinehint mustprogress 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @p, ptr noundef getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1), ptr noundef @cc, ptr noundef getelementptr inbounds (%"struct.std::pair", ptr @p, i32 0, i32 1), ptr noundef getelementptr inbounds (%"struct.std::pair", ptr getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1), i32 0, i32 1))
  %10 = load i32, ptr @p, align 16, !tbaa !9
  %11 = add nsw i32 %10, 1
  store i32 %11, ptr @p, align 16, !tbaa !9
  %12 = load i32, ptr getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1), align 8, !tbaa !9
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1), align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %35, %0
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %38

19:                                               ; preds = %14
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr @a, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %22)
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1001 x i32], ptr @a, i64 0, i64 %25
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %28 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %28, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1001 x i32], ptr @a, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = add nsw i32 %33, %32
  store i32 %34, ptr %3, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %19
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %4, align 4, !tbaa !5
  br label %14, !llvm.loop !11

38:                                               ; preds = %18
  %39 = call noundef zeroext i1 @_ZStgtIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) @p, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1))
  br i1 %39, label %40, label %41

40:                                               ; preds = %38
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) @p, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1)) #7
  br label %41

41:                                               ; preds = %40, %38
  %42 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr @p, i32 0, i32 1), align 4, !tbaa !13
  %43 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1), i32 0, i32 1), align 4, !tbaa !13
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %41
  %46 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds ([2 x %"struct.std::pair"], ptr @p, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(8) @p)
  br label %47

47:                                               ; preds = %45, %41
  br label %48

48:                                               ; preds = %75, %47
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sub nsw i32 %49, %50
  %52 = icmp sge i32 %51, 4
  br i1 %52, label %53, label %76

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sub nsw i32 %55, %56
  %58 = sdiv i32 %57, 3
  %59 = add nsw i32 %54, %58
  store i32 %59, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sub nsw i32 %61, %62
  %64 = sdiv i32 %63, 3
  %65 = sub nsw i32 %60, %64
  store i32 %65, ptr %6, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = call noundef i32 @_Z4calci(i32 noundef %66)
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = call noundef i32 @_Z4calci(i32 noundef %68)
  %70 = icmp slt i32 %67, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %53
  %72 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %72, ptr %3, align 4, !tbaa !5
  br label %75

73:                                               ; preds = %53
  %74 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %74, ptr %2, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %73, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %48, !llvm.loop !14

76:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = call noundef i32 @_Z4calci(i32 noundef %77)
  store i32 %78, ptr %7, align 4, !tbaa !5
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %2, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %90, %76
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = icmp sle i32 %82, %83
  br i1 %84, label %85, label %93

85:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = call noundef i32 @_Z4calci(i32 noundef %86)
  store i32 %87, ptr %8, align 4, !tbaa !5
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %89 = load i32, ptr %88, align 4, !tbaa !5
  store i32 %89, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %90

90:                                               ; preds = %85
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %2, align 4, !tbaa !5
  br label %81, !llvm.loop !15

93:                                               ; preds = %81
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %94)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

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

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZStgtIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #5

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

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

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 nosync 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 = { 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 #6 = { 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 #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, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@cc = external dso_local global i32, align 4
@a = external dso_local global [1001 x i32], align 16
@p = external dso_local global [2 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4calci(i32 noundef) local_unnamed_addr #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: 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 #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @p, ptr noundef nonnull getelementptr inbounds (i8, ptr @p, i64 8), ptr noundef nonnull @cc, ptr noundef nonnull getelementptr inbounds (i8, ptr @p, i64 4), ptr noundef nonnull getelementptr inbounds (i8, ptr @p, i64 12))
  %5 = load i32, ptr @p, align 16, !tbaa !9
  %6 = add nsw i32 %5, 1
  store i32 %6, ptr @p, align 16, !tbaa !9
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !9
  %8 = add nsw i32 %7, 1
  store i32 %8, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !9
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.0.lcssa = phi i32 [ 0, %0 ], [ %17, %.lr.ph ]
  %11 = call noundef zeroext i1 @_ZStgtIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) @p, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @p, i64 8))
  br i1 %11, label %21, label %22

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %.018 = phi i32 [ %17, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %12)
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %15 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %15, ptr %1, align 4, !tbaa !5
  %16 = load i32, ptr %12, align 4, !tbaa !5
  %17 = add nsw i32 %16, %.018
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !11

21:                                               ; preds = %._crit_edge
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) @p, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @p, i64 8)) #7
  br label %22

22:                                               ; preds = %21, %._crit_edge
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @p, i64 4), align 4, !tbaa !13
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @p, i64 12), align 4, !tbaa !13
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %26, label %28

26:                                               ; preds = %22
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @p, i64 8), ptr noundef nonnull align 4 dereferenceable(8) @p)
  br label %28

28:                                               ; preds = %26, %22
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sub nsw i32 %.0.lcssa, %29
  %31 = icmp sgt i32 %30, 3
  br i1 %31, label %.lr.ph21, label %._crit_edge22

.lr.ph21:                                         ; preds = %28, %41
  %32 = phi i32 [ %43, %41 ], [ %30, %28 ]
  %33 = phi i32 [ %42, %41 ], [ %29, %28 ]
  %.119 = phi i32 [ %.2, %41 ], [ %.0.lcssa, %28 ]
  %34 = udiv i32 %32, 3
  %35 = add nsw i32 %34, %33
  %36 = sub nsw i32 %.119, %34
  %37 = call noundef i32 @_Z4calci(i32 noundef %35)
  %38 = call noundef i32 @_Z4calci(i32 noundef %36)
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %.lr.ph21._crit_edge, label %40

.lr.ph21._crit_edge:                              ; preds = %.lr.ph21
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %41

40:                                               ; preds = %.lr.ph21
  store i32 %35, ptr %1, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %.lr.ph21._crit_edge, %40
  %42 = phi i32 [ %35, %40 ], [ %.pre, %.lr.ph21._crit_edge ]
  %.2 = phi i32 [ %.119, %40 ], [ %36, %.lr.ph21._crit_edge ]
  %43 = sub nsw i32 %.2, %42
  %44 = icmp sgt i32 %43, 3
  br i1 %44, label %.lr.ph21, label %._crit_edge22, !llvm.loop !14

._crit_edge22:                                    ; preds = %41, %28
  %.1.lcssa = phi i32 [ %.0.lcssa, %28 ], [ %.2, %41 ]
  %.lcssa = phi i32 [ %29, %28 ], [ %42, %41 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %45 = call noundef i32 @_Z4calci(i32 noundef %.lcssa)
  store i32 %45, ptr %2, align 4, !tbaa !5
  %storemerge.in25 = load i32, ptr %1, align 4, !tbaa !5
  %storemerge26 = add nsw i32 %storemerge.in25, 1
  store i32 %storemerge26, ptr %1, align 4, !tbaa !5
  %.not.not27 = icmp slt i32 %storemerge.in25, %.1.lcssa
  br i1 %.not.not27, label %.lr.ph30, label %._crit_edge31

.lr.ph30:                                         ; preds = %._crit_edge22, %.lr.ph30
  %storemerge28 = phi i32 [ %storemerge, %.lr.ph30 ], [ %storemerge26, %._crit_edge22 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %46 = call noundef i32 @_Z4calci(i32 noundef %storemerge28)
  store i32 %46, ptr %3, align 4, !tbaa !5
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %48 = load i32, ptr %47, align 4, !tbaa !5
  store i32 %48, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %storemerge.in = load i32, ptr %1, align 4, !tbaa !5
  %storemerge = add nsw i32 %storemerge.in, 1
  store i32 %storemerge, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %storemerge.in, %.1.lcssa
  br i1 %.not.not, label %.lr.ph30, label %._crit_edge31, !llvm.loop !15

._crit_edge31:                                    ; preds = %.lr.ph30, %._crit_edge22
  %49 = phi i32 [ %45, %._crit_edge22 ], [ %48, %.lr.ph30 ]
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %49)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStgtIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync 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 = { 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 #5 = { 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 #6 = { 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 #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, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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