; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Week of Code/Week 25/Problem A (A)

; 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 [10 x i32], align 16
@b = external dso_local global [10 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@_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 i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = 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)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %22, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %19
  %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) %20)
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %36, %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %34)
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !11

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %89, %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = icmp sle i32 %41, 100
  br i1 %42, label %44, label %43

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

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

45:                                               ; preds = %60, %44
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %63

50:                                               ; preds = %45
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = srem i32 %51, %55
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %50
  store i8 0, ptr %7, align 1, !tbaa !12
  br label %59

59:                                               ; preds = %58, %50
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %8, align 4, !tbaa !5
  br label %45, !llvm.loop !14

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

64:                                               ; preds = %79, %63
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %82

69:                                               ; preds = %64
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = srem i32 %73, %74
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %69
  store i8 0, ptr %7, align 1, !tbaa !12
  br label %78

78:                                               ; preds = %77, %69
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %9, align 4, !tbaa !5
  br label %64, !llvm.loop !15

82:                                               ; preds = %68
  %83 = load i8, ptr %7, align 1, !tbaa !12, !range !16, !noundef !17
  %84 = trunc i8 %83 to i1
  br i1 %84, label %85, label %88

85:                                               ; preds = %82
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %4, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %85, %82
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %5, align 4, !tbaa !5
  br label %40, !llvm.loop !18

92:                                               ; preds = %43
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %93)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %96 = load i32, ptr %1, align 4
  ret i32 %96
}

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [10 x i32], align 16
@b = external dso_local global [10 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@_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 nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.preheader32

.preheader32:                                     ; preds = %.lr.ph, %0
  %5 = phi i32 [ %3, %0 ], [ %10, %.lr.ph ]
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph35, label %.preheader31

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv
  %9 = 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) %8)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next, %11
  br i1 %12, label %.lr.ph, label %.preheader32, !llvm.loop !9

.preheader31.loopexit:                            ; preds = %.lr.ph35
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader31

.preheader31:                                     ; preds = %.preheader31.loopexit, %.preheader32
  %13 = phi i32 [ %5, %.preheader32 ], [ %.pre, %.preheader31.loopexit ]
  %.lcssa = phi i32 [ %6, %.preheader32 ], [ %73, %.preheader31.loopexit ]
  %14 = icmp sgt i32 %13, 0
  %15 = icmp sgt i32 %.lcssa, 0
  br i1 %14, label %.preheader31.split.us, label %.preheader31.split

.preheader31.split.us:                            ; preds = %.preheader31
  %wide.trip.count79 = zext nneg i32 %13 to i64
  br i1 %15, label %.preheader30.us.us.preheader, label %.preheader30.us.preheader

.preheader30.us.preheader:                        ; preds = %.preheader31.split.us
  %xtraiter100 = and i64 %wide.trip.count79, 1
  %16 = icmp eq i32 %13, 1
  %unroll_iter103 = and i64 %wide.trip.count79, 2147483646
  %lcmp.mod101.not = icmp eq i64 %xtraiter100, 0
  br label %.preheader30.us

.preheader30.us.us.preheader:                     ; preds = %.preheader31.split.us
  %wide.trip.count83 = zext nneg i32 %.lcssa to i64
  %xtraiter106 = and i64 %wide.trip.count79, 1
  %17 = icmp eq i32 %13, 1
  %unroll_iter109 = and i64 %wide.trip.count79, 2147483646
  %lcmp.mod107.not = icmp eq i64 %xtraiter106, 0
  %xtraiter111 = and i64 %wide.trip.count83, 1
  %18 = icmp eq i32 %.lcssa, 1
  %unroll_iter114 = and i64 %wide.trip.count83, 2147483646
  %lcmp.mod112.not = icmp eq i64 %xtraiter111, 0
  br label %.preheader30.us.us

.preheader30.us.us:                               ; preds = %.preheader30.us.us.preheader, %._crit_edge.us.us
  %.02245.us.us = phi i32 [ %42, %._crit_edge.us.us ], [ 1, %.preheader30.us.us.preheader ]
  %.02344.us.us = phi i32 [ %spec.select28.us.us, %._crit_edge.us.us ], [ 0, %.preheader30.us.us.preheader ]
  br i1 %17, label %..preheader_crit_edge.us.us.preheader.unr-lcssa, label %.preheader30.us.us.new

..preheader_crit_edge.us.us:                      ; preds = %..preheader_crit_edge.us.us.preheader, %..preheader_crit_edge.us.us
  %indvars.iv81 = phi i64 [ %indvars.iv.next82.1, %..preheader_crit_edge.us.us ], [ 0, %..preheader_crit_edge.us.us.preheader ]
  %.240.us.us = phi i8 [ %spec.select29.us.us.1, %..preheader_crit_edge.us.us ], [ %spec.select.us.us.lcssa, %..preheader_crit_edge.us.us.preheader ]
  %niter115 = phi i64 [ %niter115.next.1, %..preheader_crit_edge.us.us ], [ 0, %..preheader_crit_edge.us.us.preheader ]
  %19 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %indvars.iv81
  %20 = load i32, ptr %19, align 8, !tbaa !5
  %21 = srem i32 %20, %.02245.us.us
  %.not.us.us = icmp eq i32 %21, 0
  %indvars.iv.next82 = or disjoint i64 %indvars.iv81, 1
  %22 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %indvars.iv.next82
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = srem i32 %23, %.02245.us.us
  %.not.us.us.1 = icmp eq i32 %24, 0
  %25 = select i1 %.not.us.us.1, i1 %.not.us.us, i1 false
  %spec.select29.us.us.1 = select i1 %25, i8 %.240.us.us, i8 0
  %indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 2
  %niter115.next.1 = add i64 %niter115, 2
  %niter115.ncmp.1 = icmp eq i64 %niter115.next.1, %unroll_iter114
  br i1 %niter115.ncmp.1, label %._crit_edge.us.us.unr-lcssa, label %..preheader_crit_edge.us.us, !llvm.loop !11

.preheader30.us.us.new:                           ; preds = %.preheader30.us.us, %.preheader30.us.us.new
  %indvars.iv77 = phi i64 [ %indvars.iv.next78.1, %.preheader30.us.us.new ], [ 0, %.preheader30.us.us ]
  %.02136.us.us = phi i8 [ %spec.select.us.us.1, %.preheader30.us.us.new ], [ 1, %.preheader30.us.us ]
  %niter110 = phi i64 [ %niter110.next.1, %.preheader30.us.us.new ], [ 0, %.preheader30.us.us ]
  %26 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv77
  %27 = load i32, ptr %26, align 8, !tbaa !5
  %28 = srem i32 %.02245.us.us, %27
  %indvars.iv.next78 = or disjoint i64 %indvars.iv77, 1
  %29 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv.next78
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = srem i32 %.02245.us.us, %30
  %32 = or i32 %31, %28
  %33 = icmp eq i32 %32, 0
  %spec.select.us.us.1 = select i1 %33, i8 %.02136.us.us, i8 0
  %indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
  %niter110.next.1 = add i64 %niter110, 2
  %niter110.ncmp.1 = icmp eq i64 %niter110.next.1, %unroll_iter109
  br i1 %niter110.ncmp.1, label %..preheader_crit_edge.us.us.preheader.unr-lcssa, label %.preheader30.us.us.new, !llvm.loop !12

..preheader_crit_edge.us.us.preheader.unr-lcssa:  ; preds = %.preheader30.us.us.new, %.preheader30.us.us
  %spec.select.us.us.lcssa.ph = phi i8 [ poison, %.preheader30.us.us ], [ %spec.select.us.us.1, %.preheader30.us.us.new ]
  %indvars.iv77.unr = phi i64 [ 0, %.preheader30.us.us ], [ %indvars.iv.next78.1, %.preheader30.us.us.new ]
  %.02136.us.us.unr = phi i8 [ 1, %.preheader30.us.us ], [ %spec.select.us.us.1, %.preheader30.us.us.new ]
  br i1 %lcmp.mod107.not, label %..preheader_crit_edge.us.us.preheader, label %..preheader_crit_edge.us.us.preheader.epilog-lcssa

..preheader_crit_edge.us.us.preheader.epilog-lcssa: ; preds = %..preheader_crit_edge.us.us.preheader.unr-lcssa
  %34 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv77.unr
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = srem i32 %.02245.us.us, %35
  %.not27.us.us.epil = icmp eq i32 %36, 0
  %spec.select.us.us.epil = select i1 %.not27.us.us.epil, i8 %.02136.us.us.unr, i8 0
  br label %..preheader_crit_edge.us.us.preheader

..preheader_crit_edge.us.us.preheader:            ; preds = %..preheader_crit_edge.us.us.preheader.unr-lcssa, %..preheader_crit_edge.us.us.preheader.epilog-lcssa
  %spec.select.us.us.lcssa = phi i8 [ %spec.select.us.us.lcssa.ph, %..preheader_crit_edge.us.us.preheader.unr-lcssa ], [ %spec.select.us.us.epil, %..preheader_crit_edge.us.us.preheader.epilog-lcssa ]
  br i1 %18, label %._crit_edge.us.us.unr-lcssa, label %..preheader_crit_edge.us.us

._crit_edge.us.us.unr-lcssa:                      ; preds = %..preheader_crit_edge.us.us, %..preheader_crit_edge.us.us.preheader
  %spec.select29.us.us.lcssa.ph = phi i8 [ poison, %..preheader_crit_edge.us.us.preheader ], [ %spec.select29.us.us.1, %..preheader_crit_edge.us.us ]
  %indvars.iv81.unr = phi i64 [ 0, %..preheader_crit_edge.us.us.preheader ], [ %indvars.iv.next82.1, %..preheader_crit_edge.us.us ]
  %.240.us.us.unr = phi i8 [ %spec.select.us.us.lcssa, %..preheader_crit_edge.us.us.preheader ], [ %spec.select29.us.us.1, %..preheader_crit_edge.us.us ]
  br i1 %lcmp.mod112.not, label %._crit_edge.us.us, label %..preheader_crit_edge.us.us.epil

..preheader_crit_edge.us.us.epil:                 ; preds = %._crit_edge.us.us.unr-lcssa
  %37 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %indvars.iv81.unr
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = srem i32 %38, %.02245.us.us
  %.not.us.us.epil = icmp eq i32 %39, 0
  %spec.select29.us.us.epil = select i1 %.not.us.us.epil, i8 %.240.us.us.unr, i8 0
  br label %._crit_edge.us.us

._crit_edge.us.us:                                ; preds = %._crit_edge.us.us.unr-lcssa, %..preheader_crit_edge.us.us.epil
  %spec.select29.us.us.lcssa = phi i8 [ %spec.select29.us.us.lcssa.ph, %._crit_edge.us.us.unr-lcssa ], [ %spec.select29.us.us.epil, %..preheader_crit_edge.us.us.epil ]
  %40 = and i8 %spec.select29.us.us.lcssa, 1
  %41 = zext nneg i8 %40 to i32
  %spec.select28.us.us = add nuw nsw i32 %.02344.us.us, %41
  %42 = add nuw nsw i32 %.02245.us.us, 1
  %exitcond85.not = icmp eq i32 %42, 101
  br i1 %exitcond85.not, label %.split.us, label %.preheader30.us.us, !llvm.loop !13

.preheader30.us:                                  ; preds = %.preheader30.us.preheader, %..preheader_crit_edge.us
  %.02245.us = phi i32 [ %56, %..preheader_crit_edge.us ], [ 1, %.preheader30.us.preheader ]
  %.02344.us = phi i32 [ %spec.select28.us, %..preheader_crit_edge.us ], [ 0, %.preheader30.us.preheader ]
  br i1 %16, label %..preheader_crit_edge.us.unr-lcssa, label %.preheader30.us.new

.preheader30.us.new:                              ; preds = %.preheader30.us, %.preheader30.us.new
  %indvars.iv72 = phi i64 [ %indvars.iv.next73.1, %.preheader30.us.new ], [ 0, %.preheader30.us ]
  %.02136.us = phi i8 [ %spec.select.us.1, %.preheader30.us.new ], [ 1, %.preheader30.us ]
  %niter104 = phi i64 [ %niter104.next.1, %.preheader30.us.new ], [ 0, %.preheader30.us ]
  %43 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv72
  %44 = load i32, ptr %43, align 8, !tbaa !5
  %45 = srem i32 %.02245.us, %44
  %indvars.iv.next73 = or disjoint i64 %indvars.iv72, 1
  %46 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv.next73
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = srem i32 %.02245.us, %47
  %49 = or i32 %48, %45
  %50 = icmp eq i32 %49, 0
  %spec.select.us.1 = select i1 %50, i8 %.02136.us, i8 0
  %indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 2
  %niter104.next.1 = add i64 %niter104, 2
  %niter104.ncmp.1 = icmp eq i64 %niter104.next.1, %unroll_iter103
  br i1 %niter104.ncmp.1, label %..preheader_crit_edge.us.unr-lcssa, label %.preheader30.us.new, !llvm.loop !12

..preheader_crit_edge.us.unr-lcssa:               ; preds = %.preheader30.us.new, %.preheader30.us
  %spec.select.us.lcssa.ph = phi i8 [ poison, %.preheader30.us ], [ %spec.select.us.1, %.preheader30.us.new ]
  %indvars.iv72.unr = phi i64 [ 0, %.preheader30.us ], [ %indvars.iv.next73.1, %.preheader30.us.new ]
  %.02136.us.unr = phi i8 [ 1, %.preheader30.us ], [ %spec.select.us.1, %.preheader30.us.new ]
  br i1 %lcmp.mod101.not, label %..preheader_crit_edge.us, label %..preheader_crit_edge.us.epilog-lcssa

..preheader_crit_edge.us.epilog-lcssa:            ; preds = %..preheader_crit_edge.us.unr-lcssa
  %51 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv72.unr
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = srem i32 %.02245.us, %52
  %.not27.us.epil = icmp eq i32 %53, 0
  %spec.select.us.epil = select i1 %.not27.us.epil, i8 %.02136.us.unr, i8 0
  br label %..preheader_crit_edge.us

..preheader_crit_edge.us:                         ; preds = %..preheader_crit_edge.us.unr-lcssa, %..preheader_crit_edge.us.epilog-lcssa
  %spec.select.us.lcssa = phi i8 [ %spec.select.us.lcssa.ph, %..preheader_crit_edge.us.unr-lcssa ], [ %spec.select.us.epil, %..preheader_crit_edge.us.epilog-lcssa ]
  %54 = and i8 %spec.select.us.lcssa, 1
  %55 = zext nneg i8 %54 to i32
  %spec.select28.us = add nuw nsw i32 %.02344.us, %55
  %56 = add nuw nsw i32 %.02245.us, 1
  %exitcond76.not = icmp eq i32 %56, 101
  br i1 %exitcond76.not, label %.split.us, label %.preheader30.us, !llvm.loop !13

.preheader31.split:                               ; preds = %.preheader31
  br i1 %15, label %.preheader30.us46.preheader, label %.split.us

.preheader30.us46.preheader:                      ; preds = %.preheader31.split
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %57 = icmp eq i32 %.lcssa, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader30.us46

.preheader30.us46:                                ; preds = %.preheader30.us46.preheader, %._crit_edge.us56
  %.02245.us47 = phi i32 [ %70, %._crit_edge.us56 ], [ 1, %.preheader30.us46.preheader ]
  %.02344.us48 = phi i32 [ %spec.select28.us50, %._crit_edge.us56 ], [ 0, %.preheader30.us46.preheader ]
  br i1 %57, label %._crit_edge.us56.unr-lcssa, label %.preheader30.us46.new

.preheader30.us46.new:                            ; preds = %.preheader30.us46, %.preheader30.us46.new
  %indvars.iv69 = phi i64 [ %indvars.iv.next70.1, %.preheader30.us46.new ], [ 0, %.preheader30.us46 ]
  %.240.us52 = phi i8 [ %spec.select29.us54.1, %.preheader30.us46.new ], [ 1, %.preheader30.us46 ]
  %niter = phi i64 [ %niter.next.1, %.preheader30.us46.new ], [ 0, %.preheader30.us46 ]
  %58 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %indvars.iv69
  %59 = load i32, ptr %58, align 8, !tbaa !5
  %60 = srem i32 %59, %.02245.us47
  %.not.us53 = icmp eq i32 %60, 0
  %indvars.iv.next70 = or disjoint i64 %indvars.iv69, 1
  %61 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %indvars.iv.next70
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = srem i32 %62, %.02245.us47
  %.not.us53.1 = icmp eq i32 %63, 0
  %64 = select i1 %.not.us53.1, i1 %.not.us53, i1 false
  %spec.select29.us54.1 = select i1 %64, i8 %.240.us52, i8 0
  %indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us56.unr-lcssa, label %.preheader30.us46.new, !llvm.loop !11

._crit_edge.us56.unr-lcssa:                       ; preds = %.preheader30.us46.new, %.preheader30.us46
  %spec.select29.us54.lcssa.ph = phi i8 [ poison, %.preheader30.us46 ], [ %spec.select29.us54.1, %.preheader30.us46.new ]
  %indvars.iv69.unr = phi i64 [ 0, %.preheader30.us46 ], [ %indvars.iv.next70.1, %.preheader30.us46.new ]
  %.240.us52.unr = phi i8 [ 1, %.preheader30.us46 ], [ %spec.select29.us54.1, %.preheader30.us46.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us56, label %._crit_edge.us56.epilog-lcssa

._crit_edge.us56.epilog-lcssa:                    ; preds = %._crit_edge.us56.unr-lcssa
  %65 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %indvars.iv69.unr
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = srem i32 %66, %.02245.us47
  %.not.us53.epil = icmp eq i32 %67, 0
  %spec.select29.us54.epil = select i1 %.not.us53.epil, i8 %.240.us52.unr, i8 0
  br label %._crit_edge.us56

._crit_edge.us56:                                 ; preds = %._crit_edge.us56.unr-lcssa, %._crit_edge.us56.epilog-lcssa
  %spec.select29.us54.lcssa = phi i8 [ %spec.select29.us54.lcssa.ph, %._crit_edge.us56.unr-lcssa ], [ %spec.select29.us54.epil, %._crit_edge.us56.epilog-lcssa ]
  %68 = and i8 %spec.select29.us54.lcssa, 1
  %69 = zext nneg i8 %68 to i32
  %spec.select28.us50 = add nuw nsw i32 %.02344.us48, %69
  %70 = add nuw nsw i32 %.02245.us47, 1
  %exitcond71.not = icmp eq i32 %70, 101
  br i1 %exitcond71.not, label %.split.us, label %.preheader30.us46, !llvm.loop !13

.lr.ph35:                                         ; preds = %.preheader32, %.lr.ph35
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph35 ], [ 0, %.preheader32 ]
  %71 = getelementptr inbounds [10 x i32], ptr @b, i64 0, i64 %indvars.iv66
  %72 = 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) %71)
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next67, %74
  br i1 %75, label %.lr.ph35, label %.preheader31.loopexit, !llvm.loop !14

.split.us:                                        ; preds = %._crit_edge.us56, %..preheader_crit_edge.us, %._crit_edge.us.us, %.preheader31.split
  %.us-phi = phi i32 [ 100, %.preheader31.split ], [ %spec.select28.us.us, %._crit_edge.us.us ], [ %spec.select28.us, %..preheader_crit_edge.us ], [ %spec.select28.us50, %._crit_edge.us56 ]
  %76 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.us-phi)
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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

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 #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)) #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 = { "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 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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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