; LLVM IR from tangjz/acm-icpc :: lydsy (2769)

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

@n = external dso_local global i32, align 4
@a = external dso_local global [15001 x i32], align 16
@b = external dso_local global [15001 x i32], align 16
@ans = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = 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 %10

10:                                               ; preds = %24, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr @a, i64 %17
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %18)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %22
  store i32 %20, ptr %23, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %15
  %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 %10, !llvm.loop !9

27:                                               ; preds = %14
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr @b, i64 %29
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @b, ptr noundef %30, ptr noundef @_Z3cmpRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %47, %27
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %50

36:                                               ; preds = %31
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %42
  store i32 %37, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %45
  store i32 0, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %36
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !11

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

51:                                               ; preds = %91, %50
  %52 = load i32, ptr %4, 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 %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %94

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %7, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %87, %56
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %90

66:                                               ; preds = %61
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = icmp sgt i32 %70, %71
  br i1 %72, label %73, label %85

73:                                               ; preds = %66
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sub nsw i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %81, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  br label %85

85:                                               ; preds = %73, %66
  %86 = phi i1 [ false, %66 ], [ %84, %73 ]
  br label %87

87:                                               ; preds = %85
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %6, align 4, !tbaa !5
  br label %61, !llvm.loop !12

90:                                               ; preds = %65
  br label %91

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

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

95:                                               ; preds = %113, %94
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %116

100:                                              ; preds = %95
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = shl i32 %104, 1
  %106 = sitofp i32 %105 to double
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sitofp i32 %107 to double
  %109 = fadd double %108, 1.000000e+00
  %110 = fdiv double %106, %109
  %111 = load double, ptr @ans, align 8, !tbaa !14
  %112 = fadd double %111, %110
  store double %112, ptr @ans, align 8, !tbaa !14
  br label %113

113:                                              ; preds = %100
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %8, align 4, !tbaa !5
  br label %95, !llvm.loop !16

116:                                              ; preds = %99
  %117 = load double, ptr @ans, align 8, !tbaa !14
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %117)
  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 @_ZSt4sortIPiPFbRKiS2_EEvT_S5_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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !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"

@n = external dso_local global i32, align 4
@a = external dso_local global [15001 x i32], align 16
@b = external dso_local global [15001 x i32], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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
  %.pre = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %14, %.lr.ph ]
  %4 = getelementptr inbounds i32, ptr @b, i64 %.pre-phi
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @b, ptr noundef nonnull %4, ptr noundef nonnull @_Z3cmpRKiS0_)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph36.preheader, label %.preheader.thread

.lr.ph36.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %5 to i64
  %7 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %wide.trip.count, 3
  %8 = icmp ult i32 %5, 4
  br i1 %8, label %.preheader31.unr-lcssa, label %.lr.ph36.preheader.new

.lr.ph36.preheader.new:                           ; preds = %.lr.ph36.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph36

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %9)
  %11 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv
  %12 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %12, ptr %11, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, 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

.preheader31.unr-lcssa:                           ; preds = %.lr.ph36, %.lr.ph36.preheader
  %indvars.iv50.unr = phi i64 [ 0, %.lr.ph36.preheader ], [ %indvars.iv.next51.3, %.lr.ph36 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader31, label %.lr.ph36.epil

.lr.ph36.epil:                                    ; preds = %.preheader31.unr-lcssa, %.lr.ph36.epil
  %indvars.iv50.epil = phi i64 [ %indvars.iv.next51.epil, %.lr.ph36.epil ], [ %indvars.iv50.unr, %.preheader31.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph36.epil ], [ 0, %.preheader31.unr-lcssa ]
  %16 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv50.epil
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %18
  %20 = trunc nuw nsw i64 %indvars.iv50.epil to i32
  store i32 %20, ptr %19, align 4, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !5
  %indvars.iv.next51.epil = add nuw nsw i64 %indvars.iv50.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader31, label %.lr.ph36.epil, !llvm.loop !11

.preheader31:                                     ; preds = %.lr.ph36.epil, %.preheader31.unr-lcssa
  br i1 %6, label %.lr.ph43.preheader, label %.preheader.thread

.lr.ph43.preheader:                               ; preds = %.preheader31
  %wide.trip.count61 = zext nneg i32 %5 to i64
  br label %.lr.ph43

.lr.ph36:                                         ; preds = %.lr.ph36, %.lr.ph36.preheader.new
  %indvars.iv50 = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %indvars.iv.next51.3, %.lr.ph36 ]
  %niter = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %niter.next.3, %.lr.ph36 ]
  %21 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv50
  %22 = load i32, ptr %21, align 16, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %23
  %25 = trunc nuw nsw i64 %indvars.iv50 to i32
  store i32 %25, ptr %24, align 4, !tbaa !5
  store i32 0, ptr %21, align 16, !tbaa !5
  %indvars.iv.next51 = or disjoint i64 %indvars.iv50, 1
  %26 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv.next51
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %28
  %30 = trunc nuw nsw i64 %indvars.iv.next51 to i32
  store i32 %30, ptr %29, align 4, !tbaa !5
  store i32 0, ptr %26, align 4, !tbaa !5
  %indvars.iv.next51.1 = or disjoint i64 %indvars.iv50, 2
  %31 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv.next51.1
  %32 = load i32, ptr %31, align 8, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %33
  %35 = trunc nuw nsw i64 %indvars.iv.next51.1 to i32
  store i32 %35, ptr %34, align 4, !tbaa !5
  store i32 0, ptr %31, align 8, !tbaa !5
  %indvars.iv.next51.2 = or disjoint i64 %indvars.iv50, 3
  %36 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv.next51.2
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %38
  %40 = trunc nuw nsw i64 %indvars.iv.next51.2 to i32
  store i32 %40, ptr %39, align 4, !tbaa !5
  store i32 0, ptr %36, align 4, !tbaa !5
  %indvars.iv.next51.3 = add nuw nsw i64 %indvars.iv50, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader31.unr-lcssa, label %.lr.ph36, !llvm.loop !13

.preheader.thread:                                ; preds = %.preheader31, %._crit_edge
  %ans.promoted68 = load double, ptr @ans, align 8, !tbaa !14
  br label %82

.preheader:                                       ; preds = %._crit_edge41
  %ans.promoted = load double, ptr @ans, align 8, !tbaa !14
  %.not70 = icmp eq i32 %5, 1
  br i1 %.not70, label %82, label %.lr.ph45.preheader

.lr.ph45.preheader:                               ; preds = %.preheader
  %xtraiter78 = and i64 %7, 1
  %41 = icmp eq i32 %5, 2
  br i1 %41, label %._crit_edge46.unr-lcssa, label %.lr.ph45.preheader.new

.lr.ph45.preheader.new:                           ; preds = %.lr.ph45.preheader
  %unroll_iter82 = and i64 %7, -2
  br label %.lr.ph45

.lr.ph43:                                         ; preds = %.lr.ph43.preheader, %._crit_edge41
  %indvars.iv58 = phi i64 [ 0, %.lr.ph43.preheader ], [ %indvars.iv.next59, %._crit_edge41 ]
  %42 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %indvars.iv58
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %.not = icmp eq i64 %indvars.iv58, 0
  br i1 %.not, label %._crit_edge41, label %.lr.ph40.preheader

.lr.ph40.preheader:                               ; preds = %.lr.ph43
  %xtraiter73 = and i64 %indvars.iv58, 1
  %44 = icmp eq i64 %indvars.iv58, 1
  br i1 %44, label %._crit_edge41.loopexit.unr-lcssa, label %.lr.ph40.preheader.new

.lr.ph40.preheader.new:                           ; preds = %.lr.ph40.preheader
  %unroll_iter76 = and i64 %indvars.iv58, 9223372036854775806
  br label %.lr.ph40

._crit_edge41.loopexit.unr-lcssa:                 ; preds = %72, %.lr.ph40.preheader
  %indvars.iv53.unr = phi i64 [ 0, %.lr.ph40.preheader ], [ %indvars.iv.next54.1, %72 ]
  %lcmp.mod75.not = icmp eq i64 %xtraiter73, 0
  br i1 %lcmp.mod75.not, label %._crit_edge41, label %.lr.ph40.epil

.lr.ph40.epil:                                    ; preds = %._crit_edge41.loopexit.unr-lcssa
  %45 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %indvars.iv53.unr
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, %43
  br i1 %47, label %48, label %._crit_edge41

48:                                               ; preds = %.lr.ph40.epil
  %49 = sub nsw i32 %46, %43
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %51, align 4, !tbaa !5
  br label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge41.loopexit.unr-lcssa, %48, %.lr.ph40.epil, %.lr.ph43
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count61
  br i1 %exitcond62.not, label %.preheader, label %.lr.ph43, !llvm.loop !16

.lr.ph40:                                         ; preds = %72, %.lr.ph40.preheader.new
  %indvars.iv53 = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %indvars.iv.next54.1, %72 ]
  %niter77 = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %niter77.next.1, %72 ]
  %54 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %indvars.iv53
  %55 = load i32, ptr %54, align 8, !tbaa !5
  %56 = icmp sgt i32 %55, %43
  br i1 %56, label %57, label %.lr.ph40.1

57:                                               ; preds = %.lr.ph40
  %58 = sub nsw i32 %55, %43
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !5
  br label %.lr.ph40.1

.lr.ph40.1:                                       ; preds = %.lr.ph40, %57
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %63 = getelementptr inbounds [15001 x i32], ptr @a, i64 0, i64 %indvars.iv.next54
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, %43
  br i1 %65, label %66, label %72

66:                                               ; preds = %.lr.ph40.1
  %67 = sub nsw i32 %64, %43
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %69, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %66, %.lr.ph40.1
  %indvars.iv.next54.1 = add nuw nsw i64 %indvars.iv53, 2
  %niter77.next.1 = add i64 %niter77, 2
  %niter77.ncmp.1 = icmp eq i64 %niter77.next.1, %unroll_iter76
  br i1 %niter77.ncmp.1, label %._crit_edge41.loopexit.unr-lcssa, label %.lr.ph40, !llvm.loop !17

._crit_edge46.unr-lcssa:                          ; preds = %.lr.ph45, %.lr.ph45.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph45.preheader ], [ %101, %.lr.ph45 ]
  %indvars.iv63.unr = phi i64 [ 1, %.lr.ph45.preheader ], [ %indvars.iv.next64.1, %.lr.ph45 ]
  %.unr = phi double [ %ans.promoted, %.lr.ph45.preheader ], [ %101, %.lr.ph45 ]
  %lcmp.mod80.not = icmp eq i64 %xtraiter78, 0
  br i1 %lcmp.mod80.not, label %._crit_edge46, label %.lr.ph45.epil

.lr.ph45.epil:                                    ; preds = %._crit_edge46.unr-lcssa
  %73 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv63.unr
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = shl i32 %74, 1
  %76 = sitofp i32 %75 to double
  %77 = trunc i64 %indvars.iv63.unr to i32
  %78 = add i32 %77, 1
  %79 = uitofp nneg i32 %78 to double
  %80 = fdiv double %76, %79
  %81 = fadd double %.unr, %80
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge46.unr-lcssa, %.lr.ph45.epil
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge46.unr-lcssa ], [ %81, %.lr.ph45.epil ]
  store double %.lcssa, ptr @ans, align 8, !tbaa !14
  br label %82

82:                                               ; preds = %.preheader.thread, %._crit_edge46, %.preheader
  %83 = phi double [ %.lcssa, %._crit_edge46 ], [ %ans.promoted, %.preheader ], [ %ans.promoted68, %.preheader.thread ]
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %83)
  ret i32 0

.lr.ph45:                                         ; preds = %.lr.ph45, %.lr.ph45.preheader.new
  %indvars.iv63 = phi i64 [ 1, %.lr.ph45.preheader.new ], [ %indvars.iv.next64.1, %.lr.ph45 ]
  %85 = phi double [ %ans.promoted, %.lr.ph45.preheader.new ], [ %101, %.lr.ph45 ]
  %niter83 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %niter83.next.1, %.lr.ph45 ]
  %86 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv63
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = shl i32 %87, 1
  %89 = sitofp i32 %88 to double
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %90 = trunc nuw nsw i64 %indvars.iv.next64 to i32
  %91 = uitofp nneg i32 %90 to double
  %92 = fdiv double %89, %91
  %93 = fadd double %85, %92
  %94 = getelementptr inbounds [15001 x i32], ptr @b, i64 0, i64 %indvars.iv.next64
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = shl i32 %95, 1
  %97 = sitofp i32 %96 to double
  %indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 2
  %98 = trunc nuw nsw i64 %indvars.iv.next64.1 to i32
  %99 = uitofp nneg i32 %98 to double
  %100 = fdiv double %97, %99
  %101 = fadd double %93, %100
  %niter83.next.1 = add i64 %niter83, 2
  %niter83.ncmp.1 = icmp eq i64 %niter83.next.1, %unroll_iter82
  br i1 %niter83.ncmp.1, label %._crit_edge46.unr-lcssa, label %.lr.ph45, !llvm.loop !18
}

; 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 @_ZSt4sortIPiPFbRKiS2_EEvT_S5_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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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