; LLVM IR from kazunetakahashi/atcoder :: 2018/0415_s8pc-5/F.ll (Z6solveAv)

; 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_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@used = external dso_local global [50 x i8], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; 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
define dso_local void @_Z6solveAv() #2 {
  %1 = alloca i64, align 8
  %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
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  store i64 10000000000000, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %61, %0
  %9 = load i32, ptr %2, align 4, !tbaa !9
  %10 = load i32, ptr @N, align 4, !tbaa !9
  %11 = shl i32 1, %10
  %12 = icmp slt i32 %9, %11
  br i1 %12, label %14, label %13

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

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

15:                                               ; preds = %30, %14
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = load i32, ptr @N, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %33

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = ashr i32 %21, %22
  %24 = and i32 %23, 1
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %29

26:                                               ; preds = %20
  %27 = load i32, ptr %4, align 4, !tbaa !9
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %4, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %26, %20
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %5, align 4, !tbaa !9
  br label %15, !llvm.loop !11

33:                                               ; preds = %19
  %34 = load i32, ptr %4, align 4, !tbaa !9
  %35 = load i32, ptr @M, align 4, !tbaa !9
  %36 = icmp eq i32 %34, %35
  br i1 %36, label %37, label %60

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %53, %37
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = load i32, ptr @N, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = load i32, ptr %2, align 4, !tbaa !9
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = ashr i32 %44, %45
  %47 = and i32 %46, 1
  %48 = icmp ne i32 %47, 0
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [50 x i8], ptr @used, i64 0, i64 %50
  %52 = zext i1 %48 to i8
  store i8 %52, ptr %51, align 1, !tbaa !13
  br label %53

53:                                               ; preds = %43
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %6, align 4, !tbaa !9
  br label %38, !llvm.loop !15

56:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %57 = call noundef i64 @_Z5solvev()
  store i64 %57, ptr %7, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %59 = load i64, ptr %58, align 8, !tbaa !5
  store i64 %59, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %60

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

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

64:                                               ; preds = %13
  %65 = load i64, ptr %1, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %65)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 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) #2 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)) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !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_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@N = external dso_local local_unnamed_addr global i32, align 4
@M = external dso_local local_unnamed_addr global i32, align 4
@used = external dso_local local_unnamed_addr global [50 x i8], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; 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
define dso_local void @_Z6solveAv() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 10000000000000, ptr %1, align 8, !tbaa !5
  %3 = load i32, ptr @N, align 4, !tbaa !9
  %.not = icmp eq i32 %3, 31
  br i1 %.not, label %._crit_edge24, label %.preheader16

.preheader16:                                     ; preds = %0, %47
  %4 = phi i64 [ %48, %47 ], [ 10000000000000, %0 ]
  %5 = phi i32 [ %49, %47 ], [ %3, %0 ]
  %.01522 = phi i32 [ %50, %47 ], [ 0, %0 ]
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %.preheader16
  %min.iters.check40 = icmp ult i32 %5, 8
  br i1 %min.iters.check40, label %.lr.ph.preheader55, label %vector.ph41

.lr.ph.preheader55:                               ; preds = %middle.block39, %.lr.ph.preheader
  %.01318.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %n.vec43, %middle.block39 ]
  %.01417.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %14, %middle.block39 ]
  br label %.lr.ph

vector.ph41:                                      ; preds = %.lr.ph.preheader
  %n.vec43 = and i32 %5, 2147483640
  %broadcast.splatinsert51 = insertelement <4 x i32> poison, i32 %.01522, i64 0
  %broadcast.splat52 = shufflevector <4 x i32> %broadcast.splatinsert51, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body45

vector.body45:                                    ; preds = %vector.body45, %vector.ph41
  %index46 = phi i32 [ 0, %vector.ph41 ], [ %index.next53, %vector.body45 ]
  %vec.ind47 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph41 ], [ %vec.ind.next49, %vector.body45 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph41 ], [ %11, %vector.body45 ]
  %vec.phi50 = phi <4 x i32> [ zeroinitializer, %vector.ph41 ], [ %12, %vector.body45 ]
  %step.add = add <4 x i32> %vec.ind47, <i32 4, i32 4, i32 4, i32 4>
  %7 = lshr <4 x i32> %broadcast.splat52, %vec.ind47
  %8 = lshr <4 x i32> %broadcast.splat52, %step.add
  %9 = and <4 x i32> %7, <i32 1, i32 1, i32 1, i32 1>
  %10 = and <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
  %11 = add <4 x i32> %9, %vec.phi
  %12 = add <4 x i32> %10, %vec.phi50
  %index.next53 = add nuw i32 %index46, 8
  %vec.ind.next49 = add <4 x i32> %vec.ind47, <i32 8, i32 8, i32 8, i32 8>
  %13 = icmp eq i32 %index.next53, %n.vec43
  br i1 %13, label %middle.block39, label %vector.body45, !llvm.loop !11

middle.block39:                                   ; preds = %vector.body45
  %bin.rdx = add <4 x i32> %12, %11
  %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n54 = icmp eq i32 %5, %n.vec43
  br i1 %cmp.n54, label %._crit_edge, label %.lr.ph.preheader55

._crit_edge24:                                    ; preds = %47, %0
  %15 = phi i64 [ 10000000000000, %0 ], [ %48, %47 ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %15)
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void

._crit_edge:                                      ; preds = %.lr.ph, %middle.block39
  %spec.select.lcssa = phi i32 [ %14, %middle.block39 ], [ %spec.select, %.lr.ph ]
  %18 = load i32, ptr @M, align 4, !tbaa !9
  %19 = icmp eq i32 %spec.select.lcssa, %18
  br i1 %19, label %.preheader, label %47

._crit_edge.thread:                               ; preds = %.preheader16
  %20 = load i32, ptr @M, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %._crit_edge21, label %47

.preheader:                                       ; preds = %._crit_edge
  br i1 %6, label %iter.check, label %._crit_edge21

iter.check:                                       ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %5 to i64
  %min.iters.check = icmp ult i32 %5, 8
  br i1 %min.iters.check, label %.lr.ph20.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check28 = icmp ult i32 %5, 16
  br i1 %min.iters.check28, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count, 2147483632
  %broadcast.splatinsert = insertelement <16 x i32> poison, i32 %.01522, i64 0
  %broadcast.splat = shufflevector <16 x i32> %broadcast.splatinsert, <16 x i32> poison, <16 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %22 = shl nuw <16 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>, %vec.ind
  %23 = and <16 x i32> %22, %broadcast.splat
  %24 = icmp ne <16 x i32> %23, zeroinitializer
  %25 = getelementptr inbounds [50 x i8], ptr @used, i64 0, i64 %index
  %26 = zext <16 x i1> %24 to <16 x i8>
  store <16 x i8> %26, ptr %25, align 16, !tbaa !15
  %index.next = add nuw i64 %index, 16
  %vec.ind.next = add <16 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge21, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %wide.trip.count, 8
  %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check.not.not, label %.lr.ph20.preheader, label %vec.epilog.ph

.lr.ph20.preheader:                               ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec30, %vec.epilog.middle.block ]
  br label %.lr.ph20

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec30 = and i64 %wide.trip.count, 2147483640
  %28 = trunc nuw nsw i64 %vec.epilog.resume.val to i32
  %.splatinsert = insertelement <8 x i32> poison, i32 %28, i64 0
  %.splat = shufflevector <8 x i32> %.splatinsert, <8 x i32> poison, <8 x i32> zeroinitializer
  %induction = or disjoint <8 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  %broadcast.splatinsert35 = insertelement <8 x i32> poison, i32 %.01522, i64 0
  %broadcast.splat36 = shufflevector <8 x i32> %broadcast.splatinsert35, <8 x i32> poison, <8 x i32> zeroinitializer
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index32 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next37, %vec.epilog.vector.body ]
  %vec.ind33 = phi <8 x i32> [ %induction, %vec.epilog.ph ], [ %vec.ind.next34, %vec.epilog.vector.body ]
  %29 = shl nuw <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>, %vec.ind33
  %30 = and <8 x i32> %29, %broadcast.splat36
  %31 = icmp ne <8 x i32> %30, zeroinitializer
  %32 = getelementptr inbounds [50 x i8], ptr @used, i64 0, i64 %index32
  %33 = zext <8 x i1> %31 to <8 x i8>
  store <8 x i8> %33, ptr %32, align 8, !tbaa !15
  %index.next37 = add nuw i64 %index32, 8
  %vec.ind.next34 = add <8 x i32> %vec.ind33, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8>
  %34 = icmp eq i64 %index.next37, %n.vec30
  br i1 %34, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !18

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n38 = icmp eq i64 %n.vec30, %wide.trip.count
  br i1 %cmp.n38, label %._crit_edge21, label %.lr.ph20.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader55, %.lr.ph
  %.01318 = phi i32 [ %37, %.lr.ph ], [ %.01318.ph, %.lr.ph.preheader55 ]
  %.01417 = phi i32 [ %spec.select, %.lr.ph ], [ %.01417.ph, %.lr.ph.preheader55 ]
  %35 = lshr i32 %.01522, %.01318
  %36 = and i32 %35, 1
  %spec.select = add nuw nsw i32 %36, %.01417
  %37 = add nuw nsw i32 %.01318, 1
  %exitcond.not = icmp eq i32 %37, %5
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge21:                                    ; preds = %.lr.ph20, %middle.block, %vec.epilog.middle.block, %._crit_edge.thread, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %38 = call noundef i64 @_Z5solvev()
  store i64 %38, ptr %2, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %40 = load i64, ptr %39, align 8, !tbaa !5
  store i64 %40, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %.pre = load i32, ptr @N, align 4, !tbaa !9
  br label %47

.lr.ph20:                                         ; preds = %.lr.ph20.preheader, %.lr.ph20
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph20 ], [ %indvars.iv.ph, %.lr.ph20.preheader ]
  %41 = trunc nuw nsw i64 %indvars.iv to i32
  %42 = shl nuw i32 1, %41
  %43 = and i32 %42, %.01522
  %44 = icmp ne i32 %43, 0
  %45 = getelementptr inbounds [50 x i8], ptr @used, i64 0, i64 %indvars.iv
  %46 = zext i1 %44 to i8
  store i8 %46, ptr %45, align 1, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond26.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond26.not, label %._crit_edge21, label %.lr.ph20, !llvm.loop !20

47:                                               ; preds = %._crit_edge.thread, %._crit_edge21, %._crit_edge
  %48 = phi i64 [ %40, %._crit_edge21 ], [ %4, %._crit_edge ], [ %4, %._crit_edge.thread ]
  %49 = phi i32 [ %.pre, %._crit_edge21 ], [ %5, %._crit_edge ], [ %5, %._crit_edge.thread ]
  %50 = add nuw nsw i32 %.01522, 1
  %51 = shl nuw i32 1, %49
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.preheader16, label %._crit_edge24, !llvm.loop !21
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

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


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