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

; 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._RcsGraph = type { ptr, [10 x %struct._RcsBody], i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct._RcsBody = type { double, i8, i32, [3 x double], [3 x double], double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._MatNd = type { ptr, i32, i32, i32, i8 }
%struct.HTr = type { [3 x double], [3 x [3 x double]] }

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

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

declare ptr @MatNd_create(i32 noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @MatNd_mul(ptr noundef, ptr noundef, ptr noundef) #1

declare void @MatNd_destroy(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @RcsGraph_dAdq(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #3

declare void @MatNd_transposeSelf(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_dEulerErrorDq(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca [3 x [3 x double]], align 16
  %14 = alloca [3 x [3 x double]], align 16
  %15 = alloca [3 x [3 x double]], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._RcsGraph, ptr %16, i32 0, i32 3
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = mul i32 18, %18
  %20 = icmp ugt i32 %19, 1296
  br i1 %20, label %21, label %26

21:                                               ; preds = %4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._RcsGraph, ptr %22, i32 0, i32 3
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = call ptr @MatNd_create(i32 noundef 18, i32 noundef %24)
  store ptr %25, ptr %9, align 8, !tbaa !5
  br label %67

26:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._RcsGraph, ptr %27, i32 0, i32 3
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = mul i32 18, %29
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %26
  br label %38

33:                                               ; preds = %26
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._RcsGraph, ptr %34, i32 0, i32 3
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = mul i32 18, %36
  br label %38

38:                                               ; preds = %33, %32
  %39 = phi i32 [ 1, %32 ], [ %37, %33 ]
  store i32 %39, ptr %10, align 4, !tbaa !12
  %40 = load i32, ptr %10, align 4, !tbaa !12
  %41 = zext i32 %40 to i64
  %42 = mul i64 %41, 8
  %43 = add i64 24, %42
  %44 = alloca i8, i64 %43, align 16
  store ptr %44, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._MatNd, ptr %45, i64 1
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._MatNd, ptr %47, i32 0, i32 0
  store ptr %46, ptr %48, align 8, !tbaa !13
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._MatNd, ptr %49, i32 0, i32 1
  store i32 18, ptr %50, align 8, !tbaa !16
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._RcsGraph, ptr %51, i32 0, i32 3
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._MatNd, ptr %54, i32 0, i32 2
  store i32 %53, ptr %55, align 4, !tbaa !17
  %56 = load i32, ptr %10, align 4, !tbaa !12
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._MatNd, ptr %57, i32 0, i32 3
  store i32 %56, ptr %58, align 8, !tbaa !18
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._MatNd, ptr %59, i32 0, i32 4
  store i8 1, ptr %60, align 4, !tbaa !19
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._MatNd, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !13
  %64 = load i32, ptr %10, align 4, !tbaa !12
  %65 = zext i32 %64 to i64
  %66 = mul i64 %65, 8
  call void @llvm.memset.p0.i64(ptr align 8 %63, i8 0, i64 %66, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %67

67:                                               ; preds = %38, %21
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._MatNd, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !13
  %73 = getelementptr inbounds double, ptr %72, i64 0
  call void @RcsGraph_dAdq(ptr noundef %68, ptr noundef %69, ptr noundef %73, i1 noundef zeroext false)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._MatNd, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !13
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._RcsGraph, ptr %79, i32 0, i32 3
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = mul i32 9, %81
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds double, ptr %78, i64 %83
  call void @RcsGraph_dAdq(ptr noundef %74, ptr noundef %75, ptr noundef %84, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 54, ptr %12, align 4, !tbaa !12
  %85 = load i32, ptr %12, align 4, !tbaa !12
  %86 = zext i32 %85 to i64
  %87 = mul i64 %86, 8
  %88 = add i64 24, %87
  %89 = alloca i8, i64 %88, align 16
  store ptr %89, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._MatNd, ptr %90, i64 1
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._MatNd, ptr %92, i32 0, i32 0
  store ptr %91, ptr %93, align 8, !tbaa !13
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._MatNd, ptr %94, i32 0, i32 1
  store i32 18, ptr %95, align 8, !tbaa !16
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MatNd, ptr %96, i32 0, i32 2
  store i32 3, ptr %97, align 4, !tbaa !17
  %98 = load i32, ptr %12, align 4, !tbaa !12
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._MatNd, ptr %99, i32 0, i32 3
  store i32 %98, ptr %100, align 8, !tbaa !18
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._MatNd, ptr %101, i32 0, i32 4
  store i8 1, ptr %102, align 4, !tbaa !19
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._MatNd, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !13
  %106 = load i32, ptr %12, align 4, !tbaa !12
  %107 = zext i32 %106 to i64
  %108 = mul i64 %107, 8
  call void @llvm.memset.p0.i64(ptr align 8 %105, i8 0, i64 %108, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 72, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 72, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 72, ptr %15) #4
  %109 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  call void @Mat3d_setIdentity(ptr noundef %109)
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %119

112:                                              ; preds = %67
  %113 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 0
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._RcsBody, ptr %114, i32 0, i32 10
  %116 = load ptr, ptr %115, align 8, !tbaa !20
  %117 = getelementptr inbounds %struct.HTr, ptr %116, i32 0, i32 1
  %118 = getelementptr inbounds [3 x [3 x double]], ptr %117, i64 0, i64 0
  call void @Mat3d_copy(ptr noundef %113, ptr noundef %118)
  br label %121

119:                                              ; preds = %67
  %120 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  call void @Mat3d_setIdentity(ptr noundef %120)
  br label %121

121:                                              ; preds = %119, %112
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %131

124:                                              ; preds = %121
  %125 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._RcsBody, ptr %126, i32 0, i32 10
  %128 = load ptr, ptr %127, align 8, !tbaa !20
  %129 = getelementptr inbounds %struct.HTr, ptr %128, i32 0, i32 1
  %130 = getelementptr inbounds [3 x [3 x double]], ptr %129, i64 0, i64 0
  call void @Mat3d_copy(ptr noundef %125, ptr noundef %130)
  br label %133

131:                                              ; preds = %121
  %132 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  call void @Mat3d_setIdentity(ptr noundef %132)
  br label %133

133:                                              ; preds = %131, %124
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._MatNd, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !13
  %137 = getelementptr inbounds double, ptr %136, i64 0
  %138 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %139 = getelementptr inbounds [3 x double], ptr %138, i64 0, i64 0
  call void @Mat3d_skew(ptr noundef %137, ptr noundef %139)
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._MatNd, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !13
  %143 = getelementptr inbounds double, ptr %142, i64 9
  %144 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 1
  %145 = getelementptr inbounds [3 x double], ptr %144, i64 0, i64 0
  call void @Mat3d_skew(ptr noundef %143, ptr noundef %145)
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._MatNd, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !13
  %149 = getelementptr inbounds double, ptr %148, i64 18
  %150 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 2
  %151 = getelementptr inbounds [3 x double], ptr %150, i64 0, i64 0
  call void @Mat3d_skew(ptr noundef %149, ptr noundef %151)
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._MatNd, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !13
  %155 = getelementptr inbounds double, ptr %154, i64 27
  %156 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 0
  %157 = getelementptr inbounds [3 x double], ptr %156, i64 0, i64 0
  call void @Mat3d_transposeSkew(ptr noundef %155, ptr noundef %157)
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._MatNd, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !13
  %161 = getelementptr inbounds double, ptr %160, i64 36
  %162 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 1
  %163 = getelementptr inbounds [3 x double], ptr %162, i64 0, i64 0
  call void @Mat3d_transposeSkew(ptr noundef %161, ptr noundef %163)
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._MatNd, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !13
  %167 = getelementptr inbounds double, ptr %166, i64 45
  %168 = getelementptr inbounds [3 x [3 x double]], ptr %13, i64 0, i64 2
  %169 = getelementptr inbounds [3 x double], ptr %168, i64 0, i64 0
  call void @Mat3d_transposeSkew(ptr noundef %167, ptr noundef %169)
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  call void @MatNd_transposeSelf(ptr noundef %170)
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %171, ptr noundef %172, ptr noundef %173)
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  call void @MatNd_constMulSelf(ptr noundef %174, double noundef 5.000000e-01)
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %175)
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %176)
  call void @llvm.lifetime.end.p0(i64 72, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret void
}

declare void @Mat3d_setIdentity(ptr noundef) #1

declare void @Mat3d_copy(ptr noundef, ptr noundef) #1

declare void @Mat3d_skew(ptr noundef, ptr noundef) #1

declare void @Mat3d_transposeSkew(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 nounwind willreturn memory(argmem: write) }
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 = { 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, !11, i64 1852}
!10 = !{!"_RcsGraph", !6, i64 0, !7, i64 8, !11, i64 1848, !11, i64 1852, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_MatNd", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !15, i64 20}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!14, !11, i64 8}
!17 = !{!14, !11, i64 12}
!18 = !{!14, !11, i64 16}
!19 = !{!14, !15, i64 20}
!20 = !{!21, !6, i64 104}
!21 = !{!"_RcsBody", !22, i64 0, !15, i64 8, !11, i64 12, !7, i64 16, !7, i64 40, !22, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!22 = !{!"double", !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"

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

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

declare ptr @MatNd_create(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @MatNd_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @RcsGraph_dAdq(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

declare void @MatNd_transposeSelf(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_dEulerErrorDq(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca [3 x [3 x double]], align 16
  %6 = alloca [3 x [3 x double]], align 16
  %7 = alloca [3 x [3 x double]], align 16
  %8 = getelementptr inbounds i8, ptr %0, i64 1852
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = mul i32 %9, 18
  %11 = icmp ugt i32 %10, 1296
  br i1 %11, label %12, label %14

12:                                               ; preds = %4
  %13 = tail call ptr @MatNd_create(i32 noundef 18, i32 noundef %9) #5
  %.pre = load ptr, ptr %13, align 8, !tbaa !11
  br label %24

14:                                               ; preds = %4
  %spec.select = tail call i32 @llvm.umax.i32(i32 %10, i32 1)
  %15 = shl nuw nsw i32 %spec.select, 3
  %16 = zext nneg i32 %15 to i64
  %17 = add nuw nsw i64 %16, 24
  %18 = alloca i8, i64 %17, align 16
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  store ptr %19, ptr %18, align 16, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %18, i64 8
  store i32 18, ptr %20, align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %18, i64 12
  store i32 %9, ptr %21, align 4, !tbaa !15
  %22 = getelementptr inbounds i8, ptr %18, i64 16
  store i32 %spec.select, ptr %22, align 16, !tbaa !16
  %23 = getelementptr inbounds i8, ptr %18, i64 20
  store i8 1, ptr %23, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %19, i8 0, i64 %16, i1 false)
  br label %24

24:                                               ; preds = %14, %12
  %25 = phi ptr [ %.pre, %12 ], [ %19, %14 ]
  %.0 = phi ptr [ %13, %12 ], [ %18, %14 ]
  call void @RcsGraph_dAdq(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %25, i1 noundef zeroext false)
  %26 = load ptr, ptr %.0, align 8, !tbaa !11
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = mul i32 %27, 9
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds double, ptr %26, i64 %29
  call void @RcsGraph_dAdq(ptr noundef nonnull %0, ptr noundef %2, ptr noundef %30, i1 noundef zeroext false)
  %31 = alloca [456 x i8], align 16
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  store ptr %32, ptr %31, align 16, !tbaa !11
  %33 = getelementptr inbounds i8, ptr %31, i64 8
  store i32 18, ptr %33, align 8, !tbaa !14
  %34 = getelementptr inbounds i8, ptr %31, i64 12
  store i32 3, ptr %34, align 4, !tbaa !15
  %35 = getelementptr inbounds i8, ptr %31, i64 16
  store i32 54, ptr %35, align 16, !tbaa !16
  %36 = getelementptr inbounds i8, ptr %31, i64 20
  store i8 1, ptr %36, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(432) %32, i8 0, i64 432, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #5
  call void @Mat3d_setIdentity(ptr noundef nonnull %7) #5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %41, label %37

37:                                               ; preds = %24
  %38 = getelementptr inbounds i8, ptr %1, i64 104
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  %40 = getelementptr inbounds i8, ptr %39, i64 24
  call void @Mat3d_copy(ptr noundef nonnull %5, ptr noundef nonnull %40) #5
  br label %42

41:                                               ; preds = %24
  call void @Mat3d_setIdentity(ptr noundef nonnull %7) #5
  br label %42

42:                                               ; preds = %41, %37
  %.not51 = icmp eq ptr %2, null
  br i1 %.not51, label %47, label %43

43:                                               ; preds = %42
  %44 = getelementptr inbounds i8, ptr %2, i64 104
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = getelementptr inbounds i8, ptr %45, i64 24
  call void @Mat3d_copy(ptr noundef nonnull %6, ptr noundef nonnull %46) #5
  br label %48

47:                                               ; preds = %42
  call void @Mat3d_setIdentity(ptr noundef nonnull %7) #5
  br label %48

48:                                               ; preds = %47, %43
  %49 = load ptr, ptr %31, align 16, !tbaa !11
  call void @Mat3d_skew(ptr noundef %49, ptr noundef nonnull %6) #5
  %50 = load ptr, ptr %31, align 16, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %50, i64 72
  %52 = getelementptr inbounds i8, ptr %6, i64 24
  call void @Mat3d_skew(ptr noundef nonnull %51, ptr noundef nonnull %52) #5
  %53 = load ptr, ptr %31, align 16, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %53, i64 144
  %55 = getelementptr inbounds i8, ptr %6, i64 48
  call void @Mat3d_skew(ptr noundef nonnull %54, ptr noundef nonnull %55) #5
  %56 = load ptr, ptr %31, align 16, !tbaa !11
  %57 = getelementptr inbounds i8, ptr %56, i64 216
  call void @Mat3d_transposeSkew(ptr noundef nonnull %57, ptr noundef nonnull %5) #5
  %58 = load ptr, ptr %31, align 16, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %58, i64 288
  %60 = getelementptr inbounds i8, ptr %5, i64 24
  call void @Mat3d_transposeSkew(ptr noundef nonnull %59, ptr noundef nonnull %60) #5
  %61 = load ptr, ptr %31, align 16, !tbaa !11
  %62 = getelementptr inbounds i8, ptr %61, i64 360
  %63 = getelementptr inbounds i8, ptr %5, i64 48
  call void @Mat3d_transposeSkew(ptr noundef nonnull %62, ptr noundef nonnull %63) #5
  call void @MatNd_transposeSelf(ptr noundef nonnull %31) #5
  call void @MatNd_mul(ptr noundef %3, ptr noundef nonnull %31, ptr noundef nonnull %.0) #5
  call void @MatNd_constMulSelf(ptr noundef %3, double noundef 5.000000e-01) #5
  call void @MatNd_destroy(ptr noundef nonnull %.0) #5
  call void @MatNd_destroy(ptr noundef nonnull %31) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #5
  ret void
}

declare void @Mat3d_setIdentity(ptr noundef) local_unnamed_addr #1

declare void @Mat3d_copy(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @Mat3d_skew(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @Mat3d_transposeSkew(ptr noundef, ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !10, i64 1852}
!6 = !{!"_RcsGraph", !7, i64 0, !8, i64 8, !10, i64 1848, !10, i64 1852, !7, i64 1856, !7, i64 1864, !7, i64 1872, !7, i64 1880, !7, i64 1888}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 12}
!16 = !{!12, !10, i64 16}
!17 = !{!12, !13, i64 20}
!18 = !{!19, !7, i64 104}
!19 = !{!"_RcsBody", !20, i64 0, !13, i64 8, !10, i64 12, !8, i64 16, !8, i64 40, !20, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!20 = !{!"double", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass