; LLVM IR from lzyrapx/Competitive-Programming :: Retired_code/String (BZOJ 1009 （AC自动机+矩阵乘法优化dp）)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }
%struct.matrix = type { [26 x [26 x i32]] }

@mod = external dso_local global i32, align 4
@End = external dso_local global [1000100 x i32], align 16
@ch = external dso_local global [1000100 x [26 x i32]], align 16
@sz = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@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 uwtable
declare dso_local void @_Zml6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 4, ptr noundef byval(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix4initEv(ptr noundef nonnull align 4 dereferenceable(2704)) #1 align 2

; 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: mustprogress uwtable
declare dso_local void @_Z6qpower6matrixi(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 4, ptr noundef byval(%struct.matrix) align 8, i32 noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6insertNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7getfailv() #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.matrix, align 4
  %10 = alloca %struct.matrix, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.matrix, align 4
  %16 = alloca %struct.matrix, align 8
  %17 = alloca %struct.matrix, align 8
  %18 = alloca %struct.matrix, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %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) @n)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) @mod)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  invoke void @_Z6insertNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %6)
          to label %25 unwind label %34

25:                                               ; preds = %2
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @_Z7getfailv()
  call void @llvm.lifetime.start.p0(i64 2704, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 2704, ptr %10) #7
  call void @_ZN6matrix4initEv(ptr noundef nonnull align 4 dereferenceable(2704) %9)
  call void @_ZN6matrix4initEv(ptr noundef nonnull align 4 dereferenceable(2704) %10)
  %26 = getelementptr inbounds %struct.matrix, ptr %10, i32 0, i32 0
  %27 = getelementptr inbounds [26 x [26 x i32]], ptr %26, i64 0, i64 1
  %28 = getelementptr inbounds [26 x i32], ptr %27, i64 0, i64 1
  store i32 1, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %73, %25
  %30 = load i32, ptr %11, align 4, !tbaa !5
  %31 = load i32, ptr @sz, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %38, label %33

33:                                               ; preds = %29
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %76

34:                                               ; preds = %2
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %7, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  br label %104

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

39:                                               ; preds = %69, %38
  %40 = load i32, ptr %13, align 4, !tbaa !5
  %41 = icmp sle i32 %40, 9
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %72

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %44 = load i32, ptr %11, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %45
  %47 = load i32, ptr %13, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [26 x i32], ptr %46, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %50, ptr %14, align 4, !tbaa !5
  %51 = load i32, ptr %14, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %68

56:                                               ; preds = %43
  %57 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 0
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [26 x [26 x i32]], ptr %57, i64 0, i64 %60
  %62 = load i32, ptr %14, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [26 x i32], ptr %61, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %56, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %13, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %13, align 4, !tbaa !5
  br label %39, !llvm.loop !11

72:                                               ; preds = %42
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %11, align 4, !tbaa !5
  br label %29, !llvm.loop !13

76:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 2704, ptr %15) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %10, i64 2704, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %9, i64 2704, i1 false), !tbaa.struct !14
  %77 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6qpower6matrixi(ptr dead_on_unwind writable sret(%struct.matrix) align 4 %17, ptr noundef byval(%struct.matrix) align 8 %18, i32 noundef %77)
  call void @_Zml6matrixS_(ptr dead_on_unwind writable sret(%struct.matrix) align 4 %15, ptr noundef byval(%struct.matrix) align 8 %16, ptr noundef byval(%struct.matrix) align 8 %17)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %15, i64 2704, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 2704, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %96, %76
  %79 = load i32, ptr %20, align 4, !tbaa !5
  %80 = load i32, ptr @sz, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  %82 = icmp sle i32 %79, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %78
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %99

84:                                               ; preds = %78
  %85 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 0
  %86 = getelementptr inbounds [26 x [26 x i32]], ptr %85, i64 0, i64 1
  %87 = load i32, ptr %20, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [26 x i32], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %19, align 4, !tbaa !5
  %92 = add nsw i32 %91, %90
  store i32 %92, ptr %19, align 4, !tbaa !5
  %93 = load i32, ptr @mod, align 4, !tbaa !5
  %94 = load i32, ptr %19, align 4, !tbaa !5
  %95 = srem i32 %94, %93
  store i32 %95, ptr %19, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %84
  %97 = load i32, ptr %20, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %20, align 4, !tbaa !5
  br label %78, !llvm.loop !16

99:                                               ; preds = %83
  %100 = load i32, ptr %19, align 4, !tbaa !5
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %100)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %101, i8 noundef signext 10)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 2704, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 2704, ptr %9) #7
  %103 = load i32, ptr %3, align 4
  ret i32 %103

104:                                              ; preds = %34
  %105 = load ptr, ptr %7, align 8
  %106 = load i32, ptr %8, align 4
  %107 = insertvalue { ptr, i32 } poison, ptr %105, 0
  %108 = insertvalue { ptr, i32 } %107, i32 %106, 1
  resume { ptr, i32 } %108
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #5

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

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

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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { "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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{i64 0, i64 2704, !15}
!15 = !{!7, !7, i64 0}
!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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }
%struct.matrix = type { [26 x [26 x i32]] }

@mod = external dso_local global i32, align 4
@End = external dso_local local_unnamed_addr global [1000100 x i32], align 16
@ch = external dso_local local_unnamed_addr global [1000100 x [26 x i32]], align 16
@sz = external dso_local local_unnamed_addr global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@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 uwtable
declare dso_local void @_Zml6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 4, ptr noundef byval(%struct.matrix) align 8, ptr noundef byval(%struct.matrix) align 8) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix4initEv(ptr noundef nonnull align 4 dereferenceable(2704)) local_unnamed_addr #1 align 2

; 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: mustprogress uwtable
declare dso_local void @_Z6qpower6matrixi(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 4, ptr noundef byval(%struct.matrix) align 8, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6insertNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7getfailv() local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %struct.matrix, align 8
  %5 = alloca %struct.matrix, align 4
  %6 = alloca %struct.matrix, align 4
  %7 = alloca %struct.matrix, align 8
  %8 = alloca %struct.matrix, align 8
  %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) @n)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @mod)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  invoke void @_Z6insertNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %3)
          to label %13 unwind label %30

13:                                               ; preds = %2
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @_Z7getfailv()
  call void @llvm.lifetime.start.p0(i64 2704, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 2704, ptr nonnull %5) #7
  call void @_ZN6matrix4initEv(ptr noundef nonnull align 4 dereferenceable(2704) %4)
  call void @_ZN6matrix4initEv(ptr noundef nonnull align 4 dereferenceable(2704) %5)
  %14 = getelementptr inbounds i8, ptr %5, i64 108
  store i32 1, ptr %14, align 4, !tbaa !5
  %15 = load i32, ptr @sz, align 4, !tbaa !5
  %.not22 = icmp slt i32 %15, 0
  br i1 %.not22, label %._crit_edge, label %.preheader.preheader

.preheader.preheader:                             ; preds = %13
  %16 = add nuw i32 %15, 1
  %wide.trip.count = zext i32 %16 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %155
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %155 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 0
  %18 = load i32, ptr %17, align 8, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %32, label %38

._crit_edge:                                      ; preds = %155, %13
  call void @llvm.lifetime.start.p0(i64 2704, ptr nonnull %6) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2704) %7, ptr noundef nonnull align 4 dereferenceable(2704) %5, i64 2704, i1 false), !tbaa.struct !9
  %23 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6qpower6matrixi(ptr dead_on_unwind nonnull writable sret(%struct.matrix) align 4 %8, ptr noundef nonnull byval(%struct.matrix) align 8 %4, i32 noundef %23)
  call void @_Zml6matrixS_(ptr dead_on_unwind nonnull writable sret(%struct.matrix) align 4 %6, ptr noundef nonnull byval(%struct.matrix) align 8 %7, ptr noundef nonnull byval(%struct.matrix) align 8 %8)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2704) %4, ptr noundef nonnull align 4 dereferenceable(2704) %6, i64 2704, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 2704, ptr nonnull %6) #7
  %24 = load i32, ptr @sz, align 4, !tbaa !5
  %.not2024 = icmp slt i32 %24, 0
  br i1 %.not2024, label %._crit_edge28, label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge
  %25 = getelementptr inbounds i8, ptr %4, i64 104
  %26 = load i32, ptr @mod, align 4, !tbaa !5
  %27 = add nuw i32 %24, 1
  %28 = zext i32 %27 to i64
  %xtraiter = and i64 %28, 1
  %29 = icmp eq i32 %24, 0
  br i1 %29, label %._crit_edge28.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %28, 4294967294
  br label %162

30:                                               ; preds = %2
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  resume { ptr, i32 } %31

32:                                               ; preds = %.preheader
  %33 = add nsw i32 %18, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %35, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %32, %.preheader
  %39 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 1
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %51

45:                                               ; preds = %38
  %46 = add nsw i32 %40, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %48, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %45, %38
  %52 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 2
  %53 = load i32, ptr %52, align 8, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %64

58:                                               ; preds = %51
  %59 = add nsw i32 %53, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %61, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %58, %51
  %65 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 3
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %77

71:                                               ; preds = %64
  %72 = add nsw i32 %66, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %74, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %71, %64
  %78 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 4
  %79 = load i32, ptr %78, align 8, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %90

84:                                               ; preds = %77
  %85 = add nsw i32 %79, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %87, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %84, %77
  %91 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 5
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %103

97:                                               ; preds = %90
  %98 = add nsw i32 %92, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %100, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %97, %90
  %104 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 6
  %105 = load i32, ptr %104, align 8, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %116

110:                                              ; preds = %103
  %111 = add nsw i32 %105, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %113, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %110, %103
  %117 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 7
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %129

123:                                              ; preds = %116
  %124 = add nsw i32 %118, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %126, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %123, %116
  %130 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 8
  %131 = load i32, ptr %130, align 8, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %142

136:                                              ; preds = %129
  %137 = add nsw i32 %131, 1
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %139, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %136, %129
  %143 = getelementptr inbounds [1000100 x [26 x i32]], ptr @ch, i64 0, i64 %indvars.iv, i64 9
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1000100 x i32], ptr @End, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = icmp eq i32 %147, 0
  br i1 %148, label %149, label %155

149:                                              ; preds = %142
  %150 = add nsw i32 %144, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [26 x [26 x i32]], ptr %4, i64 0, i64 %indvars.iv.next, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %152, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %149, %142
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.preheader, !llvm.loop !11

._crit_edge28.loopexit.unr-lcssa:                 ; preds = %162, %.lr.ph
  %.lcssa.ph = phi i32 [ poison, %.lr.ph ], [ %170, %162 ]
  %indvars.iv31.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next32.1, %162 ]
  %.01725.unr = phi i32 [ 0, %.lr.ph ], [ %170, %162 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge28, label %._crit_edge28.loopexit.epilog-lcssa

._crit_edge28.loopexit.epilog-lcssa:              ; preds = %._crit_edge28.loopexit.unr-lcssa
  %156 = getelementptr inbounds [26 x i32], ptr %25, i64 0, i64 %indvars.iv31.unr
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = add nsw i32 %157, %.01725.unr
  %159 = srem i32 %158, %26
  br label %._crit_edge28

._crit_edge28:                                    ; preds = %._crit_edge28.loopexit.epilog-lcssa, %._crit_edge28.loopexit.unr-lcssa, %._crit_edge
  %.017.lcssa = phi i32 [ 0, %._crit_edge ], [ %.lcssa.ph, %._crit_edge28.loopexit.unr-lcssa ], [ %159, %._crit_edge28.loopexit.epilog-lcssa ]
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.017.lcssa)
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %160, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 2704, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 2704, ptr nonnull %4) #7
  ret i32 0

162:                                              ; preds = %162, %.lr.ph.new
  %indvars.iv31 = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next32.1, %162 ]
  %.01725 = phi i32 [ 0, %.lr.ph.new ], [ %170, %162 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %162 ]
  %163 = getelementptr inbounds [26 x i32], ptr %25, i64 0, i64 %indvars.iv31
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = add nsw i32 %164, %.01725
  %166 = srem i32 %165, %26
  %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
  %167 = getelementptr inbounds [26 x i32], ptr %25, i64 0, i64 %indvars.iv.next32
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = add nsw i32 %168, %166
  %170 = srem i32 %169, %26
  %indvars.iv.next32.1 = add nuw nsw i64 %indvars.iv31, 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_edge28.loopexit.unr-lcssa, label %162, !llvm.loop !13
}

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 #5

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

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

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


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