; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Codeforces/Codeforces Round 320 (Div 2) (Or Game)

; 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 [200005 x i64], align 16
@pre = external dso_local global [200005 x i64], align 16
@suf = external dso_local global [200005 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %25, %0
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %28

20:                                               ; preds = %15
  %21 = load i32, ptr %4, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = load i64, ptr %5, align 8, !tbaa !5
  %24 = mul nsw i64 %23, %22
  store i64 %24, ptr %5, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %7, align 4, !tbaa !9
  br label %15, !llvm.loop !11

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %52, %28
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = load i32, ptr %2, align 4, !tbaa !9
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200005 x i64], ptr @pre, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = or i64 %43, %47
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [200005 x i64], ptr @pre, i64 0, i64 %50
  store i64 %48, ptr %51, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %34
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %8, align 4, !tbaa !9
  br label %29, !llvm.loop !13

55:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %56 = load i32, ptr %2, align 4, !tbaa !9
  store i32 %56, ptr %9, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %75, %55
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %78

61:                                               ; preds = %57
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = or i64 %66, %70
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %73
  store i64 %71, ptr %74, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %61
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %9, align 4, !tbaa !9
  br label %57, !llvm.loop !14

78:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %105, %78
  %80 = load i32, ptr %10, align 4, !tbaa !9
  %81 = load i32, ptr %2, align 4, !tbaa !9
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %108

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = sub nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [200005 x i64], ptr @pre, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !5
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = load i64, ptr %5, align 8, !tbaa !5
  %95 = mul nsw i64 %93, %94
  %96 = or i64 %89, %95
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !5
  %102 = or i64 %96, %101
  store i64 %102, ptr %11, align 8, !tbaa !5
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %104 = load i64, ptr %103, align 8, !tbaa !5
  store i64 %104, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %105

105:                                              ; preds = %84
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %10, align 4, !tbaa !9
  br label %79, !llvm.loop !15

108:                                              ; preds = %83
  %109 = load i64, ptr %6, align 8, !tbaa !5
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %109)
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %110, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

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

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.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 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) #3 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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 [200005 x i64], align 16
@pre = external dso_local local_unnamed_addr global [200005 x i64], align 16
@suf = external dso_local local_unnamed_addr global [200005 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 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store i64 0, ptr %4, align 8, !tbaa !5
  %9 = load i32, ptr %2, align 4, !tbaa !9
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.preheader27

.lr.ph:                                           ; preds = %0
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = sext i32 %11 to i64
  %xtraiter = and i32 %9, 7
  %13 = icmp ult i32 %9, 8
  br i1 %13, label %.preheader27.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i32 %9, 2147483640
  %factor.op.mul = mul i64 %12, %12
  %factor.op.mul62 = mul i64 %factor.op.mul, %12
  %factor.op.mul63 = mul i64 %factor.op.mul62, %12
  %factor.op.mul64 = mul i64 %factor.op.mul63, %12
  %factor.op.mul65 = mul i64 %factor.op.mul64, %12
  %factor.op.mul66 = mul i64 %factor.op.mul65, %12
  %factor.op.mul67 = mul i64 %factor.op.mul66, %12
  br label %16

.preheader27.loopexit.unr-lcssa:                  ; preds = %16, %.lr.ph
  %.lcssa54.ph = phi i64 [ poison, %.lr.ph ], [ %.reass.reass.reass.reass.reass.reass.reass, %16 ]
  %.02328.unr = phi i64 [ 1, %.lr.ph ], [ %.reass.reass.reass.reass.reass.reass.reass, %16 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader27, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader27.loopexit.unr-lcssa, %.epil.preheader
  %.02328.epil = phi i64 [ %14, %.epil.preheader ], [ %.02328.unr, %.preheader27.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader27.loopexit.unr-lcssa ]
  %14 = mul nsw i64 %.02328.epil, %12
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader27, label %.epil.preheader, !llvm.loop !11

.preheader27:                                     ; preds = %.preheader27.loopexit.unr-lcssa, %.epil.preheader, %0
  %.023.lcssa = phi i64 [ 1, %0 ], [ %.lcssa54.ph, %.preheader27.loopexit.unr-lcssa ], [ %14, %.epil.preheader ]
  %15 = load i32, ptr %1, align 4, !tbaa !9
  %.not30 = icmp slt i32 %15, 1
  br i1 %.not30, label %._crit_edge, label %.lr.ph32

16:                                               ; preds = %16, %.lr.ph.new
  %.02328 = phi i64 [ 1, %.lr.ph.new ], [ %.reass.reass.reass.reass.reass.reass.reass, %16 ]
  %niter = phi i32 [ 0, %.lr.ph.new ], [ %niter.next.7, %16 ]
  %.reass.reass.reass.reass.reass.reass.reass = mul i64 %.02328, %factor.op.mul67
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.preheader27.loopexit.unr-lcssa, label %16, !llvm.loop !13

.preheader26:                                     ; preds = %.lr.ph32
  %17 = icmp sgt i32 %33, 0
  br i1 %17, label %.lr.ph35.preheader, label %._crit_edge

.lr.ph35.preheader:                               ; preds = %.preheader26
  %18 = zext nneg i32 %33 to i64
  %19 = shl nuw nsw i64 %18, 3
  %scevgep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @suf, i64 8), i64 %19
  %load_initial = load i64, ptr %scevgep, align 8
  %xtraiter56 = and i64 %18, 3
  %lcmp.mod57.not = icmp eq i64 %xtraiter56, 0
  br i1 %lcmp.mod57.not, label %.lr.ph35.prol.loopexit, label %.lr.ph35.prol

.lr.ph35.prol:                                    ; preds = %.lr.ph35.preheader, %.lr.ph35.prol
  %store_forwarded.prol = phi i64 [ %22, %.lr.ph35.prol ], [ %load_initial, %.lr.ph35.preheader ]
  %indvars.iv42.prol = phi i64 [ %indvars.iv.next43.prol, %.lr.ph35.prol ], [ %18, %.lr.ph35.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph35.prol ], [ 0, %.lr.ph35.preheader ]
  %20 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv42.prol
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = or i64 %21, %store_forwarded.prol
  %23 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %indvars.iv42.prol
  store i64 %22, ptr %23, align 8, !tbaa !5
  %indvars.iv.next43.prol = add nsw i64 %indvars.iv42.prol, -1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter56
  br i1 %prol.iter.cmp.not, label %.lr.ph35.prol.loopexit, label %.lr.ph35.prol, !llvm.loop !15

.lr.ph35.prol.loopexit:                           ; preds = %.lr.ph35.prol, %.lr.ph35.preheader
  %store_forwarded.unr = phi i64 [ %load_initial, %.lr.ph35.preheader ], [ %22, %.lr.ph35.prol ]
  %indvars.iv42.unr = phi i64 [ %18, %.lr.ph35.preheader ], [ %indvars.iv.next43.prol, %.lr.ph35.prol ]
  %24 = icmp ult i32 %33, 4
  br i1 %24, label %.lr.ph38.preheader, label %.lr.ph35

.lr.ph32:                                         ; preds = %.preheader27, %.lr.ph32
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph32 ], [ 1, %.preheader27 ]
  %25 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr inbounds [200005 x i64], ptr @pre, i64 0, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = load i64, ptr %25, align 8, !tbaa !5
  %31 = or i64 %30, %29
  %32 = getelementptr inbounds [200005 x i64], ptr @pre, i64 0, i64 %indvars.iv
  store i64 %31, ptr %32, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr %1, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %.not.not = icmp slt i64 %indvars.iv, %34
  br i1 %.not.not, label %.lr.ph32, label %.preheader26, !llvm.loop !16

.lr.ph35:                                         ; preds = %.lr.ph35.prol.loopexit, %.lr.ph35
  %store_forwarded = phi i64 [ %49, %.lr.ph35 ], [ %store_forwarded.unr, %.lr.ph35.prol.loopexit ]
  %indvars.iv42 = phi i64 [ %indvars.iv.next43.3, %.lr.ph35 ], [ %indvars.iv42.unr, %.lr.ph35.prol.loopexit ]
  %35 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv42
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = or i64 %36, %store_forwarded
  %38 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %indvars.iv42
  store i64 %37, ptr %38, align 8, !tbaa !5
  %indvars.iv.next43 = add nsw i64 %indvars.iv42, -1
  %39 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv.next43
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = or i64 %40, %37
  %42 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %indvars.iv.next43
  store i64 %41, ptr %42, align 8, !tbaa !5
  %indvars.iv.next43.1 = add nsw i64 %indvars.iv42, -2
  %43 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv.next43.1
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = or i64 %44, %41
  %46 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %indvars.iv.next43.1
  store i64 %45, ptr %46, align 8, !tbaa !5
  %indvars.iv.next43.2 = add nsw i64 %indvars.iv42, -3
  %47 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv.next43.2
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = or i64 %48, %45
  %50 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %indvars.iv.next43.2
  store i64 %49, ptr %50, align 8, !tbaa !5
  %indvars.iv.next43.3 = add nsw i64 %indvars.iv42, -4
  %51 = icmp ugt i64 %indvars.iv.next43.2, 1
  br i1 %51, label %.lr.ph35, label %.lr.ph38.preheader, !llvm.loop !17

.lr.ph38.preheader:                               ; preds = %.lr.ph35, %.lr.ph35.prol.loopexit
  br label %.lr.ph38

._crit_edge:                                      ; preds = %.lr.ph38, %.preheader27, %.preheader26
  %52 = phi i64 [ 0, %.preheader26 ], [ 0, %.preheader27 ], [ %66, %.lr.ph38 ]
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %52)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph38:                                         ; preds = %.lr.ph38.preheader, %.lr.ph38
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph38 ], [ 1, %.lr.ph38.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %55 = add nsw i64 %indvars.iv45, -1
  %56 = getelementptr inbounds [200005 x i64], ptr @pre, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv45
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = mul nsw i64 %59, %.023.lcssa
  %61 = or i64 %60, %57
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %62 = getelementptr inbounds [200005 x i64], ptr @suf, i64 0, i64 %indvars.iv.next46
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = or i64 %61, %63
  store i64 %64, ptr %5, align 8, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %66 = load i64, ptr %65, align 8, !tbaa !5
  store i64 %66, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %67 = load i32, ptr %1, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %.not25.not = icmp slt i64 %indvars.iv45, %68
  br i1 %.not25.not, label %.lr.ph38, label %._crit_edge, !llvm.loop !18
}

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 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 #3 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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