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

; 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 }
%class.Vector = type { %class.Matrix, ptr }
%class.Quaternion = type { %class.Vector }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12bestRotationRK6MatrixS1_(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) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.Vector, align 8
  %9 = alloca %class.Vector, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %class.Vector, align 8
  %13 = alloca %class.Matrix, align 8
  %14 = alloca %class.Matrix, align 8
  %15 = alloca %class.Matrix, align 8
  %16 = alloca %class.Matrix, align 8
  %17 = alloca %class.Matrix, align 8
  %18 = alloca %class.Quaternion, align 8
  %19 = alloca %class.Vector, align 8
  %20 = alloca %class.Vector, align 8
  %21 = alloca %class.Matrix, align 8
  %22 = alloca %class.Matrix, align 8
  %23 = alloca %class.Quaternion, align 8
  %24 = alloca %class.Matrix, align 8
  %25 = alloca %class.Quaternion, align 8
  %26 = alloca %class.Matrix, align 8
  %27 = alloca %class.Matrix, align 8
  %28 = alloca %class.Vector, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  call void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  invoke void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %29 unwind label %87

29:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  invoke void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %30 unwind label %91

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %31 unwind label %95

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %32 unwind label %99

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %33 unwind label %103

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %34 unwind label %107

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %35 unwind label %111

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #5
  invoke void @_ZN10QuaternionC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %36 unwind label %115

36:                                               ; preds = %35
  invoke void @_ZN6Matrix6createEiid(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 4, i32 noundef 4, double noundef 0.000000e+00)
          to label %37 unwind label %119

37:                                               ; preds = %36
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %84, %37
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = invoke noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %40)
          to label %42 unwind label %119

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

44:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !9
  invoke void @_ZNK6Matrix6getColEi(ptr dead_on_unwind writable sret(%class.Vector) align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %45, i32 noundef %46)
          to label %47 unwind label %123

47:                                               ; preds = %44
  %48 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %49 unwind label %127

49:                                               ; preds = %47
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !9
  invoke void @_ZNK6Matrix6getColEi(ptr dead_on_unwind writable sret(%class.Vector) align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %50, i32 noundef %51)
          to label %52 unwind label %132

52:                                               ; preds = %49
  %53 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %54 unwind label %136

54:                                               ; preds = %52
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #5
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef 1)
          to label %56 unwind label %141

56:                                               ; preds = %54
  %57 = load double, ptr %55, align 8, !tbaa !11
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef 2)
          to label %59 unwind label %141

59:                                               ; preds = %56
  %60 = load double, ptr %58, align 8, !tbaa !11
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef 3)
          to label %62 unwind label %141

62:                                               ; preds = %59
  %63 = load double, ptr %61, align 8, !tbaa !11
  invoke void @_ZN10QuaternionC1Eddd(ptr noundef nonnull align 8 dereferenceable(32) %23, double noundef %57, double noundef %60, double noundef %63)
          to label %64 unwind label %141

64:                                               ; preds = %62
  invoke void @_ZNK10Quaternion7matrixQEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %22, ptr noundef nonnull align 8 dereferenceable(32) %23)
          to label %65 unwind label %145

65:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #5
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef 1)
          to label %67 unwind label %149

67:                                               ; preds = %65
  %68 = load double, ptr %66, align 8, !tbaa !11
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef 2)
          to label %70 unwind label %149

70:                                               ; preds = %67
  %71 = load double, ptr %69, align 8, !tbaa !11
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef 3)
          to label %73 unwind label %149

73:                                               ; preds = %70
  %74 = load double, ptr %72, align 8, !tbaa !11
  invoke void @_ZN10QuaternionC1Eddd(ptr noundef nonnull align 8 dereferenceable(32) %25, double noundef %68, double noundef %71, double noundef %74)
          to label %75 unwind label %149

75:                                               ; preds = %73
  invoke void @_ZNK10Quaternion7matrixWEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %24, ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %76 unwind label %153

76:                                               ; preds = %75
  invoke void @_ZNK6MatrixmiERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %77 unwind label %157

77:                                               ; preds = %76
  %78 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %79 unwind label %161

79:                                               ; preds = %77
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #5
  invoke void @_ZNK6Matrix9transposeEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %27, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %80 unwind label %170

80:                                               ; preds = %79
  invoke void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %26, ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %81 unwind label %174

81:                                               ; preds = %80
  %82 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6MatrixpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %26)
          to label %83 unwind label %178

83:                                               ; preds = %81
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #5
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %7, align 4, !tbaa !9
  br label %38, !llvm.loop !13

87:                                               ; preds = %3
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %10, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %11, align 4
  br label %211

91:                                               ; preds = %29
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %10, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %11, align 4
  br label %210

95:                                               ; preds = %30
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %10, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %11, align 4
  br label %209

99:                                               ; preds = %31
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %10, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %11, align 4
  br label %208

103:                                              ; preds = %32
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %10, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %11, align 4
  br label %207

107:                                              ; preds = %33
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %10, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %11, align 4
  br label %206

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

115:                                              ; preds = %35
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %10, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %11, align 4
  br label %204

119:                                              ; preds = %192, %190, %184, %38, %36
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %10, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %11, align 4
  br label %203

123:                                              ; preds = %44
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %10, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %11, align 4
  br label %131

127:                                              ; preds = %47
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %10, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %11, align 4
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  br label %131

131:                                              ; preds = %127, %123
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  br label %203

132:                                              ; preds = %49
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %10, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %11, align 4
  br label %140

136:                                              ; preds = %52
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %10, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %11, align 4
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  br label %140

140:                                              ; preds = %136, %132
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  br label %203

141:                                              ; preds = %62, %59, %56, %54
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %10, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %11, align 4
  br label %169

145:                                              ; preds = %64
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %10, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %11, align 4
  br label %168

149:                                              ; preds = %73, %70, %67, %65
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %10, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %11, align 4
  br label %167

153:                                              ; preds = %75
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %10, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %11, align 4
  br label %166

157:                                              ; preds = %76
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %10, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %11, align 4
  br label %165

161:                                              ; preds = %77
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %10, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %11, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  br label %165

165:                                              ; preds = %161, %157
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  br label %166

166:                                              ; preds = %165, %153
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  br label %167

167:                                              ; preds = %166, %149
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  br label %168

168:                                              ; preds = %167, %145
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #5
  br label %169

169:                                              ; preds = %168, %141
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  br label %203

170:                                              ; preds = %79
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %10, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %11, align 4
  br label %183

174:                                              ; preds = %80
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %10, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %11, align 4
  br label %182

178:                                              ; preds = %81
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %10, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %11, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #5
  br label %182

182:                                              ; preds = %178, %174
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  br label %183

183:                                              ; preds = %182, %170
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #5
  br label %203

184:                                              ; preds = %42
  invoke void @_ZNK6Matrix3svdERS_S0_S0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %185 unwind label %119

185:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 32, ptr %28) #5
  %186 = invoke noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %187 unwind label %194

187:                                              ; preds = %185
  invoke void @_ZNK6Matrix6getColEi(ptr dead_on_unwind writable sret(%class.Vector) align 8 %28, ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %186)
          to label %188 unwind label %194

188:                                              ; preds = %187
  %189 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %28)
          to label %190 unwind label %198

190:                                              ; preds = %188
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #5
  %191 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN10Quaternion7setQuatERK6Vector(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %192 unwind label %119

192:                                              ; preds = %190
  invoke void @_ZNK10Quaternion8rotationEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %193 unwind label %119

193:                                              ; preds = %192
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void

194:                                              ; preds = %187, %185
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %10, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %11, align 4
  br label %202

198:                                              ; preds = %188
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %10, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %11, align 4
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #5
  br label %202

202:                                              ; preds = %198, %194
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #5
  br label %203

203:                                              ; preds = %202, %183, %169, %140, %131, %119
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  br label %204

204:                                              ; preds = %203, %115
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  br label %205

205:                                              ; preds = %204, %111
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br label %206

206:                                              ; preds = %205, %107
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  br label %207

207:                                              ; preds = %206, %103
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  br label %208

208:                                              ; preds = %207, %99
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %209

209:                                              ; preds = %208, %95
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %210

210:                                              ; preds = %209, %91
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br label %211

211:                                              ; preds = %210, %87
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %212

212:                                              ; preds = %211
  %213 = load ptr, ptr %10, align 8
  %214 = load i32, ptr %11, align 4
  %215 = insertvalue { ptr, i32 } poison, ptr %213, 0
  %216 = insertvalue { ptr, i32 } %215, i32 %214, 1
  resume { ptr, i32 } %216
}

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

declare void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN10QuaternionC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

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

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

declare void @_ZNK6Matrix6getColEi(ptr dead_on_unwind writable sret(%class.Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2

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

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

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

declare void @_ZN10QuaternionC1Eddd(ptr noundef nonnull align 8 dereferenceable(32), double noundef, double noundef, double noundef) unnamed_addr #2

declare void @_ZNK10Quaternion7matrixQEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(32)) #2

declare void @_ZNK6MatrixmiERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

declare void @_ZNK10Quaternion7matrixWEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(32)) #2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

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

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

declare void @_ZNK6Matrix9transposeEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24)) #2

declare void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN6MatrixpLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

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

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN10Quaternion7setQuatERK6Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2

declare void @_ZNK10Quaternion8rotationEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(32)) #2

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


; 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 }
%class.Vector = type { %class.Matrix, ptr }
%class.Quaternion = type { %class.Vector }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12bestRotationRK6MatrixS1_(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) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.Vector, align 8
  %5 = alloca %class.Vector, align 8
  %6 = alloca %class.Vector, align 8
  %7 = alloca %class.Matrix, align 8
  %8 = alloca %class.Matrix, align 8
  %9 = alloca %class.Matrix, align 8
  %10 = alloca %class.Matrix, align 8
  %11 = alloca %class.Matrix, align 8
  %12 = alloca %class.Quaternion, align 8
  %13 = alloca %class.Vector, align 8
  %14 = alloca %class.Vector, align 8
  %15 = alloca %class.Matrix, align 8
  %16 = alloca %class.Matrix, align 8
  %17 = alloca %class.Quaternion, align 8
  %18 = alloca %class.Matrix, align 8
  %19 = alloca %class.Quaternion, align 8
  %20 = alloca %class.Matrix, align 8
  %21 = alloca %class.Matrix, align 8
  %22 = alloca %class.Vector, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  invoke void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %23 unwind label %63

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  invoke void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %24 unwind label %65

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %25 unwind label %67

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %26 unwind label %69

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %27 unwind label %71

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %28 unwind label %73

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  invoke void @_ZN6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %29 unwind label %75

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  invoke void @_ZN10QuaternionC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %30 unwind label %77

30:                                               ; preds = %29
  invoke void @_ZN6Matrix6createEiid(ptr noundef nonnull align 8 dereferenceable(24) %8, i32 noundef 4, i32 noundef 4, double noundef 0.000000e+00)
          to label %.preheader unwind label %79

.preheader:                                       ; preds = %30
  %31 = call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not51 = icmp slt i32 %31, 1
  br i1 %.not51, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %60
  %.02752 = phi i32 [ %61, %60 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #5
  invoke void @_ZNK6Matrix6getColEi(ptr dead_on_unwind nonnull writable sret(%class.Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.02752)
          to label %32 unwind label %81

32:                                               ; preds = %.lr.ph
  %33 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %34 unwind label %83

34:                                               ; preds = %32
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #5
  invoke void @_ZNK6Matrix6getColEi(ptr dead_on_unwind nonnull writable sret(%class.Vector) align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.02752)
          to label %35 unwind label %86

35:                                               ; preds = %34
  %36 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %37 unwind label %88

37:                                               ; preds = %35
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %17) #5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 1)
  %39 = load double, ptr %38, align 8, !tbaa !5
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 2)
  %41 = load double, ptr %40, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 3)
  %43 = load double, ptr %42, align 8, !tbaa !5
  invoke void @_ZN10QuaternionC1Eddd(ptr noundef nonnull align 8 dereferenceable(32) %17, double noundef %39, double noundef %41, double noundef %43)
          to label %44 unwind label %91

44:                                               ; preds = %37
  invoke void @_ZNK10Quaternion7matrixQEv(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %16, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %45 unwind label %93

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %19) #5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 1)
  %47 = load double, ptr %46, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 2)
  %49 = load double, ptr %48, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6VectorclEi(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 3)
  %51 = load double, ptr %50, align 8, !tbaa !5
  invoke void @_ZN10QuaternionC1Eddd(ptr noundef nonnull align 8 dereferenceable(32) %19, double noundef %47, double noundef %49, double noundef %51)
          to label %52 unwind label %95

52:                                               ; preds = %45
  invoke void @_ZNK10Quaternion7matrixWEv(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %18, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %53 unwind label %97

53:                                               ; preds = %52
  invoke void @_ZNK6MatrixmiERKS_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %54 unwind label %99

54:                                               ; preds = %53
  %55 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %56 unwind label %101

56:                                               ; preds = %54
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %20) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %21) #5
  invoke void @_ZNK6Matrix9transposeEv(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %57 unwind label %108

57:                                               ; preds = %56
  invoke void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %58 unwind label %110

58:                                               ; preds = %57
  %59 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6MatrixpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %60 unwind label %112

60:                                               ; preds = %58
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #5
  %61 = add nuw nsw i32 %.02752, 1
  %62 = call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not.not = icmp slt i32 %.02752, %62
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

63:                                               ; preds = %3
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %137

65:                                               ; preds = %23
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %136

67:                                               ; preds = %24
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %135

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

71:                                               ; preds = %26
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %133

73:                                               ; preds = %27
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %132

75:                                               ; preds = %28
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %131

77:                                               ; preds = %29
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %130

79:                                               ; preds = %122, %120, %._crit_edge, %30
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %129

81:                                               ; preds = %.lr.ph
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

83:                                               ; preds = %32
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %85

85:                                               ; preds = %83, %81
  %.pn29 = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  br label %129

86:                                               ; preds = %34
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %90

88:                                               ; preds = %35
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  br label %90

90:                                               ; preds = %88, %86
  %.pn31 = phi { ptr, i32 } [ %89, %88 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  br label %129

91:                                               ; preds = %37
  %92 = landingpad { ptr, i32 }
          cleanup
  br label %107

93:                                               ; preds = %44
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %106

95:                                               ; preds = %45
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %105

97:                                               ; preds = %52
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %104

99:                                               ; preds = %53
  %100 = landingpad { ptr, i32 }
          cleanup
  br label %103

101:                                              ; preds = %54
  %102 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  br label %103

103:                                              ; preds = %101, %99
  %.pn33 = phi { ptr, i32 } [ %102, %101 ], [ %100, %99 ]
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  br label %104

104:                                              ; preds = %103, %97
  %.pn33.pn = phi { ptr, i32 } [ %.pn33, %103 ], [ %98, %97 ]
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  br label %105

105:                                              ; preds = %104, %95
  %.pn33.pn.pn = phi { ptr, i32 } [ %.pn33.pn, %104 ], [ %96, %95 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br label %106

106:                                              ; preds = %105, %93
  %.pn33.pn.pn.pn = phi { ptr, i32 } [ %.pn33.pn.pn, %105 ], [ %94, %93 ]
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #5
  br label %107

107:                                              ; preds = %106, %91
  %.pn33.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn33.pn.pn.pn, %106 ], [ %92, %91 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #5
  br label %129

108:                                              ; preds = %56
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %115

110:                                              ; preds = %57
  %111 = landingpad { ptr, i32 }
          cleanup
  br label %114

112:                                              ; preds = %58
  %113 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  br label %114

114:                                              ; preds = %112, %110
  %.pn39 = phi { ptr, i32 } [ %113, %112 ], [ %111, %110 ]
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  br label %115

115:                                              ; preds = %114, %108
  %.pn39.pn = phi { ptr, i32 } [ %.pn39, %114 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #5
  br label %129

._crit_edge:                                      ; preds = %60, %.preheader
  invoke void @_ZNK6Matrix3svdERS_S0_S0_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %116 unwind label %79

116:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %22) #5
  %117 = call noundef i32 @_ZNK6Matrix6nbColsEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  invoke void @_ZNK6Matrix6getColEi(ptr dead_on_unwind nonnull writable sret(%class.Vector) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %11, i32 noundef %117)
          to label %118 unwind label %124

118:                                              ; preds = %116
  %119 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %120 unwind label %126

120:                                              ; preds = %118
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #5
  %121 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN10Quaternion7setQuatERK6Vector(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %122 unwind label %79

122:                                              ; preds = %120
  invoke void @_ZNK10Quaternion8rotationEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %123 unwind label %79

123:                                              ; preds = %122
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  ret void

124:                                              ; preds = %116
  %125 = landingpad { ptr, i32 }
          cleanup
  br label %128

126:                                              ; preds = %118
  %127 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #5
  br label %128

128:                                              ; preds = %126, %124
  %.pn = phi { ptr, i32 } [ %127, %126 ], [ %125, %124 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #5
  br label %129

129:                                              ; preds = %128, %115, %107, %90, %85, %79
  %.pn39.pn.pn = phi { ptr, i32 } [ %.pn39.pn, %115 ], [ %.pn33.pn.pn.pn.pn, %107 ], [ %.pn31, %90 ], [ %.pn29, %85 ], [ %80, %79 ], [ %.pn, %128 ]
  call void @_ZN10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %130

130:                                              ; preds = %129, %77
  %.pn39.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn, %129 ], [ %78, %77 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  br label %131

131:                                              ; preds = %130, %75
  %.pn39.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn.pn, %130 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  br label %132

132:                                              ; preds = %131, %73
  %.pn39.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn.pn.pn, %131 ], [ %74, %73 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br label %133

133:                                              ; preds = %132, %71
  %.pn39.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn.pn.pn.pn, %132 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  br label %134

134:                                              ; preds = %133, %69
  %.pn39.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn.pn.pn.pn.pn, %133 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %135

135:                                              ; preds = %134, %67
  %.pn39.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn.pn.pn.pn.pn.pn, %134 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %136

136:                                              ; preds = %135, %65
  %.pn39.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn.pn.pn.pn.pn.pn.pn, %135 ], [ %66, %65 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %137

137:                                              ; preds = %136, %63
  %.pn39.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn39.pn.pn.pn.pn.pn.pn.pn.pn.pn, %136 ], [ %64, %63 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN6VectorD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn39.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

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

declare void @_ZN6VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN10QuaternionC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

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

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

declare void @_ZNK6Matrix6getColEi(ptr dead_on_unwind writable sret(%class.Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN6VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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

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

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

declare void @_ZN10QuaternionC1Eddd(ptr noundef nonnull align 8 dereferenceable(32), double noundef, double noundef, double noundef) unnamed_addr #2

declare void @_ZNK10Quaternion7matrixQEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare void @_ZNK6MatrixmiERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

declare void @_ZNK10Quaternion7matrixWEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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

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

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

declare void @_ZNK6Matrix9transposeEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

declare void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

declare void @_ZNK6Matrix3svdERS_S0_S0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN10Quaternion7setQuatERK6Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare void @_ZNK10Quaternion8rotationEv(ptr dead_on_unwind writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass