; LLVM IR from jonpena/Cirobb :: cirobb/Collision.ll (Z11CircleToOBBR8ManifoldP5ShapeS2_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.Mat2 = type { float, float, float, float }
%struct.Vec2 = type { float, float }
%struct.Shape = type { ptr, float, %struct.Vec2, i32, ptr }
%struct.RigidBody = type { %struct.Vec2, %struct.Vec2, %struct.Vec2, float, float, float, float, float, float, float, float, float, float, float, float, ptr }
%struct.Manifold = type { i32, [2 x %struct.Contact], %struct.PostPosition, float, float, ptr, ptr, %struct.Vec2 }
%struct.Contact = type { %struct.Vec2, %struct.Vec2, float, float, float, float, float, float, float }
%struct.PostPosition = type { float, float, [2 x %struct.Vec2], [2 x %struct.Vec2] }

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

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

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

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #3

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11CircleToOBBR8ManifoldP5ShapeS2_(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.Mat2, align 4
  %8 = alloca float, align 4
  %9 = alloca %struct.Vec2, align 4
  %10 = alloca %struct.Vec2, align 4
  %11 = alloca %struct.Vec2, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca %struct.Vec2, align 4
  %17 = alloca float, align 4
  %18 = alloca %struct.Vec2, align 4
  %19 = alloca float, align 4
  %20 = alloca %struct.Vec2, align 4
  %21 = alloca %struct.Vec2, align 4
  %22 = alloca %struct.Vec2, align 4
  %23 = alloca %struct.Vec2, align 4
  %24 = alloca %struct.Vec2, 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
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Shape, ptr %25, i32 0, i32 4
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.RigidBody, ptr %27, i32 0, i32 3
  %29 = load float, ptr %28, align 8, !tbaa !14
  %30 = fneg float %29
  store float %30, ptr %8, align 4, !tbaa !16
  call void @_ZN4Mat2C2ERKf(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.Shape, ptr %31, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.RigidBody, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Shape, ptr %35, i32 0, i32 4
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.RigidBody, ptr %37, i32 0, i32 0
  %39 = call <2 x float> @_ZN4Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %38)
  store <2 x float> %39, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %40 = call <2 x float> @_ZN4Mat2mlERK4Vec2(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %40, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.Shape, ptr %41, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store float 5.000000e-01, ptr %12, align 4, !tbaa !16
  %43 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %42, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store <2 x float> %43, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %44 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 0
  %45 = load float, ptr %44, align 4, !tbaa !17
  %46 = fcmp olt float %45, 0.000000e+00
  br i1 %46, label %47, label %51

47:                                               ; preds = %3
  %48 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 0
  %49 = load float, ptr %48, align 4, !tbaa !17
  %50 = fneg float %49
  br label %54

51:                                               ; preds = %3
  %52 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 0
  %53 = load float, ptr %52, align 4, !tbaa !17
  br label %54

54:                                               ; preds = %51, %47
  %55 = phi float [ %50, %47 ], [ %53, %51 ]
  %56 = getelementptr inbounds %struct.Vec2, ptr %11, i32 0, i32 0
  %57 = load float, ptr %56, align 4, !tbaa !17
  %58 = fsub float %55, %57
  store float %58, ptr %13, align 4, !tbaa !16
  %59 = load float, ptr %13, align 4, !tbaa !16
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Shape, ptr %60, i32 0, i32 1
  %62 = load float, ptr %61, align 8, !tbaa !18
  %63 = fcmp ogt float %59, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %54
  store i32 1, ptr %14, align 4
  br label %226

65:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %66 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 1
  %67 = load float, ptr %66, align 4, !tbaa !19
  %68 = fcmp olt float %67, 0.000000e+00
  br i1 %68, label %69, label %73

69:                                               ; preds = %65
  %70 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 1
  %71 = load float, ptr %70, align 4, !tbaa !19
  %72 = fneg float %71
  br label %76

73:                                               ; preds = %65
  %74 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 1
  %75 = load float, ptr %74, align 4, !tbaa !19
  br label %76

76:                                               ; preds = %73, %69
  %77 = phi float [ %72, %69 ], [ %75, %73 ]
  %78 = getelementptr inbounds %struct.Vec2, ptr %11, i32 0, i32 1
  %79 = load float, ptr %78, align 4, !tbaa !19
  %80 = fsub float %77, %79
  store float %80, ptr %15, align 4, !tbaa !16
  %81 = load float, ptr %15, align 4, !tbaa !16
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Shape, ptr %82, i32 0, i32 1
  %84 = load float, ptr %83, align 8, !tbaa !18
  %85 = fcmp ogt float %81, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %76
  store i32 1, ptr %14, align 4
  br label %225

87:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @_ZN4Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %16)
  %88 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 0
  %89 = load float, ptr %88, align 4, !tbaa !17
  %90 = fneg float %89
  %91 = getelementptr inbounds %struct.Vec2, ptr %11, i32 0, i32 0
  %92 = load float, ptr %91, align 4, !tbaa !17
  %93 = fcmp ogt float %90, %92
  br i1 %93, label %94, label %97

94:                                               ; preds = %87
  %95 = load float, ptr %13, align 4, !tbaa !16
  %96 = getelementptr inbounds %struct.Vec2, ptr %16, i32 0, i32 0
  store float %95, ptr %96, align 4, !tbaa !17
  br label %108

97:                                               ; preds = %87
  %98 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 0
  %99 = load float, ptr %98, align 4, !tbaa !17
  %100 = getelementptr inbounds %struct.Vec2, ptr %11, i32 0, i32 0
  %101 = load float, ptr %100, align 4, !tbaa !17
  %102 = fcmp ogt float %99, %101
  br i1 %102, label %103, label %107

103:                                              ; preds = %97
  %104 = load float, ptr %13, align 4, !tbaa !16
  %105 = fneg float %104
  %106 = getelementptr inbounds %struct.Vec2, ptr %16, i32 0, i32 0
  store float %105, ptr %106, align 4, !tbaa !17
  br label %107

107:                                              ; preds = %103, %97
  br label %108

108:                                              ; preds = %107, %94
  %109 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 1
  %110 = load float, ptr %109, align 4, !tbaa !19
  %111 = fneg float %110
  %112 = getelementptr inbounds %struct.Vec2, ptr %11, i32 0, i32 1
  %113 = load float, ptr %112, align 4, !tbaa !19
  %114 = fcmp ogt float %111, %113
  br i1 %114, label %115, label %118

115:                                              ; preds = %108
  %116 = load float, ptr %15, align 4, !tbaa !16
  %117 = getelementptr inbounds %struct.Vec2, ptr %16, i32 0, i32 1
  store float %116, ptr %117, align 4, !tbaa !19
  br label %129

118:                                              ; preds = %108
  %119 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 1
  %120 = load float, ptr %119, align 4, !tbaa !19
  %121 = getelementptr inbounds %struct.Vec2, ptr %11, i32 0, i32 1
  %122 = load float, ptr %121, align 4, !tbaa !19
  %123 = fcmp ogt float %120, %122
  br i1 %123, label %124, label %128

124:                                              ; preds = %118
  %125 = load float, ptr %15, align 4, !tbaa !16
  %126 = fneg float %125
  %127 = getelementptr inbounds %struct.Vec2, ptr %16, i32 0, i32 1
  store float %126, ptr %127, align 4, !tbaa !19
  br label %128

128:                                              ; preds = %124, %118
  br label %129

129:                                              ; preds = %128, %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %130 = call noundef float @_ZN4Vec215SquareMagnitudeEv(ptr noundef nonnull align 4 dereferenceable(8) %16)
  store float %130, ptr %17, align 4, !tbaa !16
  %131 = load float, ptr %17, align 4, !tbaa !16
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.Shape, ptr %132, i32 0, i32 1
  %134 = load float, ptr %133, align 8, !tbaa !18
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.Shape, ptr %135, i32 0, i32 1
  %137 = load float, ptr %136, align 8, !tbaa !18
  %138 = fmul float %134, %137
  %139 = fcmp ogt float %131, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %129
  store i32 1, ptr %14, align 4
  br label %224

141:                                              ; preds = %129
  %142 = load float, ptr %17, align 4, !tbaa !16
  %143 = fcmp une float %142, 0.000000e+00
  br i1 %143, label %144, label %152

144:                                              ; preds = %141
  %145 = load float, ptr %17, align 4, !tbaa !16
  %146 = call float @sqrtf(float noundef %145) #5
  store float %146, ptr %17, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %147 = load float, ptr %17, align 4, !tbaa !16
  %148 = fdiv float 1.000000e+00, %147
  store float %148, ptr %19, align 4, !tbaa !16
  %149 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %19)
  store <2 x float> %149, ptr %18, align 4
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.Manifold, ptr %150, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %151, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %182

152:                                              ; preds = %141
  %153 = load float, ptr %13, align 4, !tbaa !16
  %154 = load float, ptr %15, align 4, !tbaa !16
  %155 = fcmp olt float %153, %154
  br i1 %155, label %156, label %158

156:                                              ; preds = %152
  %157 = load float, ptr %15, align 4, !tbaa !16
  br label %160

158:                                              ; preds = %152
  %159 = load float, ptr %13, align 4, !tbaa !16
  br label %160

160:                                              ; preds = %158, %156
  %161 = phi float [ %157, %156 ], [ %159, %158 ]
  store float %161, ptr %17, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %162 = load float, ptr %13, align 4, !tbaa !16
  %163 = load float, ptr %15, align 4, !tbaa !16
  %164 = fcmp ogt float %162, %163
  br i1 %164, label %165, label %172

165:                                              ; preds = %160
  %166 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 0
  %167 = load float, ptr %166, align 4, !tbaa !17
  %168 = fcmp olt float %167, 0.000000e+00
  %169 = zext i1 %168 to i64
  %170 = select i1 %168, i32 1, i32 -1
  %171 = sitofp i32 %170 to float
  call void @_ZN4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %20, float noundef %171, float noundef 0.000000e+00)
  br label %179

172:                                              ; preds = %160
  %173 = getelementptr inbounds %struct.Vec2, ptr %10, i32 0, i32 1
  %174 = load float, ptr %173, align 4, !tbaa !19
  %175 = fcmp olt float %174, 0.000000e+00
  %176 = zext i1 %175 to i64
  %177 = select i1 %175, i32 1, i32 -1
  %178 = sitofp i32 %177 to float
  call void @_ZN4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %20, float noundef 0.000000e+00, float noundef %178)
  br label %179

179:                                              ; preds = %172, %165
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.Manifold, ptr %180, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %181, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %182

182:                                              ; preds = %179, %144
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.Manifold, ptr %183, i32 0, i32 0
  store i32 1, ptr %184, align 8, !tbaa !21
  %185 = load float, ptr %17, align 4, !tbaa !16
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.Shape, ptr %186, i32 0, i32 1
  %188 = load float, ptr %187, align 8, !tbaa !18
  %189 = fsub float %185, %188
  %190 = load ptr, ptr %4, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.Manifold, ptr %190, i32 0, i32 1
  %192 = getelementptr inbounds [2 x %struct.Contact], ptr %191, i64 0, i64 0
  %193 = getelementptr inbounds %struct.Contact, ptr %192, i32 0, i32 2
  store float %189, ptr %193, align 4, !tbaa !25
  %194 = load ptr, ptr %4, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.Manifold, ptr %194, i32 0, i32 7
  call void @_ZN4Mat212SetTransposeER4Vec2(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(8) %195)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.Shape, ptr %196, i32 0, i32 4
  %198 = load ptr, ptr %197, align 8, !tbaa !9
  %199 = getelementptr inbounds %struct.RigidBody, ptr %198, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.Manifold, ptr %200, i32 0, i32 7
  %202 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %201, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store <2 x float> %202, ptr %22, align 4
  %203 = call <2 x float> @_ZN4Vec2plERKS_(ptr noundef nonnull align 4 dereferenceable(8) %199, ptr noundef nonnull align 4 dereferenceable(8) %22)
  store <2 x float> %203, ptr %21, align 4
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.Manifold, ptr %204, i32 0, i32 1
  %206 = getelementptr inbounds [2 x %struct.Contact], ptr %205, i64 0, i64 0
  %207 = getelementptr inbounds %struct.Contact, ptr %206, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %207, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %208 = load ptr, ptr %4, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.Manifold, ptr %208, i32 0, i32 7
  %210 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %209, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store <2 x float> %210, ptr %24, align 4
  %211 = call <2 x float> @_ZN4Vec2plERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %24)
  store <2 x float> %211, ptr %23, align 4
  %212 = load ptr, ptr %4, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.Manifold, ptr %212, i32 0, i32 2
  %214 = getelementptr inbounds %struct.PostPosition, ptr %213, i32 0, i32 3
  %215 = getelementptr inbounds [2 x %struct.Vec2], ptr %214, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %215, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.Shape, ptr %216, i32 0, i32 4
  %218 = load ptr, ptr %217, align 8, !tbaa !9
  %219 = getelementptr inbounds %struct.RigidBody, ptr %218, i32 0, i32 3
  %220 = load float, ptr %219, align 8, !tbaa !14
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.Manifold, ptr %221, i32 0, i32 2
  %223 = getelementptr inbounds %struct.PostPosition, ptr %222, i32 0, i32 1
  store float %220, ptr %223, align 4, !tbaa !27
  store i32 0, ptr %14, align 4
  br label %224

224:                                              ; preds = %182, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %225

225:                                              ; preds = %224, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %226

226:                                              ; preds = %225, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #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
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  %227 = load i32, ptr %14, align 4
  switch i32 %227, label %229 [
    i32 0, label %228
    i32 1, label %228
  ]

228:                                              ; preds = %226, %226
  ret void

229:                                              ; preds = %226
  unreachable
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Mat212SetTransposeER4Vec2(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #2 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 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"_ZTS5Shape", !11, i64 8, !12, i64 12, !13, i64 20, !6, i64 24}
!11 = !{!"float", !7, i64 0}
!12 = !{!"_ZTS4Vec2", !11, i64 0, !11, i64 4}
!13 = !{!"_ZTS9typeShape", !7, i64 0}
!14 = !{!15, !11, i64 24}
!15 = !{!"_ZTS9RigidBody", !12, i64 0, !12, i64 8, !12, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !6, i64 72}
!16 = !{!11, !11, i64 0}
!17 = !{!12, !11, i64 0}
!18 = !{!10, !11, i64 8}
!19 = !{!12, !11, i64 4}
!20 = !{i64 0, i64 4, !16, i64 4, i64 4, !16}
!21 = !{!22, !23, i64 0}
!22 = !{!"_ZTS8Manifold", !23, i64 0, !7, i64 4, !24, i64 92, !11, i64 132, !11, i64 136, !6, i64 144, !6, i64 152, !12, i64 160}
!23 = !{!"int", !7, i64 0}
!24 = !{!"_ZTS12PostPosition", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 24}
!25 = !{!26, !11, i64 16}
!26 = !{!"_ZTS7Contact", !12, i64 0, !12, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40}
!27 = !{!22, !11, i64 96}


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

%class.Mat2 = type { float, float, float, float }
%struct.Vec2 = type { float, float }

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sqrtf(float noundef) local_unnamed_addr #3

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

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

; 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
declare dso_local <2 x float> @_ZN4Vec2plERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11CircleToOBBR8ManifoldP5ShapeS2_(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca %class.Mat2, align 4
  %5 = alloca float, align 4
  %6 = alloca %struct.Vec2, align 8
  %7 = alloca float, align 4
  %8 = alloca %struct.Vec2, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca %struct.Vec2, align 8
  %12 = alloca %struct.Vec2, align 8
  %13 = alloca %struct.Vec2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %14 = getelementptr inbounds i8, ptr %2, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  %17 = load float, ptr %16, align 8, !tbaa !13
  %18 = fneg float %17
  store float %18, ptr %5, align 4, !tbaa !15
  call void @_ZN4Mat2C2ERKf(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %19 = getelementptr inbounds i8, ptr %1, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = load ptr, ptr %14, align 8, !tbaa !5
  %22 = call <2 x float> @_ZN4Vec2miERKS_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(8) %21)
  store <2 x float> %22, ptr %6, align 8
  %23 = call <2 x float> @_ZN4Mat2mlERK4Vec2(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %24 = getelementptr inbounds i8, ptr %2, i64 12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store float 5.000000e-01, ptr %7, align 4, !tbaa !15
  %25 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %.sroa.023.0.vec.extract = extractelement <2 x float> %23, i64 0
  %26 = fcmp olt float %.sroa.023.0.vec.extract, 0.000000e+00
  %27 = fneg float %.sroa.023.0.vec.extract
  %28 = select i1 %26, float %27, float %.sroa.023.0.vec.extract
  %.sroa.014.0.vec.extract = extractelement <2 x float> %25, i64 0
  %29 = fsub float %28, %.sroa.014.0.vec.extract
  %30 = getelementptr inbounds i8, ptr %1, i64 8
  %31 = load float, ptr %30, align 8, !tbaa !16
  %32 = fcmp ogt float %29, %31
  br i1 %32, label %94, label %33

33:                                               ; preds = %3
  %.sroa.023.4.vec.extract = extractelement <2 x float> %23, i64 1
  %34 = fcmp olt float %.sroa.023.4.vec.extract, 0.000000e+00
  %35 = fneg float %.sroa.023.4.vec.extract
  %36 = select i1 %34, float %35, float %.sroa.023.4.vec.extract
  %.sroa.014.4.vec.extract = extractelement <2 x float> %25, i64 1
  %37 = fsub float %36, %.sroa.014.4.vec.extract
  %38 = fcmp ogt float %37, %31
  br i1 %38, label %94, label %39

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN4Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %8)
  %40 = fcmp olt float %.sroa.014.0.vec.extract, %27
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  store float %29, ptr %8, align 4, !tbaa !17
  br label %46

42:                                               ; preds = %39
  %43 = fcmp ogt float %.sroa.023.0.vec.extract, %.sroa.014.0.vec.extract
  br i1 %43, label %44, label %46

44:                                               ; preds = %42
  %45 = fneg float %29
  store float %45, ptr %8, align 4, !tbaa !17
  br label %46

46:                                               ; preds = %42, %44, %41
  %47 = fcmp olt float %.sroa.014.4.vec.extract, %35
  br i1 %47, label %.sink.split, label %48

48:                                               ; preds = %46
  %49 = fcmp ogt float %.sroa.023.4.vec.extract, %.sroa.014.4.vec.extract
  br i1 %49, label %50, label %53

50:                                               ; preds = %48
  %51 = fneg float %37
  br label %.sink.split

.sink.split:                                      ; preds = %46, %50
  %.sink = phi float [ %51, %50 ], [ %37, %46 ]
  %52 = getelementptr inbounds i8, ptr %8, i64 4
  store float %.sink, ptr %52, align 4, !tbaa !18
  br label %53

53:                                               ; preds = %.sink.split, %48
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %54 = call noundef float @_ZN4Vec215SquareMagnitudeEv(ptr noundef nonnull align 4 dereferenceable(8) %8)
  %55 = load float, ptr %30, align 8, !tbaa !16
  %56 = fmul float %55, %55
  %57 = fcmp ogt float %54, %56
  br i1 %57, label %93, label %58

58:                                               ; preds = %53
  %59 = fcmp une float %54, 0.000000e+00
  br i1 %59, label %60, label %65

60:                                               ; preds = %58
  %61 = call float @sqrtf(float noundef %54) #4
  store float %61, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %62 = fdiv float 1.000000e+00, %61
  store float %62, ptr %10, align 4, !tbaa !15
  %63 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %64 = getelementptr inbounds i8, ptr %0, i64 160
  store <2 x float> %63, ptr %64, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  br label %76

65:                                               ; preds = %58
  %66 = fcmp olt float %29, %37
  %67 = select i1 %66, float %37, float %29
  store float %67, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %68 = fcmp ogt float %29, %37
  br i1 %68, label %69, label %71

69:                                               ; preds = %65
  %70 = select i1 %26, float 1.000000e+00, float -1.000000e+00
  call void @_ZN4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef %70, float noundef 0.000000e+00)
  br label %73

71:                                               ; preds = %65
  %72 = select i1 %34, float 1.000000e+00, float -1.000000e+00
  call void @_ZN4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef 0.000000e+00, float noundef %72)
  br label %73

73:                                               ; preds = %71, %69
  %74 = getelementptr inbounds i8, ptr %0, i64 160
  %75 = load i64, ptr %11, align 8
  store i64 %75, ptr %74, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %76

76:                                               ; preds = %73, %60
  %77 = phi float [ %67, %73 ], [ %61, %60 ]
  store i32 1, ptr %0, align 8, !tbaa !19
  %78 = load float, ptr %30, align 8, !tbaa !16
  %79 = fsub float %77, %78
  %80 = getelementptr inbounds i8, ptr %0, i64 4
  %81 = getelementptr inbounds i8, ptr %0, i64 20
  store float %79, ptr %81, align 4, !tbaa !23
  %82 = getelementptr inbounds i8, ptr %0, i64 160
  call void @_ZN4Mat212SetTransposeER4Vec2(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(8) %82)
  %83 = load ptr, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %84 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %82, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store <2 x float> %84, ptr %12, align 8
  %85 = call <2 x float> @_ZN4Vec2plERKS_(ptr noundef nonnull align 4 dereferenceable(8) %83, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %85, ptr %80, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %86 = call <2 x float> @_ZN4Vec2mlERKf(ptr noundef nonnull align 4 dereferenceable(8) %82, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store <2 x float> %86, ptr %13, align 8
  %87 = call <2 x float> @_ZN4Vec2plERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %88 = getelementptr inbounds i8, ptr %0, i64 116
  store <2 x float> %87, ptr %88, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i64 24
  %91 = load float, ptr %90, align 8, !tbaa !13
  %92 = getelementptr inbounds i8, ptr %0, i64 96
  store float %91, ptr %92, align 8, !tbaa !25
  br label %93

93:                                               ; preds = %53, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %94

94:                                               ; preds = %93, %33, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  ret void
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Mat212SetTransposeER4Vec2(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 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 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(write) "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 }

!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, !12, i64 24}
!6 = !{!"_ZTS5Shape", !7, i64 8, !10, i64 12, !11, i64 20, !12, i64 24}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS4Vec2", !7, i64 0, !7, i64 4}
!11 = !{!"_ZTS9typeShape", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !7, i64 24}
!14 = !{!"_ZTS9RigidBody", !10, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !12, i64 72}
!15 = !{!7, !7, i64 0}
!16 = !{!6, !7, i64 8}
!17 = !{!10, !7, i64 0}
!18 = !{!10, !7, i64 4}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTS8Manifold", !21, i64 0, !8, i64 4, !22, i64 92, !7, i64 132, !7, i64 136, !12, i64 144, !12, i64 152, !10, i64 160}
!21 = !{!"int", !8, i64 0}
!22 = !{!"_ZTS12PostPosition", !7, i64 0, !7, i64 4, !8, i64 8, !8, i64 24}
!23 = !{!24, !7, i64 16}
!24 = !{!"_ZTS7Contact", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40}
!25 = !{!20, !7, i64 96}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass