; LLVM IR from SOHNE/Dura2D :: src/collision/d2Constraint.ll (ZN23d2PenetrationConstraint8PreSolveEf)

; 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.d2MatMN = type { i32, i32, ptr }
%struct.d2VecN = type { i32, ptr }
%struct.d2Vec2 = type { float, float }
%class.d2Constraint = type { ptr, ptr, ptr, %struct.d2Vec2, %struct.d2Vec2, ptr, ptr }
%class.d2PenetrationConstraint = type { %class.d2Constraint, %struct.d2MatMN, %struct.d2VecN, float, %struct.d2Vec2, float }

declare void @_ZN7d2MatMN4ZeroEv(ptr noundef nonnull align 8 dereferenceable(16)) #0

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #0

; Function Attrs: nounwind
declare void @_ZN7d2MatMND1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN6d2VecND1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

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

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

declare <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132), ptr noundef nonnull align 4 dereferenceable(8)) #0

declare <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK6d2Body11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(132)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

declare void @_ZNK7d2MatMN9TransposeEv(ptr dead_on_unwind writable sret(%struct.d2MatMN) align 8, ptr noundef nonnull align 8 dereferenceable(16)) #0

declare void @_ZNK7d2MatMNmlERK6d2VecN(ptr dead_on_unwind writable sret(%struct.d2VecN) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

declare void @_ZN6d2Body18ApplyImpulseLinearERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6d2Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #4 align 2

declare void @_ZN6d2Body19ApplyImpulseAngularEf(ptr noundef nonnull align 8 dereferenceable(132), float noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6d2Vec23DotERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23d2PenetrationConstraint8PreSolveEf(ptr noundef nonnull align 8 dereferenceable(104) %0, float noundef %1) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca %struct.d2Vec2, align 4
  %6 = alloca %struct.d2Vec2, align 4
  %7 = alloca %struct.d2Vec2, align 4
  %8 = alloca %struct.d2Vec2, align 4
  %9 = alloca %struct.d2Vec2, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca %struct.d2Vec2, align 4
  %13 = alloca %struct.d2MatMN, align 8
  %14 = alloca %struct.d2VecN, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.d2Vec2, align 4
  %18 = alloca %struct.d2Vec2, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca %struct.d2Vec2, align 4
  %22 = alloca %struct.d2Vec2, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %23 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %24 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 3
  %27 = call <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %25, ptr noundef nonnull align 4 dereferenceable(8) %26)
  store <2 x float> %27, ptr %5, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %28 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 4
  %31 = call <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %29, ptr noundef nonnull align 4 dereferenceable(8) %30)
  store <2 x float> %31, ptr %6, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %32 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 1
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 4
  %35 = call <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %33, ptr noundef nonnull align 4 dereferenceable(8) %34)
  store <2 x float> %35, ptr %7, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %36 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK6d2Body11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(132) %37)
  %39 = call <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %38)
  store <2 x float> %39, ptr %8, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %40 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK6d2Body11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(132) %41)
  %43 = call <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %42)
  store <2 x float> %43, ptr %9, align 4
  %44 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  call void @_ZN7d2MatMN4ZeroEv(ptr noundef nonnull align 8 dereferenceable(16) %44)
  %45 = getelementptr inbounds %struct.d2Vec2, ptr %7, i32 0, i32 0
  %46 = load float, ptr %45, align 4, !tbaa !15
  %47 = fneg float %46
  %48 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %49 = getelementptr inbounds %struct.d2MatMN, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !16
  %51 = getelementptr inbounds %struct.d2VecN, ptr %50, i64 0
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %51, i32 noundef 0)
  store float %47, ptr %52, align 4, !tbaa !9
  %53 = getelementptr inbounds %struct.d2Vec2, ptr %7, i32 0, i32 1
  %54 = load float, ptr %53, align 4, !tbaa !21
  %55 = fneg float %54
  %56 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %57 = getelementptr inbounds %struct.d2MatMN, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  %59 = getelementptr inbounds %struct.d2VecN, ptr %58, i64 0
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %59, i32 noundef 1)
  store float %55, ptr %60, align 4, !tbaa !9
  %61 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %62 = fneg float %61
  %63 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %64 = getelementptr inbounds %struct.d2MatMN, ptr %63, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !16
  %66 = getelementptr inbounds %struct.d2VecN, ptr %65, i64 0
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %66, i32 noundef 2)
  store float %62, ptr %67, align 4, !tbaa !9
  %68 = getelementptr inbounds %struct.d2Vec2, ptr %7, i32 0, i32 0
  %69 = load float, ptr %68, align 4, !tbaa !15
  %70 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %71 = getelementptr inbounds %struct.d2MatMN, ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !16
  %73 = getelementptr inbounds %struct.d2VecN, ptr %72, i64 0
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %73, i32 noundef 3)
  store float %69, ptr %74, align 4, !tbaa !9
  %75 = getelementptr inbounds %struct.d2Vec2, ptr %7, i32 0, i32 1
  %76 = load float, ptr %75, align 4, !tbaa !21
  %77 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %78 = getelementptr inbounds %struct.d2MatMN, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  %80 = getelementptr inbounds %struct.d2VecN, ptr %79, i64 0
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %80, i32 noundef 4)
  store float %76, ptr %81, align 4, !tbaa !9
  %82 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %83 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %84 = getelementptr inbounds %struct.d2MatMN, ptr %83, i32 0, i32 2
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  %86 = getelementptr inbounds %struct.d2VecN, ptr %85, i64 0
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %86, i32 noundef 5)
  store float %82, ptr %87, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %88 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !11
  %90 = call noundef float @_ZNK6d2Body11GetFrictionEv(ptr noundef nonnull align 8 dereferenceable(132) %89)
  store float %90, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %91 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !14
  %93 = call noundef float @_ZNK6d2Body11GetFrictionEv(ptr noundef nonnull align 8 dereferenceable(132) %92)
  store float %93, ptr %11, align 4, !tbaa !9
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %95 = load float, ptr %94, align 4, !tbaa !9
  %96 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 5
  store float %95, ptr %96, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %97 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 5
  %98 = load float, ptr %97, align 4, !tbaa !22
  %99 = fpext float %98 to double
  %100 = fcmp ogt double %99, 0.000000e+00
  br i1 %100, label %101, label %146

101:                                              ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %102 = call <2 x float> @_ZNK6d2Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %102, ptr %12, align 4
  %103 = getelementptr inbounds %struct.d2Vec2, ptr %12, i32 0, i32 0
  %104 = load float, ptr %103, align 4, !tbaa !15
  %105 = fneg float %104
  %106 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %107 = getelementptr inbounds %struct.d2MatMN, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !16
  %109 = getelementptr inbounds %struct.d2VecN, ptr %108, i64 1
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %109, i32 noundef 0)
  store float %105, ptr %110, align 4, !tbaa !9
  %111 = getelementptr inbounds %struct.d2Vec2, ptr %12, i32 0, i32 1
  %112 = load float, ptr %111, align 4, !tbaa !21
  %113 = fneg float %112
  %114 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %115 = getelementptr inbounds %struct.d2MatMN, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !16
  %117 = getelementptr inbounds %struct.d2VecN, ptr %116, i64 1
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %117, i32 noundef 1)
  store float %113, ptr %118, align 4, !tbaa !9
  %119 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %120 = fneg float %119
  %121 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %122 = getelementptr inbounds %struct.d2MatMN, ptr %121, i32 0, i32 2
  %123 = load ptr, ptr %122, align 8, !tbaa !16
  %124 = getelementptr inbounds %struct.d2VecN, ptr %123, i64 1
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %124, i32 noundef 2)
  store float %120, ptr %125, align 4, !tbaa !9
  %126 = getelementptr inbounds %struct.d2Vec2, ptr %12, i32 0, i32 0
  %127 = load float, ptr %126, align 4, !tbaa !15
  %128 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %129 = getelementptr inbounds %struct.d2MatMN, ptr %128, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !16
  %131 = getelementptr inbounds %struct.d2VecN, ptr %130, i64 1
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %131, i32 noundef 3)
  store float %127, ptr %132, align 4, !tbaa !9
  %133 = getelementptr inbounds %struct.d2Vec2, ptr %12, i32 0, i32 1
  %134 = load float, ptr %133, align 4, !tbaa !21
  %135 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %136 = getelementptr inbounds %struct.d2MatMN, ptr %135, i32 0, i32 2
  %137 = load ptr, ptr %136, align 8, !tbaa !16
  %138 = getelementptr inbounds %struct.d2VecN, ptr %137, i64 1
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %138, i32 noundef 4)
  store float %134, ptr %139, align 4, !tbaa !9
  %140 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %141 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  %142 = getelementptr inbounds %struct.d2MatMN, ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %142, align 8, !tbaa !16
  %144 = getelementptr inbounds %struct.d2VecN, ptr %143, i64 1
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %144, i32 noundef 5)
  store float %140, ptr %145, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %146

146:                                              ; preds = %101, %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %147 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 1
  call void @_ZNK7d2MatMN9TransposeEv(ptr dead_on_unwind writable sret(%struct.d2MatMN) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %147)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %148 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 2
  invoke void @_ZNK7d2MatMNmlERK6d2VecN(ptr dead_on_unwind writable sret(%struct.d2VecN) align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %148)
          to label %149 unwind label %197

149:                                              ; preds = %146
  %150 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 1
  %151 = load ptr, ptr %150, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %152 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 0)
          to label %153 unwind label %201

153:                                              ; preds = %149
  %154 = load float, ptr %152, align 4, !tbaa !9
  %155 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 1)
          to label %156 unwind label %201

156:                                              ; preds = %153
  %157 = load float, ptr %155, align 4, !tbaa !9
  invoke void @_ZN6d2Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %17, float noundef %154, float noundef %157)
          to label %158 unwind label %201

158:                                              ; preds = %156
  invoke void @_ZN6d2Body18ApplyImpulseLinearERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %151, ptr noundef nonnull align 4 dereferenceable(8) %17)
          to label %159 unwind label %201

159:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %160 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 1
  %161 = load ptr, ptr %160, align 8, !tbaa !11
  %162 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 2)
          to label %163 unwind label %205

163:                                              ; preds = %159
  %164 = load float, ptr %162, align 4, !tbaa !9
  invoke void @_ZN6d2Body19ApplyImpulseAngularEf(ptr noundef nonnull align 8 dereferenceable(132) %161, float noundef %164)
          to label %165 unwind label %205

165:                                              ; preds = %163
  %166 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 2
  %167 = load ptr, ptr %166, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %168 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 3)
          to label %169 unwind label %209

169:                                              ; preds = %165
  %170 = load float, ptr %168, align 4, !tbaa !9
  %171 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 4)
          to label %172 unwind label %209

172:                                              ; preds = %169
  %173 = load float, ptr %171, align 4, !tbaa !9
  invoke void @_ZN6d2Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %18, float noundef %170, float noundef %173)
          to label %174 unwind label %209

174:                                              ; preds = %172
  invoke void @_ZN6d2Body18ApplyImpulseLinearERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %167, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %175 unwind label %209

175:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %176 = getelementptr inbounds %class.d2Constraint, ptr %23, i32 0, i32 2
  %177 = load ptr, ptr %176, align 8, !tbaa !14
  %178 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 5)
          to label %179 unwind label %205

179:                                              ; preds = %175
  %180 = load float, ptr %178, align 4, !tbaa !9
  invoke void @_ZN6d2Body19ApplyImpulseAngularEf(ptr noundef nonnull align 8 dereferenceable(132) %177, float noundef %180)
          to label %181 unwind label %205

181:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store float 1.000000e+00, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %182 = invoke <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %183 unwind label %213

183:                                              ; preds = %181
  store <2 x float> %182, ptr %21, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %184 = invoke <2 x float> @_ZN6d2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
          to label %185 unwind label %217

185:                                              ; preds = %183
  store <2 x float> %184, ptr %22, align 4
  %186 = invoke noundef float @_ZNK6d2Vec23DotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %187 unwind label %217

187:                                              ; preds = %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  store float %186, ptr %20, align 4, !tbaa !9
  %188 = load float, ptr %20, align 4, !tbaa !9
  %189 = fadd float %188, 0x3F847AE140000000
  %190 = invoke noundef float @_Z5d2MinIfET_S0_S0_(float noundef 0.000000e+00, float noundef %189)
          to label %191 unwind label %222

191:                                              ; preds = %187
  store float %190, ptr %20, align 4, !tbaa !9
  %192 = load float, ptr %4, align 4, !tbaa !9
  %193 = fdiv float 1.000000e+00, %192
  %194 = load float, ptr %20, align 4, !tbaa !9
  %195 = fmul float %193, %194
  %196 = getelementptr inbounds %class.d2PenetrationConstraint, ptr %23, i32 0, i32 3
  store float %195, ptr %196, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @_ZN6d2VecND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @_ZN7d2MatMND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

197:                                              ; preds = %146
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %15, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %16, align 4
  br label %228

201:                                              ; preds = %158, %156, %153, %149
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %15, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %227

205:                                              ; preds = %179, %175, %163, %159
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %15, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %16, align 4
  br label %227

209:                                              ; preds = %174, %172, %169, %165
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %15, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %227

213:                                              ; preds = %181
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %15, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %16, align 4
  br label %221

217:                                              ; preds = %185, %183
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %15, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %221

221:                                              ; preds = %217, %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %226

222:                                              ; preds = %187
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %15, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %16, align 4
  br label %226

226:                                              ; preds = %222, %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %227

227:                                              ; preds = %226, %209, %205, %201
  call void @_ZN6d2VecND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  br label %228

228:                                              ; preds = %227, %197
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @_ZN7d2MatMND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %229

229:                                              ; preds = %228
  %230 = load ptr, ptr %15, align 8
  %231 = load i32, ptr %16, align 4
  %232 = insertvalue { ptr, i32 } poison, ptr %230, 0
  %233 = insertvalue { ptr, i32 } %232, i32 %231, 1
  resume { ptr, i32 } %233
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6d2Body11GetFrictionEv(ptr noundef nonnull align 8 dereferenceable(132)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK6d2Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

declare <2 x float> @_ZN6d2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5d2MinIfET_S0_S0_(float noundef, float noundef) #3

attributes #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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #4 = { 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 #5 = { 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 #6 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS12d2Constraint", !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 32, !6, i64 40, !6, i64 48}
!13 = !{!"_ZTS6d2Vec2", !10, i64 0, !10, i64 4}
!14 = !{!12, !6, i64 16}
!15 = !{!13, !10, i64 0}
!16 = !{!17, !6, i64 64}
!17 = !{!"_ZTS23d2PenetrationConstraint", !12, i64 0, !18, i64 56, !20, i64 72, !10, i64 88, !13, i64 92, !10, i64 100}
!18 = !{!"_ZTS7d2MatMN", !19, i64 0, !19, i64 4, !6, i64 8}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTS6d2VecN", !19, i64 0, !6, i64 8}
!21 = !{!13, !10, i64 4}
!22 = !{!17, !10, i64 100}
!23 = !{!17, !10, i64 88}


; 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.d2MatMN = type { i32, i32, ptr }
%struct.d2VecN = type { i32, ptr }
%struct.d2Vec2 = type { float, float }

declare void @_ZN7d2MatMN4ZeroEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN7d2MatMND1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN6d2VecND1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

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

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

declare <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

declare <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK6d2Body11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

declare void @_ZNK7d2MatMN9TransposeEv(ptr dead_on_unwind writable sret(%struct.d2MatMN) align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare void @_ZNK7d2MatMNmlERK6d2VecN(ptr dead_on_unwind writable sret(%struct.d2VecN) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare void @_ZN6d2Body18ApplyImpulseLinearERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6d2Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #4 align 2

declare void @_ZN6d2Body19ApplyImpulseAngularEf(ptr noundef nonnull align 8 dereferenceable(132), float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6d2Vec23DotERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23d2PenetrationConstraint8PreSolveEf(ptr noundef nonnull align 8 dereferenceable(104) %0, float noundef %1) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.d2Vec2, align 8
  %4 = alloca %struct.d2Vec2, align 8
  %5 = alloca %struct.d2Vec2, align 8
  %6 = alloca %struct.d2Vec2, align 8
  %7 = alloca %struct.d2Vec2, align 8
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca %struct.d2Vec2, align 8
  %11 = alloca %struct.d2MatMN, align 8
  %12 = alloca %struct.d2VecN, align 8
  %13 = alloca %struct.d2Vec2, align 4
  %14 = alloca %struct.d2Vec2, align 4
  %15 = alloca %struct.d2Vec2, align 8
  %16 = alloca %struct.d2Vec2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = tail call <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %18, ptr noundef nonnull align 4 dereferenceable(8) %19)
  store <2 x float> %20, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %0, i64 32
  %24 = tail call <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %22, ptr noundef nonnull align 4 dereferenceable(8) %23)
  store <2 x float> %24, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %25 = load ptr, ptr %17, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %0, i64 92
  %27 = tail call <2 x float> @_ZNK6d2Body22LocalSpaceToWorldSpaceERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %25, ptr noundef nonnull align 4 dereferenceable(8) %26)
  store <2 x float> %27, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %28 = load ptr, ptr %17, align 8, !tbaa !5
  %29 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK6d2Body11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(132) %28)
  %30 = call <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %29)
  store <2 x float> %30, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %31 = load ptr, ptr %21, align 8, !tbaa !12
  %32 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK6d2Body11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(132) %31)
  %33 = call <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %32)
  store <2 x float> %33, ptr %7, align 8
  %34 = getelementptr inbounds i8, ptr %0, i64 56
  call void @_ZN7d2MatMN4ZeroEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
  %35 = extractelement <2 x float> %27, i64 0
  %36 = fneg float %35
  %37 = getelementptr inbounds i8, ptr %0, i64 64
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %38, i32 noundef 0)
  store float %36, ptr %39, align 4, !tbaa !18
  %40 = getelementptr inbounds i8, ptr %5, i64 4
  %41 = extractelement <2 x float> %27, i64 1
  %42 = fneg float %41
  %43 = load ptr, ptr %37, align 8, !tbaa !13
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %43, i32 noundef 1)
  store float %42, ptr %44, align 4, !tbaa !18
  %45 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %46 = fneg float %45
  %47 = load ptr, ptr %37, align 8, !tbaa !13
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %47, i32 noundef 2)
  store float %46, ptr %48, align 4, !tbaa !18
  %49 = load float, ptr %5, align 8, !tbaa !19
  %50 = load ptr, ptr %37, align 8, !tbaa !13
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %50, i32 noundef 3)
  store float %49, ptr %51, align 4, !tbaa !18
  %52 = load float, ptr %40, align 4, !tbaa !20
  %53 = load ptr, ptr %37, align 8, !tbaa !13
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %53, i32 noundef 4)
  store float %52, ptr %54, align 4, !tbaa !18
  %55 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %56 = load ptr, ptr %37, align 8, !tbaa !13
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %56, i32 noundef 5)
  store float %55, ptr %57, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %58 = load ptr, ptr %17, align 8, !tbaa !5
  %59 = call noundef float @_ZNK6d2Body11GetFrictionEv(ptr noundef nonnull align 8 dereferenceable(132) %58)
  store float %59, ptr %8, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %60 = load ptr, ptr %21, align 8, !tbaa !12
  %61 = call noundef float @_ZNK6d2Body11GetFrictionEv(ptr noundef nonnull align 8 dereferenceable(132) %60)
  store float %61, ptr %9, align 4, !tbaa !18
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %63 = load float, ptr %62, align 4, !tbaa !18
  %64 = getelementptr inbounds i8, ptr %0, i64 100
  store float %63, ptr %64, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %65 = fcmp ogt float %63, 0.000000e+00
  br i1 %65, label %66, label %96

66:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %67 = call <2 x float> @_ZNK6d2Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  store <2 x float> %67, ptr %10, align 8
  %68 = extractelement <2 x float> %67, i64 0
  %69 = fneg float %68
  %70 = load ptr, ptr %37, align 8, !tbaa !13
  %71 = getelementptr inbounds i8, ptr %70, i64 16
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %71, i32 noundef 0)
  store float %69, ptr %72, align 4, !tbaa !18
  %73 = getelementptr inbounds i8, ptr %10, i64 4
  %74 = extractelement <2 x float> %67, i64 1
  %75 = fneg float %74
  %76 = load ptr, ptr %37, align 8, !tbaa !13
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %77, i32 noundef 1)
  store float %75, ptr %78, align 4, !tbaa !18
  %79 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %80 = fneg float %79
  %81 = load ptr, ptr %37, align 8, !tbaa !13
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %82, i32 noundef 2)
  store float %80, ptr %83, align 4, !tbaa !18
  %84 = load float, ptr %10, align 8, !tbaa !19
  %85 = load ptr, ptr %37, align 8, !tbaa !13
  %86 = getelementptr inbounds i8, ptr %85, i64 16
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %86, i32 noundef 3)
  store float %84, ptr %87, align 4, !tbaa !18
  %88 = load float, ptr %73, align 4, !tbaa !20
  %89 = load ptr, ptr %37, align 8, !tbaa !13
  %90 = getelementptr inbounds i8, ptr %89, i64 16
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %90, i32 noundef 4)
  store float %88, ptr %91, align 4, !tbaa !18
  %92 = call noundef float @_ZNK6d2Vec25CrossERKS_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %93 = load ptr, ptr %37, align 8, !tbaa !13
  %94 = getelementptr inbounds i8, ptr %93, i64 16
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %94, i32 noundef 5)
  store float %92, ptr %95, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %96

96:                                               ; preds = %66, %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @_ZNK7d2MatMN9TransposeEv(ptr dead_on_unwind nonnull writable sret(%struct.d2MatMN) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %34)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %97 = getelementptr inbounds i8, ptr %0, i64 72
  invoke void @_ZNK7d2MatMNmlERK6d2VecN(ptr dead_on_unwind nonnull writable sret(%struct.d2VecN) align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %97)
          to label %98 unwind label %135

98:                                               ; preds = %96
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %100 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 0)
          to label %101 unwind label %137

101:                                              ; preds = %98
  %102 = load float, ptr %100, align 4, !tbaa !18
  %103 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 1)
          to label %104 unwind label %137

104:                                              ; preds = %101
  %105 = load float, ptr %103, align 4, !tbaa !18
  call void @_ZN6d2Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %13, float noundef %102, float noundef %105)
  invoke void @_ZN6d2Body18ApplyImpulseLinearERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %99, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %106 unwind label %137

106:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  %107 = load ptr, ptr %17, align 8, !tbaa !5
  %108 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 2)
          to label %109 unwind label %139

109:                                              ; preds = %106
  %110 = load float, ptr %108, align 4, !tbaa !18
  invoke void @_ZN6d2Body19ApplyImpulseAngularEf(ptr noundef nonnull align 8 dereferenceable(132) %107, float noundef %110)
          to label %111 unwind label %139

111:                                              ; preds = %109
  %112 = load ptr, ptr %21, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %113 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 3)
          to label %114 unwind label %141

114:                                              ; preds = %111
  %115 = load float, ptr %113, align 4, !tbaa !18
  %116 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 4)
          to label %117 unwind label %141

117:                                              ; preds = %114
  %118 = load float, ptr %116, align 4, !tbaa !18
  call void @_ZN6d2Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %14, float noundef %115, float noundef %118)
  invoke void @_ZN6d2Body18ApplyImpulseLinearERK6d2Vec2(ptr noundef nonnull align 8 dereferenceable(132) %112, ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %119 unwind label %141

119:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  %120 = load ptr, ptr %21, align 8, !tbaa !12
  %121 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6d2VecNixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 5)
          to label %122 unwind label %139

122:                                              ; preds = %119
  %123 = load float, ptr %121, align 4, !tbaa !18
  invoke void @_ZN6d2Body19ApplyImpulseAngularEf(ptr noundef nonnull align 8 dereferenceable(132) %120, float noundef %123)
          to label %124 unwind label %139

124:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %125 = invoke <2 x float> @_ZNK6d2Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %3)
          to label %126 unwind label %143

126:                                              ; preds = %124
  store <2 x float> %125, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %127 = invoke <2 x float> @_ZN6d2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %128 unwind label %145

128:                                              ; preds = %126
  store <2 x float> %127, ptr %16, align 8
  %129 = call noundef float @_ZNK6d2Vec23DotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  %130 = fadd float %129, 0x3F847AE140000000
  %131 = call noundef float @_Z5d2MinIfET_S0_S0_(float noundef 0.000000e+00, float noundef %130)
  %132 = fdiv float 1.000000e+00, %1
  %133 = fmul float %132, %131
  %134 = getelementptr inbounds i8, ptr %0, i64 88
  store float %133, ptr %134, align 8, !tbaa !22
  call void @_ZN6d2VecND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @_ZN7d2MatMND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void

135:                                              ; preds = %96
  %136 = landingpad { ptr, i32 }
          cleanup
  br label %149

137:                                              ; preds = %104, %101, %98
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br label %148

139:                                              ; preds = %122, %119, %109, %106
  %140 = landingpad { ptr, i32 }
          cleanup
  br label %148

141:                                              ; preds = %117, %114, %111
  %142 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  br label %148

143:                                              ; preds = %124
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %147

145:                                              ; preds = %126
  %146 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  br label %147

147:                                              ; preds = %145, %143
  %.pn = phi { ptr, i32 } [ %146, %145 ], [ %144, %143 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %148

148:                                              ; preds = %147, %141, %139, %137
  %.pn.pn = phi { ptr, i32 } [ %.pn, %147 ], [ %140, %139 ], [ %142, %141 ], [ %138, %137 ]
  call void @_ZN6d2VecND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  br label %149

149:                                              ; preds = %148, %135
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %148 ], [ %136, %135 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @_ZN7d2MatMND1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6d2Body11GetFrictionEv(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK6d2Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

declare <2 x float> @_ZN6d2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5d2MinIfET_S0_S0_(float noundef, float noundef) local_unnamed_addr #3

attributes #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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #4 = { 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 #5 = { 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 #6 = { 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 8}
!6 = !{!"_ZTS12d2Constraint", !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS6d2Vec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !7, i64 16}
!13 = !{!14, !7, i64 64}
!14 = !{!"_ZTS23d2PenetrationConstraint", !6, i64 0, !15, i64 56, !17, i64 72, !11, i64 88, !10, i64 92, !11, i64 100}
!15 = !{!"_ZTS7d2MatMN", !16, i64 0, !16, i64 4, !7, i64 8}
!16 = !{!"int", !8, i64 0}
!17 = !{!"_ZTS6d2VecN", !16, i64 0, !7, i64 8}
!18 = !{!11, !11, i64 0}
!19 = !{!10, !11, i64 0}
!20 = !{!10, !11, i64 4}
!21 = !{!14, !11, i64 100}
!22 = !{!14, !11, i64 88}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass