; LLVM IR from erincatto/box2d-lite :: src/Arbiter.ll (ZN7Arbiter7PreStepEf)

; 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.Vec2 = type { float, float }
%struct.Arbiter = type <{ [2 x %struct.Contact], i32, [4 x i8], ptr, ptr, float, [4 x i8] }>
%struct.Contact = type { %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, float, float, float, float, float, float, float, %union.FeaturePair }
%union.FeaturePair = type { i32 }
%struct.Body = type { %struct.Vec2, float, %struct.Vec2, float, %struct.Vec2, float, %struct.Vec2, float, float, float, float, float }

@_ZN5World18positionCorrectionE = external global i8, align 1
@_ZN5World18accumulateImpulsesE = external global i8, align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Arbiter7PreStepEf(ptr noundef nonnull align 8 dereferenceable(156) %0, float noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %struct.Vec2, align 4
  %10 = alloca %struct.Vec2, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca %struct.Vec2, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca %struct.Vec2, align 4
  %19 = alloca %struct.Vec2, align 4
  %20 = alloca %struct.Vec2, align 4
  %21 = alloca %struct.Vec2, align 4
  %22 = alloca %struct.Vec2, 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 4, ptr %5) #6
  store float 0x3F847AE140000000, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %24 = load i8, ptr @_ZN5World18positionCorrectionE, align 1, !tbaa !11, !range !13, !noundef !14
  %25 = trunc i8 %24 to i1
  %26 = zext i1 %25 to i64
  %27 = select i1 %25, float 0x3FC99999A0000000, float 0.000000e+00
  store float %27, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !15
  br label %28

28:                                               ; preds = %197, %2
  %29 = load i32, ptr %7, align 4, !tbaa !15
  %30 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 1
  %31 = load i32, ptr %30, align 8, !tbaa !17
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %200

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %35 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 0
  %36 = getelementptr inbounds [2 x %struct.Contact], ptr %35, i64 0, i64 0
  %37 = load i32, ptr %7, align 4, !tbaa !15
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.Contact, ptr %36, i64 %38
  store ptr %39, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Contact, ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  %44 = getelementptr inbounds %struct.Body, ptr %43, i32 0, i32 0
  %45 = call <2 x float> @_ZmiRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %41, ptr noundef nonnull align 4 dereferenceable(8) %44)
  store <2 x float> %45, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Contact, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !20
  %50 = getelementptr inbounds %struct.Body, ptr %49, i32 0, i32 0
  %51 = call <2 x float> @_ZmiRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %50)
  store <2 x float> %51, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.Contact, ptr %52, i32 0, i32 1
  %54 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %53)
  store float %54, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Contact, ptr %55, i32 0, i32 1
  %57 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %56)
  store float %57, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %58 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = getelementptr inbounds %struct.Body, ptr %59, i32 0, i32 9
  %61 = load float, ptr %60, align 4, !tbaa !21
  %62 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !20
  %64 = getelementptr inbounds %struct.Body, ptr %63, i32 0, i32 9
  %65 = load float, ptr %64, align 4, !tbaa !21
  %66 = fadd float %61, %65
  store float %66, ptr %13, align 4, !tbaa !9
  %67 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !19
  %69 = getelementptr inbounds %struct.Body, ptr %68, i32 0, i32 11
  %70 = load float, ptr %69, align 4, !tbaa !24
  %71 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %72 = load float, ptr %11, align 4, !tbaa !9
  %73 = load float, ptr %11, align 4, !tbaa !9
  %74 = fneg float %72
  %75 = call float @llvm.fmuladd.f32(float %74, float %73, float %71)
  %76 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  %78 = getelementptr inbounds %struct.Body, ptr %77, i32 0, i32 11
  %79 = load float, ptr %78, align 4, !tbaa !24
  %80 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %81 = load float, ptr %12, align 4, !tbaa !9
  %82 = load float, ptr %12, align 4, !tbaa !9
  %83 = fneg float %81
  %84 = call float @llvm.fmuladd.f32(float %83, float %82, float %80)
  %85 = fmul float %79, %84
  %86 = call float @llvm.fmuladd.f32(float %70, float %75, float %85)
  %87 = load float, ptr %13, align 4, !tbaa !9
  %88 = fadd float %87, %86
  store float %88, ptr %13, align 4, !tbaa !9
  %89 = load float, ptr %13, align 4, !tbaa !9
  %90 = fdiv float 1.000000e+00, %89
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Contact, ptr %91, i32 0, i32 8
  store float %90, ptr %92, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Contact, ptr %93, i32 0, i32 1
  %95 = call <2 x float> @_Z5CrossRK4Vec2f(ptr noundef nonnull align 4 dereferenceable(8) %94, float noundef 1.000000e+00)
  store <2 x float> %95, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %96 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store float %96, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %97 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store float %97, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %98 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !19
  %100 = getelementptr inbounds %struct.Body, ptr %99, i32 0, i32 9
  %101 = load float, ptr %100, align 4, !tbaa !21
  %102 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %103 = load ptr, ptr %102, align 8, !tbaa !20
  %104 = getelementptr inbounds %struct.Body, ptr %103, i32 0, i32 9
  %105 = load float, ptr %104, align 4, !tbaa !21
  %106 = fadd float %101, %105
  store float %106, ptr %17, align 4, !tbaa !9
  %107 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %108 = load ptr, ptr %107, align 8, !tbaa !19
  %109 = getelementptr inbounds %struct.Body, ptr %108, i32 0, i32 11
  %110 = load float, ptr %109, align 4, !tbaa !24
  %111 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %112 = load float, ptr %15, align 4, !tbaa !9
  %113 = load float, ptr %15, align 4, !tbaa !9
  %114 = fneg float %112
  %115 = call float @llvm.fmuladd.f32(float %114, float %113, float %111)
  %116 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %117 = load ptr, ptr %116, align 8, !tbaa !20
  %118 = getelementptr inbounds %struct.Body, ptr %117, i32 0, i32 11
  %119 = load float, ptr %118, align 4, !tbaa !24
  %120 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %121 = load float, ptr %16, align 4, !tbaa !9
  %122 = load float, ptr %16, align 4, !tbaa !9
  %123 = fneg float %121
  %124 = call float @llvm.fmuladd.f32(float %123, float %122, float %120)
  %125 = fmul float %119, %124
  %126 = call float @llvm.fmuladd.f32(float %110, float %115, float %125)
  %127 = load float, ptr %17, align 4, !tbaa !9
  %128 = fadd float %127, %126
  store float %128, ptr %17, align 4, !tbaa !9
  %129 = load float, ptr %17, align 4, !tbaa !9
  %130 = fdiv float 1.000000e+00, %129
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.Contact, ptr %131, i32 0, i32 9
  store float %130, ptr %132, align 4, !tbaa !27
  %133 = load float, ptr %6, align 4, !tbaa !9
  %134 = fneg float %133
  %135 = load float, ptr %4, align 4, !tbaa !9
  %136 = fmul float %134, %135
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.Contact, ptr %137, i32 0, i32 4
  %139 = load float, ptr %138, align 4, !tbaa !28
  %140 = fadd float %139, 0x3F847AE140000000
  %141 = call noundef float @_Z3Minff(float noundef 0.000000e+00, float noundef %140)
  %142 = fmul float %136, %141
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.Contact, ptr %143, i32 0, i32 10
  store float %142, ptr %144, align 4, !tbaa !29
  %145 = load i8, ptr @_ZN5World18accumulateImpulsesE, align 1, !tbaa !11, !range !13, !noundef !14
  %146 = trunc i8 %145 to i1
  br i1 %146, label %147, label %196

147:                                              ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.Contact, ptr %148, i32 0, i32 5
  %150 = load float, ptr %149, align 4, !tbaa !30
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.Contact, ptr %151, i32 0, i32 1
  %153 = call <2 x float> @_ZmlfRK4Vec2(float noundef %150, ptr noundef nonnull align 4 dereferenceable(8) %152)
  store <2 x float> %153, ptr %19, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.Contact, ptr %154, i32 0, i32 6
  %156 = load float, ptr %155, align 4, !tbaa !31
  %157 = call <2 x float> @_ZmlfRK4Vec2(float noundef %156, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %157, ptr %20, align 4
  %158 = call <2 x float> @_ZplRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(8) %20)
  store <2 x float> %158, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %159 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !19
  %161 = getelementptr inbounds %struct.Body, ptr %160, i32 0, i32 9
  %162 = load float, ptr %161, align 4, !tbaa !21
  %163 = call <2 x float> @_ZmlfRK4Vec2(float noundef %162, ptr noundef nonnull align 4 dereferenceable(8) %18)
  store <2 x float> %163, ptr %21, align 4
  %164 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %165 = load ptr, ptr %164, align 8, !tbaa !19
  %166 = getelementptr inbounds %struct.Body, ptr %165, i32 0, i32 2
  call void @_ZN4Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %166, ptr noundef nonnull align 4 dereferenceable(8) %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  %167 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %168 = load ptr, ptr %167, align 8, !tbaa !19
  %169 = getelementptr inbounds %struct.Body, ptr %168, i32 0, i32 11
  %170 = load float, ptr %169, align 4, !tbaa !24
  %171 = call noundef float @_Z5CrossRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %18)
  %172 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 3
  %173 = load ptr, ptr %172, align 8, !tbaa !19
  %174 = getelementptr inbounds %struct.Body, ptr %173, i32 0, i32 3
  %175 = load float, ptr %174, align 4, !tbaa !32
  %176 = fneg float %170
  %177 = call float @llvm.fmuladd.f32(float %176, float %171, float %175)
  store float %177, ptr %174, align 4, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %178 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %179 = load ptr, ptr %178, align 8, !tbaa !20
  %180 = getelementptr inbounds %struct.Body, ptr %179, i32 0, i32 9
  %181 = load float, ptr %180, align 4, !tbaa !21
  %182 = call <2 x float> @_ZmlfRK4Vec2(float noundef %181, ptr noundef nonnull align 4 dereferenceable(8) %18)
  store <2 x float> %182, ptr %22, align 4
  %183 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %184 = load ptr, ptr %183, align 8, !tbaa !20
  %185 = getelementptr inbounds %struct.Body, ptr %184, i32 0, i32 2
  call void @_ZN4Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %185, ptr noundef nonnull align 4 dereferenceable(8) %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  %186 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %187 = load ptr, ptr %186, align 8, !tbaa !20
  %188 = getelementptr inbounds %struct.Body, ptr %187, i32 0, i32 11
  %189 = load float, ptr %188, align 4, !tbaa !24
  %190 = call noundef float @_Z5CrossRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %18)
  %191 = getelementptr inbounds %struct.Arbiter, ptr %23, i32 0, i32 4
  %192 = load ptr, ptr %191, align 8, !tbaa !20
  %193 = getelementptr inbounds %struct.Body, ptr %192, i32 0, i32 3
  %194 = load float, ptr %193, align 4, !tbaa !32
  %195 = call float @llvm.fmuladd.f32(float %189, float %190, float %194)
  store float %195, ptr %193, align 4, !tbaa !32
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %196

196:                                              ; preds = %147, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %7, align 4, !tbaa !15
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %7, align 4, !tbaa !15
  br label %28, !llvm.loop !33

200:                                              ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void
}

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

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !16, i64 128}
!18 = !{!"_ZTS7Arbiter", !7, i64 0, !16, i64 128, !6, i64 136, !6, i64 144, !10, i64 152}
!19 = !{!18, !6, i64 136}
!20 = !{!18, !6, i64 144}
!21 = !{!22, !10, i64 52}
!22 = !{!"_ZTS4Body", !23, i64 0, !10, i64 8, !23, i64 12, !10, i64 20, !23, i64 24, !10, i64 32, !23, i64 36, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60}
!23 = !{!"_ZTS4Vec2", !10, i64 0, !10, i64 4}
!24 = !{!22, !10, i64 60}
!25 = !{!26, !10, i64 48}
!26 = !{!"_ZTS7Contact", !23, i64 0, !23, i64 8, !23, i64 16, !23, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !7, i64 60}
!27 = !{!26, !10, i64 52}
!28 = !{!26, !10, i64 32}
!29 = !{!26, !10, i64 56}
!30 = !{!26, !10, i64 36}
!31 = !{!26, !10, i64 40}
!32 = !{!22, !10, i64 20}
!33 = distinct !{!33, !34}
!34 = !{!"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.Vec2 = type { float, float }
%struct.Contact = type { %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, float, float, float, float, float, float, float, %union.FeaturePair }
%union.FeaturePair = type { i32 }

@_ZN5World18positionCorrectionE = external local_unnamed_addr global i8, align 1
@_ZN5World18accumulateImpulsesE = external local_unnamed_addr global i8, align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Arbiter7PreStepEf(ptr noundef nonnull align 8 dereferenceable(156) %0, float noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %struct.Vec2, align 8
  %4 = alloca %struct.Vec2, align 8
  %5 = alloca %struct.Vec2, align 8
  %6 = alloca %struct.Vec2, align 8
  %7 = alloca %struct.Vec2, align 8
  %8 = alloca %struct.Vec2, align 8
  %9 = alloca %struct.Vec2, align 8
  %10 = alloca %struct.Vec2, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %14 = load i8, ptr @_ZN5World18positionCorrectionE, align 1, !tbaa !12, !range !14, !noundef !15
  %15 = trunc nuw i8 %14 to i1
  %16 = getelementptr inbounds i8, ptr %0, i64 136
  %17 = getelementptr inbounds i8, ptr %0, i64 144
  %18 = select i1 %15, float 0xBFC99999A0000000, float -0.000000e+00
  %19 = fmul float %18, %1
  br label %20

._crit_edge:                                      ; preds = %123, %2
  ret void

20:                                               ; preds = %.lr.ph, %123
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %123 ]
  %21 = getelementptr inbounds %struct.Contact, ptr %0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %22 = load ptr, ptr %16, align 8, !tbaa !16
  %23 = call <2 x float> @_ZmiRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %22)
  store <2 x float> %23, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %24 = load ptr, ptr %17, align 8, !tbaa !17
  %25 = call <2 x float> @_ZmiRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %24)
  store <2 x float> %25, ptr %4, align 8
  %26 = getelementptr inbounds i8, ptr %21, i64 8
  %27 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %26)
  %28 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %26)
  %29 = load ptr, ptr %16, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %29, i64 52
  %31 = load float, ptr %30, align 4, !tbaa !18
  %32 = load ptr, ptr %17, align 8, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %32, i64 52
  %34 = load float, ptr %33, align 4, !tbaa !18
  %35 = fadd float %31, %34
  %36 = getelementptr inbounds i8, ptr %29, i64 60
  %37 = load float, ptr %36, align 4, !tbaa !21
  %38 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %39 = fneg float %27
  %40 = call float @llvm.fmuladd.f32(float %39, float %27, float %38)
  %41 = load ptr, ptr %17, align 8, !tbaa !17
  %42 = getelementptr inbounds i8, ptr %41, i64 60
  %43 = load float, ptr %42, align 4, !tbaa !21
  %44 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %45 = fneg float %28
  %46 = call float @llvm.fmuladd.f32(float %45, float %28, float %44)
  %47 = fmul float %43, %46
  %48 = call float @llvm.fmuladd.f32(float %37, float %40, float %47)
  %49 = fadd float %35, %48
  %50 = fdiv float 1.000000e+00, %49
  %51 = getelementptr inbounds i8, ptr %21, i64 48
  store float %50, ptr %51, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %52 = call <2 x float> @_Z5CrossRK4Vec2f(ptr noundef nonnull align 4 dereferenceable(8) %26, float noundef 1.000000e+00)
  store <2 x float> %52, ptr %5, align 8
  %53 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %54 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %55 = load ptr, ptr %16, align 8, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %55, i64 52
  %57 = load float, ptr %56, align 4, !tbaa !18
  %58 = load ptr, ptr %17, align 8, !tbaa !17
  %59 = getelementptr inbounds i8, ptr %58, i64 52
  %60 = load float, ptr %59, align 4, !tbaa !18
  %61 = fadd float %57, %60
  %62 = getelementptr inbounds i8, ptr %55, i64 60
  %63 = load float, ptr %62, align 4, !tbaa !21
  %64 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %65 = fneg float %53
  %66 = call float @llvm.fmuladd.f32(float %65, float %53, float %64)
  %67 = load ptr, ptr %17, align 8, !tbaa !17
  %68 = getelementptr inbounds i8, ptr %67, i64 60
  %69 = load float, ptr %68, align 4, !tbaa !21
  %70 = call noundef float @_Z3DotRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %71 = fneg float %54
  %72 = call float @llvm.fmuladd.f32(float %71, float %54, float %70)
  %73 = fmul float %69, %72
  %74 = call float @llvm.fmuladd.f32(float %63, float %66, float %73)
  %75 = fadd float %61, %74
  %76 = fdiv float 1.000000e+00, %75
  %77 = getelementptr inbounds i8, ptr %21, i64 52
  store float %76, ptr %77, align 4, !tbaa !24
  %78 = getelementptr inbounds i8, ptr %21, i64 32
  %79 = load float, ptr %78, align 8, !tbaa !25
  %80 = fadd float %79, 0x3F847AE140000000
  %81 = call noundef float @_Z3Minff(float noundef 0.000000e+00, float noundef %80)
  %82 = fmul float %19, %81
  %83 = getelementptr inbounds i8, ptr %21, i64 56
  store float %82, ptr %83, align 8, !tbaa !26
  %84 = load i8, ptr @_ZN5World18accumulateImpulsesE, align 1, !tbaa !12, !range !14, !noundef !15
  %85 = trunc nuw i8 %84 to i1
  br i1 %85, label %86, label %123

86:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %87 = getelementptr inbounds i8, ptr %21, i64 36
  %88 = load float, ptr %87, align 4, !tbaa !27
  %89 = call <2 x float> @_ZmlfRK4Vec2(float noundef %88, ptr noundef nonnull align 4 dereferenceable(8) %26)
  store <2 x float> %89, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %90 = getelementptr inbounds i8, ptr %21, i64 40
  %91 = load float, ptr %90, align 8, !tbaa !28
  %92 = call <2 x float> @_ZmlfRK4Vec2(float noundef %91, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store <2 x float> %92, ptr %8, align 8
  %93 = call <2 x float> @_ZplRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %93, ptr %6, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %94 = load ptr, ptr %16, align 8, !tbaa !16
  %95 = getelementptr inbounds i8, ptr %94, i64 52
  %96 = load float, ptr %95, align 4, !tbaa !18
  %97 = call <2 x float> @_ZmlfRK4Vec2(float noundef %96, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %97, ptr %9, align 8
  %98 = load ptr, ptr %16, align 8, !tbaa !16
  %99 = getelementptr inbounds i8, ptr %98, i64 12
  call void @_ZN4Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %99, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %100 = load ptr, ptr %16, align 8, !tbaa !16
  %101 = getelementptr inbounds i8, ptr %100, i64 60
  %102 = load float, ptr %101, align 4, !tbaa !21
  %103 = call noundef float @_Z5CrossRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %104 = load ptr, ptr %16, align 8, !tbaa !16
  %105 = getelementptr inbounds i8, ptr %104, i64 20
  %106 = load float, ptr %105, align 4, !tbaa !29
  %107 = fneg float %102
  %108 = call float @llvm.fmuladd.f32(float %107, float %103, float %106)
  store float %108, ptr %105, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %109 = load ptr, ptr %17, align 8, !tbaa !17
  %110 = getelementptr inbounds i8, ptr %109, i64 52
  %111 = load float, ptr %110, align 4, !tbaa !18
  %112 = call <2 x float> @_ZmlfRK4Vec2(float noundef %111, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %112, ptr %10, align 8
  %113 = load ptr, ptr %17, align 8, !tbaa !17
  %114 = getelementptr inbounds i8, ptr %113, i64 12
  call void @_ZN4Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %114, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %115 = load ptr, ptr %17, align 8, !tbaa !17
  %116 = getelementptr inbounds i8, ptr %115, i64 60
  %117 = load float, ptr %116, align 4, !tbaa !21
  %118 = call noundef float @_Z5CrossRK4Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %119 = load ptr, ptr %17, align 8, !tbaa !17
  %120 = getelementptr inbounds i8, ptr %119, i64 20
  %121 = load float, ptr %120, align 4, !tbaa !29
  %122 = call float @llvm.fmuladd.f32(float %117, float %118, float %121)
  store float %122, ptr %120, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %123

123:                                              ; preds = %86, %20
  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
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %124 = load i32, ptr %11, align 8, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = icmp slt i64 %indvars.iv.next, %125
  br i1 %126, label %20, label %._crit_edge, !llvm.loop !30
}

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

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !9, i64 128}
!6 = !{!"_ZTS7Arbiter", !7, i64 0, !9, i64 128, !10, i64 136, !10, i64 144, !11, i64 152}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!6, !10, i64 136}
!17 = !{!6, !10, i64 144}
!18 = !{!19, !11, i64 52}
!19 = !{!"_ZTS4Body", !20, i64 0, !11, i64 8, !20, i64 12, !11, i64 20, !20, i64 24, !11, i64 32, !20, i64 36, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60}
!20 = !{!"_ZTS4Vec2", !11, i64 0, !11, i64 4}
!21 = !{!19, !11, i64 60}
!22 = !{!23, !11, i64 48}
!23 = !{!"_ZTS7Contact", !20, i64 0, !20, i64 8, !20, i64 16, !20, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !7, i64 60}
!24 = !{!23, !11, i64 52}
!25 = !{!23, !11, i64 32}
!26 = !{!23, !11, i64 56}
!27 = !{!23, !11, i64 36}
!28 = !{!23, !11, i64 40}
!29 = !{!19, !11, i64 20}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass