; LLVM IR from kazunetakahashi/atcoder :: 2019/0519_ABC126/past (C)

; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::_Setprecision" = type { i32 }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@P = external dso_local global [100010 x i64], align 16
@cnt = external dso_local global [50 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::_Setprecision", align 4
  store i32 0, ptr %1, align 4
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %15 = load i64, ptr @K, align 8, !tbaa !5
  store i64 %15, ptr %2, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %24, %0
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = load i64, ptr @N, align 8, !tbaa !5
  %19 = icmp sle i64 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %22
  store i64 0, ptr %23, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %21
  %25 = load i64, ptr %2, align 8, !tbaa !5
  %26 = add nsw i64 %25, 1
  store i64 %26, ptr %2, align 8, !tbaa !5
  br label %16, !llvm.loop !9

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

28:                                               ; preds = %50, %27
  %29 = load i32, ptr %3, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = load i64, ptr @K, align 8, !tbaa !5
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %35 = load i32, ptr %3, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  store i64 %36, ptr %4, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %41, %34
  %38 = load i64, ptr %4, align 8, !tbaa !5
  %39 = load i64, ptr @K, align 8, !tbaa !5
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %41, label %49

41:                                               ; preds = %37
  %42 = load i32, ptr %3, align 4, !tbaa !11
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !5
  %47 = load i64, ptr %4, align 8, !tbaa !5
  %48 = mul nsw i64 %47, 2
  store i64 %48, ptr %4, align 8, !tbaa !5
  br label %37, !llvm.loop !13

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

50:                                               ; preds = %49
  %51 = load i32, ptr %3, align 4, !tbaa !11
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !11
  br label %28, !llvm.loop !14

53:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @cnt, ptr noundef getelementptr inbounds (i64, ptr @cnt, i64 50), ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !11
  br label %54

54:                                               ; preds = %68, %53
  %55 = load i32, ptr %6, align 4, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = load i64, ptr @N, align 8, !tbaa !5
  %58 = icmp sle i64 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %71

60:                                               ; preds = %54
  %61 = load i32, ptr %6, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %65, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %60
  %69 = load i32, ptr %6, align 4, !tbaa !11
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !11
  br label %54, !llvm.loop !15

71:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store double 0.000000e+00, ptr %7, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %72

72:                                               ; preds = %99, %71
  %73 = load i32, ptr %8, align 4, !tbaa !11
  %74 = icmp slt i32 %73, 50
  br i1 %74, label %76, label %75

75:                                               ; preds = %72
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %102

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 1, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %85, %76
  %78 = load i32, ptr %11, align 4, !tbaa !11
  %79 = load i32, ptr %8, align 4, !tbaa !11
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %88

82:                                               ; preds = %77
  %83 = load i64, ptr %10, align 8, !tbaa !5
  %84 = mul nsw i64 %83, 2
  store i64 %84, ptr %10, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %82
  %86 = load i32, ptr %11, align 4, !tbaa !11
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %11, align 4, !tbaa !11
  br label %77, !llvm.loop !18

88:                                               ; preds = %81
  %89 = load i32, ptr %8, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !5
  %93 = sitofp i64 %92 to double
  %94 = load i64, ptr %10, align 8, !tbaa !5
  %95 = sitofp i64 %94 to double
  %96 = fdiv double %93, %95
  %97 = load double, ptr %7, align 8, !tbaa !16
  %98 = fadd double %97, %96
  store double %98, ptr %7, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %99

99:                                               ; preds = %88
  %100 = load i32, ptr %8, align 4, !tbaa !11
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %8, align 4, !tbaa !11
  br label %72, !llvm.loop !19

102:                                              ; preds = %75
  %103 = load i64, ptr @N, align 8, !tbaa !5
  %104 = sitofp i64 %103 to double
  %105 = load double, ptr %7, align 8, !tbaa !16
  %106 = fdiv double %105, %104
  store double %106, ptr %7, align 8, !tbaa !16
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
  %108 = call i32 @_ZSt12setprecisioni(i32 noundef 15)
  %109 = getelementptr inbounds %"struct.std::_Setprecision", ptr %12, i32 0, i32 0
  store i32 %108, ptr %109, align 4
  %110 = getelementptr inbounds %"struct.std::_Setprecision", ptr %12, i32 0, i32 0
  %111 = load i32, ptr %110, align 4
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %107, i32 %111)
  %113 = load double, ptr %7, align 8, !tbaa !16
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %112, double noundef %113)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %116 = load i32, ptr %1, align 4
  ret i32 %116
}

; 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)) #1 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = !{!"long long", !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 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@P = external dso_local local_unnamed_addr global [100010 x i64], align 16
@cnt = external dso_local global [50 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = 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) @N)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %4 = load i64, ptr @K, align 8, !tbaa !5
  %5 = load i64, ptr @N, align 8, !tbaa !5
  %.not36 = icmp sgt i64 %4, %5
  br i1 %.not36, label %.preheader35, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %6 = shl i64 %4, 3
  %scevgep = getelementptr i8, ptr @P, i64 %6
  %7 = add i64 %5, 1
  %8 = sub i64 %7, %4
  %9 = shl nuw i64 %8, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %scevgep, i8 0, i64 %9, i1 false), !tbaa !5
  br label %.preheader35

.preheader35:                                     ; preds = %.lr.ph.preheader, %0
  %10 = icmp sgt i64 %4, 1
  br i1 %10, label %.preheader34.preheader, label %._crit_edge

.preheader34.preheader:                           ; preds = %.preheader35
  %11 = add nsw i64 %4, -1
  %xtraiter = and i64 %11, 1
  %12 = icmp eq i64 %4, 2
  br i1 %12, label %._crit_edge.loopexit.unr-lcssa, label %.preheader34.preheader.new

.preheader34.preheader.new:                       ; preds = %.preheader34.preheader
  %unroll_iter = and i64 %11, -2
  br label %.preheader34

.preheader34:                                     ; preds = %33, %.preheader34.preheader.new
  %indvars.iv = phi i64 [ 1, %.preheader34.preheader.new ], [ %indvars.iv.next.1, %33 ]
  %niter = phi i64 [ 0, %.preheader34.preheader.new ], [ %niter.next.1, %33 ]
  %13 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv
  %.promoted = load i64, ptr %13, align 8, !tbaa !5
  br label %22

._crit_edge.loopexit.unr-lcssa:                   ; preds = %33, %.preheader34.preheader
  %indvars.iv.unr = phi i64 [ 1, %.preheader34.preheader ], [ %indvars.iv.next.1, %33 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.preheader34.epil

.preheader34.epil:                                ; preds = %._crit_edge.loopexit.unr-lcssa
  %14 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv.unr
  %.promoted.epil = load i64, ptr %14, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %15, %.preheader34.epil
  %16 = phi i64 [ %.promoted.epil, %.preheader34.epil ], [ %17, %15 ]
  %.02838.epil = phi i64 [ %indvars.iv.unr, %.preheader34.epil ], [ %18, %15 ]
  %17 = add nsw i64 %16, 1
  %18 = shl nsw i64 %.02838.epil, 1
  %19 = icmp slt i64 %18, %4
  br i1 %19, label %15, label %._crit_edge.loopexit.epilog-lcssa, !llvm.loop !9

._crit_edge.loopexit.epilog-lcssa:                ; preds = %15
  store i64 %17, ptr %14, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %.preheader35
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @cnt, ptr noundef nonnull getelementptr inbounds (i8, ptr @cnt, i64 400), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %20 = load i64, ptr @N, align 8, !tbaa !5
  %.not3241 = icmp slt i64 %20, 1
  br i1 %.not3241, label %.preheader.preheader, label %.lr.ph44.preheader

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %xtraiter70 = and i64 %20, 3
  %21 = icmp ult i64 %20, 4
  br i1 %21, label %.preheader.preheader.loopexit.unr-lcssa, label %.lr.ph44.preheader.new

.lr.ph44.preheader.new:                           ; preds = %.lr.ph44.preheader
  %unroll_iter72 = and i64 %20, 9223372036854775804
  br label %.lr.ph44

22:                                               ; preds = %.preheader34, %22
  %23 = phi i64 [ %.promoted, %.preheader34 ], [ %24, %22 ]
  %.02838 = phi i64 [ %indvars.iv, %.preheader34 ], [ %25, %22 ]
  %24 = add nsw i64 %23, 1
  %25 = shl nsw i64 %.02838, 1
  %26 = icmp slt i64 %25, %4
  br i1 %26, label %22, label %.preheader34.1, !llvm.loop !9

.preheader34.1:                                   ; preds = %22
  store i64 %24, ptr %13, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv.next
  %.promoted.1 = load i64, ptr %27, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %28, %.preheader34.1
  %29 = phi i64 [ %.promoted.1, %.preheader34.1 ], [ %30, %28 ]
  %.02838.1 = phi i64 [ %indvars.iv.next, %.preheader34.1 ], [ %31, %28 ]
  %30 = add nsw i64 %29, 1
  %31 = shl nsw i64 %.02838.1, 1
  %32 = icmp slt i64 %31, %4
  br i1 %32, label %28, label %33, !llvm.loop !9

33:                                               ; preds = %28
  store i64 %30, ptr %27, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.preheader34, !llvm.loop !13

.lr.ph44:                                         ; preds = %.lr.ph44, %.lr.ph44.preheader.new
  %indvars.iv55 = phi i64 [ 1, %.lr.ph44.preheader.new ], [ %indvars.iv.next56.3, %.lr.ph44 ]
  %niter73 = phi i64 [ 0, %.lr.ph44.preheader.new ], [ %niter73.next.3, %.lr.ph44 ]
  %34 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv55
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = add nsw i64 %37, 1
  store i64 %38, ptr %36, align 8, !tbaa !5
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %39 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv.next56
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %41, align 8, !tbaa !5
  %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2
  %44 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv.next56.1
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = add nsw i64 %47, 1
  store i64 %48, ptr %46, align 8, !tbaa !5
  %indvars.iv.next56.2 = add nuw nsw i64 %indvars.iv55, 3
  %49 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv.next56.2
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %51, align 8, !tbaa !5
  %indvars.iv.next56.3 = add nuw nsw i64 %indvars.iv55, 4
  %niter73.next.3 = add i64 %niter73, 4
  %niter73.ncmp.3 = icmp eq i64 %niter73.next.3, %unroll_iter72
  br i1 %niter73.ncmp.3, label %.preheader.preheader.loopexit.unr-lcssa, label %.lr.ph44, !llvm.loop !14

.preheader.preheader.loopexit.unr-lcssa:          ; preds = %.lr.ph44, %.lr.ph44.preheader
  %indvars.iv55.unr = phi i64 [ 1, %.lr.ph44.preheader ], [ %indvars.iv.next56.3, %.lr.ph44 ]
  %lcmp.mod71.not = icmp eq i64 %xtraiter70, 0
  br i1 %lcmp.mod71.not, label %.preheader.preheader, label %.lr.ph44.epil

.lr.ph44.epil:                                    ; preds = %.preheader.preheader.loopexit.unr-lcssa, %.lr.ph44.epil
  %indvars.iv55.epil = phi i64 [ %indvars.iv.next56.epil, %.lr.ph44.epil ], [ %indvars.iv55.unr, %.preheader.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph44.epil ], [ 0, %.preheader.preheader.loopexit.unr-lcssa ]
  %54 = getelementptr inbounds [100010 x i64], ptr @P, i64 0, i64 %indvars.iv55.epil
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %56, align 8, !tbaa !5
  %indvars.iv.next56.epil = add nuw nsw i64 %indvars.iv55.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter70
  br i1 %epil.iter.cmp.not, label %.preheader.preheader, label %.lr.ph44.epil, !llvm.loop !15

.preheader.preheader:                             ; preds = %.preheader.preheader.loopexit.unr-lcssa, %.lr.ph44.epil, %._crit_edge
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge48
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %._crit_edge48 ], [ 0, %.preheader.preheader ]
  %.02650 = phi double [ %74, %._crit_edge48 ], [ 0.000000e+00, %.preheader.preheader ]
  %.not = icmp eq i64 %indvars.iv60, 0
  br i1 %.not, label %._crit_edge48, label %.lr.ph47.preheader

.lr.ph47.preheader:                               ; preds = %.preheader
  %xtraiter74 = and i64 %indvars.iv60, 7
  %59 = icmp ult i64 %indvars.iv60, 8
  br i1 %59, label %._crit_edge48.loopexit.unr-lcssa, label %.lr.ph47.preheader.new

.lr.ph47.preheader.new:                           ; preds = %.lr.ph47.preheader
  %unroll_iter78 = and i64 %indvars.iv60, 9223372036854775800
  br label %.lr.ph47

60:                                               ; preds = %._crit_edge48
  %61 = sitofp i64 %20 to double
  %62 = fdiv double %74, %61
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
  %64 = call i32 @_ZSt12setprecisioni(i32 noundef 15)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %63, i32 %64)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %65, double noundef %62)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

._crit_edge48.loopexit.unr-lcssa:                 ; preds = %.lr.ph47, %.lr.ph47.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph47.preheader ], [ %75, %.lr.ph47 ]
  %.02445.unr = phi i64 [ 1, %.lr.ph47.preheader ], [ %75, %.lr.ph47 ]
  %lcmp.mod76.not = icmp eq i64 %xtraiter74, 0
  br i1 %lcmp.mod76.not, label %._crit_edge48, label %.lr.ph47.epil

.lr.ph47.epil:                                    ; preds = %._crit_edge48.loopexit.unr-lcssa, %.lr.ph47.epil
  %.02445.epil = phi i64 [ %68, %.lr.ph47.epil ], [ %.02445.unr, %._crit_edge48.loopexit.unr-lcssa ]
  %epil.iter75 = phi i64 [ %epil.iter75.next, %.lr.ph47.epil ], [ 0, %._crit_edge48.loopexit.unr-lcssa ]
  %68 = shl nsw i64 %.02445.epil, 1
  %epil.iter75.next = add i64 %epil.iter75, 1
  %epil.iter75.cmp.not = icmp eq i64 %epil.iter75.next, %xtraiter74
  br i1 %epil.iter75.cmp.not, label %._crit_edge48, label %.lr.ph47.epil, !llvm.loop !17

._crit_edge48:                                    ; preds = %._crit_edge48.loopexit.unr-lcssa, %.lr.ph47.epil, %.preheader
  %.024.lcssa = phi i64 [ 1, %.preheader ], [ %.lcssa.ph, %._crit_edge48.loopexit.unr-lcssa ], [ %68, %.lr.ph47.epil ]
  %69 = getelementptr inbounds [50 x i64], ptr @cnt, i64 0, i64 %indvars.iv60
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = sitofp i64 %70 to double
  %72 = uitofp nneg i64 %.024.lcssa to double
  %73 = fdiv double %71, %72
  %74 = fadd double %.02650, %73
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next61, 50
  br i1 %exitcond63.not, label %60, label %.preheader, !llvm.loop !18

.lr.ph47:                                         ; preds = %.lr.ph47, %.lr.ph47.preheader.new
  %.02445 = phi i64 [ 1, %.lr.ph47.preheader.new ], [ %75, %.lr.ph47 ]
  %niter79 = phi i64 [ 0, %.lr.ph47.preheader.new ], [ %niter79.next.7, %.lr.ph47 ]
  %75 = shl i64 %.02445, 8
  %niter79.next.7 = add i64 %niter79, 8
  %niter79.ncmp.7 = icmp eq i64 %niter79.next.7, %unroll_iter78
  br i1 %niter79.ncmp.7, label %._crit_edge48.loopexit.unr-lcssa, label %.lr.ph47, !llvm.loop !19
}

; 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 #1 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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


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