; LLVM IR from erincatto/box2d :: src (revolute_joint)

; 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.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon }
%union.anon = type { %struct.b2PrismaticJoint }
%struct.b2PrismaticJoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, %struct.b2Softness, i8, i8, i8 }
%struct.b2Softness = type { float, float, float }
%struct.b2RevoluteJoint = type { %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, %struct.b2Softness, i8, i8, i8 }
%struct.b2StepContext = type { float, float, float, float, i32, %struct.b2Softness, %struct.b2Softness, %struct.b2Softness, float, float, ptr, ptr, ptr, ptr, ptr, i32, ptr, %struct.b2AtomicInt, ptr, ptr, ptr, i32, i32, ptr, i32, i8, [64 x i8], %struct.b2AtomicU32, [64 x i8] }
%struct.b2AtomicInt = type { i32 }
%struct.b2AtomicU32 = type { i32 }

@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@__const.b2WarmStartRevoluteJoint.dummyState = external hidden unnamed_addr constant %struct.b2BodyState, align 4

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

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2RotateVector(<2 x float>, <2 x float>) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
define dso_local void @b2WarmStartRevoluteJoint(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %struct.b2BodyState, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.b2Vec2, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca float, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %2
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.b2JointSim, ptr %19, i32 0, i32 3
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = icmp eq i32 %21, 5
  br i1 %22, label %27, label %23

23:                                               ; preds = %18
  %24 = call i32 @b2InternalAssertFcn(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 252)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  call void @llvm.trap()
  br label %27

27:                                               ; preds = %26, %23, %18
  br label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.b2JointSim, ptr %29, i32 0, i32 6
  %31 = load float, ptr %30, align 4, !tbaa !14
  store float %31, ptr %5, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.b2JointSim, ptr %32, i32 0, i32 7
  %34 = load float, ptr %33, align 4, !tbaa !16
  store float %34, ptr %6, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.b2JointSim, ptr %35, i32 0, i32 8
  %37 = load float, ptr %36, align 4, !tbaa !17
  store float %37, ptr %7, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.b2JointSim, ptr %38, i32 0, i32 9
  %40 = load float, ptr %39, align 4, !tbaa !18
  store float %40, ptr %8, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 @__const.b2WarmStartRevoluteJoint.dummyState, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.b2JointSim, ptr %41, i32 0, i32 10
  store ptr %42, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %43, i32 0, i32 12
  %45 = load i32, ptr %44, align 4, !tbaa !19
  %46 = icmp eq i32 %45, -1
  br i1 %46, label %47, label %48

47:                                               ; preds = %28
  br label %57

48:                                               ; preds = %28
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.b2StepContext, ptr %49, i32 0, i32 12
  %51 = load ptr, ptr %50, align 8, !tbaa !23
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %52, i32 0, i32 12
  %54 = load i32, ptr %53, align 4, !tbaa !19
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %struct.b2BodyState, ptr %51, i64 %55
  br label %57

57:                                               ; preds = %48, %47
  %58 = phi ptr [ %9, %47 ], [ %56, %48 ]
  store ptr %58, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %59, i32 0, i32 13
  %61 = load i32, ptr %60, align 4, !tbaa !27
  %62 = icmp eq i32 %61, -1
  br i1 %62, label %63, label %64

63:                                               ; preds = %57
  br label %73

64:                                               ; preds = %57
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.b2StepContext, ptr %65, i32 0, i32 12
  %67 = load ptr, ptr %66, align 8, !tbaa !23
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %68, i32 0, i32 13
  %70 = load i32, ptr %69, align 4, !tbaa !27
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %struct.b2BodyState, ptr %67, i64 %71
  br label %73

73:                                               ; preds = %64, %63
  %74 = phi ptr [ %9, %63 ], [ %72, %64 ]
  store ptr %74, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.b2BodyState, ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %77, i32 0, i32 14
  %79 = load <2 x float>, ptr %76, align 4
  %80 = load <2 x float>, ptr %78, align 4
  %81 = call <2 x float> @b2RotateVector(<2 x float> %79, <2 x float> %80)
  store <2 x float> %81, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.b2BodyState, ptr %82, i32 0, i32 4
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %84, i32 0, i32 15
  %86 = load <2 x float>, ptr %83, align 4
  %87 = load <2 x float>, ptr %85, align 4
  %88 = call <2 x float> @b2RotateVector(<2 x float> %86, <2 x float> %87)
  store <2 x float> %88, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %89, i32 0, i32 1
  %91 = load float, ptr %90, align 4, !tbaa !28
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %92, i32 0, i32 2
  %94 = load float, ptr %93, align 4, !tbaa !29
  %95 = fadd float %91, %94
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %96, i32 0, i32 3
  %98 = load float, ptr %97, align 4, !tbaa !30
  %99 = fadd float %95, %98
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %100, i32 0, i32 4
  %102 = load float, ptr %101, align 4, !tbaa !31
  %103 = fsub float %99, %102
  store float %103, ptr %15, align 4, !tbaa !15
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.b2BodyState, ptr %104, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.b2BodyState, ptr %106, i32 0, i32 0
  %108 = load float, ptr %5, align 4, !tbaa !15
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %109, i32 0, i32 0
  %111 = load <2 x float>, ptr %107, align 4
  %112 = load <2 x float>, ptr %110, align 4
  %113 = call <2 x float> @b2MulSub(<2 x float> %111, float noundef %108, <2 x float> %112)
  store <2 x float> %113, ptr %16, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %105, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !32
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %114 = load float, ptr %7, align 4, !tbaa !15
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %115, i32 0, i32 0
  %117 = load <2 x float>, ptr %13, align 4
  %118 = load <2 x float>, ptr %116, align 4
  %119 = call float @b2Cross(<2 x float> %117, <2 x float> %118)
  %120 = load float, ptr %15, align 4, !tbaa !15
  %121 = fadd float %119, %120
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.b2BodyState, ptr %122, i32 0, i32 1
  %124 = load float, ptr %123, align 4, !tbaa !33
  %125 = fneg float %114
  %126 = call float @llvm.fmuladd.f32(float %125, float %121, float %124)
  store float %126, ptr %123, align 4, !tbaa !33
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.b2BodyState, ptr %127, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.b2BodyState, ptr %129, i32 0, i32 0
  %131 = load float, ptr %6, align 4, !tbaa !15
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %132, i32 0, i32 0
  %134 = load <2 x float>, ptr %130, align 4
  %135 = load <2 x float>, ptr %133, align 4
  %136 = call <2 x float> @b2MulAdd(<2 x float> %134, float noundef %131, <2 x float> %135)
  store <2 x float> %136, ptr %17, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %128, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !32
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  %137 = load float, ptr %8, align 4, !tbaa !15
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.b2RevoluteJoint, ptr %138, i32 0, i32 0
  %140 = load <2 x float>, ptr %14, align 4
  %141 = load <2 x float>, ptr %139, align 4
  %142 = call float @b2Cross(<2 x float> %140, <2 x float> %141)
  %143 = load float, ptr %15, align 4, !tbaa !15
  %144 = fadd float %142, %143
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.b2BodyState, ptr %145, i32 0, i32 1
  %147 = load float, ptr %146, align 4, !tbaa !33
  %148 = call float @llvm.fmuladd.f32(float %137, float %144, float %147)
  store float %148, ptr %146, align 4, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSub(<2 x float>, float noundef, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Cross(<2 x float>, <2 x float>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) #3

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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #3 = { inlinehint nounwind 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 12}
!10 = !{!"b2JointSim", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !7, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"b2Vec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!10, !13, i64 32}
!15 = !{!13, !13, i64 0}
!16 = !{!10, !13, i64 36}
!17 = !{!10, !13, i64 40}
!18 = !{!10, !13, i64 44}
!19 = !{!20, !11, i64 52}
!20 = !{!"b2RevoluteJoint", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !11, i64 52, !11, i64 56, !12, i64 60, !12, i64 68, !12, i64 76, !13, i64 84, !13, i64 88, !21, i64 92, !22, i64 104, !22, i64 105, !22, i64 106}
!21 = !{!"b2Softness", !13, i64 0, !13, i64 4, !13, i64 8}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{!24, !6, i64 80}
!24 = !{!"b2StepContext", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !11, i64 16, !21, i64 20, !21, i64 32, !21, i64 44, !13, i64 56, !13, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !11, i64 104, !6, i64 112, !25, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !11, i64 152, !11, i64 156, !6, i64 160, !11, i64 168, !22, i64 172, !7, i64 173, !26, i64 240, !7, i64 244}
!25 = !{!"b2AtomicInt", !11, i64 0}
!26 = !{!"b2AtomicU32", !11, i64 0}
!27 = !{!20, !11, i64 56}
!28 = !{!20, !13, i64 8}
!29 = !{!20, !13, i64 12}
!30 = !{!20, !13, i64 16}
!31 = !{!20, !13, i64 20}
!32 = !{i64 0, i64 4, !15, i64 4, i64 4, !15}
!33 = !{!34, !13, i64 8}
!34 = !{!"b2BodyState", !12, i64 0, !13, i64 8, !11, i64 12, !12, i64 16, !35, i64 24}
!35 = !{!"b2Rot", !13, i64 0, !13, i64 4}


; 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.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }

@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@__const.b2WarmStartRevoluteJoint.dummyState = external hidden unnamed_addr constant %struct.b2BodyState, align 4

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

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2RotateVector(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
define dso_local void @b2WarmStartRevoluteJoint(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #5 {
  %3 = alloca %struct.b2BodyState, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 5
  br i1 %6, label %10, label %7

7:                                                ; preds = %2
  %8 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 252) #7
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %10, label %9

9:                                                ; preds = %7
  tail call void @llvm.trap()
  unreachable

10:                                               ; preds = %2, %7
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load float, ptr %11, align 4, !tbaa !12
  %13 = getelementptr inbounds i8, ptr %0, i64 36
  %14 = load float, ptr %13, align 4, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = load float, ptr %15, align 4, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %0, i64 44
  %18 = load float, ptr %17, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %3, ptr noundef nonnull align 4 dereferenceable(32) @__const.b2WarmStartRevoluteJoint.dummyState, i64 32, i1 false)
  %19 = getelementptr inbounds i8, ptr %0, i64 100
  %20 = load i32, ptr %19, align 4, !tbaa !16
  %21 = icmp eq i32 %20, -1
  br i1 %21, label %27, label %22

22:                                               ; preds = %10
  %23 = getelementptr inbounds i8, ptr %1, i64 80
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  %25 = sext i32 %20 to i64
  %26 = getelementptr inbounds %struct.b2BodyState, ptr %24, i64 %25
  br label %27

27:                                               ; preds = %10, %22
  %28 = phi ptr [ %26, %22 ], [ %3, %10 ]
  %29 = getelementptr inbounds i8, ptr %0, i64 104
  %30 = load i32, ptr %29, align 4, !tbaa !25
  %31 = icmp eq i32 %30, -1
  br i1 %31, label %37, label %32

32:                                               ; preds = %27
  %33 = getelementptr inbounds i8, ptr %1, i64 80
  %34 = load ptr, ptr %33, align 8, !tbaa !20
  %35 = sext i32 %30 to i64
  %36 = getelementptr inbounds %struct.b2BodyState, ptr %34, i64 %35
  br label %37

37:                                               ; preds = %27, %32
  %38 = phi ptr [ %36, %32 ], [ %3, %27 ]
  %39 = getelementptr inbounds i8, ptr %0, i64 48
  %40 = getelementptr inbounds i8, ptr %28, i64 24
  %41 = getelementptr inbounds i8, ptr %0, i64 108
  %42 = load <2 x float>, ptr %40, align 4
  %43 = load <2 x float>, ptr %41, align 4
  %44 = tail call <2 x float> @b2RotateVector(<2 x float> %42, <2 x float> %43)
  %45 = getelementptr inbounds i8, ptr %38, i64 24
  %46 = getelementptr inbounds i8, ptr %0, i64 116
  %47 = load <2 x float>, ptr %45, align 4
  %48 = load <2 x float>, ptr %46, align 4
  %49 = tail call <2 x float> @b2RotateVector(<2 x float> %47, <2 x float> %48)
  %50 = getelementptr inbounds i8, ptr %0, i64 56
  %51 = load float, ptr %50, align 4, !tbaa !26
  %52 = getelementptr inbounds i8, ptr %0, i64 60
  %53 = load float, ptr %52, align 4, !tbaa !27
  %54 = fadd float %51, %53
  %55 = getelementptr inbounds i8, ptr %0, i64 64
  %56 = load float, ptr %55, align 4, !tbaa !28
  %57 = fadd float %54, %56
  %58 = getelementptr inbounds i8, ptr %0, i64 68
  %59 = load float, ptr %58, align 4, !tbaa !29
  %60 = fsub float %57, %59
  %61 = load <2 x float>, ptr %28, align 4
  %62 = load <2 x float>, ptr %39, align 4
  %63 = tail call <2 x float> @b2MulSub(<2 x float> %61, float noundef %12, <2 x float> %62)
  store <2 x float> %63, ptr %28, align 4
  %64 = load <2 x float>, ptr %39, align 4
  %65 = tail call float @b2Cross(<2 x float> %44, <2 x float> %64)
  %66 = fadd float %60, %65
  %67 = getelementptr inbounds i8, ptr %28, i64 8
  %68 = load float, ptr %67, align 4, !tbaa !30
  %69 = fneg float %16
  %70 = tail call float @llvm.fmuladd.f32(float %69, float %66, float %68)
  store float %70, ptr %67, align 4, !tbaa !30
  %71 = load <2 x float>, ptr %38, align 4
  %72 = load <2 x float>, ptr %39, align 4
  %73 = tail call <2 x float> @b2MulAdd(<2 x float> %71, float noundef %14, <2 x float> %72)
  store <2 x float> %73, ptr %38, align 4
  %74 = load <2 x float>, ptr %39, align 4
  %75 = tail call float @b2Cross(<2 x float> %49, <2 x float> %74)
  %76 = fadd float %60, %75
  %77 = getelementptr inbounds i8, ptr %38, i64 8
  %78 = load float, ptr %77, align 4, !tbaa !30
  %79 = tail call float @llvm.fmuladd.f32(float %18, float %76, float %78)
  store float %79, ptr %77, align 4, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSub(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Cross(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #3

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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #3 = { inlinehint nounwind 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind 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 #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !7, i64 12}
!6 = !{!"b2JointSim", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !8, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !11, i64 32}
!13 = !{!6, !11, i64 36}
!14 = !{!6, !11, i64 40}
!15 = !{!6, !11, i64 44}
!16 = !{!17, !7, i64 52}
!17 = !{!"b2RevoluteJoint", !10, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !7, i64 52, !7, i64 56, !10, i64 60, !10, i64 68, !10, i64 76, !11, i64 84, !11, i64 88, !18, i64 92, !19, i64 104, !19, i64 105, !19, i64 106}
!18 = !{!"b2Softness", !11, i64 0, !11, i64 4, !11, i64 8}
!19 = !{!"_Bool", !8, i64 0}
!20 = !{!21, !22, i64 80}
!21 = !{!"b2StepContext", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, i64 16, !18, i64 20, !18, i64 32, !18, i64 44, !11, i64 56, !11, i64 60, !22, i64 64, !22, i64 72, !22, i64 80, !22, i64 88, !22, i64 96, !7, i64 104, !22, i64 112, !23, i64 120, !22, i64 128, !22, i64 136, !22, i64 144, !7, i64 152, !7, i64 156, !22, i64 160, !7, i64 168, !19, i64 172, !8, i64 173, !24, i64 240, !8, i64 244}
!22 = !{!"any pointer", !8, i64 0}
!23 = !{!"b2AtomicInt", !7, i64 0}
!24 = !{!"b2AtomicU32", !7, i64 0}
!25 = !{!17, !7, i64 56}
!26 = !{!17, !11, i64 8}
!27 = !{!17, !11, i64 12}
!28 = !{!17, !11, i64 16}
!29 = !{!17, !11, i64 20}
!30 = !{!31, !11, i64 8}
!31 = !{!"b2BodyState", !10, i64 0, !11, i64 8, !7, i64 12, !10, i64 16, !32, i64 24}
!32 = !{!"b2Rot", !11, i64 0, !11, i64 4}


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