; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/1014_KUPC_2013 (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" }

@M = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@memo = external dso_local global [110 x [110 x i32]], align 16
@a = external dso_local global [110 x [110 x i8]], align 16
@row = 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 uwtable
declare dso_local noundef i32 @_Z3eatii(i32 noundef, i32 noundef) #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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  %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) @M)
  %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) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %12

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

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

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

18:                                               ; preds = %34, %17
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = load i32, ptr @N, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %37

23:                                               ; preds = %18
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = icmp eq i32 %25, 1
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %28
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [110 x i8], ptr %29, i64 0, i64 %31
  %33 = zext i1 %26 to i8
  store i8 %33, ptr %32, align 1, !tbaa !9
  br label %34

34:                                               ; preds = %23
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %5, align 4, !tbaa !5
  br label %18, !llvm.loop !11

37:                                               ; preds = %22
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %3, align 4, !tbaa !5
  br label %12, !llvm.loop !13

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

42:                                               ; preds = %78, %41
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = load i32, ptr @M, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

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

47:                                               ; preds = %42
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %49
  %51 = getelementptr inbounds [110 x i8], ptr %50, i64 0, i64 0
  %52 = load i8, ptr %51, align 2, !tbaa !9, !range !14, !noundef !15
  %53 = trunc i8 %52 to i1
  %54 = xor i1 %53, true
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %56
  %58 = getelementptr inbounds [110 x i8], ptr %57, i64 0, i64 0
  %59 = zext i1 %54 to i8
  store i8 %59, ptr %58, align 2, !tbaa !9
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %61
  %63 = load i32, ptr @N, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [110 x i8], ptr %62, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !9, !range !14, !noundef !15
  %68 = trunc i8 %67 to i1
  %69 = xor i1 %68, true
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %71
  %73 = load i32, ptr @N, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [110 x i8], ptr %72, i64 0, i64 %75
  %77 = zext i1 %69 to i8
  store i8 %77, ptr %76, align 1, !tbaa !9
  br label %78

78:                                               ; preds = %47
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %6, align 4, !tbaa !5
  br label %42, !llvm.loop !16

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

82:                                               ; preds = %98, %81
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load i32, ptr @N, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %101

87:                                               ; preds = %82
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [110 x i8], ptr @a, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !9, !range !14, !noundef !15
  %92 = trunc i8 %91 to i1
  %93 = xor i1 %92, true
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [110 x i8], ptr @a, i64 0, i64 %95
  %97 = zext i1 %93 to i8
  store i8 %97, ptr %96, align 1, !tbaa !9
  br label %98

98:                                               ; preds = %87
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %7, align 4, !tbaa !5
  br label %82, !llvm.loop !17

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

102:                                              ; preds = %112, %101
  %103 = load i32, ptr @row, align 4, !tbaa !5
  %104 = load i32, ptr @M, align 4, !tbaa !5
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %106, label %115

106:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @memo, ptr noundef getelementptr inbounds (i32, ptr @memo, i64 12100), ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %107 = load i32, ptr @N, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = call noundef i32 @_Z3eatii(i32 noundef 0, i32 noundef %108)
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = add nsw i32 %110, %109
  store i32 %111, ptr %8, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %106
  %113 = load i32, ptr @row, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr @row, align 4, !tbaa !5
  br label %102, !llvm.loop !18

115:                                              ; preds = %102
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %116)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %119 = load i32, ptr %1, align 4
  ret i32 %119
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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 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 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 #3 = { "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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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

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

@M = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@memo = external dso_local global [110 x [110 x i32]], align 16
@a = external dso_local local_unnamed_addr global [110 x [110 x i8]], align 16
@row = external dso_local local_unnamed_addr 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 uwtable
declare dso_local noundef i32 @_Z3eatii(i32 noundef, i32 noundef) 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = 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) @M)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %5 = load i32, ptr @M, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  %.pre51.pre = load i32, ptr @N, align 4, !tbaa !5
  br i1 %6, label %.preheader25.lr.ph, label %.preheader23

.preheader25.lr.ph:                               ; preds = %0
  %7 = icmp sgt i32 %.pre51.pre, 0
  br i1 %7, label %.preheader25, label %.lr.ph29

.preheader25:                                     ; preds = %.preheader25.lr.ph, %._crit_edge
  %8 = phi i32 [ %16, %._crit_edge ], [ %5, %.preheader25.lr.ph ]
  %9 = phi i32 [ %17, %._crit_edge ], [ %.pre51.pre, %.preheader25.lr.ph ]
  %indvars.iv40 = phi i64 [ %indvars.iv.next41, %._crit_edge ], [ 0, %.preheader25.lr.ph ]
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.preheader24:                                     ; preds = %._crit_edge
  %11 = icmp sgt i32 %16, 0
  br i1 %11, label %.lr.ph29, label %.preheader23

.lr.ph29:                                         ; preds = %.preheader25.lr.ph, %.preheader24
  %12 = phi i32 [ %16, %.preheader24 ], [ %5, %.preheader25.lr.ph ]
  %.pre5155 = phi i32 [ %17, %.preheader24 ], [ %.pre51.pre, %.preheader25.lr.ph ]
  %13 = add nsw i32 %.pre5155, -1
  %14 = sext i32 %13 to i64
  %wide.trip.count = zext nneg i32 %12 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %15 = icmp eq i32 %12, 1
  br i1 %15, label %.preheader23.loopexit.unr-lcssa, label %.lr.ph29.new

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

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr @M, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader25
  %16 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %8, %.preheader25 ]
  %17 = phi i32 [ %25, %._crit_edge.loopexit ], [ %9, %.preheader25 ]
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %18 = sext i32 %16 to i64
  %19 = icmp slt i64 %indvars.iv.next41, %18
  br i1 %19, label %.preheader25, label %.preheader24, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader25, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader25 ]
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = icmp eq i32 %21, 1
  %23 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %indvars.iv40, i64 %indvars.iv
  %24 = zext i1 %22 to i8
  store i8 %24, ptr %23, align 1, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr @N, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next, %26
  br i1 %27, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !14

.preheader23.loopexit.unr-lcssa:                  ; preds = %44, %.lr.ph29
  %indvars.iv43.unr = phi i64 [ 0, %.lr.ph29 ], [ %indvars.iv.next44.1, %44 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader23, label %.preheader23.loopexit.epilog-lcssa

.preheader23.loopexit.epilog-lcssa:               ; preds = %.preheader23.loopexit.unr-lcssa
  %28 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %indvars.iv43.unr
  %29 = load i8, ptr %28, align 2, !tbaa !12, !range !15, !noundef !16
  %30 = xor i8 %29, 1
  store i8 %30, ptr %28, align 2, !tbaa !12
  %31 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %indvars.iv43.unr, i64 %14
  %32 = load i8, ptr %31, align 1, !tbaa !12, !range !15, !noundef !16
  %33 = xor i8 %32, 1
  store i8 %33, ptr %31, align 1, !tbaa !12
  br label %.preheader23

.preheader23:                                     ; preds = %.preheader23.loopexit.epilog-lcssa, %.preheader23.loopexit.unr-lcssa, %0, %.preheader24
  %34 = phi i1 [ false, %.preheader24 ], [ false, %0 ], [ true, %.preheader23.loopexit.unr-lcssa ], [ true, %.preheader23.loopexit.epilog-lcssa ]
  %.pre5154 = phi i32 [ %17, %.preheader24 ], [ %.pre51.pre, %0 ], [ %.pre5155, %.preheader23.loopexit.unr-lcssa ], [ %.pre5155, %.preheader23.loopexit.epilog-lcssa ]
  %35 = icmp sgt i32 %.pre5154, 0
  br i1 %35, label %iter.check, label %.preheader

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

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check64 = icmp ult i32 %.pre5154, 32
  br i1 %min.iters.check64, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count49, 2147483616
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %36 = getelementptr inbounds [110 x i8], ptr @a, i64 0, i64 %index
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %wide.load = load <16 x i8>, ptr %36, align 16, !tbaa !12
  %wide.load65 = load <16 x i8>, ptr %37, align 16, !tbaa !12
  %38 = xor <16 x i8> %wide.load, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
  %39 = xor <16 x i8> %wide.load65, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
  store <16 x i8> %38, ptr %36, align 16, !tbaa !12
  store <16 x i8> %39, ptr %37, align 16, !tbaa !12
  %index.next = add nuw i64 %index, 32
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !17

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

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

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

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.vec67 = and i64 %wide.trip.count49, 2147483640
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index68 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next70, %vec.epilog.vector.body ]
  %41 = getelementptr inbounds [110 x i8], ptr @a, i64 0, i64 %index68
  %wide.load69 = load <8 x i8>, ptr %41, align 8, !tbaa !12
  %42 = xor <8 x i8> %wide.load69, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
  store <8 x i8> %42, ptr %41, align 8, !tbaa !12
  %index.next70 = add nuw i64 %index68, 8
  %43 = icmp eq i64 %index.next70, %n.vec67
  br i1 %43, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !20

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n71 = icmp eq i64 %n.vec67, %wide.trip.count49
  br i1 %cmp.n71, label %.preheader, label %.lr.ph31.preheader

44:                                               ; preds = %44, %.lr.ph29.new
  %indvars.iv43 = phi i64 [ 0, %.lr.ph29.new ], [ %indvars.iv.next44.1, %44 ]
  %niter = phi i64 [ 0, %.lr.ph29.new ], [ %niter.next.1, %44 ]
  %45 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %indvars.iv43
  %46 = load i8, ptr %45, align 4, !tbaa !12, !range !15, !noundef !16
  %47 = xor i8 %46, 1
  store i8 %47, ptr %45, align 4, !tbaa !12
  %48 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %indvars.iv43, i64 %14
  %49 = load i8, ptr %48, align 1, !tbaa !12, !range !15, !noundef !16
  %50 = xor i8 %49, 1
  store i8 %50, ptr %48, align 1, !tbaa !12
  %indvars.iv.next44 = or disjoint i64 %indvars.iv43, 1
  %51 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %indvars.iv.next44
  %52 = load i8, ptr %51, align 2, !tbaa !12, !range !15, !noundef !16
  %53 = xor i8 %52, 1
  store i8 %53, ptr %51, align 2, !tbaa !12
  %54 = getelementptr inbounds [110 x [110 x i8]], ptr @a, i64 0, i64 %indvars.iv.next44, i64 %14
  %55 = load i8, ptr %54, align 1, !tbaa !12, !range !15, !noundef !16
  %56 = xor i8 %55, 1
  store i8 %56, ptr %54, align 1, !tbaa !12
  %indvars.iv.next44.1 = add nuw nsw i64 %indvars.iv43, 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 %44, !llvm.loop !21

.preheader:                                       ; preds = %.lr.ph31, %middle.block, %vec.epilog.middle.block, %.preheader23
  store i32 0, ptr @row, align 4, !tbaa !5
  br i1 %34, label %.lr.ph33, label %._crit_edge34

.lr.ph31:                                         ; preds = %.lr.ph31.preheader, %.lr.ph31
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %.lr.ph31 ], [ %indvars.iv46.ph, %.lr.ph31.preheader ]
  %57 = getelementptr inbounds [110 x i8], ptr @a, i64 0, i64 %indvars.iv46
  %58 = load i8, ptr %57, align 1, !tbaa !12, !range !15, !noundef !16
  %59 = xor i8 %58, 1
  store i8 %59, ptr %57, align 1, !tbaa !12
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count49
  br i1 %exitcond50.not, label %.preheader, label %.lr.ph31, !llvm.loop !22

.lr.ph33:                                         ; preds = %.preheader, %.lr.ph33
  %.032 = phi i32 [ %63, %.lr.ph33 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 -1, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @memo, ptr noundef nonnull getelementptr inbounds (i8, ptr @memo, i64 48400), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %60 = load i32, ptr @N, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  %62 = call noundef i32 @_Z3eatii(i32 noundef 0, i32 noundef %61)
  %63 = add nsw i32 %62, %.032
  %64 = load i32, ptr @row, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr @row, align 4, !tbaa !5
  %66 = load i32, ptr @M, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %.lr.ph33, label %._crit_edge34, !llvm.loop !23

._crit_edge34:                                    ; preds = %.lr.ph33, %.preheader
  %.0.lcssa = phi i32 [ 0, %.preheader ], [ %63, %.lr.ph33 ]
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.0.lcssa)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  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 #3

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

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

; 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 #0 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 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 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 #3 = { "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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10, !18, !19}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !19, !18}
!23 = distinct !{!23, !10}


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