; LLVM IR from ClementineAccount/Albuquerque :: lib/bullet/include/Bullet3Dynamics/ConstraintSolver (b3Generic6DofConstraint)

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

%class.b3Vector3 = type { %union.anon.0 }
%union.anon.0 = type { [4 x float] }
%class.b3Generic6DofConstraint = type { %class.b3TypedConstraint, %class.b3Transform, %class.b3Transform, %class.b3TranslationalLimitMotor, [3 x %class.b3RotationalLimitMotor], %class.b3Transform, %class.b3Transform, %class.b3Vector3, [3 x %class.b3Vector3], %class.b3Vector3, float, float, float, i8, %class.b3Vector3, i8, i8, i32, [8 x i8] }
%class.b3TypedConstraint = type { ptr, %struct.b3TypedObject, i32, %union.anon, float, i8, i8, i32, i32, i32, float, float, ptr }
%struct.b3TypedObject = type { i32 }
%union.anon = type { ptr }
%class.b3TranslationalLimitMotor = type { %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, float, float, float, [3 x i8], [3 x i32], [4 x i8] }
%class.b3RotationalLimitMotor = type { float, float, float, float, float, float, float, float, float, float, float, i8, float, float, i32, float }
%class.b3Transform = type { %class.b3Matrix3x3, %class.b3Vector3 }
%class.b3Matrix3x3 = type { [3 x %class.b3Vector3] }
%"struct.b3TypedConstraint::b3ConstraintInfo2" = type { float, float, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, i32, float }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN22b3RotationalLimitMotor16needApplyTorquesEv(ptr noundef nonnull align 4 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN23b3Generic6DofConstraint16setAngularLimitsEPN17b3TypedConstraint17b3ConstraintInfo2EiRK11b3TransformS5_RK9b3Vector3S8_S8_S8_(ptr noundef nonnull align 16 dereferenceable(824) %0, ptr noundef %1, i32 noundef %2, ptr noundef nonnull align 16 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(64) %4, ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %8) #2 align 2 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, 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 i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %class.b3Vector3, align 16
  %23 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store i32 %2, ptr %12, align 4, !tbaa !9
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  %24 = load ptr, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store ptr %24, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %25 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %25, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %109, %9
  %27 = load i32, ptr %21, align 4, !tbaa !9
  %28 = icmp slt i32 %27, 3
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %112

30:                                               ; preds = %26
  %31 = load ptr, ptr %19, align 8, !tbaa !5
  %32 = load i32, ptr %21, align 4, !tbaa !9
  %33 = call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %31, i32 noundef %32)
  %34 = call noundef zeroext i1 @_ZN22b3RotationalLimitMotor16needApplyTorquesEv(ptr noundef nonnull align 4 dereferenceable(64) %33)
  br i1 %34, label %35, label %108

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #3
  %36 = load ptr, ptr %19, align 8, !tbaa !5
  %37 = load i32, ptr %21, align 4, !tbaa !9
  %38 = call { <2 x float>, <2 x float> } @_ZNK23b3Generic6DofConstraint7getAxisEi(ptr noundef nonnull align 16 dereferenceable(824) %36, i32 noundef %37)
  %39 = getelementptr inbounds %class.b3Vector3, ptr %22, i32 0, i32 0
  %40 = getelementptr inbounds %union.anon.0, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %40, i32 0, i32 0
  %42 = extractvalue { <2 x float>, <2 x float> } %38, 0
  store <2 x float> %42, ptr %41, align 16
  %43 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %40, i32 0, i32 1
  %44 = extractvalue { <2 x float>, <2 x float> } %38, 1
  store <2 x float> %44, ptr %43, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %45 = getelementptr inbounds %class.b3Generic6DofConstraint, ptr %24, i32 0, i32 17
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = load i32, ptr %21, align 4, !tbaa !9
  %48 = add nsw i32 %47, 3
  %49 = mul nsw i32 %48, 3
  %50 = ashr i32 %46, %49
  store i32 %50, ptr %23, align 4, !tbaa !9
  %51 = load i32, ptr %23, align 4, !tbaa !9
  %52 = and i32 %51, 1
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %65, label %54

54:                                               ; preds = %35
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.b3TypedConstraint::b3ConstraintInfo2", ptr %55, i32 0, i32 8
  %57 = load ptr, ptr %56, align 8, !tbaa !21
  %58 = getelementptr inbounds float, ptr %57, i64 0
  %59 = load float, ptr %58, align 4, !tbaa !23
  %60 = getelementptr inbounds %class.b3Generic6DofConstraint, ptr %24, i32 0, i32 4
  %61 = load i32, ptr %21, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [3 x %class.b3RotationalLimitMotor], ptr %60, i64 0, i64 %62
  %64 = getelementptr inbounds %class.b3RotationalLimitMotor, ptr %63, i32 0, i32 7
  store float %59, ptr %64, align 4, !tbaa !24
  br label %65

65:                                               ; preds = %54, %35
  %66 = load i32, ptr %23, align 4, !tbaa !9
  %67 = and i32 %66, 2
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %80, label %69

69:                                               ; preds = %65
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.b3TypedConstraint::b3ConstraintInfo2", ptr %70, i32 0, i32 8
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = getelementptr inbounds float, ptr %72, i64 0
  %74 = load float, ptr %73, align 4, !tbaa !23
  %75 = getelementptr inbounds %class.b3Generic6DofConstraint, ptr %24, i32 0, i32 4
  %76 = load i32, ptr %21, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [3 x %class.b3RotationalLimitMotor], ptr %75, i64 0, i64 %77
  %79 = getelementptr inbounds %class.b3RotationalLimitMotor, ptr %78, i32 0, i32 9
  store float %74, ptr %79, align 4, !tbaa !26
  br label %80

80:                                               ; preds = %69, %65
  %81 = load i32, ptr %23, align 4, !tbaa !9
  %82 = and i32 %81, 4
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %93, label %84

84:                                               ; preds = %80
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.b3TypedConstraint::b3ConstraintInfo2", ptr %85, i32 0, i32 1
  %87 = load float, ptr %86, align 4, !tbaa !27
  %88 = getelementptr inbounds %class.b3Generic6DofConstraint, ptr %24, i32 0, i32 4
  %89 = load i32, ptr %21, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [3 x %class.b3RotationalLimitMotor], ptr %88, i64 0, i64 %90
  %92 = getelementptr inbounds %class.b3RotationalLimitMotor, ptr %91, i32 0, i32 8
  store float %87, ptr %92, align 16, !tbaa !28
  br label %93

93:                                               ; preds = %84, %80
  %94 = load ptr, ptr %19, align 8, !tbaa !5
  %95 = load i32, ptr %21, align 4, !tbaa !9
  %96 = call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %94, i32 noundef %95)
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = load ptr, ptr %14, align 8, !tbaa !5
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  %100 = load ptr, ptr %16, align 8, !tbaa !5
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  %102 = load ptr, ptr %18, align 8, !tbaa !5
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = load i32, ptr %20, align 4, !tbaa !9
  %105 = call noundef i32 @_ZN23b3Generic6DofConstraint21get_limit_motor_info2EP22b3RotationalLimitMotorRK11b3TransformS4_RK9b3Vector3S7_S7_S7_PN17b3TypedConstraint17b3ConstraintInfo2EiRS5_ii(ptr noundef nonnull align 16 dereferenceable(824) %24, ptr noundef %96, ptr noundef nonnull align 16 dereferenceable(64) %97, ptr noundef nonnull align 16 dereferenceable(64) %98, ptr noundef nonnull align 16 dereferenceable(16) %99, ptr noundef nonnull align 16 dereferenceable(16) %100, ptr noundef nonnull align 16 dereferenceable(16) %101, ptr noundef nonnull align 16 dereferenceable(16) %102, ptr noundef %103, i32 noundef %104, ptr noundef nonnull align 16 dereferenceable(16) %22, i32 noundef 1, i32 noundef 0)
  %106 = load i32, ptr %20, align 4, !tbaa !9
  %107 = add nsw i32 %106, %105
  store i32 %107, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #3
  br label %108

108:                                              ; preds = %93, %30
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %21, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %21, align 4, !tbaa !9
  br label %26, !llvm.loop !29

112:                                              ; preds = %29
  %113 = load i32, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  ret i32 %113
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN23b3Generic6DofConstraint21get_limit_motor_info2EP22b3RotationalLimitMotorRK11b3TransformS4_RK9b3Vector3S7_S7_S7_PN17b3TypedConstraint17b3ConstraintInfo2EiRS5_ii(ptr noundef nonnull align 16 dereferenceable(824), ptr noundef, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef, i32 noundef, ptr noundef nonnull align 16 dereferenceable(16), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZNK23b3Generic6DofConstraint7getAxisEi(ptr noundef nonnull align 16 dereferenceable(824), i32 noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 820}
!12 = !{!"_ZTS23b3Generic6DofConstraint", !13, i64 0, !17, i64 64, !17, i64 128, !20, i64 192, !7, i64 384, !17, i64 576, !17, i64 640, !19, i64 704, !7, i64 720, !19, i64 768, !15, i64 784, !15, i64 788, !15, i64 792, !16, i64 796, !19, i64 800, !16, i64 816, !16, i64 817, !10, i64 820}
!13 = !{!"_ZTS17b3TypedConstraint", !14, i64 8, !10, i64 12, !7, i64 16, !15, i64 24, !16, i64 28, !16, i64 29, !10, i64 32, !10, i64 36, !10, i64 40, !15, i64 44, !15, i64 48, !6, i64 56}
!14 = !{!"_ZTS13b3TypedObject", !10, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTS11b3Transform", !18, i64 0, !19, i64 48}
!18 = !{!"_ZTS11b3Matrix3x3", !7, i64 0}
!19 = !{!"_ZTS9b3Vector3", !7, i64 0}
!20 = !{!"_ZTS25b3TranslationalLimitMotor", !19, i64 0, !19, i64 16, !19, i64 32, !19, i64 48, !19, i64 64, !19, i64 80, !19, i64 96, !19, i64 112, !19, i64 128, !19, i64 144, !15, i64 160, !15, i64 164, !15, i64 168, !7, i64 172, !7, i64 176}
!21 = !{!22, !6, i64 56}
!22 = !{!"_ZTSN17b3TypedConstraint17b3ConstraintInfo2E", !15, i64 0, !15, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !15, i64 92}
!23 = !{!15, !15, i64 0}
!24 = !{!25, !15, i64 28}
!25 = !{!"_ZTS22b3RotationalLimitMotor", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !15, i64 40, !16, i64 44, !15, i64 48, !15, i64 52, !10, i64 56, !15, i64 60}
!26 = !{!25, !15, i64 36}
!27 = !{!22, !15, i64 4}
!28 = !{!25, !15, i64 32}
!29 = distinct !{!29, !30}
!30 = !{!"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"

%class.b3Vector3 = type { %union.anon.0 }
%union.anon.0 = type { [4 x float] }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN22b3RotationalLimitMotor16needApplyTorquesEv(ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN23b3Generic6DofConstraint16setAngularLimitsEPN17b3TypedConstraint17b3ConstraintInfo2EiRK11b3TransformS5_RK9b3Vector3S8_S8_S8_(ptr noundef nonnull align 16 dereferenceable(824) %0, ptr noundef %1, i32 noundef %2, ptr noundef nonnull align 16 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(64) %4, ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %8) local_unnamed_addr #2 align 2 {
  %10 = alloca %class.b3Vector3, align 16
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = getelementptr inbounds i8, ptr %0, i64 820
  %13 = getelementptr inbounds i8, ptr %1, i64 56
  %14 = getelementptr inbounds i8, ptr %1, i64 4
  %15 = tail call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 0)
  %16 = tail call noundef zeroext i1 @_ZN22b3RotationalLimitMotor16needApplyTorquesEv(ptr noundef nonnull align 4 dereferenceable(64) %15)
  br i1 %16, label %17, label %42

17:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #3
  %18 = tail call { <2 x float>, <2 x float> } @_ZNK23b3Generic6DofConstraint7getAxisEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 0)
  %19 = extractvalue { <2 x float>, <2 x float> } %18, 0
  store <2 x float> %19, ptr %10, align 16
  %20 = extractvalue { <2 x float>, <2 x float> } %18, 1
  store <2 x float> %20, ptr %11, align 8
  %21 = load i32, ptr %12, align 4, !tbaa !5
  %22 = and i32 %21, 512
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %23, label %27

23:                                               ; preds = %17
  %24 = load ptr, ptr %13, align 8, !tbaa !19
  %25 = load float, ptr %24, align 4, !tbaa !21
  %26 = getelementptr inbounds i8, ptr %0, i64 412
  store float %25, ptr %26, align 4, !tbaa !22
  br label %27

27:                                               ; preds = %23, %17
  %28 = and i32 %21, 1024
  %.not30 = icmp eq i32 %28, 0
  br i1 %.not30, label %29, label %33

29:                                               ; preds = %27
  %30 = load ptr, ptr %13, align 8, !tbaa !19
  %31 = load float, ptr %30, align 4, !tbaa !21
  %32 = getelementptr inbounds i8, ptr %0, i64 420
  store float %31, ptr %32, align 4, !tbaa !24
  br label %33

33:                                               ; preds = %29, %27
  %34 = and i32 %21, 2048
  %.not31 = icmp eq i32 %34, 0
  br i1 %.not31, label %35, label %38

35:                                               ; preds = %33
  %36 = load float, ptr %14, align 4, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %0, i64 416
  store float %36, ptr %37, align 16, !tbaa !26
  br label %38

38:                                               ; preds = %35, %33
  %39 = tail call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 0)
  %40 = call noundef i32 @_ZN23b3Generic6DofConstraint21get_limit_motor_info2EP22b3RotationalLimitMotorRK11b3TransformS4_RK9b3Vector3S7_S7_S7_PN17b3TypedConstraint17b3ConstraintInfo2EiRS5_ii(ptr noundef nonnull align 16 dereferenceable(824) %0, ptr noundef %39, ptr noundef nonnull align 16 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(64) %4, ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef %1, i32 noundef %2, ptr noundef nonnull align 16 dereferenceable(16) %10, i32 noundef 1, i32 noundef 0)
  %41 = add nsw i32 %40, %2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #3
  br label %42

42:                                               ; preds = %9, %38
  %.1 = phi i32 [ %41, %38 ], [ %2, %9 ]
  %43 = call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 1)
  %44 = call noundef zeroext i1 @_ZN22b3RotationalLimitMotor16needApplyTorquesEv(ptr noundef nonnull align 4 dereferenceable(64) %43)
  br i1 %44, label %45, label %70

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #3
  %46 = call { <2 x float>, <2 x float> } @_ZNK23b3Generic6DofConstraint7getAxisEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 1)
  %47 = extractvalue { <2 x float>, <2 x float> } %46, 0
  store <2 x float> %47, ptr %10, align 16
  %48 = extractvalue { <2 x float>, <2 x float> } %46, 1
  store <2 x float> %48, ptr %11, align 8
  %49 = load i32, ptr %12, align 4, !tbaa !5
  %50 = and i32 %49, 4096
  %.not.1 = icmp eq i32 %50, 0
  br i1 %.not.1, label %51, label %55

51:                                               ; preds = %45
  %52 = load ptr, ptr %13, align 8, !tbaa !19
  %53 = load float, ptr %52, align 4, !tbaa !21
  %54 = getelementptr inbounds i8, ptr %0, i64 476
  store float %53, ptr %54, align 4, !tbaa !22
  br label %55

55:                                               ; preds = %51, %45
  %56 = and i32 %49, 8192
  %.not30.1 = icmp eq i32 %56, 0
  br i1 %.not30.1, label %57, label %61

57:                                               ; preds = %55
  %58 = load ptr, ptr %13, align 8, !tbaa !19
  %59 = load float, ptr %58, align 4, !tbaa !21
  %60 = getelementptr inbounds i8, ptr %0, i64 484
  store float %59, ptr %60, align 4, !tbaa !24
  br label %61

61:                                               ; preds = %57, %55
  %62 = and i32 %49, 16384
  %.not31.1 = icmp eq i32 %62, 0
  br i1 %.not31.1, label %63, label %66

63:                                               ; preds = %61
  %64 = load float, ptr %14, align 4, !tbaa !25
  %65 = getelementptr inbounds i8, ptr %0, i64 480
  store float %64, ptr %65, align 16, !tbaa !26
  br label %66

66:                                               ; preds = %63, %61
  %67 = call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 1)
  %68 = call noundef i32 @_ZN23b3Generic6DofConstraint21get_limit_motor_info2EP22b3RotationalLimitMotorRK11b3TransformS4_RK9b3Vector3S7_S7_S7_PN17b3TypedConstraint17b3ConstraintInfo2EiRS5_ii(ptr noundef nonnull align 16 dereferenceable(824) %0, ptr noundef %67, ptr noundef nonnull align 16 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(64) %4, ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef %1, i32 noundef %.1, ptr noundef nonnull align 16 dereferenceable(16) %10, i32 noundef 1, i32 noundef 0)
  %69 = add nsw i32 %68, %.1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #3
  br label %70

70:                                               ; preds = %66, %42
  %.1.1 = phi i32 [ %69, %66 ], [ %.1, %42 ]
  %71 = call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 2)
  %72 = call noundef zeroext i1 @_ZN22b3RotationalLimitMotor16needApplyTorquesEv(ptr noundef nonnull align 4 dereferenceable(64) %71)
  br i1 %72, label %73, label %98

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #3
  %74 = call { <2 x float>, <2 x float> } @_ZNK23b3Generic6DofConstraint7getAxisEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 2)
  %75 = extractvalue { <2 x float>, <2 x float> } %74, 0
  store <2 x float> %75, ptr %10, align 16
  %76 = extractvalue { <2 x float>, <2 x float> } %74, 1
  store <2 x float> %76, ptr %11, align 8
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = and i32 %77, 32768
  %.not.2 = icmp eq i32 %78, 0
  br i1 %.not.2, label %79, label %83

79:                                               ; preds = %73
  %80 = load ptr, ptr %13, align 8, !tbaa !19
  %81 = load float, ptr %80, align 4, !tbaa !21
  %82 = getelementptr inbounds i8, ptr %0, i64 540
  store float %81, ptr %82, align 4, !tbaa !22
  br label %83

83:                                               ; preds = %79, %73
  %84 = and i32 %77, 65536
  %.not30.2 = icmp eq i32 %84, 0
  br i1 %.not30.2, label %85, label %89

85:                                               ; preds = %83
  %86 = load ptr, ptr %13, align 8, !tbaa !19
  %87 = load float, ptr %86, align 4, !tbaa !21
  %88 = getelementptr inbounds i8, ptr %0, i64 548
  store float %87, ptr %88, align 4, !tbaa !24
  br label %89

89:                                               ; preds = %85, %83
  %90 = and i32 %77, 131072
  %.not31.2 = icmp eq i32 %90, 0
  br i1 %.not31.2, label %91, label %94

91:                                               ; preds = %89
  %92 = load float, ptr %14, align 4, !tbaa !25
  %93 = getelementptr inbounds i8, ptr %0, i64 544
  store float %92, ptr %93, align 16, !tbaa !26
  br label %94

94:                                               ; preds = %91, %89
  %95 = call noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824) %0, i32 noundef 2)
  %96 = call noundef i32 @_ZN23b3Generic6DofConstraint21get_limit_motor_info2EP22b3RotationalLimitMotorRK11b3TransformS4_RK9b3Vector3S7_S7_S7_PN17b3TypedConstraint17b3ConstraintInfo2EiRS5_ii(ptr noundef nonnull align 16 dereferenceable(824) %0, ptr noundef %95, ptr noundef nonnull align 16 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(64) %4, ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef %1, i32 noundef %.1.1, ptr noundef nonnull align 16 dereferenceable(16) %10, i32 noundef 1, i32 noundef 0)
  %97 = add nsw i32 %96, %.1.1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #3
  br label %98

98:                                               ; preds = %94, %70
  %.1.2 = phi i32 [ %97, %94 ], [ %.1.1, %70 ]
  ret i32 %.1.2
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN23b3Generic6DofConstraint21get_limit_motor_info2EP22b3RotationalLimitMotorRK11b3TransformS4_RK9b3Vector3S7_S7_S7_PN17b3TypedConstraint17b3ConstraintInfo2EiRS5_ii(ptr noundef nonnull align 16 dereferenceable(824), ptr noundef, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef, i32 noundef, ptr noundef nonnull align 16 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN23b3Generic6DofConstraint23getRotationalLimitMotorEi(ptr noundef nonnull align 16 dereferenceable(824), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZNK23b3Generic6DofConstraint7getAxisEi(ptr noundef nonnull align 16 dereferenceable(824), i32 noundef) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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, !9, i64 820}
!6 = !{!"_ZTS23b3Generic6DofConstraint", !7, i64 0, !15, i64 64, !15, i64 128, !18, i64 192, !10, i64 384, !15, i64 576, !15, i64 640, !17, i64 704, !10, i64 720, !17, i64 768, !12, i64 784, !12, i64 788, !12, i64 792, !13, i64 796, !17, i64 800, !13, i64 816, !13, i64 817, !9, i64 820}
!7 = !{!"_ZTS17b3TypedConstraint", !8, i64 8, !9, i64 12, !10, i64 16, !12, i64 24, !13, i64 28, !13, i64 29, !9, i64 32, !9, i64 36, !9, i64 40, !12, i64 44, !12, i64 48, !14, i64 56}
!8 = !{!"_ZTS13b3TypedObject", !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"float", !10, i64 0}
!13 = !{!"bool", !10, i64 0}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!"_ZTS11b3Transform", !16, i64 0, !17, i64 48}
!16 = !{!"_ZTS11b3Matrix3x3", !10, i64 0}
!17 = !{!"_ZTS9b3Vector3", !10, i64 0}
!18 = !{!"_ZTS25b3TranslationalLimitMotor", !17, i64 0, !17, i64 16, !17, i64 32, !17, i64 48, !17, i64 64, !17, i64 80, !17, i64 96, !17, i64 112, !17, i64 128, !17, i64 144, !12, i64 160, !12, i64 164, !12, i64 168, !10, i64 172, !10, i64 176}
!19 = !{!20, !14, i64 56}
!20 = !{!"_ZTSN17b3TypedConstraint17b3ConstraintInfo2E", !12, i64 0, !12, i64 4, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !9, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !9, i64 88, !12, i64 92}
!21 = !{!12, !12, i64 0}
!22 = !{!23, !12, i64 28}
!23 = !{!"_ZTS22b3RotationalLimitMotor", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !13, i64 44, !12, i64 48, !12, i64 52, !9, i64 56, !12, i64 60}
!24 = !{!23, !12, i64 36}
!25 = !{!20, !12, i64 4}
!26 = !{!23, !12, i64 32}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass