; LLVM IR from upupming/algorithm :: codeforces/1466 (e)

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

@a = external dso_local global [500010 x i64], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@cnt = external dso_local global [60 x i32], 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 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 i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @t)
  br label %22

22:                                               ; preds = %141, %0
  %23 = load i32, ptr @t, align 4, !tbaa !8
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr @t, align 4, !tbaa !8
  %25 = icmp ne i32 %23, 0
  br i1 %25, label %26, label %145

26:                                               ; preds = %22
  call void @llvm.memset.p0.i64(ptr align 16 @cnt, i8 0, i64 240, i1 false)
  %27 = 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) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %28

28:                                               ; preds = %62, %26
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = load i32, ptr @n, align 4, !tbaa !8
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %65

33:                                               ; preds = %28
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [500010 x i64], ptr @a, i64 0, i64 %35
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %58, %33
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = icmp slt i32 %39, 60
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %61

42:                                               ; preds = %38
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [500010 x i64], ptr @a, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = load i32, ptr %4, align 4, !tbaa !8
  %48 = zext i32 %47 to i64
  %49 = ashr i64 %46, %48
  %50 = and i64 %49, 1
  %51 = load i32, ptr %4, align 4, !tbaa !8
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [60 x i32], ptr @cnt, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = add nsw i64 %55, %50
  %57 = trunc i64 %56 to i32
  store i32 %57, ptr %53, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %42
  %59 = load i32, ptr %4, align 4, !tbaa !8
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %4, align 4, !tbaa !8
  br label %38, !llvm.loop !13

61:                                               ; preds = %41
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %2, align 4, !tbaa !8
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %2, align 4, !tbaa !8
  br label %28, !llvm.loop !15

65:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %66

66:                                               ; preds = %138, %65
  %67 = load i32, ptr %6, align 4, !tbaa !8
  %68 = load i32, ptr @n, align 4, !tbaa !8
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %141

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %72

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

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

76:                                               ; preds = %72
  %77 = load i32, ptr %6, align 4, !tbaa !8
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [500010 x i64], ptr @a, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !11
  %81 = load i32, ptr %9, align 4, !tbaa !8
  %82 = zext i32 %81 to i64
  %83 = ashr i64 %80, %82
  %84 = and i64 %83, 1
  %85 = icmp ne i64 %84, 0
  br i1 %85, label %86, label %108

86:                                               ; preds = %76
  %87 = load i32, ptr %9, align 4, !tbaa !8
  %88 = zext i32 %87 to i64
  %89 = shl i64 1, %88
  %90 = srem i64 %89, 1000000007
  %91 = load i32, ptr %9, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [60 x i32], ptr @cnt, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = mul nsw i64 %90, %95
  %97 = load i64, ptr %8, align 8, !tbaa !11
  %98 = add nsw i64 %97, %96
  store i64 %98, ptr %8, align 8, !tbaa !11
  %99 = load i32, ptr %9, align 4, !tbaa !8
  %100 = zext i32 %99 to i64
  %101 = shl i64 1, %100
  %102 = srem i64 %101, 1000000007
  %103 = load i32, ptr @n, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = mul nsw i64 %102, %104
  %106 = load i64, ptr %7, align 8, !tbaa !11
  %107 = add nsw i64 %106, %105
  store i64 %107, ptr %7, align 8, !tbaa !11
  br label %121

108:                                              ; preds = %76
  %109 = load i32, ptr %9, align 4, !tbaa !8
  %110 = zext i32 %109 to i64
  %111 = shl i64 1, %110
  %112 = srem i64 %111, 1000000007
  %113 = load i32, ptr %9, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [60 x i32], ptr @cnt, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 %112, %117
  %119 = load i64, ptr %7, align 8, !tbaa !11
  %120 = add nsw i64 %119, %118
  store i64 %120, ptr %7, align 8, !tbaa !11
  br label %121

121:                                              ; preds = %108, %86
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %9, align 4, !tbaa !8
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %9, align 4, !tbaa !8
  br label %72, !llvm.loop !16

125:                                              ; preds = %75
  %126 = load i64, ptr %8, align 8, !tbaa !11
  %127 = srem i64 %126, 1000000007
  store i64 %127, ptr %8, align 8, !tbaa !11
  %128 = load i64, ptr %7, align 8, !tbaa !11
  %129 = srem i64 %128, 1000000007
  store i64 %129, ptr %7, align 8, !tbaa !11
  %130 = load i32, ptr %5, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = load i64, ptr %8, align 8, !tbaa !11
  %133 = load i64, ptr %7, align 8, !tbaa !11
  %134 = mul nsw i64 %132, %133
  %135 = add nsw i64 %131, %134
  %136 = srem i64 %135, 1000000007
  %137 = trunc i64 %136 to i32
  store i32 %137, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %138

138:                                              ; preds = %125
  %139 = load i32, ptr %6, align 4, !tbaa !8
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %6, align 4, !tbaa !8
  br label %66, !llvm.loop !17

141:                                              ; preds = %70
  %142 = load i32, ptr %5, align 4, !tbaa !8
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %142)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %22, !llvm.loop !18

145:                                              ; preds = %22
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 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)) #6

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 = { "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 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

@a = external dso_local global [500010 x i64], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global [60 x i32], 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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = 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) @t)
  %13 = load i32, ptr @t, align 4, !tbaa !8
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @t, align 4, !tbaa !8
  %.not45 = icmp eq i32 %13, 0
  br i1 %.not45, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %0, %._crit_edge
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) @cnt, i8 0, i64 240, i1 false)
  %15 = 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)
  %16 = load i32, ptr @n, align 4, !tbaa !8
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.preheader36:                                     ; preds = %.lr.ph
  %18 = icmp sgt i32 %99, 0
  br i1 %18, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %.preheader36
  %19 = zext nneg i32 %99 to i64
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph47, %.lr.ph
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %.lr.ph ], [ 0, %.lr.ph47 ]
  %20 = getelementptr inbounds [500010 x i64], ptr @a, i64 0, i64 %indvars.iv52
  %21 = 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) %20)
  %22 = load i64, ptr %20, align 8, !tbaa !11
  %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %22, i64 0
  %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
  %23 = lshr <4 x i64> %broadcast.splat, <i64 0, i64 1, i64 2, i64 3>
  %24 = lshr <4 x i64> %broadcast.splat, <i64 4, i64 5, i64 6, i64 7>
  %wide.load = load <4 x i32>, ptr @cnt, align 16, !tbaa !8
  %wide.load67 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 16), align 16, !tbaa !8
  %25 = trunc <4 x i64> %23 to <4 x i32>
  %26 = trunc <4 x i64> %24 to <4 x i32>
  %27 = and <4 x i32> %25, <i32 1, i32 1, i32 1, i32 1>
  %28 = and <4 x i32> %26, <i32 1, i32 1, i32 1, i32 1>
  %29 = add <4 x i32> %27, %wide.load
  %30 = add <4 x i32> %28, %wide.load67
  store <4 x i32> %29, ptr @cnt, align 16, !tbaa !8
  store <4 x i32> %30, ptr getelementptr inbounds (i8, ptr @cnt, i64 16), align 16, !tbaa !8
  %31 = lshr <4 x i64> %broadcast.splat, <i64 8, i64 9, i64 10, i64 11>
  %32 = lshr <4 x i64> %broadcast.splat, <i64 12, i64 13, i64 14, i64 15>
  %wide.load.1 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 32), align 16, !tbaa !8
  %wide.load67.1 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 48), align 16, !tbaa !8
  %33 = trunc <4 x i64> %31 to <4 x i32>
  %34 = trunc <4 x i64> %32 to <4 x i32>
  %35 = and <4 x i32> %33, <i32 1, i32 1, i32 1, i32 1>
  %36 = and <4 x i32> %34, <i32 1, i32 1, i32 1, i32 1>
  %37 = add <4 x i32> %35, %wide.load.1
  %38 = add <4 x i32> %36, %wide.load67.1
  store <4 x i32> %37, ptr getelementptr inbounds (i8, ptr @cnt, i64 32), align 16, !tbaa !8
  store <4 x i32> %38, ptr getelementptr inbounds (i8, ptr @cnt, i64 48), align 16, !tbaa !8
  %39 = lshr <4 x i64> %broadcast.splat, <i64 16, i64 17, i64 18, i64 19>
  %40 = lshr <4 x i64> %broadcast.splat, <i64 20, i64 21, i64 22, i64 23>
  %wide.load.2 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 64), align 16, !tbaa !8
  %wide.load67.2 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 80), align 16, !tbaa !8
  %41 = trunc <4 x i64> %39 to <4 x i32>
  %42 = trunc <4 x i64> %40 to <4 x i32>
  %43 = and <4 x i32> %41, <i32 1, i32 1, i32 1, i32 1>
  %44 = and <4 x i32> %42, <i32 1, i32 1, i32 1, i32 1>
  %45 = add <4 x i32> %43, %wide.load.2
  %46 = add <4 x i32> %44, %wide.load67.2
  store <4 x i32> %45, ptr getelementptr inbounds (i8, ptr @cnt, i64 64), align 16, !tbaa !8
  store <4 x i32> %46, ptr getelementptr inbounds (i8, ptr @cnt, i64 80), align 16, !tbaa !8
  %47 = lshr <4 x i64> %broadcast.splat, <i64 24, i64 25, i64 26, i64 27>
  %48 = lshr <4 x i64> %broadcast.splat, <i64 28, i64 29, i64 30, i64 31>
  %wide.load.3 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 96), align 16, !tbaa !8
  %wide.load67.3 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 112), align 16, !tbaa !8
  %49 = trunc <4 x i64> %47 to <4 x i32>
  %50 = trunc <4 x i64> %48 to <4 x i32>
  %51 = and <4 x i32> %49, <i32 1, i32 1, i32 1, i32 1>
  %52 = and <4 x i32> %50, <i32 1, i32 1, i32 1, i32 1>
  %53 = add <4 x i32> %51, %wide.load.3
  %54 = add <4 x i32> %52, %wide.load67.3
  store <4 x i32> %53, ptr getelementptr inbounds (i8, ptr @cnt, i64 96), align 16, !tbaa !8
  store <4 x i32> %54, ptr getelementptr inbounds (i8, ptr @cnt, i64 112), align 16, !tbaa !8
  %55 = lshr <4 x i64> %broadcast.splat, <i64 32, i64 33, i64 34, i64 35>
  %56 = lshr <4 x i64> %broadcast.splat, <i64 36, i64 37, i64 38, i64 39>
  %wide.load.4 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 128), align 16, !tbaa !8
  %wide.load67.4 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 144), align 16, !tbaa !8
  %57 = trunc nuw <4 x i64> %55 to <4 x i32>
  %58 = trunc nuw nsw <4 x i64> %56 to <4 x i32>
  %59 = and <4 x i32> %57, <i32 1, i32 1, i32 1, i32 1>
  %60 = and <4 x i32> %58, <i32 1, i32 1, i32 1, i32 1>
  %61 = add <4 x i32> %59, %wide.load.4
  %62 = add <4 x i32> %60, %wide.load67.4
  store <4 x i32> %61, ptr getelementptr inbounds (i8, ptr @cnt, i64 128), align 16, !tbaa !8
  store <4 x i32> %62, ptr getelementptr inbounds (i8, ptr @cnt, i64 144), align 16, !tbaa !8
  %63 = lshr <4 x i64> %broadcast.splat, <i64 40, i64 41, i64 42, i64 43>
  %64 = lshr <4 x i64> %broadcast.splat, <i64 44, i64 45, i64 46, i64 47>
  %wide.load.5 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 160), align 16, !tbaa !8
  %wide.load67.5 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 176), align 16, !tbaa !8
  %65 = trunc nuw nsw <4 x i64> %63 to <4 x i32>
  %66 = trunc nuw nsw <4 x i64> %64 to <4 x i32>
  %67 = and <4 x i32> %65, <i32 1, i32 1, i32 1, i32 1>
  %68 = and <4 x i32> %66, <i32 1, i32 1, i32 1, i32 1>
  %69 = add <4 x i32> %67, %wide.load.5
  %70 = add <4 x i32> %68, %wide.load67.5
  store <4 x i32> %69, ptr getelementptr inbounds (i8, ptr @cnt, i64 160), align 16, !tbaa !8
  store <4 x i32> %70, ptr getelementptr inbounds (i8, ptr @cnt, i64 176), align 16, !tbaa !8
  %71 = lshr <4 x i64> %broadcast.splat, <i64 48, i64 49, i64 50, i64 51>
  %72 = lshr <4 x i64> %broadcast.splat, <i64 52, i64 53, i64 54, i64 55>
  %wide.load.6 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 192), align 16, !tbaa !8
  %wide.load67.6 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @cnt, i64 208), align 16, !tbaa !8
  %73 = trunc nuw nsw <4 x i64> %71 to <4 x i32>
  %74 = trunc nuw nsw <4 x i64> %72 to <4 x i32>
  %75 = and <4 x i32> %73, <i32 1, i32 1, i32 1, i32 1>
  %76 = and <4 x i32> %74, <i32 1, i32 1, i32 1, i32 1>
  %77 = add <4 x i32> %75, %wide.load.6
  %78 = add <4 x i32> %76, %wide.load67.6
  store <4 x i32> %77, ptr getelementptr inbounds (i8, ptr @cnt, i64 192), align 16, !tbaa !8
  store <4 x i32> %78, ptr getelementptr inbounds (i8, ptr @cnt, i64 208), align 16, !tbaa !8
  %79 = lshr i64 %22, 56
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 224), align 16, !tbaa !8
  %81 = trunc nuw nsw i64 %79 to i32
  %82 = and i32 %81, 1
  %83 = add i32 %82, %80
  store i32 %83, ptr getelementptr inbounds (i8, ptr @cnt, i64 224), align 16, !tbaa !8
  %84 = lshr i64 %22, 57
  %85 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 228), align 4, !tbaa !8
  %86 = trunc nuw nsw i64 %84 to i32
  %87 = and i32 %86, 1
  %88 = add i32 %87, %85
  store i32 %88, ptr getelementptr inbounds (i8, ptr @cnt, i64 228), align 4, !tbaa !8
  %89 = lshr i64 %22, 58
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 232), align 8, !tbaa !8
  %91 = trunc nuw nsw i64 %89 to i32
  %92 = and i32 %91, 1
  %93 = add i32 %92, %90
  store i32 %93, ptr getelementptr inbounds (i8, ptr @cnt, i64 232), align 8, !tbaa !8
  %94 = lshr i64 %22, 59
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 236), align 4, !tbaa !8
  %96 = trunc nuw nsw i64 %94 to i32
  %97 = and i32 %96, 1
  %98 = add i32 %97, %95
  store i32 %98, ptr getelementptr inbounds (i8, ptr @cnt, i64 236), align 4, !tbaa !8
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %99 = load i32, ptr @n, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = icmp slt i64 %indvars.iv.next53, %100
  br i1 %101, label %.lr.ph, label %.preheader36, !llvm.loop !13

.preheader:                                       ; preds = %.preheader.lr.ph, %109
  %indvars.iv59 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next60, %109 ]
  %.03242 = phi i64 [ 0, %.preheader.lr.ph ], [ %114, %109 ]
  %102 = getelementptr inbounds [500010 x i64], ptr @a, i64 0, i64 %indvars.iv59
  %103 = load i64, ptr %102, align 8, !tbaa !11
  br label %115

._crit_edge.loopexit:                             ; preds = %109
  %104 = trunc nsw i64 %114 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph47, %._crit_edge.loopexit, %.preheader36
  %.032.lcssa = phi i32 [ 0, %.preheader36 ], [ %104, %._crit_edge.loopexit ], [ 0, %.lr.ph47 ]
  %105 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.032.lcssa)
  %106 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %107 = load i32, ptr @t, align 4, !tbaa !8
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr @t, align 4, !tbaa !8
  %.not = icmp eq i32 %107, 0
  br i1 %.not, label %._crit_edge48, label %.lr.ph47, !llvm.loop !15

109:                                              ; preds = %115
  %110 = srem i64 %.1, 1000000007
  %111 = srem i64 %.130, 1000000007
  %112 = mul nsw i64 %110, %111
  %113 = add nsw i64 %112, %.03242
  %114 = srem i64 %113, 1000000007
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next60, %19
  br i1 %exitcond62.not, label %._crit_edge.loopexit, label %.preheader, !llvm.loop !16

115:                                              ; preds = %.preheader, %115
  %indvars.iv55 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next56, %115 ]
  %.02840 = phi i64 [ 0, %.preheader ], [ %.1, %115 ]
  %.02939 = phi i64 [ 0, %.preheader ], [ %.130, %115 ]
  %116 = shl nuw nsw i64 1, %indvars.iv55
  %117 = and i64 %103, %116
  %.not35 = icmp eq i64 %117, 0
  %118 = urem i64 %116, 1000000007
  %119 = getelementptr inbounds [60 x i32], ptr @cnt, i64 0, i64 %indvars.iv55
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %121 = sext i32 %120 to i64
  %122 = mul nsw i64 %118, %121
  %123 = mul nuw nsw i64 %118, %19
  %.pn = select i1 %.not35, i64 %122, i64 %123
  %124 = select i1 %.not35, i64 0, i64 %122
  %.1 = add nsw i64 %.02840, %124
  %.130 = add nsw i64 %.pn, %.02939
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next56, 60
  br i1 %exitcond58.not, label %109, label %115, !llvm.loop !17

._crit_edge48:                                    ; preds = %._crit_edge, %0
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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 #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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)) local_unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; 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 #4 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)) #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 = { "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 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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