; LLVM IR from kazunetakahashi/atcoder :: 2019/0525_ABC127/past (C)

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

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@L = external dso_local global [100010 x i32], align 16
@R = external dso_local global [100010 x i32], align 16
@imos = external dso_local global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = 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)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, 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 %10

10:                                               ; preds = %24, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @M, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100010 x i32], ptr @L, i64 0, i64 %17
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100010 x i32], ptr @R, i64 0, i64 %21
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %22)
  br label %24

24:                                               ; preds = %15
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

27:                                               ; preds = %14
  %28 = load i32, ptr @N, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr @imos, i64 %29
  %31 = getelementptr inbounds i32, ptr %30, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @imos, ptr noundef %31, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %55, %27
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr @M, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %58

37:                                               ; preds = %32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100010 x i32], ptr @L, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %43, align 4, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100010 x i32], ptr @R, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %52, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %37
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %4, align 4, !tbaa !5
  br label %32, !llvm.loop !11

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

59:                                               ; preds = %75, %58
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = load i32, ptr @N, align 4, !tbaa !5
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %78

64:                                               ; preds = %59
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, %69
  store i32 %74, ptr %72, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %64
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %5, align 4, !tbaa !5
  br label %59, !llvm.loop !12

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

79:                                               ; preds = %95, %78
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = load i32, ptr @N, align 4, !tbaa !5
  %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 %7) #5
  br label %98

84:                                               ; preds = %79
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr @M, align 4, !tbaa !5
  %90 = icmp eq i32 %88, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %84
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %6, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %91, %84
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %7, align 4, !tbaa !5
  br label %79, !llvm.loop !13

98:                                               ; preds = %83
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %99)
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %102 = load i32, ptr %1, align 4
  ret i32 %102
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = distinct !{!12, !10}
!13 = distinct !{!13, !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" }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@L = external dso_local global [100010 x i32], align 16
@R = external dso_local global [100010 x i32], align 16
@imos = external dso_local global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = 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)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %4 = load i32, ptr @M, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %6 = load i32, ptr @N, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds i32, ptr @imos, i64 %7
  %9 = getelementptr inbounds i8, ptr %8, i64 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @imos, ptr noundef nonnull %9, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %10 = load i32, ptr @M, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph28.preheader, label %.preheader23

.lr.ph28.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %10 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %12 = icmp eq i32 %10, 1
  br i1 %12, label %.preheader23.loopexit.unr-lcssa, label %.lr.ph28.preheader.new

.lr.ph28.preheader.new:                           ; preds = %.lr.ph28.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph28

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds [100010 x i32], ptr @L, i64 0, i64 %indvars.iv
  %14 = 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) %13)
  %15 = getelementptr inbounds [100010 x i32], ptr @R, i64 0, i64 %indvars.iv
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr @M, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader23.loopexit.unr-lcssa:                  ; preds = %.lr.ph28, %.lr.ph28.preheader
  %indvars.iv40.unr = phi i64 [ 0, %.lr.ph28.preheader ], [ %indvars.iv.next41.1, %.lr.ph28 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader23, label %.lr.ph28.epil

.lr.ph28.epil:                                    ; preds = %.preheader23.loopexit.unr-lcssa
  %20 = getelementptr inbounds [100010 x i32], ptr @L, i64 0, i64 %indvars.iv40.unr
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %23, align 4, !tbaa !5
  %26 = getelementptr inbounds [100010 x i32], ptr @R, i64 0, i64 %indvars.iv40.unr
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %30, align 4, !tbaa !5
  br label %.preheader23

.preheader23:                                     ; preds = %.lr.ph28.epil, %.preheader23.loopexit.unr-lcssa, %._crit_edge
  %33 = load i32, ptr @N, align 4, !tbaa !5
  %.not29 = icmp slt i32 %33, 1
  br i1 %.not29, label %._crit_edge37, label %.lr.ph31.preheader

.lr.ph31.preheader:                               ; preds = %.preheader23
  %.pre = load i32, ptr @imos, align 16, !tbaa !5
  %34 = zext nneg i32 %33 to i64
  %xtraiter57 = and i64 %34, 3
  %35 = icmp ult i32 %33, 4
  br i1 %35, label %.preheader.unr-lcssa, label %.lr.ph31.preheader.new

.lr.ph31.preheader.new:                           ; preds = %.lr.ph31.preheader
  %unroll_iter59 = and i64 %34, 2147483644
  br label %.lr.ph31

.lr.ph28:                                         ; preds = %.lr.ph28, %.lr.ph28.preheader.new
  %indvars.iv40 = phi i64 [ 0, %.lr.ph28.preheader.new ], [ %indvars.iv.next41.1, %.lr.ph28 ]
  %niter = phi i64 [ 0, %.lr.ph28.preheader.new ], [ %niter.next.1, %.lr.ph28 ]
  %36 = getelementptr inbounds [100010 x i32], ptr @L, i64 0, i64 %indvars.iv40
  %37 = load i32, ptr %36, align 8, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %39, align 4, !tbaa !5
  %42 = getelementptr inbounds [100010 x i32], ptr @R, i64 0, i64 %indvars.iv40
  %43 = load i32, ptr %42, align 8, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %46, align 4, !tbaa !5
  %indvars.iv.next41 = or disjoint i64 %indvars.iv40, 1
  %49 = getelementptr inbounds [100010 x i32], ptr @L, i64 0, i64 %indvars.iv.next41
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %52, align 4, !tbaa !5
  %55 = getelementptr inbounds [100010 x i32], ptr @R, i64 0, i64 %indvars.iv.next41
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr %59, align 4, !tbaa !5
  %indvars.iv.next41.1 = add nuw nsw i64 %indvars.iv40, 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 %.preheader23.loopexit.unr-lcssa, label %.lr.ph28, !llvm.loop !11

.preheader.unr-lcssa:                             ; preds = %.lr.ph31, %.lr.ph31.preheader
  %.unr = phi i32 [ %.pre, %.lr.ph31.preheader ], [ %90, %.lr.ph31 ]
  %indvars.iv43.unr = phi i64 [ 1, %.lr.ph31.preheader ], [ %indvars.iv.next44.3, %.lr.ph31 ]
  %lcmp.mod58.not = icmp eq i64 %xtraiter57, 0
  br i1 %lcmp.mod58.not, label %.preheader, label %.lr.ph31.epil

.lr.ph31.epil:                                    ; preds = %.preheader.unr-lcssa, %.lr.ph31.epil
  %62 = phi i32 [ %65, %.lr.ph31.epil ], [ %.unr, %.preheader.unr-lcssa ]
  %indvars.iv43.epil = phi i64 [ %indvars.iv.next44.epil, %.lr.ph31.epil ], [ %indvars.iv43.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph31.epil ], [ 0, %.preheader.unr-lcssa ]
  %63 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %indvars.iv43.epil
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, %62
  store i32 %65, ptr %63, align 4, !tbaa !5
  %indvars.iv.next44.epil = add nuw nsw i64 %indvars.iv43.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter57
  br i1 %epil.iter.cmp.not, label %.preheader, label %.lr.ph31.epil, !llvm.loop !12

.preheader:                                       ; preds = %.lr.ph31.epil, %.preheader.unr-lcssa
  br i1 %.not29, label %._crit_edge37, label %.lr.ph36.preheader

.lr.ph36.preheader:                               ; preds = %.preheader
  %66 = add nuw i32 %33, 1
  %wide.trip.count51 = zext i32 %66 to i64
  %67 = zext nneg i32 %33 to i64
  %min.iters.check = icmp ult i32 %33, 8
  br i1 %min.iters.check, label %.lr.ph36.preheader55, label %vector.ph

.lr.ph36.preheader55:                             ; preds = %middle.block, %.lr.ph36.preheader
  %indvars.iv48.ph = phi i64 [ 1, %.lr.ph36.preheader ], [ %ind.end, %middle.block ]
  %.01834.ph = phi i32 [ 0, %.lr.ph36.preheader ], [ %77, %middle.block ]
  br label %.lr.ph36

vector.ph:                                        ; preds = %.lr.ph36.preheader
  %n.vec = and i64 %67, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %10, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 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.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %74, %vector.body ]
  %vec.phi53 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %75, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %68 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %offset.idx
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  %wide.load = load <4 x i32>, ptr %68, align 4, !tbaa !5
  %wide.load54 = load <4 x i32>, ptr %69, align 4, !tbaa !5
  %70 = icmp eq <4 x i32> %wide.load, %broadcast.splat
  %71 = icmp eq <4 x i32> %wide.load54, %broadcast.splat
  %72 = zext <4 x i1> %70 to <4 x i32>
  %73 = zext <4 x i1> %71 to <4 x i32>
  %74 = add <4 x i32> %vec.phi, %72
  %75 = add <4 x i32> %vec.phi53, %73
  %index.next = add nuw i64 %index, 8
  %76 = icmp eq i64 %index.next, %n.vec
  br i1 %76, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %75, %74
  %77 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %67
  br i1 %cmp.n, label %._crit_edge37, label %.lr.ph36.preheader55

.lr.ph31:                                         ; preds = %.lr.ph31, %.lr.ph31.preheader.new
  %78 = phi i32 [ %.pre, %.lr.ph31.preheader.new ], [ %90, %.lr.ph31 ]
  %indvars.iv43 = phi i64 [ 1, %.lr.ph31.preheader.new ], [ %indvars.iv.next44.3, %.lr.ph31 ]
  %niter60 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %niter60.next.3, %.lr.ph31 ]
  %79 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %indvars.iv43
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, %78
  store i32 %81, ptr %79, align 4, !tbaa !5
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %82 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %indvars.iv.next44
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %83, %81
  store i32 %84, ptr %82, align 4, !tbaa !5
  %indvars.iv.next44.1 = add nuw nsw i64 %indvars.iv43, 2
  %85 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %indvars.iv.next44.1
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, %84
  store i32 %87, ptr %85, align 4, !tbaa !5
  %indvars.iv.next44.2 = add nuw nsw i64 %indvars.iv43, 3
  %88 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %indvars.iv.next44.2
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = add nsw i32 %89, %87
  store i32 %90, ptr %88, align 4, !tbaa !5
  %indvars.iv.next44.3 = add nuw nsw i64 %indvars.iv43, 4
  %niter60.next.3 = add i64 %niter60, 4
  %niter60.ncmp.3 = icmp eq i64 %niter60.next.3, %unroll_iter59
  br i1 %niter60.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph31, !llvm.loop !17

._crit_edge37:                                    ; preds = %.lr.ph36, %middle.block, %.preheader23, %.preheader
  %.018.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.preheader23 ], [ %77, %middle.block ], [ %spec.select, %.lr.ph36 ]
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.018.lcssa)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph36:                                         ; preds = %.lr.ph36.preheader55, %.lr.ph36
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %.lr.ph36 ], [ %indvars.iv48.ph, %.lr.ph36.preheader55 ]
  %.01834 = phi i32 [ %spec.select, %.lr.ph36 ], [ %.01834.ph, %.lr.ph36.preheader55 ]
  %93 = getelementptr inbounds [100010 x i32], ptr @imos, i64 0, i64 %indvars.iv48
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp eq i32 %94, %10
  %96 = zext i1 %95 to i32
  %spec.select = add nuw nsw i32 %.01834, %96
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51
  br i1 %exitcond52.not, label %._crit_edge37, label %.lr.ph36, !llvm.loop !18
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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


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