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

; 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 { i64, 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 %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i64, align 8
  %13 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  br label %14

14:                                               ; preds = %136, %0
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m, ptr noundef @dt, ptr noundef @n)
  %16 = icmp eq i32 %15, 3
  br i1 %16, label %17, label %139

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %33, %17
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

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

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

33:                                               ; preds = %23
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

36:                                               ; preds = %22
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %"struct.std::pair", ptr @a, i64 %38
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef @a, ptr noundef %39)
  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 %40

40:                                               ; preds = %77, %36
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %80

45:                                               ; preds = %40
  br label %46

46:                                               ; preds = %65, %45
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %62

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

62:                                               ; preds = %49, %46
  %63 = phi i1 [ false, %46 ], [ %61, %49 ]
  br i1 %63, label %64, label %68

64:                                               ; preds = %62
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %3, align 4, !tbaa !5
  br label %46, !llvm.loop !14

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

77:                                               ; preds = %68
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %4, align 4, !tbaa !5
  br label %40, !llvm.loop !15

80:                                               ; preds = %44
  %81 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %81, 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
  %82 = load i64, ptr @m, align 8, !tbaa !16
  %83 = load i64, ptr @dt, align 8, !tbaa !16
  %84 = sdiv i64 %82, %83
  store i64 %84, ptr %6, align 8, !tbaa !16
  br label %85

85:                                               ; preds = %118, %80
  %86 = load i64, ptr %6, align 8, !tbaa !16
  %87 = load i64, ptr %5, align 8, !tbaa !16
  %88 = sub nsw i64 %86, %87
  %89 = icmp sge i64 %88, 4
  br i1 %89, label %90, label %119

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %91 = load i64, ptr %6, align 8, !tbaa !16
  %92 = load i64, ptr %5, align 8, !tbaa !16
  %93 = sub nsw i64 %91, %92
  %94 = sdiv i64 %93, 3
  store i64 %94, ptr %7, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %95 = load i64, ptr %5, align 8, !tbaa !16
  %96 = load i64, ptr %7, align 8, !tbaa !16
  %97 = add nsw i64 %95, %96
  store i64 %97, ptr %8, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %98 = load i64, ptr %6, align 8, !tbaa !16
  %99 = load i64, ptr %7, align 8, !tbaa !16
  %100 = sub nsw i64 %98, %99
  store i64 %100, ptr %9, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  %101 = load i64, ptr %8, align 8, !tbaa !16
  %102 = call { i64, i64 } @_Z4calcx(i64 noundef %101)
  %103 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %104 = extractvalue { i64, i64 } %102, 0
  store i64 %104, ptr %103, align 8
  %105 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %106 = extractvalue { i64, i64 } %102, 1
  store i64 %106, ptr %105, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %107 = load i64, ptr %9, align 8, !tbaa !16
  %108 = call { i64, i64 } @_Z4calcx(i64 noundef %107)
  %109 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %110 = extractvalue { i64, i64 } %108, 0
  store i64 %110, ptr %109, align 8
  %111 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %112 = extractvalue { i64, i64 } %108, 1
  store i64 %112, ptr %111, align 8
  %113 = call noundef zeroext i1 @_ZStltIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
  br i1 %113, label %114, label %116

114:                                              ; preds = %90
  %115 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %115, ptr %5, align 8, !tbaa !16
  br label %118

116:                                              ; preds = %90
  %117 = load i64, ptr %9, align 8, !tbaa !16
  store i64 %117, ptr %6, align 8, !tbaa !16
  br label %118

118:                                              ; preds = %116, %114
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, 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 %85, !llvm.loop !17

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

120:                                              ; preds = %125, %119
  %121 = load i64, ptr %5, align 8, !tbaa !16
  %122 = load i64, ptr %6, align 8, !tbaa !16
  %123 = icmp sle i64 %121, %122
  br i1 %123, label %124, label %136

124:                                              ; preds = %120
  br label %125

125:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  %126 = load i64, ptr %5, align 8, !tbaa !16
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %5, align 8, !tbaa !16
  %128 = call { i64, i64 } @_Z4calcx(i64 noundef %126)
  %129 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %130 = extractvalue { i64, i64 } %128, 0
  store i64 %130, ptr %129, align 8
  %131 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %132 = extractvalue { i64, i64 } %128, 1
  store i64 %132, ptr %131, align 8
  %133 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %134 = 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) %133)
  %135 = load i64, ptr %134, align 8, !tbaa !16
  store i64 %135, ptr %12, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  br label %120, !llvm.loop !18

136:                                              ; preds = %120
  %137 = load i64, ptr %12, align 8, !tbaa !16
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %137)
  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
  br label %14, !llvm.loop !19

139:                                              ; preds = %14
  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 zeroext i1 @_ZStltIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #6

; 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}
!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.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 { i64, 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 %"struct.std::pair", align 8
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @dt, ptr noundef nonnull @n)
  %6 = icmp eq i32 %5, 3
  br i1 %6, label %.preheader38.lr.ph, label %._crit_edge56

.preheader38.lr.ph:                               ; preds = %0
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = getelementptr inbounds i8, ptr %2, i64 8
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  br label %.preheader38

.preheader38:                                     ; preds = %.preheader38.lr.ph, %._crit_edge55
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader38.._crit_edge_crit_edge

.preheader38.._crit_edge_crit_edge:               ; preds = %.preheader38
  %.pre = sext i32 %10 to i64
  br label %._crit_edge

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

.lr.ph:                                           ; preds = %.preheader38, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader38 ]
  %15 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %16, ptr noundef nonnull %15)
  %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 !9

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

._crit_edge42:                                    ; preds = %.critedge, %._crit_edge
  %.028.lcssa = phi i32 [ 0, %._crit_edge ], [ %36, %.critedge ]
  store i32 %.028.lcssa, ptr @n, align 4, !tbaa !5
  %23 = load i64, ptr @m, align 8, !tbaa !11
  %24 = load i64, ptr @dt, align 8, !tbaa !11
  %25 = sdiv i64 %23, %24
  %26 = icmp sgt i64 %25, 4
  br i1 %26, label %.lr.ph47.preheader, label %._crit_edge48

.lr.ph47.preheader:                               ; preds = %._crit_edge42
  %27 = add nsw i64 %25, -1
  br label %.lr.ph47

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

30:                                               ; preds = %28
  %indvars.iv.next61 = add nsw i64 %indvars.iv60, -1
  %31 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv.next61, i32 1
  %32 = load i64, ptr %31, align 8, !tbaa !13
  %33 = load i64, ptr %21, align 8, !tbaa !13
  %.not37 = icmp slt i64 %32, %33
  br i1 %.not37, label %.critedge.split.loop.exit68, label %28, !llvm.loop !15

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

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

.lr.ph47:                                         ; preds = %.lr.ph47.preheader, %.lr.ph47
  %43 = phi i64 [ %54, %.lr.ph47 ], [ %27, %.lr.ph47.preheader ]
  %.03045 = phi i64 [ %.030., %.lr.ph47 ], [ %25, %.lr.ph47.preheader ]
  %.03244 = phi i64 [ %..032, %.lr.ph47 ], [ 1, %.lr.ph47.preheader ]
  %44 = udiv i64 %43, 3
  %45 = add nuw nsw i64 %44, %.03244
  %46 = sub nsw i64 %.03045, %44
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #7
  %47 = call { i64, i64 } @_Z4calcx(i64 noundef %45)
  %48 = extractvalue { i64, i64 } %47, 0
  store i64 %48, ptr %1, align 8
  %49 = extractvalue { i64, i64 } %47, 1
  store i64 %49, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  %50 = call { i64, i64 } @_Z4calcx(i64 noundef %46)
  %51 = extractvalue { i64, i64 } %50, 0
  store i64 %51, ptr %2, align 8
  %52 = extractvalue { i64, i64 } %50, 1
  store i64 %52, ptr %8, align 8
  %53 = call noundef zeroext i1 @_ZStltIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %..032 = select i1 %53, i64 %45, i64 %.03244
  %.030. = select i1 %53, i64 %.03045, i64 %46
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  %54 = sub nsw i64 %.030., %..032
  %55 = icmp sgt i64 %54, 3
  br i1 %55, label %.lr.ph47, label %._crit_edge48, !llvm.loop !17

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge42
  %.032.lcssa = phi i64 [ 1, %._crit_edge42 ], [ %..032, %.lr.ph47 ]
  %.030.lcssa = phi i64 [ %25, %._crit_edge42 ], [ %.030., %.lr.ph47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 0, ptr %3, align 8, !tbaa !11
  %.not51 = icmp sgt i64 %.032.lcssa, %.030.lcssa
  br i1 %.not51, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %._crit_edge48, %.lr.ph54
  %.252 = phi i64 [ %56, %.lr.ph54 ], [ %.032.lcssa, %._crit_edge48 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %56 = add i64 %.252, 1
  %57 = call { i64, i64 } @_Z4calcx(i64 noundef %.252)
  %58 = extractvalue { i64, i64 } %57, 0
  store i64 %58, ptr %4, align 8
  %59 = extractvalue { i64, i64 } %57, 1
  store i64 %59, ptr %9, align 8
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %61 = load i64, ptr %60, align 8, !tbaa !11
  store i64 %61, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %exitcond.not = icmp eq i64 %.252, %.030.lcssa
  br i1 %exitcond.not, label %._crit_edge55, label %.lr.ph54, !llvm.loop !18

._crit_edge55:                                    ; preds = %.lr.ph54, %._crit_edge48
  %62 = phi i64 [ 0, %._crit_edge48 ], [ %61, %.lr.ph54 ]
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %62)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @dt, ptr noundef nonnull @n)
  %65 = icmp eq i32 %64, 3
  br i1 %65, label %.preheader38, label %._crit_edge56, !llvm.loop !19

._crit_edge56:                                    ; preds = %._crit_edge55, %0
  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 zeroext i1 @_ZStltIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6

; 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}
!19 = distinct !{!19, !10}


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