; LLVM IR from ox-vgg/vise :: src/search_engine/relja_retrival/external/KMCode_relja/matrix (jordan)

; 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 { ptr, ptr, i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6Matrix6jordanERS_i(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3) #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca i1, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %18 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %19 = call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %20 = call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %22, label %24

22:                                               ; preds = %4
  %23 = call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  br label %26

24:                                               ; preds = %4
  %25 = call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  br label %26

26:                                               ; preds = %24, %22
  %27 = phi i32 [ %23, %22 ], [ %25, %24 ]
  store i32 %27, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store double 1.000000e+00, ptr %14, align 8, !tbaa !11
  store i1 false, ptr %15, align 1
  call void @_ZN6MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %18)
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %207, %26
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = load i32, ptr %13, align 4, !tbaa !9
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %32, label %210

32:                                               ; preds = %28
  %33 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %33, ptr %12, align 4, !tbaa !9
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %77

36:                                               ; preds = %32
  %37 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %37, ptr %9, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %64, %36
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = invoke noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %41 unwind label %59

41:                                               ; preds = %38
  %42 = icmp sle i32 %39, %40
  br i1 %42, label %43, label %67

43:                                               ; preds = %41
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %44, i32 noundef %45)
          to label %47 unwind label %59

47:                                               ; preds = %43
  %48 = load double, ptr %46, align 8, !tbaa !11
  %49 = call double @llvm.fabs.f64(double %48)
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %50, i32 noundef %51)
          to label %53 unwind label %59

53:                                               ; preds = %47
  %54 = load double, ptr %52, align 8, !tbaa !11
  %55 = call double @llvm.fabs.f64(double %54)
  %56 = fcmp ogt double %49, %55
  br i1 %56, label %57, label %63

57:                                               ; preds = %53
  %58 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %58, ptr %12, align 4, !tbaa !9
  br label %63

59:                                               ; preds = %201, %193, %175, %166, %161, %152, %148, %142, %126, %121, %116, %111, %107, %98, %87, %77, %71, %67, %47, %43, %38
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %16, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %17, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %214

63:                                               ; preds = %57, %53
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %9, align 4, !tbaa !9
  br label %38, !llvm.loop !13

67:                                               ; preds = %41
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix8swapRowsEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %68, i32 noundef %69)
          to label %71 unwind label %59

71:                                               ; preds = %67
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = load i32, ptr %10, align 4, !tbaa !9
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix8swapRowsEii(ptr noundef nonnull align 8 dereferenceable(24) %72, i32 noundef %73, i32 noundef %74)
          to label %76 unwind label %59

76:                                               ; preds = %71
  br label %77

77:                                               ; preds = %76, %32
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %78, i32 noundef %79)
          to label %81 unwind label %59

81:                                               ; preds = %77
  %82 = load double, ptr %80, align 8, !tbaa !11
  %83 = call double @llvm.fabs.f64(double %82)
  %84 = fcmp oeq double %83, 0.000000e+00
  br i1 %84, label %85, label %86

85:                                               ; preds = %81
  br label %210

86:                                               ; preds = %81
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %198, %86
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = invoke noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %90 unwind label %59

90:                                               ; preds = %87
  %91 = icmp sle i32 %88, %89
  br i1 %91, label %92, label %201

92:                                               ; preds = %90
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = icmp eq i32 %93, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %92
  br label %198

97:                                               ; preds = %92
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %138, %97
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = invoke noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %101 unwind label %59

101:                                              ; preds = %98
  %102 = icmp sle i32 %99, %100
  br i1 %102, label %103, label %141

103:                                              ; preds = %101
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = load i32, ptr %10, align 4, !tbaa !9
  %106 = icmp ne i32 %104, %105
  br i1 %106, label %107, label %137

107:                                              ; preds = %103
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %108, i32 noundef %109)
          to label %111 unwind label %59

111:                                              ; preds = %107
  %112 = load double, ptr %110, align 8, !tbaa !11
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %113, i32 noundef %114)
          to label %116 unwind label %59

116:                                              ; preds = %111
  %117 = load double, ptr %115, align 8, !tbaa !11
  %118 = load i32, ptr %9, align 4, !tbaa !9
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %118, i32 noundef %119)
          to label %121 unwind label %59

121:                                              ; preds = %116
  %122 = load double, ptr %120, align 8, !tbaa !11
  %123 = load i32, ptr %10, align 4, !tbaa !9
  %124 = load i32, ptr %11, align 4, !tbaa !9
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %123, i32 noundef %124)
          to label %126 unwind label %59

126:                                              ; preds = %121
  %127 = load double, ptr %125, align 8, !tbaa !11
  %128 = fmul double %122, %127
  %129 = fneg double %128
  %130 = call double @llvm.fmuladd.f64(double %112, double %117, double %129)
  %131 = load double, ptr %14, align 8, !tbaa !11
  %132 = fdiv double %130, %131
  %133 = load i32, ptr %9, align 4, !tbaa !9
  %134 = load i32, ptr %11, align 4, !tbaa !9
  %135 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %133, i32 noundef %134)
          to label %136 unwind label %59

136:                                              ; preds = %126
  store double %132, ptr %135, align 8, !tbaa !11
  br label %137

137:                                              ; preds = %136, %103
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %11, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %11, align 4, !tbaa !9
  br label %98, !llvm.loop !15

141:                                              ; preds = %101
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %142

142:                                              ; preds = %190, %141
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = invoke noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %144)
          to label %146 unwind label %59

146:                                              ; preds = %142
  %147 = icmp sle i32 %143, %145
  br i1 %147, label %148, label %193

148:                                              ; preds = %146
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %149, i32 noundef %150)
          to label %152 unwind label %59

152:                                              ; preds = %148
  %153 = load double, ptr %151, align 8, !tbaa !11
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = load i32, ptr %9, align 4, !tbaa !9
  %156 = load i32, ptr %11, align 4, !tbaa !9
  %157 = load ptr, ptr %154, align 8, !tbaa !16
  %158 = getelementptr inbounds ptr, ptr %157, i64 6
  %159 = load ptr, ptr %158, align 8
  %160 = invoke noundef nonnull align 8 dereferenceable(8) ptr %159(ptr noundef nonnull align 8 dereferenceable(24) %154, i32 noundef %155, i32 noundef %156)
          to label %161 unwind label %59

161:                                              ; preds = %152
  %162 = load double, ptr %160, align 8, !tbaa !11
  %163 = load i32, ptr %9, align 4, !tbaa !9
  %164 = load i32, ptr %10, align 4, !tbaa !9
  %165 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %163, i32 noundef %164)
          to label %166 unwind label %59

166:                                              ; preds = %161
  %167 = load double, ptr %165, align 8, !tbaa !11
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = load i32, ptr %10, align 4, !tbaa !9
  %170 = load i32, ptr %11, align 4, !tbaa !9
  %171 = load ptr, ptr %168, align 8, !tbaa !16
  %172 = getelementptr inbounds ptr, ptr %171, i64 6
  %173 = load ptr, ptr %172, align 8
  %174 = invoke noundef nonnull align 8 dereferenceable(8) ptr %173(ptr noundef nonnull align 8 dereferenceable(24) %168, i32 noundef %169, i32 noundef %170)
          to label %175 unwind label %59

175:                                              ; preds = %166
  %176 = load double, ptr %174, align 8, !tbaa !11
  %177 = fmul double %167, %176
  %178 = fneg double %177
  %179 = call double @llvm.fmuladd.f64(double %153, double %162, double %178)
  %180 = load double, ptr %14, align 8, !tbaa !11
  %181 = fdiv double %179, %180
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = load i32, ptr %9, align 4, !tbaa !9
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = load ptr, ptr %182, align 8, !tbaa !16
  %186 = getelementptr inbounds ptr, ptr %185, i64 6
  %187 = load ptr, ptr %186, align 8
  %188 = invoke noundef nonnull align 8 dereferenceable(8) ptr %187(ptr noundef nonnull align 8 dereferenceable(24) %182, i32 noundef %183, i32 noundef %184)
          to label %189 unwind label %59

189:                                              ; preds = %175
  store double %181, ptr %188, align 8, !tbaa !11
  br label %190

190:                                              ; preds = %189
  %191 = load i32, ptr %11, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %11, align 4, !tbaa !9
  br label %142, !llvm.loop !18

193:                                              ; preds = %146
  %194 = load i32, ptr %9, align 4, !tbaa !9
  %195 = load i32, ptr %10, align 4, !tbaa !9
  %196 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %194, i32 noundef %195)
          to label %197 unwind label %59

197:                                              ; preds = %193
  store double 0.000000e+00, ptr %196, align 8, !tbaa !11
  br label %198

198:                                              ; preds = %197, %96
  %199 = load i32, ptr %9, align 4, !tbaa !9
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %9, align 4, !tbaa !9
  br label %87, !llvm.loop !19

201:                                              ; preds = %90
  %202 = load i32, ptr %10, align 4, !tbaa !9
  %203 = load i32, ptr %10, align 4, !tbaa !9
  %204 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %202, i32 noundef %203)
          to label %205 unwind label %59

205:                                              ; preds = %201
  %206 = load double, ptr %204, align 8, !tbaa !11
  store double %206, ptr %14, align 8, !tbaa !11
  br label %207

207:                                              ; preds = %205
  %208 = load i32, ptr %10, align 4, !tbaa !9
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %10, align 4, !tbaa !9
  br label %28, !llvm.loop !20

210:                                              ; preds = %85, %28
  store i1 true, ptr %15, align 1
  %211 = load i1, ptr %15, align 1
  br i1 %211, label %213, label %212

212:                                              ; preds = %210
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %213

213:                                              ; preds = %212, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void

214:                                              ; preds = %59
  %215 = load ptr, ptr %16, align 8
  %216 = load i32, ptr %17, align 4
  %217 = insertvalue { ptr, i32 } poison, ptr %215, 0
  %218 = insertvalue { ptr, i32 } %217, i32 %216, 1
  resume { ptr, i32 } %218
}

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

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

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

declare void @_ZN6MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: nounwind
declare void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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 { ptr, ptr, i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6Matrix6jordanERS_i(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = tail call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %6 = tail call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %7 = icmp slt i32 %5, %6
  br i1 %7, label %8, label %10

8:                                                ; preds = %4
  %9 = tail call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  br label %12

10:                                               ; preds = %4
  %11 = tail call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  br label %12

12:                                               ; preds = %10, %8
  %13 = phi i32 [ %9, %8 ], [ %11, %10 ]
  tail call void @_ZN6MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not92 = icmp slt i32 %13, 1
  br i1 %.not92, label %._crit_edge98, label %.lr.ph97

.lr.ph97:                                         ; preds = %12
  %.not69 = icmp eq i32 %3, 0
  br label %14

14:                                               ; preds = %.lr.ph97, %._crit_edge91
  %.06394 = phi i32 [ 1, %.lr.ph97 ], [ %87, %._crit_edge91 ]
  %.06493 = phi double [ 1.000000e+00, %.lr.ph97 ], [ %86, %._crit_edge91 ]
  br i1 %.not69, label %29, label %.preheader77

.preheader77:                                     ; preds = %14
  %15 = tail call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not7078 = icmp sgt i32 %.06394, %15
  br i1 %.not7078, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader77, %.lr.ph
  %.080 = phi i32 [ %23, %.lr.ph ], [ %.06394, %.preheader77 ]
  %.06779 = phi i32 [ %.168, %.lr.ph ], [ %.06394, %.preheader77 ]
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.080, i32 noundef %.06394)
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = tail call double @llvm.fabs.f64(double %17)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.06779, i32 noundef %.06394)
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = tail call double @llvm.fabs.f64(double %20)
  %22 = fcmp ogt double %18, %21
  %.168 = select i1 %22, i32 %.080, i32 %.06779
  %23 = add nuw nsw i32 %.080, 1
  %24 = tail call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not70.not = icmp slt i32 %.080, %24
  br i1 %.not70.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.loopexit:                                        ; preds = %.lr.ph86, %60, %68
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %25

.loopexit.split-lp:                               ; preds = %._crit_edge, %27
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %25

25:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  tail call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %lpad.phi

._crit_edge:                                      ; preds = %.lr.ph, %.preheader77
  %.067.lcssa = phi i32 [ %.06394, %.preheader77 ], [ %.168, %.lr.ph ]
  %26 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix8swapRowsEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.06394, i32 noundef %.067.lcssa)
          to label %27 unwind label %.loopexit.split-lp

27:                                               ; preds = %._crit_edge
  %28 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix8swapRowsEii(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.06394, i32 noundef %.067.lcssa)
          to label %29 unwind label %.loopexit.split-lp

29:                                               ; preds = %27, %14
  %30 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.06394, i32 noundef %.06394)
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = fcmp oeq double %31, 0.000000e+00
  br i1 %32, label %._crit_edge98, label %.preheader76

.preheader76:                                     ; preds = %29
  %33 = tail call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not7188 = icmp slt i32 %33, 1
  br i1 %.not7188, label %._crit_edge91, label %.lr.ph90

.lr.ph90:                                         ; preds = %.preheader76, %82
  %.189 = phi i32 [ %83, %82 ], [ 1, %.preheader76 ]
  %34 = icmp eq i32 %.189, %.06394
  br i1 %34, label %82, label %.preheader75

.preheader75:                                     ; preds = %.lr.ph90
  %35 = tail call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not7281 = icmp slt i32 %35, 1
  br i1 %.not7281, label %.preheader, label %.lr.ph83

.preheader:                                       ; preds = %51, %.preheader75
  %36 = tail call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not7384 = icmp slt i32 %36, 1
  br i1 %.not7384, label %._crit_edge87, label %.lr.ph86

.lr.ph83:                                         ; preds = %.preheader75, %51
  %.06582 = phi i32 [ %52, %51 ], [ 1, %.preheader75 ]
  %.not74 = icmp eq i32 %.06582, %.06394
  br i1 %.not74, label %51, label %37

37:                                               ; preds = %.lr.ph83
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.06394, i32 noundef %.06394)
  %39 = load double, ptr %38, align 8, !tbaa !5
  %40 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.189, i32 noundef %.06582)
  %41 = load double, ptr %40, align 8, !tbaa !5
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.189, i32 noundef %.06394)
  %43 = load double, ptr %42, align 8, !tbaa !5
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.06394, i32 noundef %.06582)
  %45 = load double, ptr %44, align 8, !tbaa !5
  %46 = fneg double %43
  %47 = fmul double %45, %46
  %48 = tail call double @llvm.fmuladd.f64(double %39, double %41, double %47)
  %49 = fdiv double %48, %.06493
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.189, i32 noundef %.06582)
  store double %49, ptr %50, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %.lr.ph83, %37
  %52 = add nuw nsw i32 %.06582, 1
  %53 = tail call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not72.not = icmp slt i32 %.06582, %53
  br i1 %.not72.not, label %.lr.ph83, label %.preheader, !llvm.loop !11

.lr.ph86:                                         ; preds = %.preheader, %74
  %.16685 = phi i32 [ %79, %74 ], [ 1, %.preheader ]
  %54 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.06394, i32 noundef %.06394)
  %55 = load double, ptr %54, align 8, !tbaa !5
  %56 = load ptr, ptr %2, align 8, !tbaa !12
  %57 = getelementptr inbounds i8, ptr %56, i64 48
  %58 = load ptr, ptr %57, align 8
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr %58(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.189, i32 noundef %.16685)
          to label %60 unwind label %.loopexit

60:                                               ; preds = %.lr.ph86
  %61 = load double, ptr %59, align 8, !tbaa !5
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.189, i32 noundef %.06394)
  %63 = load double, ptr %62, align 8, !tbaa !5
  %64 = load ptr, ptr %2, align 8, !tbaa !12
  %65 = getelementptr inbounds i8, ptr %64, i64 48
  %66 = load ptr, ptr %65, align 8
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr %66(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.06394, i32 noundef %.16685)
          to label %68 unwind label %.loopexit

68:                                               ; preds = %60
  %69 = load double, ptr %67, align 8, !tbaa !5
  %70 = load ptr, ptr %2, align 8, !tbaa !12
  %71 = getelementptr inbounds i8, ptr %70, i64 48
  %72 = load ptr, ptr %71, align 8
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr %72(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.189, i32 noundef %.16685)
          to label %74 unwind label %.loopexit

74:                                               ; preds = %68
  %75 = fneg double %63
  %76 = fmul double %69, %75
  %77 = tail call double @llvm.fmuladd.f64(double %55, double %61, double %76)
  %78 = fdiv double %77, %.06493
  store double %78, ptr %73, align 8, !tbaa !5
  %79 = add nuw nsw i32 %.16685, 1
  %80 = tail call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not73.not = icmp slt i32 %.16685, %80
  br i1 %.not73.not, label %.lr.ph86, label %._crit_edge87, !llvm.loop !14

._crit_edge87:                                    ; preds = %74, %.preheader
  %81 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.189, i32 noundef %.06394)
  store double 0.000000e+00, ptr %81, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %.lr.ph90, %._crit_edge87
  %83 = add nuw nsw i32 %.189, 1
  %84 = tail call noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not71.not = icmp slt i32 %.189, %84
  br i1 %.not71.not, label %.lr.ph90, label %._crit_edge91, !llvm.loop !15

._crit_edge91:                                    ; preds = %82, %.preheader76
  %85 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.06394, i32 noundef %.06394)
  %86 = load double, ptr %85, align 8, !tbaa !5
  %87 = add nuw i32 %.06394, 1
  %exitcond.not = icmp eq i32 %.06394, %13
  br i1 %exitcond.not, label %._crit_edge98, label %14, !llvm.loop !16

._crit_edge98:                                    ; preds = %29, %._crit_edge91, %12
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6Matrix6nbRowsEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

declare void @_ZN6MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) unnamed_addr #1 align 2

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix8swapRowsEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !8, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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