; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_Mat3d)

; 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"

%struct._MatNd = type { ptr, i32, i32, i32, i8 }

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

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

; Function Attrs: nounwind
declare double @sin(double noundef) #1

; Function Attrs: nounwind
declare double @cos(double noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @Mat3d_dEulerErrorDx(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [9 x double], align 16
  %8 = alloca [9 x double], align 16
  %9 = alloca [9 x double], align 16
  %10 = alloca %struct._MatNd, align 8
  %11 = alloca %struct._MatNd, align 8
  %12 = alloca %struct._MatNd, align 8
  %13 = alloca %struct._MatNd, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  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 72, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  %23 = getelementptr inbounds [9 x double], ptr %7, i64 0, i64 0
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %10, i32 noundef 3, i32 noundef 3, ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  %24 = getelementptr inbounds [9 x double], ptr %8, i64 0, i64 0
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %11, i32 noundef 3, i32 noundef 3, ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  %25 = getelementptr inbounds [9 x double], ptr %9, i64 0, i64 0
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %12, i32 noundef 3, i32 noundef 3, ptr noundef %25)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %13, i32 noundef 3, i32 noundef 3, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %27, i64 0
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = call double @sin(double noundef %29) #5
  store double %30, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds double, ptr %31, i64 0
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = call double @cos(double noundef %33) #5
  store double %34, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds double, ptr %35, i64 1
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = call double @sin(double noundef %37) #5
  store double %38, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds double, ptr %39, i64 1
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = call double @cos(double noundef %41) #5
  store double %42, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds double, ptr %43, i64 2
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = call double @sin(double noundef %45) #5
  store double %46, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds double, ptr %47, i64 2
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = call double @cos(double noundef %49) #5
  store double %50, ptr %19, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds double, ptr %52, i64 0
  store double 0.000000e+00, ptr %53, align 8, !tbaa !9
  %54 = load double, ptr %16, align 8, !tbaa !9
  %55 = fneg double %54
  %56 = load double, ptr %19, align 8, !tbaa !9
  %57 = fmul double %55, %56
  %58 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  %60 = getelementptr inbounds double, ptr %59, i64 1
  store double %57, ptr %60, align 8, !tbaa !9
  %61 = load double, ptr %17, align 8, !tbaa !9
  %62 = fneg double %61
  %63 = load double, ptr %18, align 8, !tbaa !9
  %64 = fmul double %62, %63
  %65 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = getelementptr inbounds double, ptr %66, i64 2
  store double %64, ptr %67, align 8, !tbaa !9
  %68 = load double, ptr %14, align 8, !tbaa !9
  %69 = fneg double %68
  %70 = load double, ptr %18, align 8, !tbaa !9
  %71 = load double, ptr %15, align 8, !tbaa !9
  %72 = load double, ptr %16, align 8, !tbaa !9
  %73 = fmul double %71, %72
  %74 = load double, ptr %19, align 8, !tbaa !9
  %75 = fmul double %73, %74
  %76 = fneg double %75
  %77 = call double @llvm.fmuladd.f64(double %69, double %70, double %76)
  %78 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = getelementptr inbounds double, ptr %79, i64 3
  store double %77, ptr %80, align 8, !tbaa !9
  %81 = load double, ptr %14, align 8, !tbaa !9
  %82 = load double, ptr %17, align 8, !tbaa !9
  %83 = fmul double %81, %82
  %84 = load double, ptr %19, align 8, !tbaa !9
  %85 = fmul double %83, %84
  %86 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  %88 = getelementptr inbounds double, ptr %87, i64 4
  store double %85, ptr %88, align 8, !tbaa !9
  %89 = load double, ptr %15, align 8, !tbaa !9
  %90 = load double, ptr %19, align 8, !tbaa !9
  %91 = load double, ptr %14, align 8, !tbaa !9
  %92 = load double, ptr %16, align 8, !tbaa !9
  %93 = fmul double %91, %92
  %94 = load double, ptr %18, align 8, !tbaa !9
  %95 = fmul double %93, %94
  %96 = fneg double %95
  %97 = call double @llvm.fmuladd.f64(double %89, double %90, double %96)
  %98 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !11
  %100 = getelementptr inbounds double, ptr %99, i64 5
  store double %97, ptr %100, align 8, !tbaa !9
  %101 = load double, ptr %15, align 8, !tbaa !9
  %102 = load double, ptr %18, align 8, !tbaa !9
  %103 = load double, ptr %14, align 8, !tbaa !9
  %104 = load double, ptr %16, align 8, !tbaa !9
  %105 = fmul double %103, %104
  %106 = load double, ptr %19, align 8, !tbaa !9
  %107 = fmul double %105, %106
  %108 = call double @llvm.fmuladd.f64(double %101, double %102, double %107)
  %109 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = getelementptr inbounds double, ptr %110, i64 6
  store double %108, ptr %111, align 8, !tbaa !9
  %112 = load double, ptr %15, align 8, !tbaa !9
  %113 = fneg double %112
  %114 = load double, ptr %17, align 8, !tbaa !9
  %115 = fmul double %113, %114
  %116 = load double, ptr %19, align 8, !tbaa !9
  %117 = fmul double %115, %116
  %118 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = getelementptr inbounds double, ptr %119, i64 7
  store double %117, ptr %120, align 8, !tbaa !9
  %121 = load double, ptr %14, align 8, !tbaa !9
  %122 = load double, ptr %19, align 8, !tbaa !9
  %123 = load double, ptr %15, align 8, !tbaa !9
  %124 = load double, ptr %16, align 8, !tbaa !9
  %125 = fmul double %123, %124
  %126 = load double, ptr %18, align 8, !tbaa !9
  %127 = fmul double %125, %126
  %128 = call double @llvm.fmuladd.f64(double %121, double %122, double %127)
  %129 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !11
  %131 = getelementptr inbounds double, ptr %130, i64 8
  store double %128, ptr %131, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = getelementptr inbounds double, ptr %133, i64 0
  store double 0.000000e+00, ptr %134, align 8, !tbaa !9
  %135 = load double, ptr %16, align 8, !tbaa !9
  %136 = load double, ptr %18, align 8, !tbaa !9
  %137 = fmul double %135, %136
  %138 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  %140 = getelementptr inbounds double, ptr %139, i64 1
  store double %137, ptr %140, align 8, !tbaa !9
  %141 = load double, ptr %17, align 8, !tbaa !9
  %142 = fneg double %141
  %143 = load double, ptr %19, align 8, !tbaa !9
  %144 = fmul double %142, %143
  %145 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !11
  %147 = getelementptr inbounds double, ptr %146, i64 2
  store double %144, ptr %147, align 8, !tbaa !9
  %148 = load double, ptr %14, align 8, !tbaa !9
  %149 = fneg double %148
  %150 = load double, ptr %19, align 8, !tbaa !9
  %151 = load double, ptr %15, align 8, !tbaa !9
  %152 = load double, ptr %16, align 8, !tbaa !9
  %153 = fmul double %151, %152
  %154 = load double, ptr %18, align 8, !tbaa !9
  %155 = fmul double %153, %154
  %156 = fneg double %155
  %157 = call double @llvm.fmuladd.f64(double %149, double %150, double %156)
  %158 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8, !tbaa !11
  %160 = getelementptr inbounds double, ptr %159, i64 3
  store double %157, ptr %160, align 8, !tbaa !9
  %161 = load double, ptr %14, align 8, !tbaa !9
  %162 = fneg double %161
  %163 = load double, ptr %17, align 8, !tbaa !9
  %164 = fmul double %162, %163
  %165 = load double, ptr %18, align 8, !tbaa !9
  %166 = fmul double %164, %165
  %167 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !11
  %169 = getelementptr inbounds double, ptr %168, i64 4
  store double %166, ptr %169, align 8, !tbaa !9
  %170 = load double, ptr %15, align 8, !tbaa !9
  %171 = fneg double %170
  %172 = load double, ptr %18, align 8, !tbaa !9
  %173 = load double, ptr %14, align 8, !tbaa !9
  %174 = load double, ptr %16, align 8, !tbaa !9
  %175 = fmul double %173, %174
  %176 = load double, ptr %19, align 8, !tbaa !9
  %177 = fmul double %175, %176
  %178 = fneg double %177
  %179 = call double @llvm.fmuladd.f64(double %171, double %172, double %178)
  %180 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !11
  %182 = getelementptr inbounds double, ptr %181, i64 5
  store double %179, ptr %182, align 8, !tbaa !9
  %183 = load double, ptr %15, align 8, !tbaa !9
  %184 = load double, ptr %19, align 8, !tbaa !9
  %185 = load double, ptr %14, align 8, !tbaa !9
  %186 = load double, ptr %16, align 8, !tbaa !9
  %187 = fmul double %185, %186
  %188 = load double, ptr %18, align 8, !tbaa !9
  %189 = fmul double %187, %188
  %190 = fneg double %189
  %191 = call double @llvm.fmuladd.f64(double %183, double %184, double %190)
  %192 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !11
  %194 = getelementptr inbounds double, ptr %193, i64 6
  store double %191, ptr %194, align 8, !tbaa !9
  %195 = load double, ptr %15, align 8, !tbaa !9
  %196 = load double, ptr %17, align 8, !tbaa !9
  %197 = fmul double %195, %196
  %198 = load double, ptr %18, align 8, !tbaa !9
  %199 = fmul double %197, %198
  %200 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !11
  %202 = getelementptr inbounds double, ptr %201, i64 7
  store double %199, ptr %202, align 8, !tbaa !9
  %203 = load double, ptr %14, align 8, !tbaa !9
  %204 = fneg double %203
  %205 = load double, ptr %18, align 8, !tbaa !9
  %206 = load double, ptr %15, align 8, !tbaa !9
  %207 = load double, ptr %16, align 8, !tbaa !9
  %208 = fmul double %206, %207
  %209 = load double, ptr %19, align 8, !tbaa !9
  %210 = fmul double %208, %209
  %211 = fneg double %210
  %212 = call double @llvm.fmuladd.f64(double %204, double %205, double %211)
  %213 = getelementptr inbounds %struct._MatNd, ptr %11, i32 0, i32 0
  %214 = load ptr, ptr %213, align 8, !tbaa !11
  %215 = getelementptr inbounds double, ptr %214, i64 8
  store double %212, ptr %215, align 8, !tbaa !9
  %216 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8, !tbaa !11
  %218 = getelementptr inbounds double, ptr %217, i64 0
  store double 0.000000e+00, ptr %218, align 8, !tbaa !9
  %219 = load double, ptr %17, align 8, !tbaa !9
  %220 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8, !tbaa !11
  %222 = getelementptr inbounds double, ptr %221, i64 1
  store double %219, ptr %222, align 8, !tbaa !9
  %223 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !11
  %225 = getelementptr inbounds double, ptr %224, i64 2
  store double 0.000000e+00, ptr %225, align 8, !tbaa !9
  %226 = load double, ptr %15, align 8, !tbaa !9
  %227 = fneg double %226
  %228 = load double, ptr %17, align 8, !tbaa !9
  %229 = fmul double %227, %228
  %230 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !11
  %232 = getelementptr inbounds double, ptr %231, i64 3
  store double %229, ptr %232, align 8, !tbaa !9
  %233 = load double, ptr %14, align 8, !tbaa !9
  %234 = load double, ptr %16, align 8, !tbaa !9
  %235 = fmul double %233, %234
  %236 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !11
  %238 = getelementptr inbounds double, ptr %237, i64 4
  store double %235, ptr %238, align 8, !tbaa !9
  %239 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %240 = load ptr, ptr %239, align 8, !tbaa !11
  %241 = getelementptr inbounds double, ptr %240, i64 5
  store double 0.000000e+00, ptr %241, align 8, !tbaa !9
  %242 = load double, ptr %14, align 8, !tbaa !9
  %243 = fneg double %242
  %244 = load double, ptr %17, align 8, !tbaa !9
  %245 = fmul double %243, %244
  %246 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %247 = load ptr, ptr %246, align 8, !tbaa !11
  %248 = getelementptr inbounds double, ptr %247, i64 6
  store double %245, ptr %248, align 8, !tbaa !9
  %249 = load double, ptr %15, align 8, !tbaa !9
  %250 = fneg double %249
  %251 = load double, ptr %16, align 8, !tbaa !9
  %252 = fmul double %250, %251
  %253 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %254 = load ptr, ptr %253, align 8, !tbaa !11
  %255 = getelementptr inbounds double, ptr %254, i64 7
  store double %252, ptr %255, align 8, !tbaa !9
  %256 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 0
  %257 = load ptr, ptr %256, align 8, !tbaa !11
  %258 = getelementptr inbounds double, ptr %257, i64 8
  store double 0.000000e+00, ptr %258, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = getelementptr inbounds [3 x double], ptr %259, i64 0
  %261 = getelementptr inbounds [3 x double], ptr %260, i64 0, i64 0
  store ptr %261, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %262 = load ptr, ptr %6, align 8, !tbaa !5
  %263 = getelementptr inbounds [3 x double], ptr %262, i64 1
  %264 = getelementptr inbounds [3 x double], ptr %263, i64 0, i64 0
  store ptr %264, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %265 = load ptr, ptr %6, align 8, !tbaa !5
  %266 = getelementptr inbounds [3 x double], ptr %265, i64 2
  %267 = getelementptr inbounds [3 x double], ptr %266, i64 0, i64 0
  store ptr %267, ptr %22, align 8, !tbaa !5
  %268 = load ptr, ptr %20, align 8, !tbaa !5
  call void @MatNd_columnCrossProductSelf(ptr noundef %10, ptr noundef %268)
  %269 = load ptr, ptr %21, align 8, !tbaa !5
  call void @MatNd_columnCrossProductSelf(ptr noundef %11, ptr noundef %269)
  %270 = load ptr, ptr %22, align 8, !tbaa !5
  call void @MatNd_columnCrossProductSelf(ptr noundef %12, ptr noundef %270)
  call void @MatNd_add(ptr noundef %13, ptr noundef %10, ptr noundef %11)
  call void @MatNd_addSelf(ptr noundef %13, ptr noundef %12)
  call void @MatNd_constMulSelf(ptr noundef %13, double noundef 5.000000e-01)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #5
  ret void
}

declare void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8, i32 noundef, i32 noundef, ptr noundef) #4

declare void @MatNd_columnCrossProductSelf(ptr noundef, ptr noundef) #4

declare void @MatNd_add(ptr noundef, ptr noundef, ptr noundef) #4

declare void @MatNd_addSelf(ptr noundef, ptr noundef) #4

declare void @MatNd_constMulSelf(ptr noundef, double noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = { "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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_MatNd", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !14, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}


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

%struct._MatNd = type { ptr, i32, i32, i32, i8 }

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @Mat3d_dEulerErrorDx(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca [9 x double], align 16
  %5 = alloca [9 x double], align 16
  %6 = alloca [9 x double], align 16
  %7 = alloca %struct._MatNd, align 8
  %8 = alloca %struct._MatNd, align 8
  %9 = alloca %struct._MatNd, align 8
  %10 = alloca %struct._MatNd, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %7, i32 noundef 3, i32 noundef 3, ptr noundef nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %8, i32 noundef 3, i32 noundef 3, ptr noundef nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %9, i32 noundef 3, i32 noundef 3, ptr noundef nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %10, i32 noundef 3, i32 noundef 3, ptr noundef %0) #6
  %11 = load double, ptr %1, align 8, !tbaa !5
  %12 = call double @sin(double noundef %11) #6
  %13 = load double, ptr %1, align 8, !tbaa !5
  %14 = call double @cos(double noundef %13) #6
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load double, ptr %15, align 8, !tbaa !5
  %17 = call double @sin(double noundef %16) #6
  %18 = load double, ptr %15, align 8, !tbaa !5
  %19 = call double @cos(double noundef %18) #6
  %20 = getelementptr inbounds i8, ptr %1, i64 16
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = call double @sin(double noundef %21) #6
  %23 = load double, ptr %20, align 8, !tbaa !5
  %24 = call double @cos(double noundef %23) #6
  %25 = load ptr, ptr %7, align 8, !tbaa !9
  store double 0.000000e+00, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = insertelement <2 x double> poison, double %17, i64 0
  %28 = insertelement <2 x double> %27, double %19, i64 1
  %29 = fneg <2 x double> %28
  %30 = insertelement <2 x double> poison, double %24, i64 0
  %31 = insertelement <2 x double> %30, double %22, i64 1
  %32 = fmul <2 x double> %31, %29
  store <2 x double> %32, ptr %26, align 8, !tbaa !5
  %33 = fmul double %14, %17
  %34 = fneg double %33
  %35 = fmul double %24, %34
  %36 = getelementptr inbounds i8, ptr %25, i64 24
  %37 = fmul double %12, %19
  %38 = fmul double %37, %24
  %39 = getelementptr inbounds i8, ptr %25, i64 32
  store double %38, ptr %39, align 8, !tbaa !5
  %40 = fmul double %12, %17
  %41 = fneg double %40
  %42 = getelementptr inbounds i8, ptr %25, i64 40
  %43 = insertelement <2 x double> poison, double %22, i64 0
  %44 = insertelement <2 x double> %43, double %40, i64 1
  %45 = insertelement <2 x double> poison, double %41, i64 0
  %46 = insertelement <2 x double> %45, double %24, i64 1
  %47 = fmul <2 x double> %44, %46
  %48 = insertelement <2 x double> poison, double %14, i64 0
  %49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
  %50 = shufflevector <2 x double> %46, <2 x double> %43, <2 x i32> <i32 1, i32 2>
  %51 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %50, <2 x double> %47)
  store <2 x double> %51, ptr %42, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %25, i64 56
  %53 = fmul double %33, %22
  %54 = call double @llvm.fmuladd.f64(double %12, double %24, double %53)
  %55 = getelementptr inbounds i8, ptr %25, i64 64
  store double %54, ptr %55, align 8, !tbaa !5
  %56 = load ptr, ptr %8, align 8, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  %58 = insertelement <2 x double> %27, double %24, i64 1
  %59 = insertelement <2 x double> %29, double %22, i64 0
  %60 = fmul <2 x double> %58, %59
  %61 = fneg double %53
  %62 = getelementptr inbounds i8, ptr %56, i64 24
  %63 = getelementptr inbounds i8, ptr %56, i64 32
  %64 = extractelement <2 x double> %47, i64 1
  %65 = fneg double %64
  %66 = getelementptr inbounds i8, ptr %56, i64 40
  %67 = getelementptr inbounds i8, ptr %56, i64 48
  %68 = extractelement <2 x double> %51, i64 0
  %69 = fmul double %14, %19
  %70 = fmul double %69, %22
  %71 = getelementptr inbounds i8, ptr %56, i64 56
  %72 = getelementptr inbounds i8, ptr %56, i64 64
  %73 = load ptr, ptr %9, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = getelementptr inbounds i8, ptr %73, i64 16
  %76 = getelementptr inbounds i8, ptr %73, i64 24
  %77 = getelementptr inbounds i8, ptr %73, i64 32
  %78 = getelementptr inbounds i8, ptr %73, i64 40
  %79 = getelementptr inbounds i8, ptr %73, i64 48
  %80 = insertelement <2 x double> poison, double %12, i64 0
  %81 = insertelement <2 x double> %80, double %14, i64 1
  %82 = fneg <2 x double> %81
  %83 = extractelement <2 x double> %82, i64 0
  %84 = call double @llvm.fmuladd.f64(double %83, double %22, double %35)
  store double %84, ptr %36, align 8, !tbaa !5
  %85 = extractelement <2 x double> %82, i64 1
  %86 = fmul double %19, %85
  %87 = fmul double %86, %24
  store double %87, ptr %52, align 8, !tbaa !5
  store double 0.000000e+00, ptr %56, align 8, !tbaa !5
  store <2 x double> %60, ptr %57, align 8, !tbaa !5
  %88 = call double @llvm.fmuladd.f64(double %83, double %24, double %61)
  store double %88, ptr %62, align 8, !tbaa !5
  %89 = insertelement <2 x double> poison, double %19, i64 0
  %90 = insertelement <2 x double> %89, double %17, i64 1
  %91 = fmul <2 x double> %90, %82
  %92 = extractelement <2 x double> %91, i64 0
  %93 = fmul double %92, %22
  store double %93, ptr %63, align 8, !tbaa !5
  %94 = call double @llvm.fmuladd.f64(double %85, double %22, double %65)
  store double %94, ptr %66, align 8, !tbaa !5
  store double %68, ptr %67, align 8, !tbaa !5
  store double %70, ptr %71, align 8, !tbaa !5
  store double %84, ptr %72, align 8, !tbaa !5
  store double 0.000000e+00, ptr %73, align 8, !tbaa !5
  store double %19, ptr %74, align 8, !tbaa !5
  store double 0.000000e+00, ptr %75, align 8, !tbaa !5
  store double %86, ptr %76, align 8, !tbaa !5
  store double %40, ptr %77, align 8, !tbaa !5
  store double 0.000000e+00, ptr %78, align 8, !tbaa !5
  store <2 x double> %91, ptr %79, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %73, i64 64
  store double 0.000000e+00, ptr %95, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %2, i64 24
  %97 = getelementptr inbounds i8, ptr %2, i64 48
  call void @MatNd_columnCrossProductSelf(ptr noundef nonnull %7, ptr noundef %2) #6
  call void @MatNd_columnCrossProductSelf(ptr noundef nonnull %8, ptr noundef nonnull %96) #6
  call void @MatNd_columnCrossProductSelf(ptr noundef nonnull %9, ptr noundef nonnull %97) #6
  call void @MatNd_add(ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8) #6
  call void @MatNd_addSelf(ptr noundef nonnull %10, ptr noundef nonnull %9) #6
  call void @MatNd_constMulSelf(ptr noundef nonnull %10, double noundef 5.000000e-01) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #6
  ret void
}

declare void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @MatNd_columnCrossProductSelf(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @MatNd_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @MatNd_addSelf(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @MatNd_constMulSelf(ptr noundef, double noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_MatNd", !11, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !13, i64 20}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass