; LLVM IR from jdeokkim/ferox :: src (rigid_body)

; 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.frVector2_ = type { float, float }
%struct.frBody_ = type { %struct.frMotionData_, %struct.frTransform_, ptr, i32, i32, %struct.frAABB_, ptr }
%struct.frMotionData_ = type { float, float, float, float, %struct.frVector2_, float, float, %struct.frVector2_, float }
%struct.frTransform_ = type { %struct.frVector2_, %struct.anon, float }
%struct.anon = type { float, float }
%struct.frAABB_ = type { float, float, float, float }
%struct.frCollision_ = type { i32, %struct.frVector2_, [2 x %struct.frContact_], float, float }
%struct.frContact_ = type { i32, float, float, %struct.frVector2_, %struct.anon.0 }
%struct.anon.0 = type { float, float, float, 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Subtract(<2 x float>, <2 x float>) #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Add(<2 x float>, <2 x float>) #3

; Function Attrs: alwaysinline nounwind uwtable
declare float @frVector2Cross(<2 x float>, <2 x float>) #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2ScalarMultiply(<2 x float>, float noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @frApplyAccumulatedImpulses(ptr noundef %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.frVector2_, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.frVector2_, align 4
  %10 = alloca %struct.frVector2_, align 4
  %11 = alloca %struct.frVector2_, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca %struct.frVector2_, align 4
  %16 = alloca float, align 4
  %17 = alloca %struct.frVector2_, align 4
  %18 = alloca %struct.frVector2_, align 4
  %19 = alloca %struct.frVector2_, align 4
  %20 = alloca %struct.frVector2_, align 4
  %21 = alloca %struct.frVector2_, align 4
  %22 = alloca %struct.frVector2_, align 4
  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
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %31, label %25

25:                                               ; preds = %3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %31, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %28, %25, %3
  br label %277

32:                                               ; preds = %28
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.frBody_, ptr %33, i32 0, i32 0
  %35 = getelementptr inbounds %struct.frMotionData_, ptr %34, i32 0, i32 1
  %36 = load float, ptr %35, align 4, !tbaa !9
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.frBody_, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.frMotionData_, ptr %38, i32 0, i32 1
  %40 = load float, ptr %39, align 4, !tbaa !9
  %41 = fadd float %36, %40
  %42 = fcmp ole float %41, 0.000000e+00
  br i1 %42, label %43, label %78

43:                                               ; preds = %32
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.frBody_, ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !18
  %47 = icmp eq i32 %46, 1
  br i1 %47, label %48, label %60

48:                                               ; preds = %43
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.frBody_, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %struct.frMotionData_, ptr %50, i32 0, i32 5
  store float 0.000000e+00, ptr %51, align 8, !tbaa !19
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.frBody_, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds %struct.frMotionData_, ptr %53, i32 0, i32 4
  %55 = getelementptr inbounds %struct.frVector2_, ptr %54, i32 0, i32 1
  store float 0.000000e+00, ptr %55, align 4, !tbaa !20
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.frBody_, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %struct.frMotionData_, ptr %57, i32 0, i32 4
  %59 = getelementptr inbounds %struct.frVector2_, ptr %58, i32 0, i32 0
  store float 0.000000e+00, ptr %59, align 8, !tbaa !21
  br label %60

60:                                               ; preds = %48, %43
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.frBody_, ptr %61, i32 0, i32 3
  %63 = load i32, ptr %62, align 8, !tbaa !18
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %77

65:                                               ; preds = %60
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.frBody_, ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %struct.frMotionData_, ptr %67, i32 0, i32 5
  store float 0.000000e+00, ptr %68, align 8, !tbaa !19
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.frBody_, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %struct.frMotionData_, ptr %70, i32 0, i32 4
  %72 = getelementptr inbounds %struct.frVector2_, ptr %71, i32 0, i32 1
  store float 0.000000e+00, ptr %72, align 4, !tbaa !20
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.frBody_, ptr %73, i32 0, i32 0
  %75 = getelementptr inbounds %struct.frMotionData_, ptr %74, i32 0, i32 4
  %76 = getelementptr inbounds %struct.frVector2_, ptr %75, i32 0, i32 0
  store float 0.000000e+00, ptr %76, align 8, !tbaa !21
  br label %77

77:                                               ; preds = %65, %60
  br label %277

78:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.frCollision_, ptr %79, i32 0, i32 1
  %81 = load <2 x float>, ptr %80, align 4
  %82 = call <2 x float> @frVector2RightNormal(<2 x float> %81)
  store <2 x float> %82, ptr %7, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !22
  br label %83

83:                                               ; preds = %273, %78
  %84 = load i32, ptr %8, align 4, !tbaa !22
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.frCollision_, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 4, !tbaa !23
  %88 = icmp slt i32 %84, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %276

90:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.frCollision_, ptr %91, i32 0, i32 2
  %93 = load i32, ptr %8, align 4, !tbaa !22
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [2 x %struct.frContact_], ptr %92, i64 0, i64 %94
  %96 = getelementptr inbounds %struct.frContact_, ptr %95, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %96, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.frBody_, ptr %97, i32 0, i32 1
  %99 = getelementptr inbounds %struct.frTransform_, ptr %98, i32 0, i32 0
  %100 = load <2 x float>, ptr %9, align 4
  %101 = load <2 x float>, ptr %99, align 4
  %102 = call <2 x float> @frVector2Subtract(<2 x float> %100, <2 x float> %101)
  store <2 x float> %102, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.frBody_, ptr %103, i32 0, i32 1
  %105 = getelementptr inbounds %struct.frTransform_, ptr %104, i32 0, i32 0
  %106 = load <2 x float>, ptr %9, align 4
  %107 = load <2 x float>, ptr %105, align 4
  %108 = call <2 x float> @frVector2Subtract(<2 x float> %106, <2 x float> %107)
  store <2 x float> %108, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.frCollision_, ptr %109, i32 0, i32 1
  %111 = load <2 x float>, ptr %10, align 4
  %112 = load <2 x float>, ptr %110, align 4
  %113 = call float @frVector2Cross(<2 x float> %111, <2 x float> %112)
  store float %113, ptr %12, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.frCollision_, ptr %114, i32 0, i32 1
  %116 = load <2 x float>, ptr %11, align 4
  %117 = load <2 x float>, ptr %115, align 4
  %118 = call float @frVector2Cross(<2 x float> %116, <2 x float> %117)
  store float %118, ptr %13, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.frBody_, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %struct.frMotionData_, ptr %120, i32 0, i32 1
  %122 = load float, ptr %121, align 4, !tbaa !9
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.frBody_, ptr %123, i32 0, i32 0
  %125 = getelementptr inbounds %struct.frMotionData_, ptr %124, i32 0, i32 1
  %126 = load float, ptr %125, align 4, !tbaa !9
  %127 = fadd float %122, %126
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.frBody_, ptr %128, i32 0, i32 0
  %130 = getelementptr inbounds %struct.frMotionData_, ptr %129, i32 0, i32 3
  %131 = load float, ptr %130, align 4, !tbaa !27
  %132 = load float, ptr %12, align 4, !tbaa !26
  %133 = load float, ptr %12, align 4, !tbaa !26
  %134 = fmul float %132, %133
  %135 = call float @llvm.fmuladd.f32(float %131, float %134, float %127)
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.frBody_, ptr %136, i32 0, i32 0
  %138 = getelementptr inbounds %struct.frMotionData_, ptr %137, i32 0, i32 3
  %139 = load float, ptr %138, align 4, !tbaa !27
  %140 = load float, ptr %13, align 4, !tbaa !26
  %141 = load float, ptr %13, align 4, !tbaa !26
  %142 = fmul float %140, %141
  %143 = call float @llvm.fmuladd.f32(float %139, float %142, float %135)
  store float %143, ptr %14, align 4, !tbaa !26
  %144 = load float, ptr %14, align 4, !tbaa !26
  %145 = fdiv float 1.000000e+00, %144
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.frCollision_, ptr %146, i32 0, i32 2
  %148 = load i32, ptr %8, align 4, !tbaa !22
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [2 x %struct.frContact_], ptr %147, i64 0, i64 %149
  %151 = getelementptr inbounds %struct.frContact_, ptr %150, i32 0, i32 4
  %152 = getelementptr inbounds %struct.anon.0, ptr %151, i32 0, i32 0
  store float %145, ptr %152, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.frCollision_, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.frCollision_, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %8, align 4, !tbaa !22
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [2 x %struct.frContact_], ptr %156, i64 0, i64 %158
  %160 = getelementptr inbounds %struct.frContact_, ptr %159, i32 0, i32 4
  %161 = getelementptr inbounds %struct.anon.0, ptr %160, i32 0, i32 1
  %162 = load float, ptr %161, align 4, !tbaa !31
  %163 = load <2 x float>, ptr %154, align 4
  %164 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %163, float noundef %162)
  store <2 x float> %164, ptr %15, align 4
  %165 = load <2 x float>, ptr %10, align 4
  %166 = load <2 x float>, ptr %7, align 4
  %167 = call float @frVector2Cross(<2 x float> %165, <2 x float> %166)
  store float %167, ptr %12, align 4, !tbaa !26
  %168 = load <2 x float>, ptr %11, align 4
  %169 = load <2 x float>, ptr %7, align 4
  %170 = call float @frVector2Cross(<2 x float> %168, <2 x float> %169)
  store float %170, ptr %13, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.frBody_, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds %struct.frMotionData_, ptr %172, i32 0, i32 1
  %174 = load float, ptr %173, align 4, !tbaa !9
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.frBody_, ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds %struct.frMotionData_, ptr %176, i32 0, i32 1
  %178 = load float, ptr %177, align 4, !tbaa !9
  %179 = fadd float %174, %178
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.frBody_, ptr %180, i32 0, i32 0
  %182 = getelementptr inbounds %struct.frMotionData_, ptr %181, i32 0, i32 3
  %183 = load float, ptr %182, align 4, !tbaa !27
  %184 = load float, ptr %12, align 4, !tbaa !26
  %185 = load float, ptr %12, align 4, !tbaa !26
  %186 = fmul float %184, %185
  %187 = call float @llvm.fmuladd.f32(float %183, float %186, float %179)
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.frBody_, ptr %188, i32 0, i32 0
  %190 = getelementptr inbounds %struct.frMotionData_, ptr %189, i32 0, i32 3
  %191 = load float, ptr %190, align 4, !tbaa !27
  %192 = load float, ptr %13, align 4, !tbaa !26
  %193 = load float, ptr %13, align 4, !tbaa !26
  %194 = fmul float %192, %193
  %195 = call float @llvm.fmuladd.f32(float %191, float %194, float %187)
  store float %195, ptr %16, align 4, !tbaa !26
  %196 = load float, ptr %16, align 4, !tbaa !26
  %197 = fdiv float 1.000000e+00, %196
  %198 = load ptr, ptr %6, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.frCollision_, ptr %198, i32 0, i32 2
  %200 = load i32, ptr %8, align 4, !tbaa !22
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [2 x %struct.frContact_], ptr %199, i64 0, i64 %201
  %203 = getelementptr inbounds %struct.frContact_, ptr %202, i32 0, i32 4
  %204 = getelementptr inbounds %struct.anon.0, ptr %203, i32 0, i32 2
  store float %197, ptr %204, align 4, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.frCollision_, ptr %205, i32 0, i32 2
  %207 = load i32, ptr %8, align 4, !tbaa !22
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [2 x %struct.frContact_], ptr %206, i64 0, i64 %208
  %210 = getelementptr inbounds %struct.frContact_, ptr %209, i32 0, i32 4
  %211 = getelementptr inbounds %struct.anon.0, ptr %210, i32 0, i32 3
  %212 = load float, ptr %211, align 4, !tbaa !33
  %213 = load <2 x float>, ptr %7, align 4
  %214 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %213, float noundef %212)
  store <2 x float> %214, ptr %17, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %215 = load <2 x float>, ptr %15, align 4
  %216 = load <2 x float>, ptr %17, align 4
  %217 = call <2 x float> @frVector2Add(<2 x float> %215, <2 x float> %216)
  store <2 x float> %217, ptr %18, align 4
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.frBody_, ptr %218, i32 0, i32 0
  %220 = getelementptr inbounds %struct.frMotionData_, ptr %219, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.frBody_, ptr %221, i32 0, i32 0
  %223 = getelementptr inbounds %struct.frMotionData_, ptr %222, i32 0, i32 4
  %224 = load ptr, ptr %4, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.frBody_, ptr %224, i32 0, i32 0
  %226 = getelementptr inbounds %struct.frMotionData_, ptr %225, i32 0, i32 1
  %227 = load float, ptr %226, align 4, !tbaa !9
  %228 = load <2 x float>, ptr %18, align 4
  %229 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %228, float noundef %227)
  store <2 x float> %229, ptr %20, align 4
  %230 = load <2 x float>, ptr %223, align 8
  %231 = load <2 x float>, ptr %20, align 4
  %232 = call <2 x float> @frVector2Subtract(<2 x float> %230, <2 x float> %231)
  store <2 x float> %232, ptr %19, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %220, ptr align 4 %19, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %233 = load ptr, ptr %4, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.frBody_, ptr %233, i32 0, i32 0
  %235 = getelementptr inbounds %struct.frMotionData_, ptr %234, i32 0, i32 3
  %236 = load float, ptr %235, align 4, !tbaa !27
  %237 = load <2 x float>, ptr %10, align 4
  %238 = load <2 x float>, ptr %18, align 4
  %239 = call float @frVector2Cross(<2 x float> %237, <2 x float> %238)
  %240 = load ptr, ptr %4, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.frBody_, ptr %240, i32 0, i32 0
  %242 = getelementptr inbounds %struct.frMotionData_, ptr %241, i32 0, i32 5
  %243 = load float, ptr %242, align 8, !tbaa !19
  %244 = fneg float %236
  %245 = call float @llvm.fmuladd.f32(float %244, float %239, float %243)
  store float %245, ptr %242, align 8, !tbaa !19
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.frBody_, ptr %246, i32 0, i32 0
  %248 = getelementptr inbounds %struct.frMotionData_, ptr %247, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %249 = load ptr, ptr %5, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.frBody_, ptr %249, i32 0, i32 0
  %251 = getelementptr inbounds %struct.frMotionData_, ptr %250, i32 0, i32 4
  %252 = load ptr, ptr %5, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.frBody_, ptr %252, i32 0, i32 0
  %254 = getelementptr inbounds %struct.frMotionData_, ptr %253, i32 0, i32 1
  %255 = load float, ptr %254, align 4, !tbaa !9
  %256 = load <2 x float>, ptr %18, align 4
  %257 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %256, float noundef %255)
  store <2 x float> %257, ptr %22, align 4
  %258 = load <2 x float>, ptr %251, align 8
  %259 = load <2 x float>, ptr %22, align 4
  %260 = call <2 x float> @frVector2Add(<2 x float> %258, <2 x float> %259)
  store <2 x float> %260, ptr %21, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %248, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  %261 = load ptr, ptr %5, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.frBody_, ptr %261, i32 0, i32 0
  %263 = getelementptr inbounds %struct.frMotionData_, ptr %262, i32 0, i32 3
  %264 = load float, ptr %263, align 4, !tbaa !27
  %265 = load <2 x float>, ptr %11, align 4
  %266 = load <2 x float>, ptr %18, align 4
  %267 = call float @frVector2Cross(<2 x float> %265, <2 x float> %266)
  %268 = load ptr, ptr %5, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.frBody_, ptr %268, i32 0, i32 0
  %270 = getelementptr inbounds %struct.frMotionData_, ptr %269, i32 0, i32 5
  %271 = load float, ptr %270, align 8, !tbaa !19
  %272 = call float @llvm.fmuladd.f32(float %264, float %267, float %271)
  store float %272, ptr %270, align 8, !tbaa !19
  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 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %9) #5
  br label %273

273:                                              ; preds = %90
  %274 = load i32, ptr %8, align 4, !tbaa !22
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %8, align 4, !tbaa !22
  br label %83, !llvm.loop !34

276:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %277

277:                                              ; preds = %276, %77, %31
  ret void
}

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2RightNormal(<2 x float>) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { alwaysinline 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 = { 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 #5 = { 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, !12, i64 4}
!10 = !{!"frBody_", !11, i64 0, !14, i64 44, !6, i64 64, !16, i64 72, !16, i64 76, !17, i64 80, !6, i64 96}
!11 = !{!"frMotionData_", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !13, i64 16, !12, i64 24, !12, i64 28, !13, i64 32, !12, i64 40}
!12 = !{!"float", !7, i64 0}
!13 = !{!"frVector2_", !12, i64 0, !12, i64 4}
!14 = !{!"frTransform_", !13, i64 0, !15, i64 8, !12, i64 16}
!15 = !{!"", !12, i64 0, !12, i64 4}
!16 = !{!"int", !7, i64 0}
!17 = !{!"frAABB_", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!18 = !{!10, !16, i64 72}
!19 = !{!10, !12, i64 24}
!20 = !{!10, !12, i64 20}
!21 = !{!10, !12, i64 16}
!22 = !{!16, !16, i64 0}
!23 = !{!24, !16, i64 0}
!24 = !{!"frCollision_", !16, i64 0, !13, i64 4, !7, i64 12, !12, i64 84, !12, i64 88}
!25 = !{i64 0, i64 4, !26, i64 4, i64 4, !26}
!26 = !{!12, !12, i64 0}
!27 = !{!10, !12, i64 12}
!28 = !{!29, !12, i64 20}
!29 = !{!"frContact_", !16, i64 0, !12, i64 4, !12, i64 8, !13, i64 12, !30, i64 20}
!30 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!31 = !{!29, !12, i64 24}
!32 = !{!29, !12, i64 28}
!33 = !{!29, !12, i64 32}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.frContact_ = type { i32, float, float, %struct.frVector2_, %struct.anon.0 }
%struct.frVector2_ = type { float, float }
%struct.anon.0 = type { float, float, float, float }

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

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Subtract(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Add(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare float @frVector2Cross(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2ScalarMultiply(<2 x float>, float noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @frApplyAccumulatedImpulses(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = icmp eq ptr %0, null
  %5 = icmp eq ptr %1, null
  %or.cond = or i1 %4, %5
  %6 = icmp eq ptr %2, null
  %or.cond3 = or i1 %or.cond, %6
  br i1 %or.cond3, label %.loopexit, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load float, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 4
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = fadd float %9, %11
  %13 = fcmp ugt float %12, 0.000000e+00
  br i1 %13, label %28, label %14

14:                                               ; preds = %7
  %15 = getelementptr inbounds i8, ptr %0, i64 72
  %16 = load i32, ptr %15, align 8, !tbaa !17
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %21

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  store float 0.000000e+00, ptr %19, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x float> zeroinitializer, ptr %20, align 8, !tbaa !19
  br label %21

21:                                               ; preds = %18, %14
  %22 = getelementptr inbounds i8, ptr %1, i64 72
  %23 = load i32, ptr %22, align 8, !tbaa !17
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %.loopexit

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %1, i64 24
  store float 0.000000e+00, ptr %26, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %1, i64 16
  store <2 x float> zeroinitializer, ptr %27, align 8, !tbaa !19
  br label %.loopexit

28:                                               ; preds = %7
  %29 = getelementptr inbounds i8, ptr %2, i64 4
  %30 = load <2 x float>, ptr %29, align 4
  %31 = tail call <2 x float> @frVector2RightNormal(<2 x float> %30)
  %32 = load i32, ptr %2, align 4, !tbaa !20
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %28
  %34 = getelementptr inbounds i8, ptr %2, i64 12
  %35 = getelementptr inbounds i8, ptr %0, i64 44
  %36 = getelementptr inbounds i8, ptr %1, i64 44
  %37 = getelementptr inbounds i8, ptr %0, i64 12
  %38 = getelementptr inbounds i8, ptr %1, i64 12
  %39 = getelementptr inbounds i8, ptr %0, i64 16
  %40 = getelementptr inbounds i8, ptr %0, i64 24
  %41 = getelementptr inbounds i8, ptr %1, i64 16
  %42 = getelementptr inbounds i8, ptr %1, i64 24
  br label %43

43:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %44 = getelementptr inbounds [2 x %struct.frContact_], ptr %34, i64 0, i64 %indvars.iv
  %45 = getelementptr inbounds i8, ptr %44, i64 12
  %.sroa.028.0.copyload = load <2 x float>, ptr %45, align 4
  %46 = load <2 x float>, ptr %35, align 4
  %47 = tail call <2 x float> @frVector2Subtract(<2 x float> %.sroa.028.0.copyload, <2 x float> %46)
  %48 = load <2 x float>, ptr %36, align 4
  %49 = tail call <2 x float> @frVector2Subtract(<2 x float> %.sroa.028.0.copyload, <2 x float> %48)
  %50 = load <2 x float>, ptr %29, align 4
  %51 = tail call float @frVector2Cross(<2 x float> %47, <2 x float> %50)
  %52 = load <2 x float>, ptr %29, align 4
  %53 = tail call float @frVector2Cross(<2 x float> %49, <2 x float> %52)
  %54 = load float, ptr %8, align 4, !tbaa !5
  %55 = load float, ptr %10, align 4, !tbaa !5
  %56 = fadd float %54, %55
  %57 = load float, ptr %37, align 4, !tbaa !22
  %58 = fmul float %51, %51
  %59 = tail call float @llvm.fmuladd.f32(float %57, float %58, float %56)
  %60 = load float, ptr %38, align 4, !tbaa !22
  %61 = fmul float %53, %53
  %62 = tail call float @llvm.fmuladd.f32(float %60, float %61, float %59)
  %63 = fdiv float 1.000000e+00, %62
  %64 = getelementptr inbounds i8, ptr %44, i64 20
  store float %63, ptr %64, align 4, !tbaa !23
  %65 = getelementptr inbounds i8, ptr %44, i64 24
  %66 = load float, ptr %65, align 4, !tbaa !26
  %67 = load <2 x float>, ptr %29, align 4
  %68 = tail call <2 x float> @frVector2ScalarMultiply(<2 x float> %67, float noundef %66)
  %69 = tail call float @frVector2Cross(<2 x float> %47, <2 x float> %31)
  %70 = tail call float @frVector2Cross(<2 x float> %49, <2 x float> %31)
  %71 = load float, ptr %8, align 4, !tbaa !5
  %72 = load float, ptr %10, align 4, !tbaa !5
  %73 = fadd float %71, %72
  %74 = load float, ptr %37, align 4, !tbaa !22
  %75 = fmul float %69, %69
  %76 = tail call float @llvm.fmuladd.f32(float %74, float %75, float %73)
  %77 = load float, ptr %38, align 4, !tbaa !22
  %78 = fmul float %70, %70
  %79 = tail call float @llvm.fmuladd.f32(float %77, float %78, float %76)
  %80 = fdiv float 1.000000e+00, %79
  %81 = getelementptr inbounds i8, ptr %44, i64 28
  store float %80, ptr %81, align 4, !tbaa !27
  %82 = getelementptr inbounds i8, ptr %44, i64 32
  %83 = load float, ptr %82, align 4, !tbaa !28
  %84 = tail call <2 x float> @frVector2ScalarMultiply(<2 x float> %31, float noundef %83)
  %85 = tail call <2 x float> @frVector2Add(<2 x float> %68, <2 x float> %84)
  %86 = load float, ptr %8, align 4, !tbaa !5
  %87 = tail call <2 x float> @frVector2ScalarMultiply(<2 x float> %85, float noundef %86)
  %88 = load <2 x float>, ptr %39, align 8
  %89 = tail call <2 x float> @frVector2Subtract(<2 x float> %88, <2 x float> %87)
  store <2 x float> %89, ptr %39, align 8
  %90 = load float, ptr %37, align 4, !tbaa !22
  %91 = tail call float @frVector2Cross(<2 x float> %47, <2 x float> %85)
  %92 = load float, ptr %40, align 8, !tbaa !18
  %93 = fneg float %90
  %94 = tail call float @llvm.fmuladd.f32(float %93, float %91, float %92)
  store float %94, ptr %40, align 8, !tbaa !18
  %95 = load float, ptr %10, align 4, !tbaa !5
  %96 = tail call <2 x float> @frVector2ScalarMultiply(<2 x float> %85, float noundef %95)
  %97 = load <2 x float>, ptr %41, align 8
  %98 = tail call <2 x float> @frVector2Add(<2 x float> %97, <2 x float> %96)
  store <2 x float> %98, ptr %41, align 8
  %99 = load float, ptr %38, align 4, !tbaa !22
  %100 = tail call float @frVector2Cross(<2 x float> %49, <2 x float> %85)
  %101 = load float, ptr %42, align 8, !tbaa !18
  %102 = tail call float @llvm.fmuladd.f32(float %99, float %100, float %101)
  store float %102, ptr %42, align 8, !tbaa !18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %103 = load i32, ptr %2, align 4, !tbaa !20
  %104 = sext i32 %103 to i64
  %105 = icmp slt i64 %indvars.iv.next, %104
  br i1 %105, label %43, label %.loopexit, !llvm.loop !29

.loopexit:                                        ; preds = %43, %28, %21, %25, %3
  ret void
}

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2RightNormal(<2 x float>) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { alwaysinline 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 #2 = { 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" }

!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, !8, i64 4}
!6 = !{!"frBody_", !7, i64 0, !12, i64 44, !14, i64 64, !15, i64 72, !15, i64 76, !16, i64 80, !14, i64 96}
!7 = !{!"frMotionData_", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !11, i64 16, !8, i64 24, !8, i64 28, !11, i64 32, !8, i64 40}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"frVector2_", !8, i64 0, !8, i64 4}
!12 = !{!"frTransform_", !11, i64 0, !13, i64 8, !8, i64 16}
!13 = !{!"", !8, i64 0, !8, i64 4}
!14 = !{!"any pointer", !9, i64 0}
!15 = !{!"int", !9, i64 0}
!16 = !{!"frAABB_", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12}
!17 = !{!6, !15, i64 72}
!18 = !{!6, !8, i64 24}
!19 = !{!8, !8, i64 0}
!20 = !{!21, !15, i64 0}
!21 = !{!"frCollision_", !15, i64 0, !11, i64 4, !9, i64 12, !8, i64 84, !8, i64 88}
!22 = !{!6, !8, i64 12}
!23 = !{!24, !8, i64 20}
!24 = !{!"frContact_", !15, i64 0, !8, i64 4, !8, i64 8, !11, i64 12, !25, i64 20}
!25 = !{!"", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12}
!26 = !{!24, !8, i64 24}
!27 = !{!24, !8, i64 28}
!28 = !{!24, !8, i64 32}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass