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

; 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 }
%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.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 void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8, i32 noundef, i32 noundef, ptr noundef) #1

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 ptr @MatNd_getRowPtr(ptr noundef, i32 noundef) #1

declare void @MatNd_reshape(ptr noundef, i32 noundef, i32 noundef) #1

declare void @MatNd_setZero(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @RcsBody_massMatrix(ptr noundef, ptr noundef) #3

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

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) #1

declare void @MatNd_destroy(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_computeMassMatrix(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct._MatNd, align 8
  %11 = alloca %struct._MatNd, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct._RcsGraph, ptr %13, i32 0, i32 3
  %15 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %15, ptr %5, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 36, ptr %8, align 4, !tbaa !12
  %16 = load i32, ptr %8, align 4, !tbaa !12
  %17 = zext i32 %16 to i64
  %18 = mul i64 %17, 8
  %19 = add i64 24, %18
  %20 = alloca i8, i64 %19, align 16
  store ptr %20, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._MatNd, ptr %21, i64 1
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._MatNd, ptr %23, i32 0, i32 0
  store ptr %22, ptr %24, align 8, !tbaa !13
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._MatNd, ptr %25, i32 0, i32 1
  store i32 6, ptr %26, align 8, !tbaa !16
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._MatNd, ptr %27, i32 0, i32 2
  store i32 6, ptr %28, align 4, !tbaa !17
  %29 = load i32, ptr %8, align 4, !tbaa !12
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._MatNd, ptr %30, i32 0, i32 3
  store i32 %29, ptr %31, align 8, !tbaa !18
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._MatNd, ptr %32, i32 0, i32 4
  store i8 1, ptr %33, align 4, !tbaa !19
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._MatNd, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  %37 = load i32, ptr %8, align 4, !tbaa !12
  %38 = zext i32 %37 to i64
  %39 = mul i64 %38, 8
  call void @llvm.memset.p0.i64(ptr align 8 %36, i8 0, i64 %39, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %40 = load i32, ptr %5, align 4, !tbaa !12
  %41 = mul nsw i32 6, %40
  %42 = icmp sgt i32 %41, 1296
  br i1 %42, label %43, label %46

43:                                               ; preds = %2
  %44 = load i32, ptr %5, align 4, !tbaa !12
  %45 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %44)
  store ptr %45, ptr %7, align 8, !tbaa !5
  br label %81

46:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %47 = load i32, ptr %5, align 4, !tbaa !12
  %48 = mul nsw i32 6, %47
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %46
  br label %54

51:                                               ; preds = %46
  %52 = load i32, ptr %5, align 4, !tbaa !12
  %53 = mul nsw i32 6, %52
  br label %54

54:                                               ; preds = %51, %50
  %55 = phi i32 [ 1, %50 ], [ %53, %51 ]
  store i32 %55, ptr %9, align 4, !tbaa !12
  %56 = load i32, ptr %9, align 4, !tbaa !12
  %57 = zext i32 %56 to i64
  %58 = mul i64 %57, 8
  %59 = add i64 24, %58
  %60 = alloca i8, i64 %59, align 16
  store ptr %60, ptr %7, align 8, !tbaa !5
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._MatNd, ptr %61, i64 1
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._MatNd, ptr %63, i32 0, i32 0
  store ptr %62, ptr %64, align 8, !tbaa !13
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._MatNd, ptr %65, i32 0, i32 1
  store i32 6, ptr %66, align 8, !tbaa !16
  %67 = load i32, ptr %5, align 4, !tbaa !12
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._MatNd, ptr %68, i32 0, i32 2
  store i32 %67, ptr %69, align 4, !tbaa !17
  %70 = load i32, ptr %9, align 4, !tbaa !12
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._MatNd, ptr %71, i32 0, i32 3
  store i32 %70, ptr %72, align 8, !tbaa !18
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._MatNd, ptr %73, i32 0, i32 4
  store i8 1, ptr %74, align 4, !tbaa !19
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._MatNd, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !13
  %78 = load i32, ptr %9, align 4, !tbaa !12
  %79 = zext i32 %78 to i64
  %80 = mul i64 %79, 8
  call void @llvm.memset.p0.i64(ptr align 8 %77, i8 0, i64 %80, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %81

81:                                               ; preds = %54, %43
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  %82 = load i32, ptr %5, align 4, !tbaa !12
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = call ptr @MatNd_getRowPtr(ptr noundef %83, i32 noundef 0)
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %10, i32 noundef 3, i32 noundef %82, ptr noundef %84)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  %85 = load i32, ptr %5, align 4, !tbaa !12
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = call ptr @MatNd_getRowPtr(ptr noundef %86, i32 noundef 3)
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %11, i32 noundef 3, i32 noundef %85, ptr noundef %87)
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !12
  %90 = load i32, ptr %5, align 4, !tbaa !12
  call void @MatNd_reshape(ptr noundef %88, i32 noundef %89, i32 noundef %90)
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  call void @MatNd_setZero(ptr noundef %91)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._RcsGraph, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !20
  store ptr %94, ptr %12, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %120, %81
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %99, label %98

98:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %123

99:                                               ; preds = %95
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._RcsBody, ptr %100, i32 0, i32 0
  %102 = load double, ptr %101, align 8, !tbaa !21
  %103 = fcmp oeq double %102, 0.000000e+00
  br i1 %103, label %104, label %105

104:                                              ; preds = %99
  br label %120

105:                                              ; preds = %99
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._RcsBody, ptr %108, i32 0, i32 11
  %110 = load ptr, ptr %109, align 8, !tbaa !24
  %111 = getelementptr inbounds %struct.HTr, ptr %110, i32 0, i32 0
  %112 = getelementptr inbounds [3 x double], ptr %111, i64 0, i64 0
  call void @RcsGraph_bodyPointJacobian(ptr noundef %106, ptr noundef %107, ptr noundef %112, ptr noundef null, ptr noundef %10)
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  call void @RcsGraph_rotationJacobian(ptr noundef %113, ptr noundef %114, ptr noundef null, ptr noundef %11)
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  call void @RcsBody_massMatrix(ptr noundef %115, ptr noundef %116)
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  call void @MatNd_sqrMulAndAddAtBA(ptr noundef %117, ptr noundef %118, ptr noundef %119)
  br label %120

120:                                              ; preds = %105, %104
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef %121)
  store ptr %122, ptr %12, align 8, !tbaa !5
  br label %95, !llvm.loop !25

123:                                              ; preds = %98
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %124)
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %125)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

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 = !{!10, !6, i64 0}
!21 = !{!22, !23, i64 0}
!22 = !{!"_RcsBody", !23, i64 0, !15, i64 8, !11, i64 12, !7, i64 16, !7, i64 40, !23, 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}
!23 = !{!"double", !7, i64 0}
!24 = !{!22, !6, i64 112}
!25 = distinct !{!25, !26}
!26 = !{!"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"

%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

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

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 ptr @MatNd_getRowPtr(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @MatNd_reshape(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @MatNd_setZero(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @RcsBody_massMatrix(ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) local_unnamed_addr #1

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_computeMassMatrix(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca %struct._MatNd, align 8
  %4 = alloca %struct._MatNd, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 1852
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = alloca [312 x i8], align 16
  %8 = getelementptr inbounds i8, ptr %7, i64 24
  store ptr %8, ptr %7, align 16, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 6, ptr %9, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %7, i64 12
  store i32 6, ptr %10, align 4, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 36, ptr %11, align 16, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %7, i64 20
  store i8 1, ptr %12, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(288) %8, i8 0, i64 288, i1 false)
  %13 = icmp sgt i32 %6, 216
  br i1 %13, label %14, label %16

14:                                               ; preds = %2
  %15 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %6) #4
  br label %29

16:                                               ; preds = %2
  %17 = mul nsw i32 %6, 6
  %18 = icmp eq i32 %6, 0
  %19 = select i1 %18, i32 1, i32 %17
  %20 = zext i32 %19 to i64
  %21 = shl nuw nsw i64 %20, 3
  %22 = add nuw nsw i64 %21, 24
  %23 = alloca i8, i64 %22, align 16
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  store ptr %24, ptr %23, align 16, !tbaa !11
  %25 = getelementptr inbounds i8, ptr %23, i64 8
  store i32 6, ptr %25, align 8, !tbaa !14
  %26 = getelementptr inbounds i8, ptr %23, i64 12
  store i32 %6, ptr %26, align 4, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %23, i64 16
  store i32 %19, ptr %27, align 16, !tbaa !16
  %28 = getelementptr inbounds i8, ptr %23, i64 20
  store i8 1, ptr %28, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %24, i8 0, i64 %21, i1 false)
  br label %29

29:                                               ; preds = %16, %14
  %.049 = phi ptr [ %15, %14 ], [ %23, %16 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  %30 = call ptr @MatNd_getRowPtr(ptr noundef %.049, i32 noundef 0) #4
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %3, i32 noundef 3, i32 noundef %6, ptr noundef %30) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  %31 = call ptr @MatNd_getRowPtr(ptr noundef %.049, i32 noundef 3) #4
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %4, i32 noundef 3, i32 noundef %6, ptr noundef %31) #4
  call void @MatNd_reshape(ptr noundef %1, i32 noundef %6, i32 noundef %6) #4
  call void @MatNd_setZero(ptr noundef %1) #4
  %32 = load ptr, ptr %0, align 8, !tbaa !18
  %.not51 = icmp eq ptr %32, null
  br i1 %.not51, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %38, %29
  call void @MatNd_destroy(ptr noundef nonnull %7) #4
  call void @MatNd_destroy(ptr noundef %.049) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  ret void

.lr.ph:                                           ; preds = %29, %38
  %.052 = phi ptr [ %39, %38 ], [ %32, %29 ]
  %33 = load double, ptr %.052, align 8, !tbaa !19
  %34 = fcmp oeq double %33, 0.000000e+00
  br i1 %34, label %38, label %35

35:                                               ; preds = %.lr.ph
  %36 = getelementptr inbounds i8, ptr %.052, i64 112
  %37 = load ptr, ptr %36, align 8, !tbaa !22
  call void @RcsGraph_bodyPointJacobian(ptr noundef nonnull %0, ptr noundef nonnull %.052, ptr noundef %37, ptr noundef null, ptr noundef nonnull %3) #4
  call void @RcsGraph_rotationJacobian(ptr noundef nonnull %0, ptr noundef nonnull %.052, ptr noundef null, ptr noundef nonnull %4) #4
  call void @RcsBody_massMatrix(ptr noundef nonnull %.052, ptr noundef nonnull %7)
  call void @MatNd_sqrMulAndAddAtBA(ptr noundef %1, ptr noundef %.049, ptr noundef nonnull %7) #4
  br label %38

38:                                               ; preds = %.lr.ph, %35
  %39 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef nonnull %.052) #4
  %.not = icmp eq ptr %39, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23
}

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 = { 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 = !{!6, !7, i64 0}
!19 = !{!20, !21, i64 0}
!20 = !{!"_RcsBody", !21, i64 0, !13, i64 8, !10, i64 12, !8, i64 16, !8, i64 40, !21, 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}
!21 = !{!"double", !8, i64 0}
!22 = !{!20, !7, i64 112}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass