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

; 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.Point = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@ans = external dso_local global i64, align 8
@p = external dso_local global [200010 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5PointC2Eiii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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 %struct.Point, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 3
  br i1 %12, label %13, label %15

13:                                               ; preds = %0
  %14 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %143

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

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

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

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %3, ptr noundef %4)
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = icmp sge i32 %23, 0
  br i1 %24, label %25, label %29

25:                                               ; preds = %21
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp sge i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %46

29:                                               ; preds = %25, %21
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp sle i32 %30, 0
  br i1 %31, label %32, label %36

32:                                               ; preds = %29
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = icmp sle i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %45

36:                                               ; preds = %32, %29
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %43

39:                                               ; preds = %36
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %44

43:                                               ; preds = %39, %36
  store i32 3, ptr %5, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %43, %42
  br label %45

45:                                               ; preds = %44, %35
  br label %46

46:                                               ; preds = %45, %28
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #6
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr %5, align 4, !tbaa !5
  call void @_ZN5PointC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef %47, i32 noundef %48, i32 noundef %49)
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %51
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %52, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %53

53:                                               ; preds = %46
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !10

56:                                               ; preds = %20
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.Point, ptr @p, i64 %58
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @p, ptr noundef %59)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %74, %56
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %60
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %67
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = add nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %72
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %73, ptr align 4 %68, i64 12, i1 false), !tbaa.struct !9
  br label %74

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

77:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %125, %77
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %128

83:                                               ; preds = %78
  br label %84

84:                                               ; preds = %101, %83
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = add nsw i32 %86, %87
  %89 = icmp slt i32 %85, %88
  br i1 %89, label %90, label %99

90:                                               ; preds = %84
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %92
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %95
  %97 = call noundef i64 @_ZN5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(12) %93, ptr noundef nonnull align 4 dereferenceable(12) %96)
  %98 = icmp sge i64 %97, 0
  br label %99

99:                                               ; preds = %90, %84
  %100 = phi i1 [ false, %84 ], [ %98, %90 ]
  br i1 %100, label %101, label %104

101:                                              ; preds = %99
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %9, align 4, !tbaa !5
  br label %84, !llvm.loop !13

104:                                              ; preds = %99
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = sub nsw i32 %105, %106
  %108 = icmp sge i32 %107, 3
  br i1 %108, label %109, label %124

109:                                              ; preds = %104
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = sub nsw i32 %110, %111
  %113 = sub nsw i32 %112, 2
  %114 = sext i32 %113 to i64
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = sub nsw i32 %115, %116
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = mul nsw i64 %114, %119
  %121 = ashr i64 %120, 1
  %122 = load i64, ptr @ans, align 8, !tbaa !14
  %123 = add nsw i64 %122, %121
  store i64 %123, ptr @ans, align 8, !tbaa !14
  br label %124

124:                                              ; preds = %109, %104
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %8, align 4, !tbaa !5
  br label %78, !llvm.loop !16

128:                                              ; preds = %82
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = load i32, ptr @n, align 4, !tbaa !5
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = mul nsw i64 %130, %133
  %135 = load i32, ptr @n, align 4, !tbaa !5
  %136 = sub nsw i32 %135, 2
  %137 = sext i32 %136 to i64
  %138 = mul nsw i64 %134, %137
  %139 = sdiv i64 %138, 6
  %140 = load i64, ptr @ans, align 8, !tbaa !14
  %141 = sub nsw i64 %139, %140
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %141)
  store i32 0, ptr %1, align 4
  br label %143

143:                                              ; preds = %128, %13
  %144 = load i32, ptr %1, align 4
  ret i32 %144
}

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

declare i32 @puts(ptr noundef) #2

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

; 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) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

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

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


; 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.Point = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global i64, align 8
@p = external dso_local global [200010 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5PointC2Eiii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Point, align 4
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp slt i32 %5, 3
  br i1 %6, label %7, label %.lr.ph

7:                                                ; preds = %0
  %8 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %79

._crit_edge:                                      ; preds = %26
  %9 = sext i32 %28 to i64
  %10 = getelementptr inbounds %struct.Point, ptr @p, i64 %9
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull @p, ptr noundef nonnull %10)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph42.preheader, label %.preheader36.._crit_edge50_crit_edge

.lr.ph42.preheader:                               ; preds = %._crit_edge
  %13 = zext nneg i32 %11 to i64
  %xtraiter = and i64 %13, 1
  %14 = icmp eq i32 %11, 1
  br i1 %14, label %.preheader36.unr-lcssa, label %.lr.ph42.preheader.new

.lr.ph42.preheader.new:                           ; preds = %.lr.ph42.preheader
  %unroll_iter = and i64 %13, 2147483646
  br label %.lr.ph42

.lr.ph:                                           ; preds = %0, %26
  %indvars.iv = phi i64 [ %indvars.iv.next, %26 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, -1
  %18 = load i32, ptr %2, align 4
  %19 = icmp sgt i32 %18, -1
  %or.cond = select i1 %17, i1 %19, i1 false
  br i1 %or.cond, label %26, label %20

20:                                               ; preds = %.lr.ph
  %21 = icmp slt i32 %16, 1
  %22 = icmp slt i32 %18, 1
  %or.cond3 = select i1 %21, i1 %22, i1 false
  br i1 %or.cond3, label %26, label %23

23:                                               ; preds = %20
  %24 = icmp sgt i32 %16, 0
  %25 = icmp slt i32 %18, 0
  %or.cond5 = select i1 %24, i1 %25, i1 false
  %. = select i1 %or.cond5, i32 1, i32 3
  br label %26

26:                                               ; preds = %23, %20, %.lr.ph
  %.029 = phi i32 [ 2, %.lr.ph ], [ 0, %20 ], [ %., %23 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #6
  call void @_ZN5PointC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef %16, i32 noundef %18, i32 noundef %.029)
  %27 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %27, ptr noundef nonnull align 4 dereferenceable(12) %3, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !10

.preheader36.unr-lcssa:                           ; preds = %.lr.ph42, %.lr.ph42.preheader
  %indvars.iv55.unr = phi i64 [ 0, %.lr.ph42.preheader ], [ %indvars.iv.next56.1, %.lr.ph42 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader36, label %.lr.ph42.epil

.lr.ph42.epil:                                    ; preds = %.preheader36.unr-lcssa
  %31 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv55.unr
  %32 = add nuw nsw i64 %indvars.iv55.unr, %13
  %33 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %33, ptr noundef nonnull align 4 dereferenceable(12) %31, i64 12, i1 false), !tbaa.struct !9
  br label %.preheader36

.preheader36:                                     ; preds = %.preheader36.unr-lcssa, %.lr.ph42.epil
  br i1 %12, label %.preheader, label %.preheader36.._crit_edge50_crit_edge

.preheader36.._crit_edge50_crit_edge:             ; preds = %._crit_edge, %.preheader36
  %.pre = sext i32 %11 to i64
  br label %._crit_edge50

.lr.ph42:                                         ; preds = %.lr.ph42, %.lr.ph42.preheader.new
  %indvars.iv55 = phi i64 [ 0, %.lr.ph42.preheader.new ], [ %indvars.iv.next56.1, %.lr.ph42 ]
  %niter = phi i64 [ 0, %.lr.ph42.preheader.new ], [ %niter.next.1, %.lr.ph42 ]
  %34 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv55
  %35 = add nuw nsw i64 %indvars.iv55, %13
  %36 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %35
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 8 dereferenceable(12) %34, i64 12, i1 false), !tbaa.struct !9
  %indvars.iv.next56 = or disjoint i64 %indvars.iv55, 1
  %37 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv.next56
  %38 = add nuw nsw i64 %indvars.iv.next56, %13
  %39 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %38
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %37, i64 12, i1 false), !tbaa.struct !9
  %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader36.unr-lcssa, label %.lr.ph42, !llvm.loop !12

.preheader:                                       ; preds = %.preheader36, %75
  %40 = phi i32 [ %76, %75 ], [ %11, %.preheader36 ]
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %75 ], [ 0, %.preheader36 ]
  %.049 = phi i32 [ %.1.lcssa, %75 ], [ 0, %.preheader36 ]
  %41 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv61
  %42 = trunc nuw nsw i64 %indvars.iv61 to i32
  %43 = add nsw i32 %40, %42
  %44 = icmp slt i32 %.049, %43
  br i1 %44, label %.lr.ph44.preheader, label %.critedge

.lr.ph44.preheader:                               ; preds = %.preheader
  %45 = sext i32 %.049 to i64
  br label %.lr.ph44

._crit_edge50:                                    ; preds = %75, %.preheader36.._crit_edge50_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader36.._crit_edge50_crit_edge ], [ %77, %75 ]
  %.lcssa = phi i32 [ %11, %.preheader36.._crit_edge50_crit_edge ], [ %76, %75 ]
  %46 = add nsw i32 %.lcssa, -1
  %47 = sext i32 %46 to i64
  %48 = mul nsw i64 %.pre-phi, %47
  %49 = add nsw i32 %.lcssa, -2
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %48, %50
  %52 = sdiv i64 %51, 6
  %53 = load i64, ptr @ans, align 8, !tbaa !13
  %54 = sub nsw i64 %52, %53
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %54)
  br label %79

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %59
  %indvars.iv58 = phi i64 [ %45, %.lr.ph44.preheader ], [ %indvars.iv.next59, %59 ]
  %56 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv58
  %57 = call noundef i64 @_ZN5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(12) %41, ptr noundef nonnull align 4 dereferenceable(12) %56)
  %58 = icmp sgt i64 %57, -1
  br i1 %58, label %59, label %.critedge.loopexit

59:                                               ; preds = %.lr.ph44
  %indvars.iv.next59 = add nsw i64 %indvars.iv58, 1
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = add nsw i32 %60, %42
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next59, %62
  br i1 %63, label %.lr.ph44, label %.critedge.loopexit, !llvm.loop !15

.critedge.loopexit:                               ; preds = %59, %.lr.ph44
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv58, %.lr.ph44 ], [ %indvars.iv.next59, %59 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %.1.lcssa = phi i32 [ %.049, %.preheader ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  %64 = sub nsw i32 %.1.lcssa, %42
  %65 = icmp sgt i32 %64, 2
  br i1 %65, label %66, label %75

66:                                               ; preds = %.critedge
  %67 = add nsw i32 %64, -2
  %68 = zext nneg i32 %67 to i64
  %69 = add nsw i32 %64, -1
  %70 = zext nneg i32 %69 to i64
  %71 = mul nuw nsw i64 %68, %70
  %72 = lshr i64 %71, 1
  %73 = load i64, ptr @ans, align 8, !tbaa !13
  %74 = add nsw i64 %73, %72
  store i64 %74, ptr @ans, align 8, !tbaa !13
  br label %75

75:                                               ; preds = %.critedge, %66
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next62, %77
  br i1 %78, label %.preheader, label %._crit_edge50, !llvm.loop !16

79:                                               ; preds = %._crit_edge50, %7
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress 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) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

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

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


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