; LLVM IR from tangjz/acm-icpc :: hdu (5243)

; 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 { double, double }
%struct.Line = type { %struct.Point, %struct.Point }

@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
@a = external dso_local global [1001 x %struct.Point], align 16
@b = external dso_local global [1000001 x %struct.Point], align 16
@c = external dso_local global [1000001 x %struct.Line], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.Point, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.Line, align 8
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %15

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

19:                                               ; preds = %15
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %165

20:                                               ; preds = %15
  store i32 0, ptr @m, align 4, !tbaa !5
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %31, %20
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %34

27:                                               ; preds = %22
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %29
  call void @_ZN5Point4initEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
  br label %31

31:                                               ; preds = %27
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !9

34:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = sdiv i32 %35, 3
  %37 = sub nsw i32 %36, 1
  store i32 %37, ptr %6, align 4, !tbaa !5
  br label %38

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

42:                                               ; preds = %38
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %153

43:                                               ; preds = %38
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %70, %43
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %73

49:                                               ; preds = %44
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = icmp ne i32 %50, %51
  br i1 %52, label %53, label %69

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %58
  %60 = call { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 8 dereferenceable(16) %59)
  %61 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %62 = extractvalue { double, double } %60, 0
  store double %62, ptr %61, align 8
  %63 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %64 = extractvalue { double, double } %60, 1
  store double %64, ptr %63, align 8
  %65 = load i32, ptr @tot, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr @tot, align 4, !tbaa !5
  %67 = sext i32 %65 to i64
  %68 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %68, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  br label %69

69:                                               ; preds = %53, %49
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %7, align 4, !tbaa !5
  br label %44, !llvm.loop !14

73:                                               ; preds = %48
  %74 = load i32, ptr @tot, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.Point, ptr @b, i64 %75
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @b, ptr noundef %76)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %91, %73
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = load i32, ptr @tot, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %94

82:                                               ; preds = %77
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %84
  %86 = load i32, ptr @tot, align 4, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = add nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %89
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %90, ptr align 16 %85, i64 16, i1 false), !tbaa.struct !11
  br label %91

91:                                               ; preds = %82
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !5
  br label %77, !llvm.loop !15

94:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %95 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %95, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %144, %94
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = load i32, ptr @tot, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %149

101:                                              ; preds = %96
  br label %102

102:                                              ; preds = %121, %101
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = load i32, ptr @tot, align 4, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  %107 = icmp slt i32 %103, %106
  br i1 %107, label %108, label %118

108:                                              ; preds = %102
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %110
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %113
  %115 = call noundef double @_ZNK5Point3detERKS_(ptr noundef nonnull align 8 dereferenceable(16) %111, ptr noundef nonnull align 8 dereferenceable(16) %114)
  %116 = call noundef i32 @_Z3sgnd(double noundef %115)
  %117 = icmp sge i32 %116, 0
  br label %118

118:                                              ; preds = %108, %102
  %119 = phi i1 [ false, %102 ], [ %117, %108 ]
  br i1 %119, label %120, label %126

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %12, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %12, align 4, !tbaa !5
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = add nsw i32 %124, -1
  store i32 %125, ptr %10, align 4, !tbaa !5
  br label %102, !llvm.loop !16

126:                                              ; preds = %118
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = icmp sle i32 %127, %128
  br i1 %129, label %130, label %143

130:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #8
  %131 = getelementptr inbounds %struct.Line, ptr %13, i32 0, i32 0
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %131, ptr align 16 %134, i64 16, i1 false), !tbaa.struct !11
  %135 = getelementptr inbounds %struct.Line, ptr %13, i32 0, i32 1
  %136 = load i32, ptr %11, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %137
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %135, ptr align 16 %138, i64 16, i1 false), !tbaa.struct !11
  %139 = load i32, ptr @m, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr @m, align 4, !tbaa !5
  %141 = sext i32 %139 to i64
  %142 = getelementptr inbounds [1000001 x %struct.Line], ptr @c, i64 0, i64 %141
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %142, ptr align 8 %13, i64 32, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #8
  br label %143

143:                                              ; preds = %130, %126
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !5
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %10, align 4, !tbaa !5
  br label %96, !llvm.loop !18

149:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %5, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %5, align 4, !tbaa !5
  br label %38, !llvm.loop !19

153:                                              ; preds = %42
  %154 = load i32, ptr @m, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds %struct.Line, ptr @c, i64 %155
  call void @_ZSt4sortIP4LineEvT_S2_(ptr noundef @c, ptr noundef %156)
  %157 = load i32, ptr @m, align 4, !tbaa !5
  call void @_Z21halfPlaneIntersectioniP4LineRiP5Point(i32 noundef %157, ptr noundef @c, ptr noundef nonnull align 4 dereferenceable(4) @tot, ptr noundef @b)
  %158 = load i32, ptr %2, align 4, !tbaa !5
  %159 = load i32, ptr @tot, align 4, !tbaa !5
  %160 = call noundef double @_Z8polyAreaiP5Point(i32 noundef %159, ptr noundef @b)
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %158, double noundef %160)
  br label %162

162:                                              ; preds = %153
  %163 = load i32, ptr %2, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !20

165:                                              ; preds = %19
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Point4initEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z21halfPlaneIntersectioniP4LineRiP5Point(i32 noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z8polyAreaiP5Point(i32 noundef, ptr noundef) #7

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { 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 #8 = { 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 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{i64 0, i64 8, !12, i64 8, i64 8, !12, i64 16, i64 8, !12, i64 24, i64 8, !12}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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.Point = type { double, double }
%struct.Line = type { %struct.Point, %struct.Point }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local global i32, align 4
@a = external dso_local global [1001 x %struct.Point], align 16
@b = external dso_local global [1000001 x %struct.Point], align 16
@c = external dso_local global [1000001 x %struct.Line], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Line, align 8
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %3 = load i32, ptr @t, align 4, !tbaa !5
  %.not71 = icmp slt i32 %3, 1
  br i1 %.not71, label %._crit_edge75, label %.lr.ph74

.lr.ph74:                                         ; preds = %0
  %4 = getelementptr inbounds i8, ptr %1, i64 16
  br label %5

._crit_edge75:                                    ; preds = %._crit_edge70, %0
  ret i32 0

5:                                                ; preds = %.lr.ph74, %._crit_edge70
  %.03572 = phi i32 [ 1, %.lr.ph74 ], [ %22, %._crit_edge70 ]
  store i32 0, ptr @m, align 4, !tbaa !5
  %6 = tail 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, label %._crit_edge70

._crit_edge:                                      ; preds = %.lr.ph
  %9 = sdiv i32 %12, 3
  %10 = icmp sgt i32 %12, 0
  br i1 %10, label %.lr.ph69, label %._crit_edge70

.lr.ph:                                           ; preds = %5, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %5 ]
  %11 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %indvars.iv
  tail call void @_ZN5Point4initEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %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

._crit_edge70:                                    ; preds = %._crit_edge66, %5, %._crit_edge
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds %struct.Line, ptr @c, i64 %16
  tail call void @_ZSt4sortIP4LineEvT_S2_(ptr noundef nonnull @c, ptr noundef nonnull %17)
  %18 = load i32, ptr @m, align 4, !tbaa !5
  tail call void @_Z21halfPlaneIntersectioniP4LineRiP5Point(i32 noundef %18, ptr noundef nonnull @c, ptr noundef nonnull align 4 dereferenceable(4) @tot, ptr noundef nonnull @b)
  %19 = load i32, ptr @tot, align 4, !tbaa !5
  %20 = tail call noundef double @_Z8polyAreaiP5Point(i32 noundef %19, ptr noundef nonnull @b)
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.03572, double noundef %20)
  %22 = add nuw nsw i32 %.03572, 1
  %23 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03572, %23
  br i1 %.not.not, label %5, label %._crit_edge75, !llvm.loop !11

.lr.ph69:                                         ; preds = %._crit_edge, %._crit_edge66
  %24 = phi i32 [ %67, %._crit_edge66 ], [ %12, %._crit_edge ]
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %._crit_edge66 ], [ 0, %._crit_edge ]
  store i32 0, ptr @tot, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %.lr.ph69
  %26 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %indvars.iv91
  br label %34

._crit_edge50:                                    ; preds = %46, %.lr.ph69
  %27 = phi i32 [ 0, %.lr.ph69 ], [ %47, %46 ]
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct.Point, ptr @b, i64 %28
  tail call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull @b, ptr noundef nonnull %29)
  %30 = load i32, ptr @tot, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph53.preheader, label %._crit_edge66

.lr.ph53.preheader:                               ; preds = %._crit_edge50
  %32 = zext nneg i32 %30 to i64
  %xtraiter = and i64 %32, 1
  %33 = icmp eq i32 %30, 1
  br i1 %33, label %.preheader44.unr-lcssa, label %.lr.ph53.preheader.new

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

34:                                               ; preds = %.lr.ph49, %46
  %35 = phi i32 [ 0, %.lr.ph49 ], [ %47, %46 ]
  %36 = phi i32 [ %24, %.lr.ph49 ], [ %48, %46 ]
  %indvars.iv78 = phi i64 [ 0, %.lr.ph49 ], [ %indvars.iv.next79, %46 ]
  %.not43 = icmp eq i64 %indvars.iv91, %indvars.iv78
  br i1 %.not43, label %46, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %indvars.iv78
  %39 = tail call { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %26)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  %42 = load i32, ptr @tot, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @tot, align 4, !tbaa !5
  %44 = sext i32 %42 to i64
  %45 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %44
  store double %40, ptr %45, align 16, !tbaa !12
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 8
  store double %41, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !12
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %34, %37
  %47 = phi i32 [ %35, %34 ], [ %43, %37 ]
  %48 = phi i32 [ %36, %34 ], [ %.pre, %37 ]
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next79, %49
  br i1 %50, label %34, label %._crit_edge50, !llvm.loop !14

.preheader44.unr-lcssa:                           ; preds = %.lr.ph53, %.lr.ph53.preheader
  %indvars.iv81.unr = phi i64 [ 0, %.lr.ph53.preheader ], [ %indvars.iv.next82.1, %.lr.ph53 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader44, label %.lr.ph53.epil

.lr.ph53.epil:                                    ; preds = %.preheader44.unr-lcssa
  %51 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %indvars.iv81.unr
  %52 = add nuw nsw i64 %indvars.iv81.unr, %32
  %53 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %52
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %53, ptr noundef nonnull align 16 dereferenceable(16) %51, i64 16, i1 false), !tbaa.struct !15
  br label %.preheader44

.preheader44:                                     ; preds = %.preheader44.unr-lcssa, %.lr.ph53.epil
  br i1 %31, label %.preheader.lr.ph, label %._crit_edge66

.preheader.lr.ph:                                 ; preds = %.preheader44
  %54 = getelementptr inbounds [1001 x %struct.Point], ptr @a, i64 0, i64 %indvars.iv91
  br label %.preheader

.lr.ph53:                                         ; preds = %.lr.ph53, %.lr.ph53.preheader.new
  %indvars.iv81 = phi i64 [ 0, %.lr.ph53.preheader.new ], [ %indvars.iv.next82.1, %.lr.ph53 ]
  %niter = phi i64 [ 0, %.lr.ph53.preheader.new ], [ %niter.next.1, %.lr.ph53 ]
  %55 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %indvars.iv81
  %56 = add nuw nsw i64 %indvars.iv81, %32
  %57 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %56
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %57, ptr noundef nonnull align 16 dereferenceable(16) %55, i64 16, i1 false), !tbaa.struct !15
  %indvars.iv.next82 = or disjoint i64 %indvars.iv81, 1
  %58 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %indvars.iv.next82
  %59 = add nuw nsw i64 %indvars.iv.next82, %32
  %60 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %59
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %60, ptr noundef nonnull align 16 dereferenceable(16) %58, i64 16, i1 false), !tbaa.struct !15
  %indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 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 %.preheader44.unr-lcssa, label %.lr.ph53, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.lr.ph, %85
  %61 = phi i32 [ %30, %.preheader.lr.ph ], [ %87, %85 ]
  %indvars.iv87 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next88, %85 ]
  %.065 = phi i32 [ 0, %.preheader.lr.ph ], [ %.1.lcssa, %85 ]
  %.03263 = phi i32 [ %30, %.preheader.lr.ph ], [ %86, %85 ]
  %62 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %indvars.iv87
  %63 = trunc nuw nsw i64 %indvars.iv87 to i32
  %64 = add nsw i32 %61, %63
  %65 = icmp slt i32 %.065, %64
  br i1 %65, label %.lr.ph57.preheader, label %.critedge

.lr.ph57.preheader:                               ; preds = %.preheader
  %66 = sext i32 %.065 to i64
  br label %.lr.ph57

._crit_edge66:                                    ; preds = %85, %._crit_edge50, %.preheader44
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next92, %68
  br i1 %69, label %.lr.ph69, label %._crit_edge70, !llvm.loop !17

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %74
  %indvars.iv84 = phi i64 [ %66, %.lr.ph57.preheader ], [ %indvars.iv.next85, %74 ]
  %.13355 = phi i32 [ %.03263, %.lr.ph57.preheader ], [ %75, %74 ]
  %70 = getelementptr inbounds [1000001 x %struct.Point], ptr @b, i64 0, i64 %indvars.iv84
  %71 = tail call noundef double @_ZNK5Point3detERKS_(ptr noundef nonnull align 8 dereferenceable(16) %62, ptr noundef nonnull align 8 dereferenceable(16) %70)
  %72 = tail call noundef i32 @_Z3sgnd(double noundef %71)
  %73 = icmp sgt i32 %72, -1
  br i1 %73, label %74, label %.critedge.loopexit

74:                                               ; preds = %.lr.ph57
  %indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
  %75 = add nsw i32 %.13355, -1
  %76 = load i32, ptr @tot, align 4, !tbaa !5
  %77 = add nsw i32 %76, %63
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next85, %78
  br i1 %79, label %.lr.ph57, label %.critedge.loopexit, !llvm.loop !18

.critedge.loopexit:                               ; preds = %74, %.lr.ph57
  %.133.lcssa.ph = phi i32 [ %.13355, %.lr.ph57 ], [ %75, %74 ]
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv84, %.lr.ph57 ], [ %indvars.iv.next85, %74 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %.133.lcssa = phi i32 [ %.03263, %.preheader ], [ %.133.lcssa.ph, %.critedge.loopexit ]
  %.1.lcssa = phi i32 [ %.065, %.preheader ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  %.not42.not = icmp slt i32 %.133.lcssa, %9
  br i1 %.not42.not, label %80, label %85

80:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 16 dereferenceable(16) %54, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %62, i64 16, i1 false), !tbaa.struct !15
  %81 = load i32, ptr @m, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr @m, align 4, !tbaa !5
  %83 = sext i32 %81 to i64
  %84 = getelementptr inbounds [1000001 x %struct.Line], ptr @c, i64 0, i64 %83
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %84, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 32, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1)
  br label %85

85:                                               ; preds = %.critedge, %80
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %86 = add nsw i32 %.133.lcssa, 1
  %87 = load i32, ptr @tot, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next88, %88
  br i1 %89, label %.preheader, label %._crit_edge66, !llvm.loop !20
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Point4initEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) local_unnamed_addr #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z21halfPlaneIntersectioniP4LineRiP5Point(i32 noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z8polyAreaiP5Point(i32 noundef, ptr noundef) local_unnamed_addr #7

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { 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" }

!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 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{i64 0, i64 8, !12, i64 8, i64 8, !12, i64 16, i64 8, !12, i64 24, i64 8, !12}
!20 = distinct !{!20, !10}


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