; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-11-29 (J - Soju - tjz)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@a = external dso_local global [200001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

; 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 i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %9

9:                                                ; preds = %161, %0
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %12 = icmp ne i32 %10, 0
  br i1 %12, label %13, label %164

13:                                               ; preds = %9
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 1061109567, ptr @ans, align 4, !tbaa !5
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %35, %13
  %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) #5
  br label %38

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

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

38:                                               ; preds = %19
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %60, %38
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr @m, 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 %3) #5
  br label %63

45:                                               ; preds = %40
  %46 = load i32, ptr @tot, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %47
  %49 = getelementptr inbounds %struct.Point, ptr %48, i32 0, i32 1
  %50 = load i32, ptr @tot, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %51
  %53 = getelementptr inbounds %struct.Point, ptr %52, i32 0, i32 2
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %49, ptr noundef %53)
  %55 = load i32, ptr @tot, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr @tot, align 4, !tbaa !5
  %57 = sext i32 %55 to i64
  %58 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.Point, ptr %58, i32 0, i32 0
  store i32 1, ptr %59, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %45
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %3, align 4, !tbaa !5
  br label %40, !llvm.loop !13

63:                                               ; preds = %44
  %64 = load i32, ptr @tot, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.Point, ptr @a, i64 %65
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @a, ptr noundef %66)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1061109567, ptr %5, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %110, %63
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = load i32, ptr @tot, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %113

72:                                               ; preds = %67
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.Point, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %91

79:                                               ; preds = %72
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %81
  %83 = getelementptr inbounds %struct.Point, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %86
  %88 = getelementptr inbounds %struct.Point, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !15
  %90 = sub nsw i32 %84, %89
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %90)
  br label %109

91:                                               ; preds = %72
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = icmp ne i32 %92, 1061109567
  br i1 %93, label %94, label %108

94:                                               ; preds = %91
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.Point, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !14
  %101 = sub nsw i32 %95, %100
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %103
  %105 = getelementptr inbounds %struct.Point, ptr %104, i32 0, i32 2
  %106 = load i32, ptr %105, align 4, !tbaa !15
  %107 = add nsw i32 %101, %106
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %107)
  br label %108

108:                                              ; preds = %94, %91
  br label %109

109:                                              ; preds = %108, %79
  br label %110

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

113:                                              ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %114 = load i32, ptr @tot, align 4, !tbaa !5
  %115 = sub nsw i32 %114, 1
  store i32 %115, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1061109567, ptr %7, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %158, %113
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = icmp sge i32 %117, 0
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %161

120:                                              ; preds = %116
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %122
  %124 = getelementptr inbounds %struct.Point, ptr %123, i32 0, i32 0
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %139

127:                                              ; preds = %120
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %129
  %131 = getelementptr inbounds %struct.Point, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !14
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %134
  %136 = getelementptr inbounds %struct.Point, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 4, !tbaa !15
  %138 = add nsw i32 %132, %137
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %138)
  br label %157

139:                                              ; preds = %120
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = icmp ne i32 %140, 1061109567
  br i1 %141, label %142, label %156

142:                                              ; preds = %139
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = load i32, ptr %6, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.Point, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !14
  %149 = sub nsw i32 %143, %148
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %151
  %153 = getelementptr inbounds %struct.Point, ptr %152, i32 0, i32 2
  %154 = load i32, ptr %153, align 4, !tbaa !15
  %155 = sub nsw i32 %149, %154
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %155)
  br label %156

156:                                              ; preds = %142, %139
  br label %157

157:                                              ; preds = %156, %127
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = add nsw i32 %159, -1
  store i32 %160, ptr %6, align 4, !tbaa !5
  br label %116, !llvm.loop !17

161:                                              ; preds = %119
  %162 = load i32, ptr @ans, align 4, !tbaa !5
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %162)
  br label %9, !llvm.loop !18

164:                                              ; preds = %9
  ret i32 0
}

declare i32 @__isoc99_scanf(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 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) #4

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 = { 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 = { 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 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !6, i64 4}
!15 = !{!10, !6, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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.Point = type { i32, i32, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local global i32, align 4
@a = external dso_local global [200001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

; 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr @t, align 4, !tbaa !5
  %.not44 = icmp eq i32 %4, 0
  br i1 %.not44, label %._crit_edge47, label %.lr.ph46

.lr.ph46:                                         ; preds = %0, %._crit_edge43
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 1061109567, ptr @ans, align 4, !tbaa !5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph46
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph46
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  %.pre54 = load i32, ptr @tot, align 4, !tbaa !5
  br i1 %11, label %.lr.ph33, label %._crit_edge34

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %12 = phi i32 [ %19, %.lr.ph ], [ %.pre, %.lr.ph.preheader ]
  %.02030 = phi i32 [ %22, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %13
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  %16 = getelementptr inbounds i8, ptr %14, i64 8
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %15, ptr noundef nonnull %16)
  %18 = load i32, ptr @tot, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr @tot, align 4, !tbaa !5
  %20 = sext i32 %18 to i64
  %21 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %20
  store i32 0, ptr %21, align 4, !tbaa !9
  %22 = add nuw nsw i32 %.02030, 1
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge34:                                    ; preds = %.lr.ph33, %._crit_edge
  %25 = phi i32 [ %.pre54, %._crit_edge ], [ %37, %.lr.ph33 ]
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %struct.Point, ptr @a, i64 %26
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull @a, ptr noundef nonnull %27)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 1061109567, ptr %1, align 4, !tbaa !5
  %28 = load i32, ptr @tot, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph37, label %._crit_edge38.thread

._crit_edge38.thread:                             ; preds = %._crit_edge34
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  br label %._crit_edge43

.lr.ph33:                                         ; preds = %._crit_edge, %.lr.ph33
  %30 = phi i32 [ %37, %.lr.ph33 ], [ %.pre54, %._crit_edge ]
  %.01931 = phi i32 [ %40, %.lr.ph33 ], [ 0, %._crit_edge ]
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %31
  %33 = getelementptr inbounds i8, ptr %32, i64 4
  %34 = getelementptr inbounds i8, ptr %32, i64 8
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %33, ptr noundef nonnull %34)
  %36 = load i32, ptr @tot, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @tot, align 4, !tbaa !5
  %38 = sext i32 %36 to i64
  %39 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %38
  store i32 1, ptr %39, align 4, !tbaa !9
  %40 = add nuw nsw i32 %.01931, 1
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %.lr.ph33, label %._crit_edge34, !llvm.loop !13

._crit_edge38:                                    ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 1061109567, ptr %2, align 4, !tbaa !5
  %43 = icmp sgt i32 %63, 0
  br i1 %43, label %.lr.ph42.preheader, label %._crit_edge43

.lr.ph42.preheader:                               ; preds = %._crit_edge38
  %44 = zext nneg i32 %63 to i64
  br label %.lr.ph42

.lr.ph37:                                         ; preds = %._crit_edge34, %62
  %indvars.iv = phi i64 [ %indvars.iv.next, %62 ], [ 0, %._crit_edge34 ]
  %45 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %indvars.iv
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %.not25 = icmp eq i32 %46, 0
  br i1 %.not25, label %53, label %47

47:                                               ; preds = %.lr.ph37
  %48 = getelementptr inbounds i8, ptr %45, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !14
  %50 = getelementptr inbounds i8, ptr %45, i64 8
  %51 = load i32, ptr %50, align 4, !tbaa !15
  %52 = sub nsw i32 %49, %51
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %52)
  br label %62

53:                                               ; preds = %.lr.ph37
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %.not26 = icmp eq i32 %54, 1061109567
  br i1 %.not26, label %62, label %55

55:                                               ; preds = %53
  %56 = getelementptr inbounds i8, ptr %45, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !14
  %58 = sub i32 %54, %57
  %59 = getelementptr inbounds i8, ptr %45, i64 8
  %60 = load i32, ptr %59, align 4, !tbaa !15
  %61 = add nsw i32 %58, %60
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %61)
  br label %62

62:                                               ; preds = %47, %55, %53
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %63 = load i32, ptr @tot, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next, %64
  br i1 %65, label %.lr.ph37, label %._crit_edge38, !llvm.loop !16

._crit_edge43:                                    ; preds = %87, %._crit_edge38.thread, %._crit_edge38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %66 = load i32, ptr @ans, align 4, !tbaa !5
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %66)
  %68 = load i32, ptr @t, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %68, 0
  br i1 %.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !17

.lr.ph42:                                         ; preds = %.lr.ph42.preheader, %87
  %indvars.iv50 = phi i64 [ %44, %.lr.ph42.preheader ], [ %indvars.iv.next51, %87 ]
  %indvars.iv.next51 = add nsw i64 %indvars.iv50, -1
  %70 = getelementptr inbounds [200001 x %struct.Point], ptr @a, i64 0, i64 %indvars.iv.next51
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %.not23 = icmp eq i32 %71, 0
  br i1 %.not23, label %78, label %72

72:                                               ; preds = %.lr.ph42
  %73 = getelementptr inbounds i8, ptr %70, i64 4
  %74 = load i32, ptr %73, align 4, !tbaa !14
  %75 = getelementptr inbounds i8, ptr %70, i64 8
  %76 = load i32, ptr %75, align 4, !tbaa !15
  %77 = add nsw i32 %76, %74
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %77)
  br label %87

78:                                               ; preds = %.lr.ph42
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %.not24 = icmp eq i32 %79, 1061109567
  br i1 %.not24, label %87, label %80

80:                                               ; preds = %78
  %81 = getelementptr inbounds i8, ptr %70, i64 4
  %82 = load i32, ptr %81, align 4, !tbaa !14
  %83 = getelementptr inbounds i8, ptr %70, i64 8
  %84 = load i32, ptr %83, align 4, !tbaa !15
  %85 = add i32 %82, %84
  %86 = sub i32 %79, %85
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %86)
  br label %87

87:                                               ; preds = %72, %80, %78
  %88 = icmp ugt i64 %indvars.iv50, 1
  br i1 %88, label %.lr.ph42, label %._crit_edge43, !llvm.loop !18

._crit_edge47:                                    ; preds = %._crit_edge43, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(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 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 #4

; 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 = { 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 = { 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 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !6, i64 4}
!15 = !{!10, !6, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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