; LLVM IR from tangjz/acm-icpc :: codeforces/complete/340B.ll (Z5solvev)

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

@_ZZ5solvevE1p = external hidden global [100001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #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 i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %24, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %1, 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) #6
  br label %27

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %22
  call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8) %23)
  br label %24

24:                                               ; preds = %20
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !9

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

28:                                               ; preds = %110, %27
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %113

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %6, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %106, %33
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  store i8 1, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %102, %41
  %43 = load i32, ptr %10, align 4, !tbaa !5
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %105

47:                                               ; preds = %42
  %48 = load i32, ptr %10, align 4, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %55, label %51

51:                                               ; preds = %47
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = icmp eq i32 %52, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %51, %47
  br label %102

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %58
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %61
  %63 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %62)
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %65
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %68
  %70 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %66, ptr noundef nonnull align 4 dereferenceable(8) %69)
  %71 = add nsw i32 %63, %70
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %73
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %76
  %78 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %74, ptr noundef nonnull align 4 dereferenceable(8) %77)
  %79 = add nsw i32 %71, %78
  store i32 %79, ptr %11, align 4, !tbaa !5
  %80 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %81 = trunc i8 %80 to i1
  br i1 %81, label %82, label %84

82:                                               ; preds = %56
  %83 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %83, ptr %9, align 4, !tbaa !5
  store i32 %83, ptr %8, align 4, !tbaa !5
  store i8 0, ptr %7, align 1, !tbaa !11
  br label %101

84:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %85 = load i32, ptr %11, align 4, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = sub nsw i32 %85, %86
  %88 = call i32 @llvm.abs.i32(i32 %87, i1 true)
  store i32 %88, ptr %12, align 4, !tbaa !5
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %90 = load i32, ptr %89, align 4, !tbaa !5
  store i32 %90, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sub nsw i32 %91, %92
  %94 = call i32 @llvm.abs.i32(i32 %93, i1 true)
  store i32 %94, ptr %13, align 4, !tbaa !5
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %96 = load i32, ptr %95, align 4, !tbaa !5
  store i32 %96, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr %8, align 4, !tbaa !5
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %100 = load i32, ptr %99, align 4, !tbaa !5
  store i32 %100, ptr %9, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %84, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %102

102:                                              ; preds = %101, %55
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %10, align 4, !tbaa !5
  br label %42, !llvm.loop !15

105:                                              ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %6, align 4, !tbaa !5
  br label %36, !llvm.loop !16

109:                                              ; preds = %40
  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 %28, !llvm.loop !17

113:                                              ; preds = %32
  %114 = load i32, ptr %3, align 4, !tbaa !5
  %115 = sdiv i32 %114, 2
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = and i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !18
  %121 = sext i8 %120 to i32
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %115, i32 noundef %121)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{!7, !7, i64 0}


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

@_ZZ5solvevE1p = external hidden global [100001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge.thread

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

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  %11 = icmp sgt i32 %13, 0
  br i1 %11, label %.lr.ph36, label %._crit_edge37

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %indvars.iv
  call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.loopexit.loopexit:                               ; preds = %._crit_edge30
  %.pre51 = sext i32 %35 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph33, %.loopexit.loopexit, %.lr.ph36
  %.pre-phi = phi i64 [ %.pre51, %.loopexit.loopexit ], [ %27, %.lr.ph36 ], [ %27, %.lr.ph33 ]
  %16 = phi i32 [ %35, %.loopexit.loopexit ], [ %26, %.lr.ph36 ], [ %26, %.lr.ph33 ]
  %17 = icmp slt i64 %indvars.iv.next48, %.pre-phi
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  br i1 %17, label %.lr.ph36, label %._crit_edge37.loopexit, !llvm.loop !11

._crit_edge37.loopexit:                           ; preds = %.loopexit
  %.pre50 = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge37

._crit_edge37:                                    ; preds = %._crit_edge.thread, %._crit_edge37.loopexit, %._crit_edge
  %18 = phi i32 [ %.pre50, %._crit_edge37.loopexit ], [ 0, %._crit_edge ], [ 0, %._crit_edge.thread ]
  %19 = sdiv i32 %18, 2
  %20 = and i32 %18, 1
  %21 = zext nneg i32 %20 to i64
  %22 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !12
  %24 = sext i8 %23 to i32
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19, i32 noundef %24)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void

.lr.ph36:                                         ; preds = %._crit_edge, %.loopexit
  %26 = phi i32 [ %16, %.loopexit ], [ %13, %._crit_edge ]
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %.loopexit ], [ 0, %._crit_edge ]
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.loopexit ], [ 1, %._crit_edge ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next48, %27
  br i1 %28, label %.lr.ph33, label %.loopexit

.lr.ph33:                                         ; preds = %.lr.ph36
  %29 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %indvars.iv47
  %30 = icmp sgt i32 %26, 0
  br i1 %30, label %.lr.ph33.split, label %.loopexit

.lr.ph33.split:                                   ; preds = %.lr.ph33, %._crit_edge30
  %31 = phi i32 [ %35, %._crit_edge30 ], [ %26, %.lr.ph33 ]
  %32 = phi i32 [ %36, %._crit_edge30 ], [ %26, %.lr.ph33 ]
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %._crit_edge30 ], [ %indvars.iv42, %.lr.ph33 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph29, label %._crit_edge30

.lr.ph29:                                         ; preds = %.lr.ph33.split
  %34 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %indvars.iv44
  br label %39

._crit_edge30:                                    ; preds = %70, %.lr.ph33.split
  %35 = phi i32 [ %31, %.lr.ph33.split ], [ %71, %70 ]
  %36 = phi i32 [ %32, %.lr.ph33.split ], [ %72, %70 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %37 = trunc nuw i64 %indvars.iv.next45 to i32
  %38 = icmp sgt i32 %36, %37
  br i1 %38, label %.lr.ph33.split, label %.loopexit.loopexit, !llvm.loop !13

39:                                               ; preds = %.lr.ph29, %70
  %40 = phi i32 [ %31, %.lr.ph29 ], [ %71, %70 ]
  %41 = phi i32 [ %32, %.lr.ph29 ], [ %72, %70 ]
  %42 = phi i32 [ %32, %.lr.ph29 ], [ %73, %70 ]
  %indvars.iv40 = phi i64 [ 0, %.lr.ph29 ], [ %indvars.iv.next41, %70 ]
  %.02126 = phi i1 [ true, %.lr.ph29 ], [ %.2, %70 ]
  %43 = icmp eq i64 %indvars.iv40, %indvars.iv47
  %44 = icmp eq i64 %indvars.iv40, %indvars.iv44
  %or.cond = or i1 %43, %44
  br i1 %or.cond, label %70, label %45

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %46 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %29, ptr noundef nonnull align 4 dereferenceable(8) %34)
  %47 = getelementptr inbounds [100001 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %indvars.iv40
  %48 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %47)
  %49 = add nsw i32 %48, %46
  %50 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %29)
  %51 = add nsw i32 %49, %50
  store i32 %51, ptr %5, align 4, !tbaa !5
  br i1 %.02126, label %52, label %53

52:                                               ; preds = %45
  store i32 %51, ptr %3, align 4, !tbaa !5
  br label %69

53:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sub nsw i32 %51, %54
  %56 = call i32 @llvm.abs.i32(i32 %55, i1 true)
  store i32 %56, ptr %6, align 4, !tbaa !5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  store i32 %58, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sub nsw i32 %59, %60
  %62 = call i32 @llvm.abs.i32(i32 %61, i1 true)
  store i32 %62, ptr %7, align 4, !tbaa !5
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  store i32 %66, ptr %3, align 4, !tbaa !5
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %68 = load i32, ptr %67, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %53, %52
  %.sink = phi i32 [ %51, %52 ], [ %68, %53 ]
  store i32 %.sink, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %39, %69
  %71 = phi i32 [ %40, %39 ], [ %.pre, %69 ]
  %72 = phi i32 [ %41, %39 ], [ %.pre, %69 ]
  %73 = phi i32 [ %42, %39 ], [ %.pre, %69 ]
  %.2 = phi i1 [ %.02126, %39 ], [ false, %69 ]
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next41, %74
  br i1 %75, label %39, label %._crit_edge30, !llvm.loop !15
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass