; LLVM IR from arasgungore/EE242-projects :: ComputingEigenvaluesAndEigenvectors/main.ll (ZNK6Matrix16normPowIterationEd)

; 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.Matrix = type { i32, i32, ptr }
%"struct.std::pair" = type { double, %class.Matrix }
%"class.std::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<>::param_type" }
%"struct.std::uniform_real_distribution<>::param_type" = type { double, double }
%"class.std::linear_congruential_engine" = type { i64 }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6MatrixmlERKS_(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)) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK6Matrix15getInfinityNormEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6Matrix16normPowIterationEd(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca %class.Matrix, align 8
  %8 = alloca %"class.std::uniform_real_distribution", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::linear_congruential_engine", align 8
  %12 = alloca i32, align 4
  %13 = alloca %class.Matrix, align 8
  %14 = alloca double, align 8
  %15 = alloca %class.Matrix, align 8
  %16 = alloca %class.Matrix, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %class.Matrix, align 8
  %21 = alloca %class.Matrix, align 8
  %22 = alloca %class.Matrix, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  %23 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  %24 = getelementptr inbounds %class.Matrix, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !11
  call void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %25, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  invoke void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %8, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %26 unwind label %34

26:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  invoke void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %27 unwind label %38

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

28:                                               ; preds = %52, %27
  %29 = load i32, ptr %12, align 4, !tbaa !14
  %30 = getelementptr inbounds %class.Matrix, ptr %23, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %42, label %33

33:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %59

34:                                               ; preds = %3
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %9, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %10, align 4
  br label %166

38:                                               ; preds = %26
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %9, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %10, align 4
  br label %165

42:                                               ; preds = %28
  %43 = invoke noundef double @_ZNSt25uniform_real_distributionIdEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEdRT_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %44 unwind label %55

44:                                               ; preds = %42
  %45 = getelementptr inbounds %class.Matrix, ptr %7, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %47 = load i32, ptr %12, align 4, !tbaa !14
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds ptr, ptr %46, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds double, ptr %50, i64 0
  store double %43, ptr %51, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %44
  %53 = load i32, ptr %12, align 4, !tbaa !14
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %12, align 4, !tbaa !14
  br label %28, !llvm.loop !16

55:                                               ; preds = %42
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %165

59:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  invoke void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %60 unwind label %73

60:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %61 = invoke noundef double @_ZNK6Matrix15getInfinityNormEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %62 unwind label %77

62:                                               ; preds = %60
  store double %61, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  %63 = load double, ptr %14, align 8, !tbaa !9
  invoke void @_ZNK6MatrixdvEd(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %15, ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef %63)
          to label %64 unwind label %81

64:                                               ; preds = %62
  %65 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %66 unwind label %85

66:                                               ; preds = %64
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #4
  invoke void @_ZN6MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %67 unwind label %90

67:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %68 = load double, ptr %14, align 8, !tbaa !9
  store double %68, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 1, ptr %18, align 4, !tbaa !14
  br label %69

69:                                               ; preds = %137, %67
  %70 = load i32, ptr %18, align 4, !tbaa !14
  %71 = icmp slt i32 %70, 10000
  br i1 %71, label %94, label %72

72:                                               ; preds = %69
  store i32 5, ptr %19, align 4
  br label %140

73:                                               ; preds = %59
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %9, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %10, align 4
  br label %164

77:                                               ; preds = %60
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %9, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %10, align 4
  br label %163

81:                                               ; preds = %62
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %9, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %10, align 4
  br label %89

85:                                               ; preds = %64
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %9, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %10, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  br label %89

89:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  br label %163

90:                                               ; preds = %66
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %9, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %10, align 4
  br label %162

94:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #4
  invoke void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %20, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %95 unwind label %111

95:                                               ; preds = %94
  %96 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %97 unwind label %115

97:                                               ; preds = %95
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #4
  %98 = invoke noundef double @_ZNK6Matrix15getInfinityNormEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %99 unwind label %120

99:                                               ; preds = %97
  store double %98, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #4
  %100 = load double, ptr %14, align 8, !tbaa !9
  invoke void @_ZNK6MatrixdvEd(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef %100)
          to label %101 unwind label %124

101:                                              ; preds = %99
  %102 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %103 unwind label %128

103:                                              ; preds = %101
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #4
  %104 = load double, ptr %14, align 8, !tbaa !9
  %105 = load double, ptr %17, align 8, !tbaa !9
  %106 = fsub double %104, %105
  %107 = call double @llvm.fabs.f64(double %106)
  %108 = load double, ptr %6, align 8, !tbaa !9
  %109 = fcmp olt double %107, %108
  br i1 %109, label %110, label %133

110:                                              ; preds = %103
  store i32 5, ptr %19, align 4
  br label %140

111:                                              ; preds = %94
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %9, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %10, align 4
  br label %119

115:                                              ; preds = %95
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %9, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %10, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #4
  br label %119

119:                                              ; preds = %115, %111
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #4
  br label %141

120:                                              ; preds = %133, %97
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %9, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %10, align 4
  br label %141

124:                                              ; preds = %99
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %9, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %10, align 4
  br label %132

128:                                              ; preds = %101
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %9, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %10, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #4
  br label %132

132:                                              ; preds = %128, %124
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #4
  br label %141

133:                                              ; preds = %103
  %134 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %135 unwind label %120

135:                                              ; preds = %133
  %136 = load double, ptr %14, align 8, !tbaa !9
  store double %136, ptr %17, align 8, !tbaa !9
  br label %137

137:                                              ; preds = %135
  %138 = load i32, ptr %18, align 4, !tbaa !14
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %18, align 4, !tbaa !14
  br label %69, !llvm.loop !18

140:                                              ; preds = %110, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %142

141:                                              ; preds = %132, %120, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %161

142:                                              ; preds = %140
  %143 = call noundef double @_ZNK6Matrix13getDotProductERKS_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %144 = fcmp olt double %143, 0.000000e+00
  br i1 %144, label %145, label %148

145:                                              ; preds = %142
  %146 = load double, ptr %14, align 8, !tbaa !9
  %147 = fmul double %146, -1.000000e+00
  store double %147, ptr %14, align 8, !tbaa !9
  br label %148

148:                                              ; preds = %145, %142
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #4
  %149 = load double, ptr %14, align 8, !tbaa !9
  invoke void @_ZNK6MatrixdvEd(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %22, ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef %149)
          to label %150 unwind label %152

150:                                              ; preds = %148
  invoke void @_ZSt9make_pairIRdR6MatrixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %151 unwind label %156

151:                                              ; preds = %150
  store i32 1, ptr %19, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  ret void

152:                                              ; preds = %148
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %9, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %10, align 4
  br label %160

156:                                              ; preds = %150
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %9, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %10, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #4
  br label %160

160:                                              ; preds = %156, %152
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  br label %161

161:                                              ; preds = %160, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #4
  br label %162

162:                                              ; preds = %161, %90
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #4
  br label %163

163:                                              ; preds = %162, %89, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  br label %164

164:                                              ; preds = %163, %73
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  br label %165

165:                                              ; preds = %164, %55, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %166

166:                                              ; preds = %165, %34
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %9, align 8
  %169 = load i32, ptr %10, align 4
  %170 = insertvalue { ptr, i32 } poison, ptr %168, 0
  %171 = insertvalue { ptr, i32 } %170, i32 %169, 1
  resume { ptr, i32 } %171
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRdR6MatrixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare void @_ZN6MatrixC1Eii(ptr, i32, i32)

declare void @_ZN6MatrixC1ERKS_(ptr, ptr)

declare void @_ZN6MatrixD1Ev(ptr)

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


; 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.Matrix = type { i32, i32, ptr }
%"struct.std::pair" = type { double, %class.Matrix }
%"class.std::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<>::param_type" }
%"struct.std::uniform_real_distribution<>::param_type" = type { double, double }
%"class.std::linear_congruential_engine" = type { i64 }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6MatrixmlERKS_(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 #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK6Matrix15getInfinityNormEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6Matrix16normPowIterationEd(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.Matrix, align 8
  %5 = alloca %"class.std::uniform_real_distribution", align 8
  %6 = alloca %"class.std::linear_congruential_engine", align 8
  %7 = alloca %class.Matrix, align 8
  %8 = alloca double, align 8
  %9 = alloca %class.Matrix, align 8
  %10 = alloca %class.Matrix, align 8
  %11 = alloca %class.Matrix, align 8
  %12 = alloca %class.Matrix, align 8
  %13 = alloca %class.Matrix, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %14 = load i32, ptr %1, align 8, !tbaa !5
  call void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %14, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  invoke void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %15 unwind label %19

15:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  invoke void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %.preheader39 unwind label %21

.preheader39:                                     ; preds = %15
  %16 = load i32, ptr %1, align 8, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader39
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  br label %23

._crit_edge:                                      ; preds = %25, %.preheader39
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  invoke void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %34 unwind label %40

19:                                               ; preds = %3
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %97

21:                                               ; preds = %15
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %96

23:                                               ; preds = %.lr.ph, %25
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %25 ]
  %24 = invoke noundef double @_ZNSt25uniform_real_distributionIdEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEdRT_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %25 unwind label %32

25:                                               ; preds = %23
  %26 = load ptr, ptr %18, align 8, !tbaa !11
  %27 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  store double %24, ptr %28, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %1, align 8, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %23, label %._crit_edge, !llvm.loop !15

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %96

34:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %35 = invoke noundef double @_ZNK6Matrix15getInfinityNormEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %36 unwind label %42

36:                                               ; preds = %34
  store double %35, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  invoke void @_ZNK6MatrixdvEd(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %35)
          to label %37 unwind label %44

37:                                               ; preds = %36
  %38 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %39 unwind label %46

39:                                               ; preds = %37
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  invoke void @_ZN6MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %.preheader unwind label %49

40:                                               ; preds = %._crit_edge
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %95

42:                                               ; preds = %34
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %94

44:                                               ; preds = %36
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %48

46:                                               ; preds = %37
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  br label %48

48:                                               ; preds = %46, %44
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  br label %94

49:                                               ; preds = %39
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %93

.preheader:                                       ; preds = %39, %76
  %.0943 = phi double [ %54, %76 ], [ %35, %39 ]
  %.042 = phi i32 [ %77, %76 ], [ 1, %39 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  invoke void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %51 unwind label %62

51:                                               ; preds = %.preheader
  %52 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %53 unwind label %64

53:                                               ; preds = %51
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  %54 = invoke noundef double @_ZNK6Matrix15getInfinityNormEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %55 unwind label %67

55:                                               ; preds = %53
  store double %54, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #4
  invoke void @_ZNK6MatrixdvEd(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %54)
          to label %56 unwind label %69

56:                                               ; preds = %55
  %57 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %58 unwind label %71

58:                                               ; preds = %56
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  %59 = fsub double %54, %.0943
  %60 = call double @llvm.fabs.f64(double %59)
  %61 = fcmp olt double %60, %2
  br i1 %61, label %78, label %74

62:                                               ; preds = %.preheader
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %66

64:                                               ; preds = %51
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  br label %66

66:                                               ; preds = %64, %62
  %.pn24 = phi { ptr, i32 } [ %65, %64 ], [ %63, %62 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  br label %92

67:                                               ; preds = %74, %53
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %92

69:                                               ; preds = %55
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %56
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  br label %73

73:                                               ; preds = %71, %69
  %.pn26 = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  br label %92

74:                                               ; preds = %58
  %75 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %76 unwind label %67

76:                                               ; preds = %74
  %77 = add nuw nsw i32 %.042, 1
  %exitcond.not = icmp eq i32 %77, 10000
  br i1 %exitcond.not, label %78, label %.preheader, !llvm.loop !17

78:                                               ; preds = %58, %76
  %79 = call noundef double @_ZNK6Matrix13getDotProductERKS_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %80 = fcmp olt double %79, 0.000000e+00
  br i1 %80, label %81, label %83

81:                                               ; preds = %78
  %82 = fneg double %54
  store double %82, ptr %8, align 8, !tbaa !13
  br label %83

83:                                               ; preds = %81, %78
  %84 = phi double [ %82, %81 ], [ %54, %78 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #4
  invoke void @_ZNK6MatrixdvEd(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %84)
          to label %85 unwind label %87

85:                                               ; preds = %83
  invoke void @_ZSt9make_pairIRdR6MatrixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %86 unwind label %89

86:                                               ; preds = %85
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  ret void

87:                                               ; preds = %83
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %91

89:                                               ; preds = %85
  %90 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  br label %91

91:                                               ; preds = %89, %87
  %.pn30 = phi { ptr, i32 } [ %90, %89 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  br label %92

92:                                               ; preds = %66, %67, %73, %91
  %.pn30.pn = phi { ptr, i32 } [ %.pn30, %91 ], [ %68, %67 ], [ %.pn26, %73 ], [ %.pn24, %66 ]
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  br label %93

93:                                               ; preds = %92, %49
  %.pn30.pn.pn = phi { ptr, i32 } [ %.pn30.pn, %92 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  br label %94

94:                                               ; preds = %93, %48, %42
  %.pn30.pn.pn.pn = phi { ptr, i32 } [ %.pn30.pn.pn, %93 ], [ %.pn, %48 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  br label %95

95:                                               ; preds = %94, %40
  %.pn30.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn30.pn.pn.pn, %94 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %96

96:                                               ; preds = %95, %32, %21
  %.pn36 = phi { ptr, i32 } [ %33, %32 ], [ %.pn30.pn.pn.pn.pn, %95 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %97

97:                                               ; preds = %96, %19
  %.pn36.pn = phi { ptr, i32 } [ %.pn36, %96 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn36.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRdR6MatrixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare void @_ZN6MatrixC1Eii(ptr, i32, i32) local_unnamed_addr

declare void @_ZN6MatrixC1ERKS_(ptr, ptr) local_unnamed_addr

declare void @_ZN6MatrixD1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !7, i64 0}
!6 = !{!"_ZTS6Matrix", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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