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

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

declare ptr @RcsBody_lastJointBeforeBody(ptr noundef) #1

declare zeroext i1 @RcsJoint_isRotation(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_rotationHessian(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca [3 x double], align 16
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  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 4, ptr %9) #3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._RcsGraph, ptr %17, i32 0, i32 3
  %19 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %19, ptr %9, align 4, !tbaa !12
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = load i32, ptr %9, align 4, !tbaa !12
  %22 = mul nsw i32 %21, 3
  %23 = load i32, ptr %9, align 4, !tbaa !12
  call void @MatNd_reshapeAndSetZero(ptr noundef %20, i32 noundef %22, i32 noundef %23)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call ptr @RcsBody_lastJointBeforeBody(ptr noundef %24)
  store ptr %25, ptr %10, align 8, !tbaa !5
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %4
  store i32 1, ptr %11, align 4
  br label %142

29:                                               ; preds = %4
  br label %30

30:                                               ; preds = %137, %45, %29
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %141

33:                                               ; preds = %30
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._RcsJoint, ptr %34, i32 0, i32 8
  %36 = load i8, ptr %35, align 8, !tbaa !13, !range !18, !noundef !19
  %37 = trunc i8 %36 to i1
  %38 = zext i1 %37 to i32
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %45, label %40

40:                                               ; preds = %33
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = call zeroext i1 @RcsJoint_isRotation(ptr noundef %41)
  %43 = zext i1 %42 to i32
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %49

45:                                               ; preds = %40, %33
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._RcsJoint, ptr %46, i32 0, i32 22
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  store ptr %48, ptr %10, align 8, !tbaa !5
  br label %30, !llvm.loop !21

49:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %50, ptr %12, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %133, %49
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %137

54:                                               ; preds = %51
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = call zeroext i1 @RcsJoint_isRotation(ptr noundef %55)
  br i1 %56, label %57, label %133

57:                                               ; preds = %54
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._RcsJoint, ptr %58, i32 0, i32 8
  %60 = load i8, ptr %59, align 8, !tbaa !13, !range !18, !noundef !19
  %61 = trunc i8 %60 to i1
  %62 = zext i1 %61 to i32
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %133

64:                                               ; preds = %57
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._RcsJoint, ptr %65, i32 0, i32 12
  %67 = load i32, ptr %66, align 8, !tbaa !23
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._RcsJoint, ptr %68, i32 0, i32 12
  %70 = load i32, ptr %69, align 8, !tbaa !23
  %71 = icmp ne i32 %67, %70
  br i1 %71, label %72, label %133

72:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._RcsJoint, ptr %73, i32 0, i32 14
  %75 = getelementptr inbounds %struct.HTr, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._RcsJoint, ptr %76, i32 0, i32 10
  %78 = load i32, ptr %77, align 8, !tbaa !24
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [3 x [3 x double]], ptr %75, i64 0, i64 %79
  %81 = getelementptr inbounds [3 x double], ptr %80, i64 0, i64 0
  store ptr %81, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._RcsJoint, ptr %82, i32 0, i32 14
  %84 = getelementptr inbounds %struct.HTr, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._RcsJoint, ptr %85, i32 0, i32 10
  %87 = load i32, ptr %86, align 8, !tbaa !24
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [3 x [3 x double]], ptr %84, i64 0, i64 %88
  %90 = getelementptr inbounds [3 x double], ptr %89, i64 0, i64 0
  store ptr %90, ptr %15, align 8, !tbaa !5
  %91 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  call void @Vec3d_crossProduct(ptr noundef %91, ptr noundef %92, ptr noundef %93)
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %99

96:                                               ; preds = %72
  %97 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Vec3d_rotateSelf(ptr noundef %97, ptr noundef %98)
  br label %99

99:                                               ; preds = %96, %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !12
  br label %100

100:                                              ; preds = %129, %99
  %101 = load i32, ptr %16, align 4, !tbaa !12
  %102 = icmp slt i32 %101, 3
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 6, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %132

104:                                              ; preds = %100
  %105 = load i32, ptr %16, align 4, !tbaa !12
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !25
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._MatNd, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !26
  %112 = load i32, ptr %16, align 4, !tbaa !12
  %113 = load i32, ptr %9, align 4, !tbaa !12
  %114 = mul nsw i32 %112, %113
  %115 = load i32, ptr %9, align 4, !tbaa !12
  %116 = mul nsw i32 %114, %115
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._RcsJoint, ptr %117, i32 0, i32 12
  %119 = load i32, ptr %118, align 8, !tbaa !23
  %120 = load i32, ptr %9, align 4, !tbaa !12
  %121 = mul nsw i32 %119, %120
  %122 = add nsw i32 %116, %121
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._RcsJoint, ptr %123, i32 0, i32 12
  %125 = load i32, ptr %124, align 8, !tbaa !23
  %126 = add nsw i32 %122, %125
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds double, ptr %111, i64 %127
  store double %108, ptr %128, align 8, !tbaa !25
  br label %129

129:                                              ; preds = %104
  %130 = load i32, ptr %16, align 4, !tbaa !12
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %16, align 4, !tbaa !12
  br label %100, !llvm.loop !28

132:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #3
  br label %133

133:                                              ; preds = %132, %64, %57, %54
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._RcsJoint, ptr %134, i32 0, i32 22
  %136 = load ptr, ptr %135, align 8, !tbaa !20
  store ptr %136, ptr %12, align 8, !tbaa !5
  br label %51, !llvm.loop !29

137:                                              ; preds = %51
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._RcsJoint, ptr %138, i32 0, i32 22
  %140 = load ptr, ptr %139, align 8, !tbaa !20
  store ptr %140, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %30, !llvm.loop !21

141:                                              ; preds = %30
  store i32 0, ptr %11, align 4
  br label %142

142:                                              ; preds = %141, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %143 = load i32, ptr %11, align 4
  switch i32 %143, label %145 [
    i32 0, label %144
    i32 1, label %144
  ]

144:                                              ; preds = %142, %142
  ret void

145:                                              ; preds = %142
  unreachable
}

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !16, i64 64}
!14 = !{!"_RcsJoint", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !16, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !6, i64 88, !17, i64 96, !15, i64 192, !15, i64 200, !15, i64 208, !15, i64 216, !11, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!"", !7, i64 0, !7, i64 24}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!14, !6, i64 248}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!14, !11, i64 80}
!24 = !{!14, !11, i64 72}
!25 = !{!15, !15, i64 0}
!26 = !{!27, !6, i64 0}
!27 = !{!"_MatNd", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !16, i64 20}
!28 = distinct !{!28, !22}
!29 = distinct !{!29, !22}


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

declare ptr @RcsBody_lastJointBeforeBody(ptr noundef) local_unnamed_addr #1

declare zeroext i1 @RcsJoint_isRotation(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_rotationHessian(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca [3 x double], align 16
  %6 = getelementptr inbounds i8, ptr %0, i64 1852
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = mul nsw i32 %7, 3
  tail call void @MatNd_reshapeAndSetZero(ptr noundef %3, i32 noundef %8, i32 noundef %7) #3
  %9 = tail call ptr @RcsBody_lastJointBeforeBody(ptr noundef %1) #3
  %10 = icmp eq ptr %9, null
  br i1 %10, label %.loopexit, label %.preheader42

.preheader42:                                     ; preds = %4
  %.not41 = icmp eq ptr %2, null
  %11 = getelementptr inbounds i8, ptr %5, i64 8
  %12 = getelementptr inbounds i8, ptr %5, i64 16
  %13 = shl i32 %7, 1
  br i1 %.not41, label %.preheader42.split.us, label %.preheader42.split

.preheader42.split.us:                            ; preds = %.preheader42, %.backedge.us
  %.03545.us = phi ptr [ %.035.be.us, %.backedge.us ], [ %9, %.preheader42 ]
  %14 = getelementptr inbounds i8, ptr %.03545.us, i64 64
  %15 = load i8, ptr %14, align 8, !tbaa !11, !range !16, !noundef !17
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %.backedge.us, label %17

17:                                               ; preds = %.preheader42.split.us
  %18 = call zeroext i1 @RcsJoint_isRotation(ptr noundef nonnull %.03545.us) #3
  br i1 %18, label %.preheader.us, label %.backedge.us

.preheader.us:                                    ; preds = %17
  %19 = getelementptr inbounds i8, ptr %.03545.us, i64 80
  %20 = getelementptr inbounds i8, ptr %.03545.us, i64 120
  %21 = getelementptr inbounds i8, ptr %.03545.us, i64 72
  br label %22

.backedge.us:                                     ; preds = %61, %.preheader42.split.us, %17
  %.035.be.us.in = getelementptr inbounds i8, ptr %.03545.us, i64 248
  %.035.be.us = load ptr, ptr %.035.be.us.in, align 8, !tbaa !18
  %.not.us = icmp eq ptr %.035.be.us, null
  br i1 %.not.us, label %.loopexit, label %.preheader42.split.us, !llvm.loop !19

22:                                               ; preds = %61, %.preheader.us
  %.03644.us.us = phi ptr [ %.03545.us, %.preheader.us ], [ %63, %61 ]
  %23 = call zeroext i1 @RcsJoint_isRotation(ptr noundef nonnull %.03644.us.us) #3
  br i1 %23, label %24, label %61

24:                                               ; preds = %22
  %25 = getelementptr inbounds i8, ptr %.03644.us.us, i64 64
  %26 = load i8, ptr %25, align 8, !tbaa !11, !range !16, !noundef !17
  %27 = icmp eq i8 %26, 0
  br i1 %27, label %28, label %61

28:                                               ; preds = %24
  %29 = load i32, ptr %19, align 8, !tbaa !21
  %30 = getelementptr inbounds i8, ptr %.03644.us.us, i64 80
  %31 = load i32, ptr %30, align 8, !tbaa !21
  %.not40.us.us = icmp eq i32 %29, %31
  br i1 %.not40.us.us, label %61, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  %33 = load i32, ptr %21, align 8, !tbaa !22
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [3 x [3 x double]], ptr %20, i64 0, i64 %34
  %36 = getelementptr inbounds i8, ptr %.03644.us.us, i64 120
  %37 = getelementptr inbounds i8, ptr %.03644.us.us, i64 72
  %38 = load i32, ptr %37, align 8, !tbaa !22
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [3 x [3 x double]], ptr %36, i64 0, i64 %39
  call void @Vec3d_crossProduct(ptr noundef nonnull %5, ptr noundef nonnull %40, ptr noundef nonnull %35) #3
  %41 = load ptr, ptr %3, align 8, !tbaa !23
  %42 = load i32, ptr %19, align 8, !tbaa !21
  %43 = load i32, ptr %30, align 8, !tbaa !21
  %44 = load double, ptr %5, align 16, !tbaa !25
  %45 = mul i32 %42, %7
  %46 = add nsw i32 %45, %43
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds double, ptr %41, i64 %47
  store double %44, ptr %48, align 8, !tbaa !25
  %49 = load double, ptr %11, align 8, !tbaa !25
  %50 = add i32 %42, %7
  %51 = mul i32 %50, %7
  %52 = add nsw i32 %51, %43
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds double, ptr %41, i64 %53
  store double %49, ptr %54, align 8, !tbaa !25
  %55 = load double, ptr %12, align 16, !tbaa !25
  %56 = add i32 %42, %13
  %57 = mul i32 %56, %7
  %58 = add nsw i32 %57, %43
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %41, i64 %59
  store double %55, ptr %60, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  br label %61

61:                                               ; preds = %32, %28, %24, %22
  %62 = getelementptr inbounds i8, ptr %.03644.us.us, i64 248
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %.not39.us.us = icmp eq ptr %63, null
  br i1 %.not39.us.us, label %.backedge.us, label %22, !llvm.loop !26

.preheader42.split:                               ; preds = %.preheader42, %.backedge
  %.03545 = phi ptr [ %.035.be, %.backedge ], [ %9, %.preheader42 ]
  %64 = getelementptr inbounds i8, ptr %.03545, i64 64
  %65 = load i8, ptr %64, align 8, !tbaa !11, !range !16, !noundef !17
  %66 = trunc nuw i8 %65 to i1
  br i1 %66, label %.backedge, label %67

67:                                               ; preds = %.preheader42.split
  %68 = call zeroext i1 @RcsJoint_isRotation(ptr noundef nonnull %.03545) #3
  br i1 %68, label %.preheader, label %.backedge

.preheader:                                       ; preds = %67
  %69 = getelementptr inbounds i8, ptr %.03545, i64 80
  %70 = getelementptr inbounds i8, ptr %.03545, i64 120
  %71 = getelementptr inbounds i8, ptr %.03545, i64 72
  br label %72

.backedge:                                        ; preds = %111, %.preheader42.split, %67
  %.035.be.in = getelementptr inbounds i8, ptr %.03545, i64 248
  %.035.be = load ptr, ptr %.035.be.in, align 8, !tbaa !18
  %.not = icmp eq ptr %.035.be, null
  br i1 %.not, label %.loopexit, label %.preheader42.split, !llvm.loop !19

72:                                               ; preds = %.preheader, %111
  %.03644 = phi ptr [ %.03545, %.preheader ], [ %113, %111 ]
  %73 = call zeroext i1 @RcsJoint_isRotation(ptr noundef nonnull %.03644) #3
  br i1 %73, label %74, label %111

74:                                               ; preds = %72
  %75 = getelementptr inbounds i8, ptr %.03644, i64 64
  %76 = load i8, ptr %75, align 8, !tbaa !11, !range !16, !noundef !17
  %77 = icmp eq i8 %76, 0
  br i1 %77, label %78, label %111

78:                                               ; preds = %74
  %79 = load i32, ptr %69, align 8, !tbaa !21
  %80 = getelementptr inbounds i8, ptr %.03644, i64 80
  %81 = load i32, ptr %80, align 8, !tbaa !21
  %.not40 = icmp eq i32 %79, %81
  br i1 %.not40, label %111, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  %83 = load i32, ptr %71, align 8, !tbaa !22
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [3 x [3 x double]], ptr %70, i64 0, i64 %84
  %86 = getelementptr inbounds i8, ptr %.03644, i64 120
  %87 = getelementptr inbounds i8, ptr %.03644, i64 72
  %88 = load i32, ptr %87, align 8, !tbaa !22
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [3 x [3 x double]], ptr %86, i64 0, i64 %89
  call void @Vec3d_crossProduct(ptr noundef nonnull %5, ptr noundef nonnull %90, ptr noundef nonnull %85) #3
  call void @Vec3d_rotateSelf(ptr noundef nonnull %5, ptr noundef nonnull %2) #3
  %91 = load ptr, ptr %3, align 8, !tbaa !23
  %92 = load i32, ptr %69, align 8, !tbaa !21
  %93 = load i32, ptr %80, align 8, !tbaa !21
  %94 = load double, ptr %5, align 16, !tbaa !25
  %95 = mul i32 %92, %7
  %96 = add nsw i32 %95, %93
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %91, i64 %97
  store double %94, ptr %98, align 8, !tbaa !25
  %99 = load double, ptr %11, align 8, !tbaa !25
  %100 = add i32 %92, %7
  %101 = mul i32 %100, %7
  %102 = add nsw i32 %101, %93
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %91, i64 %103
  store double %99, ptr %104, align 8, !tbaa !25
  %105 = load double, ptr %12, align 16, !tbaa !25
  %106 = add i32 %92, %13
  %107 = mul i32 %106, %7
  %108 = add nsw i32 %107, %93
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %91, i64 %109
  store double %105, ptr %110, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  br label %111

111:                                              ; preds = %82, %78, %74, %72
  %112 = getelementptr inbounds i8, ptr %.03644, i64 248
  %113 = load ptr, ptr %112, align 8, !tbaa !18
  %.not39 = icmp eq ptr %113, null
  br i1 %.not39, label %.backedge, label %72, !llvm.loop !26

.loopexit:                                        ; preds = %.backedge, %.backedge.us, %4
  ret void
}

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !14, i64 64}
!12 = !{!"_RcsJoint", !7, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !14, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 88, !15, i64 96, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !10, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!"", !8, i64 0, !8, i64 24}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !7, i64 248}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !10, i64 80}
!22 = !{!12, !10, i64 72}
!23 = !{!24, !7, i64 0}
!24 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !14, i64 20}
!25 = !{!13, !13, i64 0}
!26 = distinct !{!26, !20}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass