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

; 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]] }

@bdy_target_qprop = external hidden global ptr, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@__func__.test_dJpinv_e = external hidden unnamed_addr constant [14 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden void @initQProp() #1

declare ptr @RcsGraph_getBodyByName(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare void @print_trace() #2

; Function Attrs: noreturn nounwind
declare void @abort() #4

; Function Attrs: nounwind uwtable
declare dso_local void @Rcs_setIKState(ptr noundef, ptr noundef) #1

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

declare void @Vec3d_sub(ptr noundef, ptr noundef, ptr noundef) #2

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

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

declare double @MatNd_rwPinv(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

declare void @MatNd_destroy(ptr noundef) #2

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

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

29:                                               ; preds = %3
  call void @initQProp()
  br label %30

30:                                               ; preds = %29, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call ptr @RcsGraph_getBodyByName(ptr noundef %31, ptr noundef @.str)
  store ptr %32, ptr %11, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %30
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %39, label %36

36:                                               ; preds = %33
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.1, ptr noundef @.str.2, ptr noundef @__func__.test_dJpinv_e, i32 noundef 279, ptr noundef @.str.3) #5
  call void @print_trace()
  call void @abort() #6
  unreachable

39:                                               ; preds = %33
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %42 = load ptr, ptr @bdy_target_qprop, align 8, !tbaa !5
  store ptr %42, ptr %12, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Rcs_setIKState(ptr noundef %43, ptr noundef %44)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store double 1.000000e-03, ptr %13, align 8, !tbaa !13
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._RcsBody, ptr %45, i32 0, i32 10
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = getelementptr inbounds %struct.HTr, ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds [3 x double], ptr %48, i64 0, i64 0
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._RcsBody, ptr %50, i32 0, i32 10
  %52 = load ptr, ptr %51, align 8, !tbaa !15
  %53 = getelementptr inbounds %struct.HTr, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds [3 x double], ptr %53, i64 0, i64 0
  call void @Vec3d_constMul(ptr noundef %49, ptr noundef %54, double noundef 0x3FEFF7CED916872B)
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._RcsBody, ptr %55, i32 0, i32 10
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = getelementptr inbounds %struct.HTr, ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds [3 x [3 x double]], ptr %58, i64 0, i64 0
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._RcsBody, ptr %60, i32 0, i32 10
  %62 = load ptr, ptr %61, align 8, !tbaa !15
  %63 = getelementptr inbounds %struct.HTr, ptr %62, i32 0, i32 1
  %64 = getelementptr inbounds [3 x [3 x double]], ptr %63, i64 0, i64 0
  call void @Mat3d_copy(ptr noundef %59, ptr noundef %64)
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._RcsBody, ptr %65, i32 0, i32 10
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = getelementptr inbounds %struct.HTr, ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds [3 x [3 x double]], ptr %68, i64 0, i64 0
  call void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef %69, i32 noundef 0, double noundef 1.000000e-03)
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._RcsBody, ptr %70, i32 0, i32 10
  %72 = load ptr, ptr %71, align 8, !tbaa !15
  %73 = getelementptr inbounds %struct.HTr, ptr %72, i32 0, i32 1
  %74 = getelementptr inbounds [3 x [3 x double]], ptr %73, i64 0, i64 0
  call void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef %74, i32 noundef 1, double noundef 1.000000e-03)
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._RcsBody, ptr %75, i32 0, i32 10
  %77 = load ptr, ptr %76, align 8, !tbaa !15
  %78 = getelementptr inbounds %struct.HTr, ptr %77, i32 0, i32 1
  %79 = getelementptr inbounds [3 x [3 x double]], ptr %78, i64 0, i64 0
  call void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef %79, i32 noundef 2, double noundef 1.000000e-03)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %80 = call ptr @MatNd_create(i32 noundef 3, i32 noundef 1)
  store ptr %80, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = call ptr @MatNd_create(i32 noundef %81, i32 noundef %82)
  store ptr %83, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = load i32, ptr %8, align 4, !tbaa !9
  %86 = call ptr @MatNd_create(i32 noundef %84, i32 noundef %85)
  store ptr %86, ptr %16, align 8, !tbaa !5
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._MatNd, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !18
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._RcsBody, ptr %90, i32 0, i32 10
  %92 = load ptr, ptr %91, align 8, !tbaa !15
  %93 = getelementptr inbounds %struct.HTr, ptr %92, i32 0, i32 0
  %94 = getelementptr inbounds [3 x double], ptr %93, i64 0, i64 0
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._RcsBody, ptr %95, i32 0, i32 10
  %97 = load ptr, ptr %96, align 8, !tbaa !15
  %98 = getelementptr inbounds %struct.HTr, ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds [3 x double], ptr %98, i64 0, i64 0
  call void @Vec3d_sub(ptr noundef %89, ptr noundef %94, ptr noundef %99)
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  call void @RcsGraph_bodyPointJacobian(ptr noundef %100, ptr noundef %101, ptr noundef %102, ptr noundef null, ptr noundef %103)
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = call double @MatNd_rwPinv(ptr noundef %104, ptr noundef %105, ptr noundef null, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = mul nsw i32 %107, %108
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = call ptr @MatNd_create(i32 noundef %109, i32 noundef %110)
  store ptr %111, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %112 = load i32, ptr %9, align 4, !tbaa !9
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = mul nsw i32 %112, %113
  %115 = load i32, ptr %8, align 4, !tbaa !9
  %116 = call ptr @MatNd_create(i32 noundef %114, i32 noundef %115)
  store ptr %116, ptr %18, align 8, !tbaa !5
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = load ptr, ptr %17, align 8, !tbaa !5
  call void @RcsGraph_bodyPointHessian(ptr noundef %117, ptr noundef %118, ptr noundef %119, ptr noundef null, ptr noundef %120)
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = load ptr, ptr %17, align 8, !tbaa !5
  %124 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_PinvHessian(ptr noundef %121, ptr noundef %122, ptr noundef %123, ptr noundef null, ptr noundef null, ptr noundef %124, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = load i32, ptr %9, align 4, !tbaa !9
  %127 = mul nsw i32 %125, %126
  %128 = call ptr @MatNd_create(i32 noundef %127, i32 noundef 1)
  store ptr %128, ptr %19, align 8, !tbaa !5
  %129 = load ptr, ptr %19, align 8, !tbaa !5
  %130 = load ptr, ptr %18, align 8, !tbaa !5
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %129, ptr noundef %130, ptr noundef %131)
  %132 = load ptr, ptr %19, align 8, !tbaa !5
  %133 = load i32, ptr %9, align 4, !tbaa !9
  %134 = load i32, ptr %9, align 4, !tbaa !9
  call void @MatNd_reshape(ptr noundef %132, i32 noundef %133, i32 noundef %134)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %135 = load i32, ptr %8, align 4, !tbaa !9
  %136 = load i32, ptr %9, align 4, !tbaa !9
  %137 = call ptr @MatNd_create(i32 noundef %135, i32 noundef %136)
  store ptr %137, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %138 = load i32, ptr %9, align 4, !tbaa !9
  %139 = load i32, ptr %9, align 4, !tbaa !9
  %140 = call ptr @MatNd_create(i32 noundef %138, i32 noundef %139)
  store ptr %140, ptr %21, align 8, !tbaa !5
  %141 = load ptr, ptr %20, align 8, !tbaa !5
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  call void @MatNd_constMul(ptr noundef %141, ptr noundef %142, double noundef -1.000000e+00)
  %143 = load ptr, ptr %21, align 8, !tbaa !5
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = load ptr, ptr %20, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %143, ptr noundef %144, ptr noundef %145)
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #5
  %146 = load i32, ptr %9, align 4, !tbaa !9
  %147 = load i32, ptr %9, align 4, !tbaa !9
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %22, i32 noundef %146, i32 noundef %147, ptr noundef %148)
  %149 = load ptr, ptr %19, align 8, !tbaa !5
  %150 = load ptr, ptr %21, align 8, !tbaa !5
  call void @MatNd_add(ptr noundef %22, ptr noundef %149, ptr noundef %150)
  %151 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %151)
  %152 = load ptr, ptr %15, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %152)
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %153)
  %154 = load ptr, ptr %17, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %154)
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %155)
  %156 = load ptr, ptr %20, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %156)
  %157 = load ptr, ptr %19, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %157)
  %158 = load ptr, ptr %21, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %158)
  call void @llvm.lifetime.end.p0(i64 24, 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 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

declare void @Vec3d_constMul(ptr noundef, ptr noundef, double noundef) #2

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

declare void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef, i32 noundef, double noundef) #2

declare void @RcsGraph_bodyPointHessian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @MatNd_PinvHessian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

declare void @MatNd_constMul(ptr noundef, ptr noundef, double noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 1852}
!12 = !{!"_RcsGraph", !6, i64 0, !7, i64 8, !10, i64 1848, !10, i64 1852, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !6, i64 104}
!16 = !{!"_RcsBody", !14, i64 0, !17, i64 8, !10, i64 12, !7, i64 16, !7, i64 40, !14, 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}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"_MatNd", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !17, i64 20}


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

@bdy_target_qprop = external hidden local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@__func__.test_dJpinv_e = external hidden unnamed_addr constant [14 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden void @initQProp() local_unnamed_addr #1

declare ptr @RcsGraph_getBodyByName(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare void @print_trace() local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @Rcs_setIKState(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @Vec3d_sub(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare double @MatNd_rwPinv(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local void @test_dJpinv_e(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca %struct._MatNd, align 8
  %5 = getelementptr inbounds i8, ptr %2, i64 1852
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = load ptr, ptr @bdy_target_qprop, align 8, !tbaa !11
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %9

8:                                                ; preds = %3
  tail call void @initQProp()
  br label %9

9:                                                ; preds = %8, %3
  %10 = tail call ptr @RcsGraph_getBodyByName(ptr noundef nonnull %2, ptr noundef nonnull @.str) #5
  %.not69 = icmp eq ptr %10, null
  br i1 %.not69, label %11, label %14

11:                                               ; preds = %9
  %12 = load ptr, ptr @stderr, align 8, !tbaa !11
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.test_dJpinv_e, i32 noundef 279, ptr noundef nonnull @.str.3) #6
  tail call void @print_trace() #5
  tail call void @abort() #7
  unreachable

14:                                               ; preds = %9
  %15 = load ptr, ptr @bdy_target_qprop, align 8, !tbaa !11
  tail call void @Rcs_setIKState(ptr noundef nonnull %2, ptr noundef %1)
  %16 = getelementptr inbounds i8, ptr %15, i64 104
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = getelementptr inbounds i8, ptr %10, i64 104
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  tail call void @Vec3d_constMul(ptr noundef %17, ptr noundef %19, double noundef 0x3FEFF7CED916872B) #5
  %20 = load ptr, ptr %16, align 8, !tbaa !12
  %21 = getelementptr inbounds i8, ptr %20, i64 24
  %22 = load ptr, ptr %18, align 8, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  tail call void @Mat3d_copy(ptr noundef nonnull %21, ptr noundef nonnull %23) #5
  %24 = load ptr, ptr %16, align 8, !tbaa !12
  %25 = getelementptr inbounds i8, ptr %24, i64 24
  tail call void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef nonnull %25, i32 noundef 0, double noundef 1.000000e-03) #5
  %26 = load ptr, ptr %16, align 8, !tbaa !12
  %27 = getelementptr inbounds i8, ptr %26, i64 24
  tail call void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef nonnull %27, i32 noundef 1, double noundef 1.000000e-03) #5
  %28 = load ptr, ptr %16, align 8, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %28, i64 24
  tail call void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef nonnull %29, i32 noundef 2, double noundef 1.000000e-03) #5
  %30 = tail call ptr @MatNd_create(i32 noundef 3, i32 noundef 1) #5
  %31 = tail call ptr @MatNd_create(i32 noundef 3, i32 noundef %6) #5
  %32 = tail call ptr @MatNd_create(i32 noundef %6, i32 noundef 3) #5
  %33 = load ptr, ptr %30, align 8, !tbaa !16
  %34 = load ptr, ptr %18, align 8, !tbaa !12
  %35 = load ptr, ptr %16, align 8, !tbaa !12
  tail call void @Vec3d_sub(ptr noundef %33, ptr noundef %34, ptr noundef %35) #5
  tail call void @RcsGraph_bodyPointJacobian(ptr noundef nonnull %2, ptr noundef nonnull %10, ptr noundef null, ptr noundef null, ptr noundef %31) #5
  %36 = tail call double @MatNd_rwPinv(ptr noundef %32, ptr noundef %31, ptr noundef null, ptr noundef null) #5
  %37 = mul nsw i32 %6, 3
  %38 = tail call ptr @MatNd_create(i32 noundef %37, i32 noundef %6) #5
  %39 = mul nsw i32 %6, %6
  %40 = tail call ptr @MatNd_create(i32 noundef %39, i32 noundef 3) #5
  tail call void @RcsGraph_bodyPointHessian(ptr noundef nonnull %2, ptr noundef nonnull %10, ptr noundef null, ptr noundef null, ptr noundef %38) #5
  tail call void @MatNd_PinvHessian(ptr noundef %40, ptr noundef %31, ptr noundef %38, ptr noundef null, ptr noundef null, ptr noundef %32, i1 noundef zeroext false) #5
  %41 = tail call ptr @MatNd_create(i32 noundef %39, i32 noundef 1) #5
  tail call void @MatNd_mul(ptr noundef %41, ptr noundef %40, ptr noundef nonnull %30) #5
  tail call void @MatNd_reshape(ptr noundef %41, i32 noundef %6, i32 noundef %6) #5
  %42 = tail call ptr @MatNd_create(i32 noundef 3, i32 noundef %6) #5
  %43 = tail call ptr @MatNd_create(i32 noundef %6, i32 noundef %6) #5
  tail call void @MatNd_constMul(ptr noundef %42, ptr noundef %31, double noundef -1.000000e+00) #5
  tail call void @MatNd_mul(ptr noundef %43, ptr noundef %32, ptr noundef %42) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %4, i32 noundef %6, i32 noundef %6, ptr noundef %0) #5
  call void @MatNd_add(ptr noundef nonnull %4, ptr noundef %41, ptr noundef %43) #5
  call void @MatNd_destroy(ptr noundef nonnull %30) #5
  call void @MatNd_destroy(ptr noundef %31) #5
  call void @MatNd_destroy(ptr noundef %32) #5
  call void @MatNd_destroy(ptr noundef %38) #5
  call void @MatNd_destroy(ptr noundef %40) #5
  call void @MatNd_destroy(ptr noundef %42) #5
  call void @MatNd_destroy(ptr noundef %41) #5
  call void @MatNd_destroy(ptr noundef %43) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void
}

declare void @Vec3d_constMul(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #2

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

declare void @Mat3d_rotateSelfAboutXYZAxis(ptr noundef, i32 noundef, double noundef) local_unnamed_addr #2

declare void @RcsGraph_bodyPointHessian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @MatNd_PinvHessian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

declare void @MatNd_constMul(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 104}
!13 = !{!"_RcsBody", !14, i64 0, !15, i64 8, !10, i64 12, !8, i64 16, !8, i64 40, !14, 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}
!14 = !{!"double", !8, i64 0}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !15, i64 20}


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