; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-05-22 (A - Bubbles - lzy)

; 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.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global [1009 x %"struct.std::pair"], align 16
@pos = external dso_local global [1000009 x double], 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3sqrd(double noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3eqldd(double noundef, double 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
  store i32 0, ptr %1, align 4
  %6 = 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 %7

7:                                                ; preds = %22, %0
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp slt i32 %8, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %7
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %14
  %16 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %18
  %20 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %16, ptr noundef %20)
  br label %22

22:                                               ; preds = %12
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %7, !llvm.loop !9

25:                                               ; preds = %11
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %27
  call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef @p, ptr noundef %28)
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %30
  %32 = call noundef ptr @_ZSt6uniqueIPSt4pairIiiEET_S3_S3_(ptr noundef @p, ptr noundef %31)
  %33 = ptrtoint ptr %32 to i64
  %34 = sub i64 %33, ptrtoint (ptr @p to i64)
  %35 = sdiv exact i64 %34, 8
  %36 = trunc i64 %35 to i32
  store i32 %36, ptr @m, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %40, label %42

40:                                               ; preds = %25
  %41 = call i32 @puts(ptr noundef @.str.2)
  br label %141

42:                                               ; preds = %25
  store i32 0, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %43

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

47:                                               ; preds = %43
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %126

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %5, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %119, %48
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %122

56:                                               ; preds = %51
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %58
  %60 = getelementptr inbounds %"struct.std::pair", ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !11
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %63
  %65 = getelementptr inbounds %"struct.std::pair", ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !11
  %67 = icmp ne i32 %61, %66
  br i1 %67, label %68, label %118

68:                                               ; preds = %56
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %70
  %72 = getelementptr inbounds %"struct.std::pair", ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !11
  %74 = sitofp i32 %73 to double
  %75 = call noundef double @_Z3sqrd(double noundef %74)
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %77
  %79 = getelementptr inbounds %"struct.std::pair", ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !11
  %81 = sitofp i32 %80 to double
  %82 = call noundef double @_Z3sqrd(double noundef %81)
  %83 = fsub double %75, %82
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %85
  %87 = getelementptr inbounds %"struct.std::pair", ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !13
  %89 = sitofp i32 %88 to double
  %90 = call noundef double @_Z3sqrd(double noundef %89)
  %91 = fadd double %83, %90
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %93
  %95 = getelementptr inbounds %"struct.std::pair", ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !13
  %97 = sitofp i32 %96 to double
  %98 = call noundef double @_Z3sqrd(double noundef %97)
  %99 = fsub double %91, %98
  %100 = fdiv double %99, 2.000000e+00
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %102
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !11
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %107
  %109 = getelementptr inbounds %"struct.std::pair", ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !11
  %111 = sub nsw i32 %105, %110
  %112 = sitofp i32 %111 to double
  %113 = fdiv double %100, %112
  %114 = load i32, ptr @m, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr @m, align 4, !tbaa !5
  %116 = sext i32 %114 to i64
  %117 = getelementptr inbounds [1000009 x double], ptr @pos, i64 0, i64 %116
  store double %113, ptr %117, align 8, !tbaa !14
  br label %118

118:                                              ; preds = %68, %56
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %5, align 4, !tbaa !5
  br label %51, !llvm.loop !16

122:                                              ; preds = %55
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %3, align 4, !tbaa !5
  br label %43, !llvm.loop !17

126:                                              ; preds = %47
  %127 = load i32, ptr @m, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr @pos, i64 %128
  call void @_ZSt4sortIPdEvT_S1_(ptr noundef @pos, ptr noundef %129)
  %130 = load i32, ptr @m, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr @pos, i64 %131
  %133 = call noundef ptr @_ZSt6uniqueIPdPFbddEET_S3_S3_T0_(ptr noundef @pos, ptr noundef %132, ptr noundef @_Z3eqldd)
  %134 = ptrtoint ptr %133 to i64
  %135 = sub i64 %134, ptrtoint (ptr @pos to i64)
  %136 = sdiv exact i64 %135, 8
  %137 = trunc i64 %136 to i32
  store i32 %137, ptr @m, align 4, !tbaa !5
  %138 = load i32, ptr @m, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  %140 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %139)
  br label %141

141:                                              ; preds = %126, %40
  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 @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPSt4pairIiiEET_S3_S3_(ptr noundef, ptr noundef) #4

declare i32 @puts(ptr noundef) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPdPFbddEET_S3_S3_T0_(ptr noundef, 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local global [1009 x %"struct.std::pair"], align 16
@pos = external dso_local global [1000009 x double], 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3sqrd(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3eqldd(double noundef, double noundef) #0

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

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre41 = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi42 = phi i64 [ %.pre41, %.._crit_edge_crit_edge ], [ %19, %.lr.ph ]
  %4 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %.pre-phi42
  tail call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef nonnull @p, ptr noundef nonnull %4)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %6
  %8 = tail call noundef ptr @_ZSt6uniqueIPSt4pairIiiEET_S3_S3_(ptr noundef nonnull @p, ptr noundef nonnull %7)
  %9 = ptrtoint ptr %8 to i64
  %10 = sub i64 %9, ptrtoint (ptr @p to i64)
  %11 = lshr exact i64 %10, 3
  %12 = trunc i64 %11 to i32
  store i32 %12, ptr @m, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, %12
  br i1 %14, label %21, label %23

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %15 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %15, ptr noundef nonnull %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !9

21:                                               ; preds = %._crit_edge
  %22 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %87

23:                                               ; preds = %._crit_edge
  store i32 0, ptr @m, align 4, !tbaa !5
  %24 = icmp sgt i32 %13, 0
  br i1 %24, label %.lr.ph27, label %._crit_edge28

.loopexit.loopexit:                               ; preds = %80
  %.pre40 = sext i32 %82 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph27
  %.pre-phi = phi i64 [ %.pre40, %.loopexit.loopexit ], [ %43, %.lr.ph27 ]
  %25 = phi i32 [ %81, %.loopexit.loopexit ], [ %41, %.lr.ph27 ]
  %26 = phi i32 [ %82, %.loopexit.loopexit ], [ %42, %.lr.ph27 ]
  %27 = icmp slt i64 %indvars.iv.next37, %.pre-phi
  %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
  br i1 %27, label %.lr.ph27, label %._crit_edge28.loopexit, !llvm.loop !11

._crit_edge28.loopexit:                           ; preds = %.loopexit
  %28 = sext i32 %25 to i64
  br label %._crit_edge28

._crit_edge28:                                    ; preds = %._crit_edge28.loopexit, %23
  %29 = phi i64 [ %28, %._crit_edge28.loopexit ], [ 0, %23 ]
  %30 = getelementptr inbounds double, ptr @pos, i64 %29
  tail call void @_ZSt4sortIPdEvT_S1_(ptr noundef nonnull @pos, ptr noundef nonnull %30)
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds double, ptr @pos, i64 %32
  %34 = tail call noundef ptr @_ZSt6uniqueIPdPFbddEET_S3_S3_T0_(ptr noundef nonnull @pos, ptr noundef nonnull %33, ptr noundef nonnull @_Z3eqldd)
  %35 = ptrtoint ptr %34 to i64
  %36 = sub i64 %35, ptrtoint (ptr @pos to i64)
  %37 = lshr exact i64 %36, 3
  %38 = trunc i64 %37 to i32
  store i32 %38, ptr @m, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %39)
  br label %87

.lr.ph27:                                         ; preds = %23, %.loopexit
  %41 = phi i32 [ %25, %.loopexit ], [ 0, %23 ]
  %42 = phi i32 [ %26, %.loopexit ], [ %13, %23 ]
  %indvars.iv36 = phi i64 [ %indvars.iv.next37, %.loopexit ], [ 0, %23 ]
  %indvars.iv31 = phi i64 [ %indvars.iv.next32, %.loopexit ], [ 1, %23 ]
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next37, %43
  br i1 %44, label %.lr.ph24, label %.loopexit

.lr.ph24:                                         ; preds = %.lr.ph27
  %45 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv36
  %46 = getelementptr inbounds i8, ptr %45, i64 4
  %.pre = load i32, ptr %45, align 8, !tbaa !12
  br label %47

47:                                               ; preds = %.lr.ph24, %80
  %48 = phi i32 [ %41, %.lr.ph24 ], [ %81, %80 ]
  %49 = phi i32 [ %42, %.lr.ph24 ], [ %82, %80 ]
  %50 = phi i32 [ %42, %.lr.ph24 ], [ %83, %80 ]
  %51 = phi i32 [ %.pre, %.lr.ph24 ], [ %84, %80 ]
  %indvars.iv33 = phi i64 [ %indvars.iv31, %.lr.ph24 ], [ %indvars.iv.next34, %80 ]
  %52 = getelementptr inbounds [1009 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv33
  %53 = load i32, ptr %52, align 8, !tbaa !12
  %.not = icmp eq i32 %51, %53
  br i1 %.not, label %80, label %54

54:                                               ; preds = %47
  %55 = sitofp i32 %53 to double
  %56 = tail call noundef double @_Z3sqrd(double noundef %55)
  %57 = load i32, ptr %45, align 8, !tbaa !12
  %58 = sitofp i32 %57 to double
  %59 = tail call noundef double @_Z3sqrd(double noundef %58)
  %60 = fsub double %56, %59
  %61 = getelementptr inbounds i8, ptr %52, i64 4
  %62 = load i32, ptr %61, align 4, !tbaa !14
  %63 = sitofp i32 %62 to double
  %64 = tail call noundef double @_Z3sqrd(double noundef %63)
  %65 = fadd double %60, %64
  %66 = load i32, ptr %46, align 4, !tbaa !14
  %67 = sitofp i32 %66 to double
  %68 = tail call noundef double @_Z3sqrd(double noundef %67)
  %69 = fsub double %65, %68
  %70 = fmul double %69, 5.000000e-01
  %71 = load i32, ptr %52, align 8, !tbaa !12
  %72 = load i32, ptr %45, align 8, !tbaa !12
  %73 = sub nsw i32 %71, %72
  %74 = sitofp i32 %73 to double
  %75 = fdiv double %70, %74
  %76 = load i32, ptr @m, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr @m, align 4, !tbaa !5
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [1000009 x double], ptr @pos, i64 0, i64 %78
  store double %75, ptr %79, align 8, !tbaa !15
  %.pre39 = load i32, ptr @n, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %47, %54
  %81 = phi i32 [ %48, %47 ], [ %77, %54 ]
  %82 = phi i32 [ %49, %47 ], [ %.pre39, %54 ]
  %83 = phi i32 [ %50, %47 ], [ %.pre39, %54 ]
  %84 = phi i32 [ %51, %47 ], [ %72, %54 ]
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %85 = trunc nuw i64 %indvars.iv.next34 to i32
  %86 = icmp sgt i32 %83, %85
  br i1 %86, label %47, label %.loopexit.loopexit, !llvm.loop !17

87:                                               ; preds = %._crit_edge28, %21
  ret i32 0
}

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

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

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

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

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

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

; 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 = { 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" }

!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, !6, i64 0}
!13 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !10}


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