; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/NOCHANGE (no)

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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; 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 [5 x i32], align 16
  %5 = alloca ptr, 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr %4) #7
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = add nsw i32 %12, 1
  %14 = zext i32 %13 to i64
  %15 = call ptr @llvm.stacksave.p0()
  store ptr %15, ptr %5, align 8
  %16 = alloca i8, i64 %14, align 16
  store i64 %14, ptr %6, align 8
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 %14, i1 false)
  %17 = getelementptr inbounds i8, ptr %16, i64 0
  store i8 1, ptr %17, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %42, %0
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %45

23:                                               ; preds = %18
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %26)
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %41

30:                                               ; preds = %23
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = sub nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, %35
  store i32 %40, ptr %38, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %30, %23
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %7, align 4, !tbaa !5
  br label %18, !llvm.loop !11

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

46:                                               ; preds = %86, %45
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %89

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %55, ptr %10, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %82, %51
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %85

61:                                               ; preds = %56
  %62 = load i32, ptr %10, align 4, !tbaa !5
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sub nsw i32 %62, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %16, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !9, !range !13, !noundef !14
  %71 = trunc i8 %70 to i1
  %72 = zext i1 %71 to i32
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %16, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9, !range !13, !noundef !14
  %77 = trunc i8 %76 to i1
  %78 = zext i1 %77 to i32
  %79 = or i32 %78, %72
  %80 = icmp ne i32 %79, 0
  %81 = zext i1 %80 to i8
  store i8 %81, ptr %75, align 1, !tbaa !9
  br label %82

82:                                               ; preds = %61
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %10, align 4, !tbaa !5
  br label %56, !llvm.loop !15

85:                                               ; preds = %60
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %8, align 4, !tbaa !5
  br label %46, !llvm.loop !16

89:                                               ; preds = %50
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %16, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !9, !range !13, !noundef !14
  %94 = trunc i8 %93 to i1
  %95 = zext i1 %94 to i32
  %96 = icmp eq i32 %95, 1
  br i1 %96, label %97, label %100

97:                                               ; preds = %89
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %103

100:                                              ; preds = %89
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %103

103:                                              ; preds = %100, %97
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  %104 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %104)
  call void @llvm.lifetime.end.p0(i64 20, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %105 = load i32, ptr %1, align 4
  ret i32 %105
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { 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 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i8 0, i8 2}
!14 = !{}
!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 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; 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 [5 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #7
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, 1
  %7 = zext i32 %6 to i64
  %8 = call ptr @llvm.stacksave.p0()
  %9 = alloca i8, i64 %7, align 16
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %9, i8 0, i64 %7, i1 false)
  store i8 1, ptr %9, align 16, !tbaa !9
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %12, label %.preheader.thread

.preheader.thread:                                ; preds = %0
  %.pre36 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge24

12:                                               ; preds = %0
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3)
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %.lr.ph.peel.next, label %.preheader

.preheader:                                       ; preds = %.lr.ph.peel.next, %12
  %.lcssa = phi i32 [ %14, %12 ], [ %25, %.lr.ph.peel.next ]
  %16 = icmp sgt i32 %.lcssa, 0
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br i1 %16, label %.lr.ph23, label %._crit_edge24

.lr.ph23:                                         ; preds = %.preheader
  %17 = add i32 %.pre, 1
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  %scevgep40 = getelementptr i8, ptr %9, i64 1
  %scevgep42 = getelementptr i8, ptr %9, i64 1
  br label %34

.lr.ph.peel.next:                                 ; preds = %12, %.lr.ph.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.peel.next ], [ 1, %12 ]
  %18 = getelementptr inbounds [5 x i32], ptr %3, i64 0, i64 %indvars.iv
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %18)
  %20 = add nsw i64 %indvars.iv, -1
  %21 = getelementptr inbounds [5 x i32], ptr %3, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = load i32, ptr %18, align 4, !tbaa !5
  %24 = add nsw i32 %23, %22
  store i32 %24, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next, %26
  br i1 %27, label %.lr.ph.peel.next, label %.preheader, !llvm.loop !11

._crit_edge24:                                    ; preds = %._crit_edge, %.preheader.thread, %.preheader
  %.pre37 = phi i32 [ %.pre36, %.preheader.thread ], [ %.pre, %.preheader ], [ %.pre, %._crit_edge ]
  %28 = sext i32 %.pre37 to i64
  %29 = getelementptr inbounds i8, ptr %9, i64 %28
  %30 = load i8, ptr %29, align 1, !tbaa !9, !range !14, !noundef !15
  %31 = trunc nuw i8 %30 to i1
  %.str.2..str.3 = select i1 %31, ptr @.str.2, ptr @.str.3
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.2..str.3)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %8)
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

34:                                               ; preds = %.lr.ph23, %._crit_edge
  %indvars.iv31 = phi i64 [ 0, %.lr.ph23 ], [ %indvars.iv.next32, %._crit_edge ]
  %35 = getelementptr inbounds [5 x i32], ptr %3, i64 0, i64 %indvars.iv31
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %.not19 = icmp sgt i32 %36, %.pre
  br i1 %.not19, label %._crit_edge, label %iter.check

iter.check:                                       ; preds = %34
  %37 = sext i32 %36 to i64
  %38 = sub i32 %.pre, %36
  %39 = zext i32 %38 to i64
  %40 = add nuw nsw i64 %39, 1
  %min.iters.check = icmp ult i32 %38, 7
  br i1 %min.iters.check, label %.lr.ph21.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %scevgep = getelementptr i8, ptr %9, i64 %37
  %41 = sub i32 %.pre, %36
  %42 = zext i32 %41 to i64
  %43 = getelementptr i8, ptr %scevgep40, i64 %37
  %scevgep41 = getelementptr i8, ptr %43, i64 %42
  %scevgep43 = getelementptr i8, ptr %scevgep42, i64 %42
  %bound0 = icmp ult ptr %scevgep, %scevgep43
  %bound1 = icmp ult ptr %9, %scevgep41
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph21.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  %min.iters.check44 = icmp ult i32 %38, 31
  br i1 %min.iters.check44, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %40, 8589934560
  %invariant.gep = getelementptr i8, ptr %9, i64 %37
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %44 = getelementptr inbounds i8, ptr %9, i64 %index
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %wide.load = load <16 x i8>, ptr %44, align 16, !tbaa !9, !alias.scope !16
  %wide.load45 = load <16 x i8>, ptr %45, align 16, !tbaa !9, !alias.scope !16
  %gep = getelementptr i8, ptr %invariant.gep, i64 %index
  %46 = getelementptr inbounds i8, ptr %gep, i64 16
  %wide.load46 = load <16 x i8>, ptr %gep, align 1, !tbaa !9, !alias.scope !19, !noalias !16
  %wide.load47 = load <16 x i8>, ptr %46, align 1, !tbaa !9, !alias.scope !19, !noalias !16
  %47 = or <16 x i8> %wide.load46, %wide.load
  %48 = or <16 x i8> %wide.load47, %wide.load45
  store <16 x i8> %47, ptr %gep, align 1, !tbaa !9, !alias.scope !19, !noalias !16
  store <16 x i8> %48, ptr %46, align 1, !tbaa !9, !alias.scope !19, !noalias !16
  %index.next = add nuw i64 %index, 32
  %49 = icmp eq i64 %index.next, %n.vec
  br i1 %49, label %middle.block, label %vector.body, !llvm.loop !21

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %40, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end50 = add nsw i64 %n.vec, %37
  %n.vec.remaining = and i64 %40, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph21.preheader, label %vec.epilog.ph

.lr.ph21.preheader:                               ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %indvars.iv28.ph = phi i64 [ %37, %iter.check ], [ %37, %vector.memcheck ], [ %ind.end50, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %50 = trunc i64 %indvars.iv28.ph to i32
  %51 = add i32 %.pre, %50
  %52 = and i32 %51, 1
  %lcmp.mod.not.not = icmp eq i32 %52, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph21.prol, label %.lr.ph21.prol.loopexit

.lr.ph21.prol:                                    ; preds = %.lr.ph21.preheader
  %53 = sub nsw i64 %indvars.iv28.ph, %37
  %54 = getelementptr inbounds i8, ptr %9, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !9, !range !14, !noundef !15
  %56 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv28.ph
  %57 = load i8, ptr %56, align 1, !tbaa !9, !range !14, !noundef !15
  %58 = or i8 %57, %55
  store i8 %58, ptr %56, align 1, !tbaa !9
  %indvars.iv.next29.prol = add nsw i64 %indvars.iv28.ph, 1
  br label %.lr.ph21.prol.loopexit

.lr.ph21.prol.loopexit:                           ; preds = %.lr.ph21.prol, %.lr.ph21.preheader
  %indvars.iv28.unr = phi i64 [ %indvars.iv28.ph, %.lr.ph21.preheader ], [ %indvars.iv.next29.prol, %.lr.ph21.prol ]
  %59 = icmp eq i32 %.pre, %50
  br i1 %59, label %._crit_edge, label %.lr.ph21

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.vec49 = and i64 %40, 8589934584
  %ind.end = add nsw i64 %n.vec49, %37
  %invariant.gep59 = getelementptr i8, ptr %9, i64 %37
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index51 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ]
  %60 = getelementptr inbounds i8, ptr %9, i64 %index51
  %wide.load53 = load <8 x i8>, ptr %60, align 8, !tbaa !9, !alias.scope !24
  %gep60 = getelementptr i8, ptr %invariant.gep59, i64 %index51
  %wide.load54 = load <8 x i8>, ptr %gep60, align 1, !tbaa !9, !alias.scope !27, !noalias !24
  %61 = or <8 x i8> %wide.load54, %wide.load53
  store <8 x i8> %61, ptr %gep60, align 1, !tbaa !9, !alias.scope !27, !noalias !24
  %index.next55 = add nuw i64 %index51, 8
  %62 = icmp eq i64 %index.next55, %n.vec49
  br i1 %62, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !29

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n56 = icmp eq i64 %40, %n.vec49
  br i1 %cmp.n56, label %._crit_edge, label %.lr.ph21.preheader

._crit_edge:                                      ; preds = %.lr.ph21.prol.loopexit, %.lr.ph21, %middle.block, %vec.epilog.middle.block, %34
  %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
  %exitcond34.not = icmp eq i64 %indvars.iv.next32, %wide.trip.count
  br i1 %exitcond34.not, label %._crit_edge24, label %34, !llvm.loop !30

.lr.ph21:                                         ; preds = %.lr.ph21.prol.loopexit, %.lr.ph21
  %indvars.iv28 = phi i64 [ %indvars.iv.next29.1, %.lr.ph21 ], [ %indvars.iv28.unr, %.lr.ph21.prol.loopexit ]
  %63 = sub nsw i64 %indvars.iv28, %37
  %64 = getelementptr inbounds i8, ptr %9, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !9, !range !14, !noundef !15
  %66 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv28
  %67 = load i8, ptr %66, align 1, !tbaa !9, !range !14, !noundef !15
  %68 = or i8 %67, %65
  store i8 %68, ptr %66, align 1, !tbaa !9
  %indvars.iv.next29 = add nsw i64 %indvars.iv28, 1
  %69 = sub nsw i64 %indvars.iv.next29, %37
  %70 = getelementptr inbounds i8, ptr %9, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !9, !range !14, !noundef !15
  %72 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv.next29
  %73 = load i8, ptr %72, align 1, !tbaa !9, !range !14, !noundef !15
  %74 = or i8 %73, %71
  store i8 %74, ptr %72, align 1, !tbaa !9
  %indvars.iv.next29.1 = add nsw i64 %indvars.iv28, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next29.1 to i32
  %exitcond.not.1 = icmp eq i32 %17, %lftr.wideiv.1
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph21, !llvm.loop !31
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

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

; 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 #6 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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17}
!17 = distinct !{!17, !18}
!18 = distinct !{!18, !"LVerDomain"}
!19 = !{!20}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !12, !22, !23}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = !{!25}
!25 = distinct !{!25, !26}
!26 = distinct !{!26, !"LVerDomain"}
!27 = !{!28}
!28 = distinct !{!28, !26}
!29 = distinct !{!29, !12, !22, !23}
!30 = distinct !{!30, !12}
!31 = distinct !{!31, !12, !22}


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