; LLVM IR from lzyrapx/Competitive-Programming :: LibreOJ (6093（贪心）)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@x = external dso_local global [1010 x i64], align 16
@y = external dso_local global [1010 x i64], align 16
@r = external dso_local global [1010 x i64], align 16
@f = external dso_local global [1010 x i64], align 16
@ans = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3sqrx(i64 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %8

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

12:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %29

13:                                               ; preds = %8
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %15
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %19
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %23
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %24)
  br label %26

26:                                               ; preds = %13
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

29:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %95, %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

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

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

36:                                               ; preds = %91, %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = icmp ne i32 %42, %43
  br i1 %44, label %45, label %90

45:                                               ; preds = %41
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !11
  %54 = sub nsw i64 %49, %53
  %55 = call noundef i64 @_Z3sqrx(i64 noundef %54)
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = sub nsw i64 %59, %63
  %65 = call noundef i64 @_Z3sqrx(i64 noundef %64)
  %66 = add nsw i64 %55, %65
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !11
  %71 = call noundef i64 @_Z3sqrx(i64 noundef %70)
  %72 = icmp sle i64 %66, %71
  br i1 %72, label %73, label %89

73:                                               ; preds = %45
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !11
  %82 = icmp sgt i64 %77, %81
  br i1 %82, label %83, label %89

83:                                               ; preds = %73
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1010 x i64], ptr @f, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !11
  %88 = add nsw i64 %87, 1
  store i64 %88, ptr %86, align 8, !tbaa !11
  br label %89

89:                                               ; preds = %83, %73, %45
  br label %90

90:                                               ; preds = %89, %41
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !13

94:                                               ; preds = %40
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !14

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

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

103:                                              ; preds = %99
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %137

104:                                              ; preds = %99
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1010 x i64], ptr @f, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !11
  %109 = icmp ne i64 %108, 0
  br i1 %109, label %110, label %117

110:                                              ; preds = %104
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1010 x i64], ptr @f, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !11
  %115 = srem i64 %114, 2
  %116 = icmp eq i64 %115, 1
  br i1 %116, label %117, label %125

117:                                              ; preds = %110, %104
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = call noundef i64 @_Z3sqrx(i64 noundef %121)
  %123 = load i64, ptr @ans, align 8, !tbaa !11
  %124 = add nsw i64 %123, %122
  store i64 %124, ptr @ans, align 8, !tbaa !11
  br label %133

125:                                              ; preds = %110
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !11
  %130 = call noundef i64 @_Z3sqrx(i64 noundef %129)
  %131 = load i64, ptr @ans, align 8, !tbaa !11
  %132 = sub nsw i64 %131, %130
  store i64 %132, ptr @ans, align 8, !tbaa !11
  br label %133

133:                                              ; preds = %125, %117
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %6, align 4, !tbaa !5
  br label %99, !llvm.loop !15

137:                                              ; preds = %103
  %138 = call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %139 = load i64, ptr @ans, align 8, !tbaa !11
  %140 = sitofp i64 %139 to double
  %141 = fmul double %138, %140
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %141)
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

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

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

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

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 = { 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 = { 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 #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 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@x = external dso_local global [1010 x i64], align 16
@y = external dso_local global [1010 x i64], align 16
@r = external dso_local global [1010 x i64], align 16
@f = external dso_local local_unnamed_addr global [1010 x i64], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not38 = icmp slt i32 %2, 1
  br i1 %.not38, label %._crit_edge48, label %.lr.ph

.preheader37:                                     ; preds = %.lr.ph
  %.not2943 = icmp slt i32 %9, 1
  br i1 %.not2943, label %._crit_edge48, label %.preheader36

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %3 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %indvars.iv
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %5 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %indvars.iv
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %7 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %indvars.iv
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %.not.not = icmp slt i64 %indvars.iv, %10
  br i1 %.not.not, label %.lr.ph, label %.preheader37, !llvm.loop !9

.preheader36:                                     ; preds = %.preheader37, %._crit_edge
  %11 = phi i32 [ %16, %._crit_edge ], [ %9, %.preheader37 ]
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %._crit_edge ], [ 1, %.preheader37 ]
  %.not3240 = icmp slt i32 %11, 1
  br i1 %.not3240, label %.preheader36.._crit_edge_crit_edge, label %.lr.ph42

.preheader36.._crit_edge_crit_edge:               ; preds = %.preheader36
  %.pre = sext i32 %11 to i64
  br label %._crit_edge

.lr.ph42:                                         ; preds = %.preheader36
  %12 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %indvars.iv54
  %13 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %indvars.iv54
  %14 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %indvars.iv54
  br label %17

.preheader:                                       ; preds = %._crit_edge
  %15 = icmp slt i32 %16, 1
  br i1 %15, label %._crit_edge48, label %.lr.ph47

._crit_edge:                                      ; preds = %41, %.preheader36.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader36.._crit_edge_crit_edge ], [ %43, %41 ]
  %16 = phi i32 [ %11, %.preheader36.._crit_edge_crit_edge ], [ %42, %41 ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %.not29.not = icmp slt i64 %indvars.iv54, %.pre-phi
  br i1 %.not29.not, label %.preheader36, label %.preheader, !llvm.loop !11

17:                                               ; preds = %.lr.ph42, %41
  %indvars.iv51 = phi i64 [ 1, %.lr.ph42 ], [ %indvars.iv.next52, %41 ]
  %.not33 = icmp eq i64 %indvars.iv54, %indvars.iv51
  br i1 %.not33, label %41, label %18

18:                                               ; preds = %17
  %19 = load i64, ptr %12, align 8, !tbaa !13
  %20 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %indvars.iv51
  %21 = load i64, ptr %20, align 8, !tbaa !13
  %22 = sub nsw i64 %19, %21
  %23 = tail call noundef i64 @_Z3sqrx(i64 noundef %22)
  %24 = load i64, ptr %13, align 8, !tbaa !13
  %25 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %indvars.iv51
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = sub nsw i64 %24, %26
  %28 = tail call noundef i64 @_Z3sqrx(i64 noundef %27)
  %29 = add nsw i64 %28, %23
  %30 = load i64, ptr %14, align 8, !tbaa !13
  %31 = tail call noundef i64 @_Z3sqrx(i64 noundef %30)
  %.not34 = icmp sgt i64 %29, %31
  br i1 %.not34, label %41, label %32

32:                                               ; preds = %18
  %33 = load i64, ptr %14, align 8, !tbaa !13
  %34 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %indvars.iv51
  %35 = load i64, ptr %34, align 8, !tbaa !13
  %36 = icmp sgt i64 %33, %35
  br i1 %36, label %37, label %41

37:                                               ; preds = %32
  %38 = getelementptr inbounds [1010 x i64], ptr @f, i64 0, i64 %indvars.iv51
  %39 = load i64, ptr %38, align 8, !tbaa !13
  %40 = add nsw i64 %39, 1
  store i64 %40, ptr %38, align 8, !tbaa !13
  br label %41

41:                                               ; preds = %17, %37, %32, %18
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %.not32.not = icmp slt i64 %indvars.iv51, %43
  br i1 %.not32.not, label %17, label %._crit_edge, !llvm.loop !15

._crit_edge48:                                    ; preds = %.lr.ph47, %0, %.preheader37, %.preheader
  %44 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %45 = load i64, ptr @ans, align 8, !tbaa !13
  %46 = sitofp i64 %45 to double
  %47 = fmul double %44, %46
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %47)
  ret i32 0

.lr.ph47:                                         ; preds = %.preheader, %.lr.ph47
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %.lr.ph47 ], [ 1, %.preheader ]
  %49 = getelementptr inbounds [1010 x i64], ptr @f, i64 0, i64 %indvars.iv57
  %50 = load i64, ptr %49, align 8, !tbaa !13
  %.not31 = icmp eq i64 %50, 0
  %51 = and i64 %50, -9223372036854775807
  %52 = icmp eq i64 %51, 1
  %or.cond = or i1 %.not31, %52
  %53 = getelementptr inbounds [1010 x i64], ptr @r, i64 0, i64 %indvars.iv57
  %54 = load i64, ptr %53, align 8, !tbaa !13
  %55 = tail call noundef i64 @_Z3sqrx(i64 noundef %54)
  %56 = load i64, ptr @ans, align 8, !tbaa !13
  %57 = sub i64 0, %55
  %storemerge.p = select i1 %or.cond, i64 %55, i64 %57
  %storemerge = add i64 %56, %storemerge.p
  store i64 %storemerge, ptr @ans, align 8, !tbaa !13
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %.not30.not = icmp slt i64 %indvars.iv57, %59
  br i1 %.not30.not, label %.lr.ph47, label %._crit_edge48, !llvm.loop !16
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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

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 = { 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 = { 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 #5 = { 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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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