; LLVM IR from tangjz/acm-icpc :: uvalive (5878)

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

@p = external dso_local global [233 x %struct.Point], align 16
@s = external dso_local global [233 x %struct.Point], align 16
@ans = external dso_local global %struct.Point, align 4
@n = external dso_local global i32, align 4
@.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 [6 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 %struct.Point, align 4
  %5 = alloca %struct.Point, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.Point, align 4
  %10 = alloca %struct.Point, align 4
  %11 = alloca %struct.Point, align 4
  store i32 0, ptr %1, align 4
  br label %12

12:                                               ; preds = %151, %0
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %14 = icmp eq i32 %13, 1
  br i1 %14, label %15, label %18

15:                                               ; preds = %12
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp ne i32 %16, 0
  br label %18

18:                                               ; preds = %15, %12
  %19 = phi i1 [ false, %12 ], [ %17, %15 ]
  br i1 %19, label %20, label %154

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

21:                                               ; preds = %60, %20
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %28
  %30 = getelementptr inbounds %struct.Point, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.Point, ptr %33, i32 0, i32 1
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %30, ptr noundef %34)
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.Point, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !9
  %41 = sub nsw i32 0, %40
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %42, %43
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.Point, ptr %46, i32 0, i32 0
  store i32 %41, ptr %47, align 8, !tbaa !9
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %49
  %51 = getelementptr inbounds %struct.Point, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = sub nsw i32 0, %52
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = add nsw i32 %54, %55
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.Point, ptr %58, i32 0, i32 1
  store i32 %53, ptr %59, align 4, !tbaa !11
  br label %60

60:                                               ; preds = %26
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !12

63:                                               ; preds = %25
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = mul nsw i32 %64, 2
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %struct.Point, ptr @p, i64 %66
  %68 = getelementptr inbounds %struct.Point, ptr %67, i64 1
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef getelementptr inbounds (%struct.Point, ptr @p, i64 1), ptr noundef %68)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %87, %63
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = mul nsw i32 %71, 2
  %73 = icmp sle i32 %70, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %90

75:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %78
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %81
  %83 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %79, ptr noundef nonnull align 4 dereferenceable(8) %82)
  store i64 %83, ptr %4, align 4
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %85
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %86, ptr align 4 %4, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %87

87:                                               ; preds = %75
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %3, align 4, !tbaa !5
  br label %69, !llvm.loop !15

90:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %91 = getelementptr inbounds %struct.Point, ptr %5, i32 0, i32 0
  store i32 0, ptr %91, align 4, !tbaa !9
  %92 = getelementptr inbounds %struct.Point, ptr %5, i32 0, i32 1
  store i32 0, ptr %92, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @ans, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %148, %90
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = mul nsw i32 %95, 2
  %97 = icmp sle i32 %94, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %151

99:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %144, %99
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %104, label %108

104:                                              ; preds = %100
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = icmp sle i32 %105, %106
  br label %108

108:                                              ; preds = %104, %100
  %109 = phi i1 [ false, %100 ], [ %107, %104 ]
  br i1 %109, label %111, label %110

110:                                              ; preds = %108
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %147

111:                                              ; preds = %108
  %112 = call noundef i32 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) @ans, ptr noundef nonnull align 4 dereferenceable(8) @ans)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %114
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = sub nsw i32 %116, %117
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %119
  %121 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %115, ptr noundef nonnull align 4 dereferenceable(8) %120)
  store i64 %121, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %123
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = sub nsw i32 %125, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %128
  %130 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %124, ptr noundef nonnull align 4 dereferenceable(8) %129)
  store i64 %130, ptr %10, align 4
  %131 = call noundef i32 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %132 = icmp slt i32 %112, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br i1 %132, label %133, label %143

133:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %135
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = load i32, ptr %8, align 4, !tbaa !5
  %139 = sub nsw i32 %137, %138
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %140
  %142 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %136, ptr noundef nonnull align 4 dereferenceable(8) %141)
  store i64 %142, ptr %11, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @ans, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %143

143:                                              ; preds = %133, %111
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %8, align 4, !tbaa !5
  br label %100, !llvm.loop !16

147:                                              ; preds = %110
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %6, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %6, align 4, !tbaa !5
  br label %93, !llvm.loop !17

151:                                              ; preds = %98
  %152 = call noundef double @_ZNK5Point4modeEv(ptr noundef nonnull align 4 dereferenceable(8) @ans)
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %152)
  br label %12, !llvm.loop !18

154:                                              ; preds = %18
  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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK5Point4modeEv(ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

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


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

@p = external dso_local global [233 x %struct.Point], align 16
@s = external dso_local global [233 x %struct.Point], align 16
@ans = external dso_local global %struct.Point, align 4
@n = external dso_local global i32, align 4
@.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 [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Point, align 8
  %2 = alloca %struct.Point, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = icmp eq i32 %3, 1
  %5 = load i32, ptr @n, align 4
  %6 = icmp ne i32 %5, 0
  %7 = select i1 %4, i1 %6, i1 false
  br i1 %7, label %.preheader36, label %._crit_edge50

.preheader36:                                     ; preds = %0, %._crit_edge49
  %8 = phi i32 [ %38, %._crit_edge49 ], [ %5, %0 ]
  %.not37 = icmp slt i32 %8, 1
  br i1 %.not37, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.preheader36
  %.lcssa = phi i32 [ %8, %.preheader36 ], [ %15, %.lr.ph ]
  %9 = shl nsw i32 %.lcssa, 1
  %10 = sext i32 %9 to i64
  %gep = getelementptr %struct.Point, ptr getelementptr inbounds (i8, ptr @p, i64 8), i64 %10
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @p, i64 8), ptr noundef nonnull %gep)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not3439 = icmp slt i32 %11, 1
  br i1 %.not3439, label %._crit_edge43.thread, label %.lr.ph42

._crit_edge43.thread:                             ; preds = %._crit_edge
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  br label %._crit_edge49

.lr.ph:                                           ; preds = %.preheader36, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader36 ]
  %12 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %13 = getelementptr inbounds i8, ptr %12, i64 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %12, ptr noundef nonnull %13)
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = trunc nuw nsw i64 %indvars.iv to i32
  %17 = add nsw i32 %15, %16
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %18
  %20 = load <2 x i32>, ptr %12, align 8, !tbaa !5
  %21 = sub nsw <2 x i32> zeroinitializer, %20
  store <2 x i32> %21, ptr %19, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = sext i32 %15 to i64
  %.not.not = icmp slt i64 %indvars.iv, %22
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge43:                                    ; preds = %.lr.ph42
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  %.not3547 = icmp slt i32 %28, 1
  br i1 %.not3547, label %._crit_edge49, label %.preheader

.lr.ph42:                                         ; preds = %._crit_edge, %.lr.ph42
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.lr.ph42 ], [ 1, %._crit_edge ]
  %23 = add nsw i64 %indvars.iv54, -1
  %24 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %23
  %25 = getelementptr inbounds [233 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv54
  %26 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(8) %25)
  %27 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %indvars.iv54
  store i64 %26, ptr %27, align 8
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = shl nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %.not34.not = icmp slt i64 %indvars.iv54, %30
  br i1 %.not34.not, label %.lr.ph42, label %._crit_edge43, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge43, %._crit_edge46
  %31 = phi i32 [ %41, %._crit_edge46 ], [ %28, %._crit_edge43 ]
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %._crit_edge46 ], [ 1, %._crit_edge43 ]
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %.preheader
  %33 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %indvars.iv60
  br label %44

._crit_edge49:                                    ; preds = %._crit_edge46, %._crit_edge43.thread, %._crit_edge43
  %34 = call noundef double @_ZNK5Point4modeEv(ptr noundef nonnull align 4 dereferenceable(8) @ans)
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %34)
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %37 = icmp eq i32 %36, 1
  %38 = load i32, ptr @n, align 4
  %39 = icmp ne i32 %38, 0
  %40 = select i1 %37, i1 %39, i1 false
  br i1 %40, label %.preheader36, label %._crit_edge50, !llvm.loop !12

._crit_edge46:                                    ; preds = %54, %.preheader
  %41 = phi i32 [ %31, %.preheader ], [ %55, %54 ]
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %42 = shl nsw i32 %41, 1
  %43 = sext i32 %42 to i64
  %.not35.not = icmp slt i64 %indvars.iv60, %43
  br i1 %.not35.not, label %.preheader, label %._crit_edge49, !llvm.loop !13

44:                                               ; preds = %.lr.ph45, %54
  %indvars.iv57 = phi i64 [ 1, %.lr.ph45 ], [ %indvars.iv.next58, %54 ]
  %45 = call noundef i32 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) @ans, ptr noundef nonnull align 4 dereferenceable(8) @ans)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %46 = sub nsw i64 %indvars.iv60, %indvars.iv57
  %47 = getelementptr inbounds [233 x %struct.Point], ptr @s, i64 0, i64 %46
  %48 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(8) %47)
  store i64 %48, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %49 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(8) %47)
  store i64 %49, ptr %2, align 8
  %50 = call noundef i32 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
  %51 = icmp slt i32 %45, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  br i1 %51, label %52, label %54

52:                                               ; preds = %44
  %53 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(8) %47)
  store i64 %53, ptr @ans, align 4
  br label %54

54:                                               ; preds = %44, %52
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv57, %56
  %58 = icmp ult i64 %indvars.iv57, %indvars.iv60
  %59 = and i1 %58, %57
  br i1 %59, label %44, label %._crit_edge46, !llvm.loop !15

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK5Point4modeEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

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 = { 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 #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 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !10}


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