; LLVM IR from kazunetakahashi/atcoder :: 2019/0609_ABC129/past (F2)

; 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" }
%struct.matrix = type { i32, i32, %"class.std::valarray" }
%"class.std::valarray" = type { i64, ptr }
%"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::initializer_list" = type { ptr, i64 }

@MOD = external dso_local global i64, align 8
@L = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@B = external dso_local global i64, align 8
@upper = external dso_local global [100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6matrixC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12mod_multiply6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6choosexx(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, i64 noundef, i64 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIxEaSESt16initializer_listIxE(ptr noundef nonnull align 8 dereferenceable(16), ptr, i64) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z1fx(i64 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 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 %"class.std::__cxx11::basic_string", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %struct.matrix, align 8
  %10 = alloca %"class.std::initializer_list", align 8
  %11 = alloca [3 x i64], align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca %struct.matrix, align 8
  %17 = alloca %struct.matrix, align 8
  %18 = alloca %struct.matrix, align 8
  store i32 0, ptr %1, align 4
  %19 = 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)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) @A)
  %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) @B)
  %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) @MOD)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %76, %0
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = icmp sle i32 %24, 18
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %79

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sub nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !9
  store i64 %32, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %33 = load i64, ptr @L, align 8, !tbaa !9
  store i64 %33, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #7
  %34 = load i64, ptr %4, align 8, !tbaa !9
  %35 = call noundef i64 @_Z1fx(i64 noundef %34)
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %6, i64 noundef %35)
  %36 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  %37 = trunc i64 %36 to i32
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = icmp ne i32 %37, %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  br i1 %39, label %40, label %45

40:                                               ; preds = %27
  %41 = load i64, ptr %4, align 8, !tbaa !9
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %43
  store i64 %41, ptr %44, align 8, !tbaa !9
  store i32 4, ptr %3, align 4
  br label %73

45:                                               ; preds = %27
  br label %46

46:                                               ; preds = %67, %45
  %47 = load i64, ptr %4, align 8, !tbaa !9
  %48 = load i64, ptr %5, align 8, !tbaa !9
  %49 = sub nsw i64 %47, %48
  %50 = call noundef i64 @_ZSt3absx(i64 noundef %49)
  %51 = icmp sgt i64 %50, 1
  br i1 %51, label %52, label %68

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %53 = load i64, ptr %4, align 8, !tbaa !9
  %54 = load i64, ptr %5, align 8, !tbaa !9
  %55 = add nsw i64 %53, %54
  %56 = sdiv i64 %55, 2
  store i64 %56, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  %57 = load i64, ptr %7, align 8, !tbaa !9
  %58 = call noundef i64 @_Z1fx(i64 noundef %57)
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, i64 noundef %58)
  %59 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  %60 = trunc i64 %59 to i32
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = icmp eq i32 %60, %61
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br i1 %62, label %63, label %65

63:                                               ; preds = %52
  %64 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %64, ptr %4, align 8, !tbaa !9
  br label %67

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

67:                                               ; preds = %65, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %46, !llvm.loop !11

68:                                               ; preds = %46
  %69 = load i64, ptr %5, align 8, !tbaa !9
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %71
  store i64 %69, ptr %72, align 8, !tbaa !9
  store i32 0, ptr %3, align 4
  br label %73

73:                                               ; preds = %68, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  %74 = load i32, ptr %3, align 4
  switch i32 %74, label %247 [
    i32 0, label %75
    i32 4, label %76
  ]

75:                                               ; preds = %73
  br label %76

76:                                               ; preds = %75, %73
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !13

79:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  call void @_ZN6matrixC2Eii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 3, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !9
  %80 = getelementptr inbounds i64, ptr %11, i64 1
  %81 = load i64, ptr @A, align 8, !tbaa !9
  store i64 %81, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds i64, ptr %11, i64 2
  store i64 1, ptr %82, align 8, !tbaa !9
  %83 = getelementptr inbounds %"class.std::initializer_list", ptr %10, i32 0, i32 0
  store ptr %11, ptr %83, align 8, !tbaa !14
  %84 = getelementptr inbounds %"class.std::initializer_list", ptr %10, i32 0, i32 1
  store i64 3, ptr %84, align 8, !tbaa !18
  %85 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 2
  %86 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8
  %88 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %89 = load i64, ptr %88, align 8
  %90 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIxEaSESt16initializer_listIxE(ptr noundef nonnull align 8 dereferenceable(16) %85, ptr %87, i64 %89)
          to label %91 unwind label %96

91:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %206, %91
  %93 = load i32, ptr %14, align 4, !tbaa !5
  %94 = icmp sle i32 %93, 18
  br i1 %94, label %100, label %95

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

96:                                               ; preds = %79
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %12, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  br label %241

100:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !9
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !9
  %110 = sub nsw i64 %104, %109
  store i64 %110, ptr %15, align 8, !tbaa !9
  %111 = load i64, ptr %15, align 8, !tbaa !9
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %100
  store i32 9, ptr %3, align 4
  br label %203

114:                                              ; preds = %100
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.5)
          to label %116 unwind label %209

116:                                              ; preds = %114
  %117 = load i32, ptr %14, align 4, !tbaa !5
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 noundef %117)
          to label %119 unwind label %209

119:                                              ; preds = %116
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef @.str.6)
          to label %121 unwind label %209

121:                                              ; preds = %119
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %120, i32 noundef %122)
          to label %124 unwind label %209

124:                                              ; preds = %121
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef @.str.7)
          to label %126 unwind label %209

126:                                              ; preds = %124
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %125, i64 noundef %130)
          to label %132 unwind label %209

132:                                              ; preds = %126
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %134 unwind label %209

134:                                              ; preds = %132
  %135 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.8)
          to label %136 unwind label %209

136:                                              ; preds = %134
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !9
  %141 = sub nsw i64 %140, 1
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %135, i64 noundef %141)
          to label %143 unwind label %209

143:                                              ; preds = %136
  %144 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef @.str.9)
          to label %145 unwind label %209

145:                                              ; preds = %143
  %146 = load i32, ptr %14, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = sub nsw i64 %149, 1
  %151 = call noundef i64 @_Z1fx(i64 noundef %150)
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %144, i64 noundef %151)
          to label %153 unwind label %209

153:                                              ; preds = %145
  %154 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %155 unwind label %209

155:                                              ; preds = %153
  %156 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.8)
          to label %157 unwind label %209

157:                                              ; preds = %155
  %158 = load i32, ptr %14, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !9
  %162 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %156, i64 noundef %161)
          to label %163 unwind label %209

163:                                              ; preds = %157
  %164 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %162, ptr noundef @.str.9)
          to label %165 unwind label %209

165:                                              ; preds = %163
  %166 = load i32, ptr %14, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !9
  %170 = call noundef i64 @_Z1fx(i64 noundef %169)
  %171 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %164, i64 noundef %170)
          to label %172 unwind label %209

172:                                              ; preds = %165
  %173 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %171, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %174 unwind label %209

174:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  %175 = load i32, ptr %14, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = load i64, ptr %15, align 8, !tbaa !9
  invoke void @_Z6choosexx(ptr dead_on_unwind writable sret(%struct.matrix) align 8 %17, i64 noundef %176, i64 noundef %177)
          to label %178 unwind label %213

178:                                              ; preds = %174
  invoke void @_ZN6matrixC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %179 unwind label %217

179:                                              ; preds = %178
  invoke void @_Z12mod_multiply6matrixS_(ptr dead_on_unwind writable sret(%struct.matrix) align 8 %16, ptr noundef %17, ptr noundef %18)
          to label %180 unwind label %221

180:                                              ; preds = %179
  %181 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6matrixaSEOS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  %182 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 2
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %182, i64 noundef 0) #7
  %184 = load i64, ptr %183, align 8, !tbaa !9
  %185 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i64 noundef %184)
          to label %186 unwind label %209

186:                                              ; preds = %180
  %187 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef @.str.10)
          to label %188 unwind label %209

188:                                              ; preds = %186
  %189 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 2
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %189, i64 noundef 1) #7
  %191 = load i64, ptr %190, align 8, !tbaa !9
  %192 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %187, i64 noundef %191)
          to label %193 unwind label %209

193:                                              ; preds = %188
  %194 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %192, ptr noundef @.str.10)
          to label %195 unwind label %209

195:                                              ; preds = %193
  %196 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 2
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %196, i64 noundef 2) #7
  %198 = load i64, ptr %197, align 8, !tbaa !9
  %199 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %194, i64 noundef %198)
          to label %200 unwind label %209

200:                                              ; preds = %195
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %199, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %202 unwind label %209

202:                                              ; preds = %200
  store i32 0, ptr %3, align 4
  br label %203

203:                                              ; preds = %202, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  %204 = load i32, ptr %3, align 4
  switch i32 %204, label %247 [
    i32 0, label %205
    i32 9, label %206
  ]

205:                                              ; preds = %203
  br label %206

206:                                              ; preds = %205, %203
  %207 = load i32, ptr %14, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %14, align 4, !tbaa !5
  br label %92, !llvm.loop !19

209:                                              ; preds = %200, %195, %193, %188, %186, %180, %172, %165, %163, %157, %155, %153, %145, %143, %136, %134, %132, %126, %124, %121, %119, %116, %114
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %12, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %13, align 4
  br label %227

213:                                              ; preds = %174
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %12, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %13, align 4
  br label %226

217:                                              ; preds = %178
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %12, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %13, align 4
  br label %225

221:                                              ; preds = %179
  %222 = landingpad { ptr, i32 }
          cleanup
  %223 = extractvalue { ptr, i32 } %222, 0
  store ptr %223, ptr %12, align 8
  %224 = extractvalue { ptr, i32 } %222, 1
  store i32 %224, ptr %13, align 4
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  br label %225

225:                                              ; preds = %221, %217
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  br label %226

226:                                              ; preds = %225, %213
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  br label %227

227:                                              ; preds = %226, %209
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %241

228:                                              ; preds = %95
  %229 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 2
  %230 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %229, i64 noundef 0) #7
  %231 = load i64, ptr %230, align 8, !tbaa !9
  %232 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %231)
          to label %233 unwind label %237

233:                                              ; preds = %228
  %234 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %232, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %235 unwind label %237

235:                                              ; preds = %233
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  %236 = load i32, ptr %1, align 4
  ret i32 %236

237:                                              ; preds = %233, %228
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %12, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %13, align 4
  br label %241

241:                                              ; preds = %237, %227, %96
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  br label %242

242:                                              ; preds = %241
  %243 = load ptr, ptr %12, align 8
  %244 = load i32, ptr %13, align 4
  %245 = insertvalue { ptr, i32 } poison, ptr %243, 0
  %246 = insertvalue { ptr, i32 } %245, i32 %244, 1
  resume { ptr, i32 } %246

247:                                              ; preds = %203, %73
  unreachable
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

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

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

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

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


; 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" }
%struct.matrix = type { i32, i32, %"class.std::valarray" }
%"class.std::valarray" = type { i64, ptr }
%"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] }

@MOD = external dso_local global i64, align 8
@L = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@B = external dso_local global i64, align 8
@upper = external dso_local local_unnamed_addr global [100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6matrixC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12mod_multiply6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6choosexx(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8, i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIxEaSESt16initializer_listIxE(ptr noundef nonnull align 8 dereferenceable(16), ptr, i64) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %struct.matrix, align 8
  %4 = alloca [3 x i64], align 8
  %5 = alloca %struct.matrix, align 8
  %6 = alloca %struct.matrix, align 8
  %7 = alloca %struct.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) @MOD)
  br label %18

12:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZN6matrixC2Eii(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef 3, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  store i64 0, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %4, i64 8
  %14 = load i64, ptr @A, align 8, !tbaa !5
  store i64 %14, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %4, i64 16
  store i64 1, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  %17 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIxEaSESt16initializer_listIxE(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr nonnull %4, i64 3)
          to label %39 unwind label %44

18:                                               ; preds = %0, %._crit_edge
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next, %._crit_edge ]
  %19 = add nsw i64 %indvars.iv, -1
  %20 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %19
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = load i64, ptr @L, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  %23 = call noundef i64 @_Z1fx(i64 noundef %21)
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %1, i64 noundef %23)
  %24 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %25 = and i64 %24, 4294967295
  %.not = icmp eq i64 %indvars.iv, %25
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  br i1 %.not, label %.preheader, label %._crit_edge

.preheader:                                       ; preds = %18
  %26 = sub nsw i64 %21, %22
  %27 = call noundef i64 @_ZSt3absx(i64 noundef %26)
  %28 = icmp sgt i64 %27, 1
  br i1 %28, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.03950 = phi i64 [ %..039, %.lr.ph ], [ %21, %.preheader ]
  %.04149 = phi i64 [ %.041., %.lr.ph ], [ %22, %.preheader ]
  %29 = add nsw i64 %.03950, %.04149
  %30 = sdiv i64 %29, 2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  %31 = call noundef i64 @_Z1fx(i64 noundef %30)
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %2, i64 noundef %31)
  %32 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  %33 = and i64 %32, 4294967295
  %34 = icmp eq i64 %indvars.iv, %33
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  %.041. = select i1 %34, i64 %.04149, i64 %30
  %..039 = select i1 %34, i64 %30, i64 %.03950
  %35 = sub nsw i64 %..039, %.041.
  %36 = 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, %.preheader, %18
  %.041.lcssa.sink = phi i64 [ %21, %18 ], [ %22, %.preheader ], [ %.041., %.lr.ph ]
  %38 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %indvars.iv
  store i64 %.041.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 %12, label %18, !llvm.loop !11

39:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %46

40:                                               ; preds = %120
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0) #7
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %42)
          to label %131 unwind label %134

44:                                               ; preds = %12
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %136

46:                                               ; preds = %39, %120
  %indvars.iv54 = phi i64 [ 1, %39 ], [ %indvars.iv.next55, %120 ]
  %47 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %indvars.iv54
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = add nsw i64 %indvars.iv54, -1
  %50 = getelementptr inbounds [100 x i64], ptr @upper, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = sub nsw i64 %48, %51
  %53 = icmp eq i64 %48, %51
  br i1 %53, label %120, label %54

54:                                               ; preds = %46
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.5)
          to label %56 unwind label %121

56:                                               ; preds = %54
  %57 = trunc nuw nsw i64 %indvars.iv54 to i32
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %55, i32 noundef %57)
          to label %59 unwind label %121

59:                                               ; preds = %56
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str.6)
          to label %61 unwind label %121

61:                                               ; preds = %59
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %60, i32 noundef %57)
          to label %63 unwind label %121

63:                                               ; preds = %61
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @.str.7)
          to label %65 unwind label %121

65:                                               ; preds = %63
  %66 = load i64, ptr %47, align 8, !tbaa !5
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %64, i64 noundef %66)
          to label %68 unwind label %121

68:                                               ; preds = %65
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %70 unwind label %121

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.8)
          to label %72 unwind label %121

72:                                               ; preds = %70
  %73 = load i64, ptr %47, align 8, !tbaa !5
  %74 = add nsw i64 %73, -1
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %71, i64 noundef %74)
          to label %76 unwind label %121

76:                                               ; preds = %72
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @.str.9)
          to label %78 unwind label %121

78:                                               ; preds = %76
  %79 = load i64, ptr %47, align 8, !tbaa !5
  %80 = add nsw i64 %79, -1
  %81 = call noundef i64 @_Z1fx(i64 noundef %80)
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %77, i64 noundef %81)
          to label %83 unwind label %121

83:                                               ; preds = %78
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %85 unwind label %121

85:                                               ; preds = %83
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.8)
          to label %87 unwind label %121

87:                                               ; preds = %85
  %88 = load i64, ptr %47, align 8, !tbaa !5
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %86, i64 noundef %88)
          to label %90 unwind label %121

90:                                               ; preds = %87
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @.str.9)
          to label %92 unwind label %121

92:                                               ; preds = %90
  %93 = load i64, ptr %47, align 8, !tbaa !5
  %94 = call noundef i64 @_Z1fx(i64 noundef %93)
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %91, i64 noundef %94)
          to label %96 unwind label %121

96:                                               ; preds = %92
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %98 unwind label %121

98:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  invoke void @_Z6choosexx(ptr dead_on_unwind nonnull writable sret(%struct.matrix) align 8 %6, i64 noundef %indvars.iv54, i64 noundef %52)
          to label %99 unwind label %123

99:                                               ; preds = %98
  invoke void @_ZN6matrixC2ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %100 unwind label %125

100:                                              ; preds = %99
  invoke void @_Z12mod_multiply6matrixS_(ptr dead_on_unwind nonnull writable sret(%struct.matrix) align 8 %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
          to label %101 unwind label %127

101:                                              ; preds = %100
  %102 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6matrixaSEOS_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0) #7
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i64 noundef %104)
          to label %106 unwind label %121

106:                                              ; preds = %101
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef nonnull @.str.10)
          to label %108 unwind label %121

108:                                              ; preds = %106
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 1) #7
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %107, i64 noundef %110)
          to label %112 unwind label %121

112:                                              ; preds = %108
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull @.str.10)
          to label %114 unwind label %121

114:                                              ; preds = %112
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 2) #7
  %116 = load i64, ptr %115, align 8, !tbaa !5
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %113, i64 noundef %116)
          to label %118 unwind label %121

118:                                              ; preds = %114
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %120 unwind label %121

120:                                              ; preds = %118, %46
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond57.not = icmp eq i64 %indvars.iv.next55, 19
  br i1 %exitcond57.not, label %40, label %46, !llvm.loop !12

121:                                              ; preds = %118, %114, %112, %108, %106, %101, %96, %92, %90, %87, %85, %83, %78, %76, %72, %70, %68, %65, %63, %61, %59, %56, %54
  %122 = landingpad { ptr, i32 }
          cleanup
  br label %136

123:                                              ; preds = %98
  %124 = landingpad { ptr, i32 }
          cleanup
  br label %130

125:                                              ; preds = %99
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %129

127:                                              ; preds = %100
  %128 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %129

129:                                              ; preds = %127, %125
  %.pn = phi { ptr, i32 } [ %128, %127 ], [ %126, %125 ]
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  br label %130

130:                                              ; preds = %129, %123
  %.pn.pn = phi { ptr, i32 } [ %.pn, %129 ], [ %124, %123 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %136

131:                                              ; preds = %40
  %132 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %133 unwind label %134

133:                                              ; preds = %131
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret i32 0

134:                                              ; preds = %131, %40
  %135 = landingpad { ptr, i32 }
          cleanup
  br label %136

136:                                              ; preds = %121, %130, %134, %44
  %.pn46.pn = phi { ptr, i32 } [ %135, %134 ], [ %45, %44 ], [ %122, %121 ], [ %.pn.pn, %130 ]
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn46.pn
}

; 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 #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

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

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

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

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

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

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

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


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