; LLVM IR from kazunetakahashi/atcoder :: 2019/0611_ABC129 (F)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%class.Matrix = type { i32, i32, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%class.mint = type { i64 }
%"class.std::allocator" = type { i8 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZN4mint3MODE = external dso_local global i64, align 8
@L = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@B = external dso_local global i64, align 8
@ub = external dso_local global [100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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)) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 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 @_Z6affinex(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, i64 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6MatrixI4mintEC2Eii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI4mintEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI4mintSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSESt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI4mintSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z1fx(i64 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %class.Matrix, align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::initializer_list", align 8
  %11 = alloca [3 x %class.mint], align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca %class.Matrix, align 8
  %18 = alloca %class.Matrix, align 8
  %19 = alloca %class.Matrix, align 8
  store i32 0, ptr %1, align 4
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @L)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) @A)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @B)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %24 = load i64, ptr @M, align 8, !tbaa !5
  store i64 %24, ptr @_ZN4mint3MODE, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %79, %0
  %26 = load i32, ptr %2, align 4, !tbaa !9
  %27 = icmp sle i32 %26, 18
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %82

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = sub nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !5
  store i64 %34, ptr %4, align 8, !tbaa !5
  %35 = load i64, ptr %4, align 8, !tbaa !5
  %36 = call noundef i32 @_Z1fx(i64 noundef %35)
  %37 = load i32, ptr %2, align 4, !tbaa !9
  %38 = icmp ne i32 %36, %37
  br i1 %38, label %39, label %48

39:                                               ; preds = %29
  %40 = load i32, ptr %2, align 4, !tbaa !9
  %41 = sub nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %46
  store i64 %44, ptr %47, align 8, !tbaa !5
  store i32 4, ptr %3, align 4
  br label %76

48:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %49 = load i64, ptr %4, align 8, !tbaa !5
  store i64 %49, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %50 = load i64, ptr @L, align 8, !tbaa !5
  store i64 %50, ptr %6, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %70, %48
  %52 = load i64, ptr %5, align 8, !tbaa !5
  %53 = load i64, ptr %6, align 8, !tbaa !5
  %54 = sub nsw i64 %52, %53
  %55 = call noundef i64 @_ZSt3absx(i64 noundef %54)
  %56 = icmp sgt i64 %55, 1
  br i1 %56, label %57, label %71

57:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %58 = load i64, ptr %5, align 8, !tbaa !5
  %59 = load i64, ptr %6, align 8, !tbaa !5
  %60 = add nsw i64 %58, %59
  %61 = sdiv i64 %60, 2
  store i64 %61, ptr %7, align 8, !tbaa !5
  %62 = load i64, ptr %7, align 8, !tbaa !5
  %63 = call noundef i32 @_Z1fx(i64 noundef %62)
  %64 = load i32, ptr %2, align 4, !tbaa !9
  %65 = icmp eq i32 %63, %64
  br i1 %65, label %66, label %68

66:                                               ; preds = %57
  %67 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %67, ptr %5, align 8, !tbaa !5
  br label %70

68:                                               ; preds = %57
  %69 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %69, ptr %6, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %68, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %51, !llvm.loop !11

71:                                               ; preds = %51
  %72 = load i64, ptr %6, align 8, !tbaa !5
  %73 = load i32, ptr %2, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %74
  store i64 %72, ptr %75, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  store i32 0, ptr %3, align 4
  br label %76

76:                                               ; preds = %71, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %77 = load i32, ptr %3, align 4
  switch i32 %77, label %145 [
    i32 0, label %78
    i32 4, label %79
  ]

78:                                               ; preds = %76
  br label %79

79:                                               ; preds = %78, %76
  %80 = load i32, ptr %2, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %2, align 4, !tbaa !9
  br label %25, !llvm.loop !13

82:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  call void @_ZN6MatrixI4mintEC2Eii(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef 3, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 0)
  %83 = getelementptr inbounds %class.mint, ptr %11, i64 1
  %84 = load i64, ptr @A, align 8, !tbaa !5
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %83, i64 noundef %84)
  %85 = getelementptr inbounds %class.mint, ptr %11, i64 2
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %85, i64 noundef 1)
  %86 = getelementptr inbounds %"class.std::initializer_list", ptr %10, i32 0, i32 0
  store ptr %11, ptr %86, align 8, !tbaa !14
  %87 = getelementptr inbounds %"class.std::initializer_list", ptr %10, i32 0, i32 1
  store i64 3, ptr %87, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @_ZNSaI4mintEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  %88 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  %90 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %91 = load i64, ptr %90, align 8
  invoke void @_ZNSt6vectorI4mintSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr %89, i64 %91, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %92 unwind label %99

92:                                               ; preds = %82
  %93 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSESt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %9)
          to label %94 unwind label %103

94:                                               ; preds = %92
  call void @_ZNSt6vectorI4mintSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @_ZNSt15__new_allocatorI4mintED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %130, %94
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = icmp sle i32 %96, 18
  br i1 %97, label %108, label %98

98:                                               ; preds = %95
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %133

99:                                               ; preds = %82
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %13, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %14, align 4
  br label %107

103:                                              ; preds = %92
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %13, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %14, align 4
  call void @_ZNSt6vectorI4mintSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  br label %107

107:                                              ; preds = %103, %99
  call void @_ZNSt15__new_allocatorI4mintED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  br label %140

108:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !5
  %113 = load i32, ptr %15, align 4, !tbaa !9
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !5
  %118 = sub nsw i64 %112, %117
  store i64 %118, ptr %16, align 8, !tbaa !5
  %119 = load i64, ptr %16, align 8, !tbaa !5
  %120 = icmp eq i64 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %108
  store i32 9, ptr %3, align 4
  br label %127

122:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %123 = load i32, ptr %15, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  call void @_Z6affinex(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %19, i64 noundef %124)
  %125 = load i64, ptr %16, align 8, !tbaa !5
  call void @_ZNK6MatrixI4mintE5powerEx(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %18, ptr noundef nonnull align 8 dereferenceable(16) %19, i64 noundef %125)
  call void @_ZNK6MatrixI4mintEmlERKS1_(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %17, ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %8)
  %126 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSES1_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %17)
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  store i32 0, ptr %3, align 4
  br label %127

127:                                              ; preds = %122, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %128 = load i32, ptr %3, align 4
  switch i32 %128, label %145 [
    i32 0, label %129
    i32 9, label %130
  ]

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129, %127
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %15, align 4, !tbaa !9
  br label %95, !llvm.loop !19

133:                                              ; preds = %98
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixI4mintEixEm(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef 0)
  %135 = load ptr, ptr %134, align 8, !tbaa !20
  %136 = getelementptr inbounds %class.mint, ptr %135, i64 0
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %136)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  %139 = load i32, ptr %1, align 4
  ret i32 %139

140:                                              ; preds = %107
  %141 = load ptr, ptr %13, align 8
  %142 = load i32, ptr %14, align 4
  %143 = insertvalue { ptr, i32 } poison, ptr %141, 0
  %144 = insertvalue { ptr, i32 } %143, i32 %142, 1
  resume { ptr, i32 } %144

145:                                              ; preds = %127, %76
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6MatrixI4mintE5powerEx(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6MatrixI4mintEmlERKS1_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixI4mintEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI4mintED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%class.Matrix = type { i32, i32, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl" = type { %"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<mint, std::allocator<mint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.mint = type { i64 }
%"class.std::allocator" = type { i8 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZN4mint3MODE = external dso_local local_unnamed_addr global i64, align 8
@L = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@B = external dso_local global i64, align 8
@ub = external dso_local local_unnamed_addr global [100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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)) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 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 @_Z6affinex(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6MatrixI4mintEC2Eii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI4mintEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI4mintSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSESt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI4mintSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z1fx(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.Matrix, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca [3 x %class.mint], align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %class.Matrix, align 8
  %6 = alloca %class.Matrix, align 8
  %7 = alloca %class.Matrix, align 8
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @L)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) @A)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @B)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %12 = load i64, ptr @M, align 8, !tbaa !5
  store i64 %12, ptr @_ZN4mint3MODE, align 8, !tbaa !5
  br label %17

13:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #6
  call void @_ZN6MatrixI4mintEC2Eii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 3, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef 0)
  %14 = getelementptr inbounds i8, ptr %3, i64 8
  %15 = load i64, ptr @A, align 8, !tbaa !5
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %14, i64 noundef %15)
  %16 = getelementptr inbounds i8, ptr %3, i64 16
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaI4mintEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorI4mintSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr nonnull %3, i64 3, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %39 unwind label %46

17:                                               ; preds = %0, %._crit_edge
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next, %._crit_edge ]
  %18 = add nsw i64 %indvars.iv, -1
  %19 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %18
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = tail call noundef i32 @_Z1fx(i64 noundef %20)
  %22 = zext i32 %21 to i64
  %.not = icmp eq i64 %indvars.iv, %22
  br i1 %.not, label %25, label %23

23:                                               ; preds = %17
  %24 = load i64, ptr %19, align 8, !tbaa !5
  br label %._crit_edge

25:                                               ; preds = %17
  %26 = load i64, ptr @L, align 8, !tbaa !5
  %27 = sub nsw i64 %20, %26
  %28 = tail call noundef i64 @_ZSt3absx(i64 noundef %27)
  %29 = icmp sgt i64 %28, 1
  br i1 %29, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %25, %.lr.ph
  %.02833 = phi i64 [ %..028, %.lr.ph ], [ %20, %25 ]
  %.02932 = phi i64 [ %.029., %.lr.ph ], [ %26, %25 ]
  %30 = add nsw i64 %.02833, %.02932
  %31 = sdiv i64 %30, 2
  %32 = tail call noundef i32 @_Z1fx(i64 noundef %31)
  %33 = zext i32 %32 to i64
  %34 = icmp eq i64 %indvars.iv, %33
  %.029. = select i1 %34, i64 %.02932, i64 %31
  %..028 = select i1 %34, i64 %31, i64 %.02833
  %35 = sub nsw i64 %..028, %.029.
  %36 = tail call noundef i64 @_ZSt3absx(i64 noundef %35)
  %37 = icmp sgt i64 %36, 1
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %25, %23
  %.029.lcssa.sink = phi i64 [ %24, %23 ], [ %26, %25 ], [ %.029., %.lr.ph ]
  %38 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %indvars.iv
  store i64 %.029.lcssa.sink, ptr %38, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 19
  br i1 %exitcond.not, label %13, label %17, !llvm.loop !11

39:                                               ; preds = %13
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSESt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %2)
  call void @_ZNSt6vectorI4mintSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @_ZNSt15__new_allocatorI4mintED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  br label %48

41:                                               ; preds = %58
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixI4mintEixEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef 0)
  %43 = load ptr, ptr %42, align 8, !tbaa !12
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %43)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  ret i32 0

46:                                               ; preds = %13
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI4mintED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  resume { ptr, i32 } %47

48:                                               ; preds = %39, %58
  %indvars.iv37 = phi i64 [ 1, %39 ], [ %indvars.iv.next38, %58 ]
  %49 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %indvars.iv37
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = add nsw i64 %indvars.iv37, -1
  %52 = getelementptr inbounds [100 x i64], ptr @ub, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = icmp eq i64 %50, %53
  br i1 %54, label %58, label %55

55:                                               ; preds = %48
  %56 = sub nsw i64 %50, %53
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @_Z6affinex(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %7, i64 noundef %indvars.iv37)
  call void @_ZNK6MatrixI4mintE5powerEx(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %56)
  call void @_ZNK6MatrixI4mintEmlERKS1_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSES1_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %58

58:                                               ; preds = %48, %55
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %exitcond40.not = icmp eq i64 %indvars.iv.next38, 19
  br i1 %exitcond40.not, label %41, label %48, !llvm.loop !14
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6MatrixI4mintE5powerEx(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6MatrixI4mintEmlERKS1_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixI4mintEaSES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixI4mintEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI4mintED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { inlinehint 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 #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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass