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

; 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 { i64, i64 }

@n = external dso_local global i32, align 4
@a = external dso_local global [201 x %"struct.std::pair"], align 16
@m = external dso_local global i64, align 8
@dt = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z4calcx(i64 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: 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() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m, ptr noundef @dt, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

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

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %33

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %22
  %24 = getelementptr inbounds %"struct.std::pair", ptr %23, i32 0, i32 1
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %26
  %28 = getelementptr inbounds %"struct.std::pair", ptr %27, i32 0, i32 0
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %24, ptr noundef %28)
  br label %30

30:                                               ; preds = %20
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !9

33:                                               ; preds = %19
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds %"struct.std::pair", ptr @a, i64 %35
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef @a, ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %74, %33
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %77

42:                                               ; preds = %37
  br label %43

43:                                               ; preds = %62, %42
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %59

46:                                               ; preds = %43
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %49
  %51 = getelementptr inbounds %"struct.std::pair", ptr %50, i32 0, i32 1
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %54
  %56 = getelementptr inbounds %"struct.std::pair", ptr %55, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = icmp sge i64 %52, %57
  br label %59

59:                                               ; preds = %46, %43
  %60 = phi i1 [ false, %43 ], [ %58, %46 ]
  br i1 %60, label %61, label %65

61:                                               ; preds = %59
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %3, align 4, !tbaa !5
  br label %43, !llvm.loop !14

65:                                               ; preds = %59
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %67
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %69 to i64
  %72 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %71
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull align 8 dereferenceable(16) %68)
  br label %74

74:                                               ; preds = %65
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %4, align 4, !tbaa !5
  br label %37, !llvm.loop !15

77:                                               ; preds = %41
  %78 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %78, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 1, ptr %5, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %79 = load i64, ptr @m, align 8, !tbaa !16
  %80 = load i64, ptr @dt, align 8, !tbaa !16
  %81 = sdiv i64 %79, %80
  store i64 %81, ptr %6, align 8, !tbaa !16
  br label %82

82:                                               ; preds = %109, %77
  %83 = load i64, ptr %6, align 8, !tbaa !16
  %84 = load i64, ptr %5, align 8, !tbaa !16
  %85 = sub nsw i64 %83, %84
  %86 = icmp sge i64 %85, 4
  br i1 %86, label %87, label %110

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %88 = load i64, ptr %6, align 8, !tbaa !16
  %89 = load i64, ptr %5, align 8, !tbaa !16
  %90 = sub nsw i64 %88, %89
  %91 = sdiv i64 %90, 3
  store i64 %91, ptr %7, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %92 = load i64, ptr %5, align 8, !tbaa !16
  %93 = load i64, ptr %7, align 8, !tbaa !16
  %94 = add nsw i64 %92, %93
  store i64 %94, ptr %8, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %95 = load i64, ptr %8, align 8, !tbaa !16
  %96 = call noundef i64 @_Z4calcx(i64 noundef %95)
  store i64 %96, ptr %9, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %97 = load i64, ptr %6, align 8, !tbaa !16
  %98 = load i64, ptr %7, align 8, !tbaa !16
  %99 = sub nsw i64 %97, %98
  store i64 %99, ptr %10, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %100 = load i64, ptr %10, align 8, !tbaa !16
  %101 = call noundef i64 @_Z4calcx(i64 noundef %100)
  store i64 %101, ptr %11, align 8, !tbaa !16
  %102 = load i64, ptr %9, align 8, !tbaa !16
  %103 = load i64, ptr %11, align 8, !tbaa !16
  %104 = icmp slt i64 %102, %103
  br i1 %104, label %105, label %107

105:                                              ; preds = %87
  %106 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %106, ptr %5, align 8, !tbaa !16
  br label %109

107:                                              ; preds = %87
  %108 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %108, ptr %6, align 8, !tbaa !16
  br label %109

109:                                              ; preds = %107, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %82, !llvm.loop !17

110:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !16
  br label %111

111:                                              ; preds = %116, %110
  %112 = load i64, ptr %5, align 8, !tbaa !16
  %113 = load i64, ptr %6, align 8, !tbaa !16
  %114 = icmp sle i64 %112, %113
  br i1 %114, label %115, label %122

115:                                              ; preds = %111
  br label %116

116:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %117 = load i64, ptr %5, align 8, !tbaa !16
  %118 = add nsw i64 %117, 1
  store i64 %118, ptr %5, align 8, !tbaa !16
  %119 = call noundef i64 @_Z4calcx(i64 noundef %117)
  store i64 %119, ptr %13, align 8, !tbaa !16
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %121 = load i64, ptr %120, align 8, !tbaa !16
  store i64 %121, ptr %12, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %111, !llvm.loop !18

122:                                              ; preds = %111
  %123 = load i64, ptr %12, align 8, !tbaa !16
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %123)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

declare i32 @printf(ptr noundef, ...) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 #6 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 8}
!12 = !{!"_ZTSSt4pairIxxE", !13, i64 0, !13, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!13, !13, i64 0}
!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"

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

@n = external dso_local global i32, align 4
@a = external dso_local global [201 x %"struct.std::pair"], align 16
@m = external dso_local global i64, align 8
@dt = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z4calcx(i64 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: 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 #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @dt, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %4 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %13, %.lr.ph ]
  %6 = getelementptr inbounds %"struct.std::pair", ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull @a, ptr noundef nonnull %6)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader, label %._crit_edge43

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %10, ptr noundef nonnull %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = icmp slt i64 %indvars.iv.next, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %._crit_edge, %.critedge
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.critedge ], [ 0, %._crit_edge ]
  %.03042 = phi i32 [ %30, %.critedge ], [ 0, %._crit_edge ]
  %15 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv63, i32 1
  %16 = sext i32 %.03042 to i64
  br label %22

._crit_edge43:                                    ; preds = %.critedge, %._crit_edge
  %.030.lcssa = phi i32 [ 0, %._crit_edge ], [ %30, %.critedge ]
  store i32 %.030.lcssa, ptr @n, align 4, !tbaa !5
  %17 = load i64, ptr @m, align 8, !tbaa !11
  %18 = load i64, ptr @dt, align 8, !tbaa !11
  %19 = sdiv i64 %17, %18
  %20 = icmp sgt i64 %19, 4
  br i1 %20, label %.lr.ph48.preheader, label %._crit_edge49

.lr.ph48.preheader:                               ; preds = %._crit_edge43
  %21 = add nsw i64 %19, -1
  br label %.lr.ph48

22:                                               ; preds = %.preheader, %24
  %indvars.iv60 = phi i64 [ %16, %.preheader ], [ %indvars.iv.next61, %24 ]
  %23 = icmp eq i64 %indvars.iv60, 0
  br i1 %23, label %.critedge, label %24

24:                                               ; preds = %22
  %indvars.iv.next61 = add nsw i64 %indvars.iv60, -1
  %25 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv.next61, i32 1
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = load i64, ptr %15, align 8, !tbaa !13
  %.not39 = icmp slt i64 %26, %27
  br i1 %.not39, label %.critedge.split.loop.exit68, label %22, !llvm.loop !15

.critedge.split.loop.exit68:                      ; preds = %24
  %28 = trunc nsw i64 %indvars.iv60 to i32
  br label %.critedge

.critedge:                                        ; preds = %22, %.critedge.split.loop.exit68
  %.1.lcssa = phi i32 [ %28, %.critedge.split.loop.exit68 ], [ 0, %22 ]
  %29 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv63
  %30 = add nsw i32 %.1.lcssa, 1
  %31 = sext i32 %.1.lcssa to i64
  %32 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %31
  %33 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(16) %29)
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next64, %35
  br i1 %36, label %.preheader, label %._crit_edge43, !llvm.loop !16

.lr.ph48:                                         ; preds = %.lr.ph48.preheader, %.lr.ph48
  %37 = phi i64 [ %44, %.lr.ph48 ], [ %21, %.lr.ph48.preheader ]
  %.03246 = phi i64 [ %..032, %.lr.ph48 ], [ 1, %.lr.ph48.preheader ]
  %.03445 = phi i64 [ %.034., %.lr.ph48 ], [ %19, %.lr.ph48.preheader ]
  %38 = udiv i64 %37, 3
  %39 = add nuw nsw i64 %38, %.03246
  %40 = tail call noundef i64 @_Z4calcx(i64 noundef %39)
  %41 = sub nsw i64 %.03445, %38
  %42 = tail call noundef i64 @_Z4calcx(i64 noundef %41)
  %43 = icmp slt i64 %40, %42
  %.034. = select i1 %43, i64 %.03445, i64 %41
  %..032 = select i1 %43, i64 %39, i64 %.03246
  %44 = sub nsw i64 %.034., %..032
  %45 = icmp sgt i64 %44, 3
  br i1 %45, label %.lr.ph48, label %._crit_edge49, !llvm.loop !17

._crit_edge49:                                    ; preds = %.lr.ph48, %._crit_edge43
  %.034.lcssa = phi i64 [ %19, %._crit_edge43 ], [ %.034., %.lr.ph48 ]
  %.032.lcssa = phi i64 [ 1, %._crit_edge43 ], [ %..032, %.lr.ph48 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !11
  %.not52 = icmp sgt i64 %.032.lcssa, %.034.lcssa
  br i1 %.not52, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; preds = %._crit_edge49, %.lr.ph55
  %.253 = phi i64 [ %46, %.lr.ph55 ], [ %.032.lcssa, %._crit_edge49 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %46 = add i64 %.253, 1
  %47 = call noundef i64 @_Z4calcx(i64 noundef %.253)
  store i64 %47, ptr %2, align 8, !tbaa !11
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %49 = load i64, ptr %48, align 8, !tbaa !11
  store i64 %49, ptr %1, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %exitcond.not = icmp eq i64 %.253, %.034.lcssa
  br i1 %exitcond.not, label %._crit_edge56, label %.lr.ph55, !llvm.loop !18

._crit_edge56:                                    ; preds = %.lr.ph55, %._crit_edge49
  %50 = phi i64 [ 0, %._crit_edge49 ], [ %49, %.lr.ph55 ]
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %50)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

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


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