; LLVM IR from wgtdkp/apollonia :: src/collision.ll (ZN9apollonia7CollideEPNS_11PolygonBodyES1_)

; 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.apollonia::Vec2" = type { float, float }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl" }
%"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl" = type { %"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl_data" }
%"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"struct.apollonia::Contact" = type { %"struct.apollonia::Vec2", %"struct.apollonia::Vec2", %"struct.apollonia::Vec2", %"struct.std::array.5", %"struct.std::array.6", float, float, float, float, float, float }
%"struct.std::array.5" = type { [2 x i8] }
%"struct.std::array.6" = type { [2 x i64] }
%"class.std::allocator.2" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [67 x i8], align 1
@__PRETTY_FUNCTION__._ZN9apollonia7CollideEPNS_11PolygonBodyES1_ = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9apollonia7CollideEPNS_11PolygonBodyES1_(ptr noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.apollonia::Vec2", align 4
  %14 = alloca %"struct.apollonia::Vec2", align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.std::vector.0", align 8
  %18 = alloca %"class.std::initializer_list", align 8
  %19 = alloca [2 x %"struct.apollonia::Contact"], align 8
  %20 = alloca %"class.std::allocator.2", align 1
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca %"class.std::vector.0", align 8
  %24 = alloca i64, align 8
  %25 = alloca %"struct.apollonia::Vec2", align 4
  %26 = alloca %"struct.apollonia::Vec2", align 4
  %27 = alloca %"struct.apollonia::Vec2", align 4
  %28 = alloca %"struct.apollonia::Vec2", align 4
  %29 = alloca i64, align 8
  %30 = alloca %"struct.apollonia::Vec2", align 4
  %31 = alloca %"struct.apollonia::Vec2", align 4
  %32 = alloca ptr, align 8
  %33 = alloca %"class.std::vector.0", align 8
  %34 = alloca ptr, align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %37 = alloca ptr, align 8
  %38 = alloca float, align 4
  %39 = alloca %"struct.apollonia::Vec2", align 4
  %40 = alloca %"struct.apollonia::Vec2", align 4
  %41 = alloca %"struct.apollonia::Vec2", align 4
  %42 = alloca %"struct.apollonia::Vec2", align 4
  %43 = alloca %"struct.apollonia::Vec2", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #10
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call noundef float @_ZNK9apollonia11PolygonBody21FindMinSeparatingAxisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(112) %44, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(112) %45)
  store float %46, ptr %8, align 4, !tbaa !9
  %47 = fcmp oge float %46, 0.000000e+00
  br i1 %47, label %48, label %49

48:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %267

49:                                               ; preds = %2
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = call noundef float @_ZNK9apollonia11PolygonBody21FindMinSeparatingAxisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(112) %50, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(112) %51)
  store float %52, ptr %9, align 4, !tbaa !9
  %53 = fcmp oge float %52, 0.000000e+00
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %267

55:                                               ; preds = %49
  %56 = load float, ptr %8, align 4, !tbaa !9
  %57 = load float, ptr %9, align 4, !tbaa !9
  %58 = fcmp olt float %56, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %55
  call void @_ZSt4swapIfENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9) #10
  call void @_ZSt4swapImENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #10
  call void @_ZSt4swapIPN9apollonia11PolygonBodyEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #10
  br label %60

60:                                               ; preds = %59, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %61, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %62, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = load i64, ptr %6, align 8, !tbaa !11
  %65 = call <2 x float> @_ZNK9apollonia11PolygonBody6EdgeAtEm(ptr noundef nonnull align 8 dereferenceable(112) %63, i64 noundef %64)
  store <2 x float> %65, ptr %14, align 4
  %66 = call <2 x float> @_ZNK9apollonia4Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %66, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = call noundef i64 @_ZN9apolloniaL16FindIncidentEdgeERKNS_4Vec2ERKNS_11PolygonBodyE(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(112) %67)
  store i64 %68, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  %69 = load i64, ptr %15, align 8, !tbaa !11
  %70 = add i64 %69, 1
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = call noundef i64 @_ZNK9apollonia11PolygonBody5CountEv(ptr noundef nonnull align 8 dereferenceable(112) %71)
  %73 = urem i64 %70, %72
  store i64 %73, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #10
  call void @llvm.lifetime.start.p0(i64 144, ptr %19) #10
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = load i64, ptr %15, align 8, !tbaa !11
  call void @_ZN9apollonia7ContactC1ERKNS_11PolygonBodyEm(ptr noundef nonnull align 8 dereferenceable(72) %19, ptr noundef nonnull align 8 dereferenceable(112) %74, i64 noundef %75)
  %76 = getelementptr inbounds %"struct.apollonia::Contact", ptr %19, i64 1
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load i64, ptr %16, align 8, !tbaa !11
  call void @_ZN9apollonia7ContactC1ERKNS_11PolygonBodyEm(ptr noundef nonnull align 8 dereferenceable(72) %76, ptr noundef nonnull align 8 dereferenceable(112) %77, i64 noundef %78)
  %79 = getelementptr inbounds %"class.std::initializer_list", ptr %18, i32 0, i32 0
  store ptr %19, ptr %79, align 8, !tbaa !13
  %80 = getelementptr inbounds %"class.std::initializer_list", ptr %18, i32 0, i32 1
  store i64 2, ptr %80, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #10
  call void @_ZNSaIN9apollonia7ContactEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #10
  %81 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8
  %83 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 1
  %84 = load i64, ptr %83, align 8
  invoke void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr %82, i64 %84, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %85 unwind label %94

85:                                               ; preds = %60
  call void @_ZNSt15__new_allocatorIN9apollonia7ContactEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 144, ptr %19) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #10
  invoke void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %86 unwind label %98

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  store i64 0, ptr %24, align 8, !tbaa !11
  br label %87

87:                                               ; preds = %161, %86
  %88 = load i64, ptr %24, align 8, !tbaa !11
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = invoke noundef i64 @_ZNK9apollonia11PolygonBody5CountEv(ptr noundef nonnull align 8 dereferenceable(112) %89)
          to label %91 unwind label %102

91:                                               ; preds = %87
  %92 = icmp ult i64 %88, %90
  br i1 %92, label %106, label %93

93:                                               ; preds = %91
  store i32 2, ptr %10, align 4
  br label %166

94:                                               ; preds = %60
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %21, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %22, align 4
  call void @_ZNSt15__new_allocatorIN9apollonia7ContactEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 144, ptr %19) #10
  br label %266

98:                                               ; preds = %85
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %21, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %22, align 4
  br label %265

102:                                              ; preds = %87
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %21, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %22, align 4
  br label %168

106:                                              ; preds = %91
  %107 = load i64, ptr %24, align 8, !tbaa !11
  %108 = load i64, ptr %6, align 8, !tbaa !11
  %109 = icmp eq i64 %107, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %106
  br label %161

111:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #10
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #10
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = load i64, ptr %24, align 8, !tbaa !11
  %115 = invoke <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112) %113, i64 noundef %114)
          to label %116 unwind label %137

116:                                              ; preds = %111
  store <2 x float> %115, ptr %26, align 4
  %117 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %112, ptr noundef nonnull align 4 dereferenceable(8) %26)
          to label %118 unwind label %137

118:                                              ; preds = %116
  store <2 x float> %117, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #10
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #10
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load i64, ptr %24, align 8, !tbaa !11
  %122 = add i64 %121, 1
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = invoke noundef i64 @_ZNK9apollonia11PolygonBody5CountEv(ptr noundef nonnull align 8 dereferenceable(112) %123)
          to label %125 unwind label %141

125:                                              ; preds = %118
  %126 = urem i64 %122, %124
  %127 = invoke <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112) %120, i64 noundef %126)
          to label %128 unwind label %141

128:                                              ; preds = %125
  store <2 x float> %127, ptr %28, align 4
  %129 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %119, ptr noundef nonnull align 4 dereferenceable(8) %28)
          to label %130 unwind label %141

130:                                              ; preds = %128
  store <2 x float> %129, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #10
  %131 = load i64, ptr %24, align 8, !tbaa !11
  %132 = invoke noundef i64 @_ZN9apolloniaL4ClipERSt6vectorINS_7ContactESaIS1_EERKS3_mRKNS_4Vec2ES9_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %131, ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(8) %27)
          to label %133 unwind label %145

133:                                              ; preds = %130
  store i64 %132, ptr %29, align 8, !tbaa !11
  %134 = load i64, ptr %29, align 8, !tbaa !11
  %135 = icmp ult i64 %134, 2
  br i1 %135, label %136, label %149

136:                                              ; preds = %133
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %158

137:                                              ; preds = %116, %111
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %21, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #10
  br label %165

141:                                              ; preds = %128, %125, %118
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %21, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  br label %164

145:                                              ; preds = %155, %130
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %21, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  br label %164

149:                                              ; preds = %133
  %150 = load i64, ptr %29, align 8, !tbaa !11
  %151 = icmp eq i64 %150, 2
  br i1 %151, label %152, label %153

152:                                              ; preds = %149
  br label %155

153:                                              ; preds = %149
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 82, ptr noundef @__PRETTY_FUNCTION__._ZN9apollonia7CollideEPNS_11PolygonBodyES1_) #11
  unreachable

154:                                              ; No predecessors!
  br label %155

155:                                              ; preds = %154, %152
  %156 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %157 unwind label %145

157:                                              ; preds = %155
  store i32 0, ptr %10, align 4
  br label %158

158:                                              ; preds = %157, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  %159 = load i32, ptr %10, align 4
  switch i32 %159, label %166 [
    i32 0, label %160
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160, %110
  %162 = load i64, ptr %24, align 8, !tbaa !11
  %163 = add i64 %162, 1
  store i64 %163, ptr %24, align 8, !tbaa !11
  br label %87, !llvm.loop !16

164:                                              ; preds = %145, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #10
  br label %165

165:                                              ; preds = %164, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  br label %168

166:                                              ; preds = %158, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  %167 = load i32, ptr %10, align 4
  switch i32 %167, label %263 [
    i32 2, label %169
  ]

168:                                              ; preds = %165, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  br label %264

169:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #10
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #10
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = load i64, ptr %6, align 8, !tbaa !11
  %173 = invoke <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112) %171, i64 noundef %172)
          to label %174 unwind label %190

174:                                              ; preds = %169
  store <2 x float> %173, ptr %31, align 4
  %175 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %170, ptr noundef nonnull align 4 dereferenceable(8) %31)
          to label %176 unwind label %190

176:                                              ; preds = %174
  store <2 x float> %175, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #10
  %177 = load ptr, ptr %11, align 8, !tbaa !5
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #10
  call void @llvm.memset.p0.i64(ptr align 8 %33, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #10
  %179 = invoke noundef ptr @_ZN9apollonia5World10NewArbiterERNS_4BodyES2_RKNS_4Vec2ERKSt6vectorINS_7ContactESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(88) %177, ptr noundef nonnull align 8 dereferenceable(88) %178, ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(24) %33)
          to label %180 unwind label %194

180:                                              ; preds = %176
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #10
  store ptr %179, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #10
  store ptr %23, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #10
  %181 = load ptr, ptr %34, align 8, !tbaa !5
  %182 = call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %181) #10
  %183 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %182, ptr %183, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #10
  %184 = load ptr, ptr %34, align 8, !tbaa !5
  %185 = call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %184) #10
  %186 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  store ptr %185, ptr %186, align 8
  br label %187

187:                                              ; preds = %256, %180
  %188 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %36) #10
  br i1 %188, label %198, label %189

189:                                              ; preds = %187
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #10
  br label %259

190:                                              ; preds = %174, %169
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %21, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #10
  br label %262

194:                                              ; preds = %176
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %21, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %22, align 4
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #10
  br label %261

198:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #10
  %199 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #10
  store ptr %199, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #10
  %200 = load ptr, ptr %37, align 8, !tbaa !5
  %201 = getelementptr inbounds %"struct.apollonia::Contact", ptr %200, i32 0, i32 0
  %202 = invoke <2 x float> @_ZN9apolloniamiERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %201, ptr noundef nonnull align 4 dereferenceable(8) %30)
          to label %203 unwind label %239

203:                                              ; preds = %198
  store <2 x float> %202, ptr %39, align 4
  %204 = invoke noundef float @_ZN9apolloniaL3DotERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %39, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %205 unwind label %239

205:                                              ; preds = %203
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #10
  store float %204, ptr %38, align 4, !tbaa !9
  %206 = load float, ptr %38, align 4, !tbaa !9
  %207 = fcmp ole float %206, 0.000000e+00
  br i1 %207, label %208, label %255

208:                                              ; preds = %205
  %209 = load float, ptr %38, align 4, !tbaa !9
  %210 = load ptr, ptr %37, align 8, !tbaa !5
  %211 = getelementptr inbounds %"struct.apollonia::Contact", ptr %210, i32 0, i32 5
  store float %209, ptr %211, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #10
  %212 = load ptr, ptr %37, align 8, !tbaa !5
  %213 = getelementptr inbounds %"struct.apollonia::Contact", ptr %212, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #10
  %214 = load ptr, ptr %11, align 8, !tbaa !5
  %215 = load ptr, ptr %11, align 8, !tbaa !5
  %216 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9apollonia4Body8centroidEv(ptr noundef nonnull align 8 dereferenceable(88) %215)
          to label %217 unwind label %243

217:                                              ; preds = %208
  %218 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %214, ptr noundef nonnull align 4 dereferenceable(8) %216)
          to label %219 unwind label %243

219:                                              ; preds = %217
  store <2 x float> %218, ptr %41, align 4
  %220 = invoke <2 x float> @_ZN9apolloniamiERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %213, ptr noundef nonnull align 4 dereferenceable(8) %41)
          to label %221 unwind label %243

221:                                              ; preds = %219
  store <2 x float> %220, ptr %40, align 4
  %222 = load ptr, ptr %37, align 8, !tbaa !5
  %223 = getelementptr inbounds %"struct.apollonia::Contact", ptr %222, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %223, ptr align 4 %40, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #10
  %224 = load ptr, ptr %37, align 8, !tbaa !5
  %225 = getelementptr inbounds %"struct.apollonia::Contact", ptr %224, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #10
  %226 = load ptr, ptr %12, align 8, !tbaa !5
  %227 = load ptr, ptr %12, align 8, !tbaa !5
  %228 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9apollonia4Body8centroidEv(ptr noundef nonnull align 8 dereferenceable(88) %227)
          to label %229 unwind label %247

229:                                              ; preds = %221
  %230 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %226, ptr noundef nonnull align 4 dereferenceable(8) %228)
          to label %231 unwind label %247

231:                                              ; preds = %229
  store <2 x float> %230, ptr %43, align 4
  %232 = invoke <2 x float> @_ZN9apolloniamiERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %225, ptr noundef nonnull align 4 dereferenceable(8) %43)
          to label %233 unwind label %247

233:                                              ; preds = %231
  store <2 x float> %232, ptr %42, align 4
  %234 = load ptr, ptr %37, align 8, !tbaa !5
  %235 = getelementptr inbounds %"struct.apollonia::Contact", ptr %234, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %235, ptr align 4 %42, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #10
  %236 = load ptr, ptr %32, align 8, !tbaa !5
  %237 = load ptr, ptr %37, align 8, !tbaa !5
  invoke void @_ZN9apollonia7Arbiter10AddContactERKNS_7ContactE(ptr noundef nonnull align 8 dereferenceable(48) %236, ptr noundef nonnull align 8 dereferenceable(72) %237)
          to label %238 unwind label %251

238:                                              ; preds = %233
  br label %255

239:                                              ; preds = %203, %198
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %21, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #10
  br label %258

243:                                              ; preds = %219, %217, %208
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %21, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #10
  br label %258

247:                                              ; preds = %231, %229, %221
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %21, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #10
  br label %258

251:                                              ; preds = %233
  %252 = landingpad { ptr, i32 }
          cleanup
  %253 = extractvalue { ptr, i32 } %252, 0
  store ptr %253, ptr %21, align 8
  %254 = extractvalue { ptr, i32 } %252, 1
  store i32 %254, ptr %22, align 4
  br label %258

255:                                              ; preds = %238, %205
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #10
  br label %256

256:                                              ; preds = %255
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #10
  br label %187

258:                                              ; preds = %251, %247, %243, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #10
  br label %261

259:                                              ; preds = %189
  %260 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %260, ptr %3, align 8
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  br label %263

261:                                              ; preds = %258, %194
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  br label %262

262:                                              ; preds = %261, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  br label %264

263:                                              ; preds = %259, %166
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #10
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  br label %267

264:                                              ; preds = %262, %168
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #10
  br label %265

265:                                              ; preds = %264, %98
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #10
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #10
  br label %266

266:                                              ; preds = %265, %94
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  br label %269

267:                                              ; preds = %263, %54, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  %268 = load ptr, ptr %3, align 8
  ret ptr %268

269:                                              ; preds = %266
  %270 = load ptr, ptr %21, align 8
  %271 = load i32, ptr %22, align 4
  %272 = insertvalue { ptr, i32 } poison, ptr %270, 0
  %273 = insertvalue { ptr, i32 } %272, i32 %271, 1
  resume { ptr, i32 } %273
}

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

declare noundef float @_ZNK9apollonia11PolygonBody21FindMinSeparatingAxisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(112)) #2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK9apollonia11PolygonBody6EdgeAtEm(ptr noundef nonnull align 8 dereferenceable(112), i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN9apolloniaL16FindIncidentEdgeERKNS_4Vec2ERKNS_11PolygonBodyE(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(112)) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN9apolloniaL4ClipERSt6vectorINS_7ContactESaIS1_EERKS3_mRKNS_4Vec2ES9_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

declare noundef ptr @_ZN9apollonia5World10NewArbiterERNS_4BodyES2_RKNS_4Vec2ERKSt6vectorINS_7ContactESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9apollonia4Body8centroidEv(ptr noundef nonnull align 8 dereferenceable(88)) #4 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) #9

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9apollonia7Arbiter10AddContactERKNS_7ContactE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(72)) #5 align 2

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

declare void @_ZN9apollonia7ContactC1ERKNS_11PolygonBodyEm(ptr, ptr, i64)

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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"="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 = { noreturn 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 #9 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { nounwind }
attributes #11 = { noreturn 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 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt16initializer_listIN9apollonia7ContactEE", !6, i64 0, !12, i64 8}
!15 = !{!14, !12, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !10, i64 48}
!19 = !{!"_ZTSN9apollonia7ContactE", !20, i64 0, !20, i64 8, !20, i64 16, !21, i64 24, !22, i64 32, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!20 = !{!"_ZTSN9apollonia4Vec2E", !10, i64 0, !10, i64 4}
!21 = !{!"_ZTSSt5arrayIbLm2EE", !7, i64 0}
!22 = !{!"_ZTSSt5arrayImLm2EE", !7, i64 0}
!23 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}


; 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.apollonia::Vec2" = type { float, float }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl" }
%"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl" = type { %"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl_data" }
%"struct.std::_Vector_base<apollonia::Contact, std::allocator<apollonia::Contact>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.apollonia::Contact" = type { %"struct.apollonia::Vec2", %"struct.apollonia::Vec2", %"struct.apollonia::Vec2", %"struct.std::array.5", %"struct.std::array.6", float, float, float, float, float, float }
%"struct.std::array.5" = type { [2 x i8] }
%"struct.std::array.6" = type { [2 x i64] }
%"class.std::allocator.2" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [67 x i8], align 1
@__PRETTY_FUNCTION__._ZN9apollonia7CollideEPNS_11PolygonBodyES1_ = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9apollonia7CollideEPNS_11PolygonBodyES1_(ptr noundef nonnull %0, ptr noundef nonnull %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"struct.apollonia::Vec2", align 8
  %10 = alloca %"struct.apollonia::Vec2", align 8
  %11 = alloca %"class.std::vector.0", align 8
  %12 = alloca [2 x %"struct.apollonia::Contact"], align 8
  %13 = alloca %"class.std::allocator.2", align 1
  %14 = alloca %"class.std::vector.0", align 8
  %15 = alloca %"struct.apollonia::Vec2", align 8
  %16 = alloca %"struct.apollonia::Vec2", align 8
  %17 = alloca %"struct.apollonia::Vec2", align 8
  %18 = alloca %"struct.apollonia::Vec2", align 8
  %19 = alloca %"struct.apollonia::Vec2", align 8
  %20 = alloca %"struct.apollonia::Vec2", align 8
  %21 = alloca %"class.std::vector.0", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca %"struct.apollonia::Vec2", align 8
  %25 = alloca %"struct.apollonia::Vec2", align 8
  %26 = alloca %"struct.apollonia::Vec2", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  %27 = call noundef float @_ZNK9apollonia11PolygonBody21FindMinSeparatingAxisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(112) %0, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(112) %1)
  store float %27, ptr %7, align 4, !tbaa !9
  %28 = fcmp ult float %27, 0.000000e+00
  br i1 %28, label %29, label %137

29:                                               ; preds = %2
  %30 = call noundef float @_ZNK9apollonia11PolygonBody21FindMinSeparatingAxisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(112) %1, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(112) %0)
  store float %30, ptr %8, align 4, !tbaa !9
  %31 = fcmp ult float %30, 0.000000e+00
  br i1 %31, label %32, label %137

32:                                               ; preds = %29
  %33 = load float, ptr %7, align 4, !tbaa !9
  %34 = fcmp olt float %33, %30
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  call void @_ZSt4swapIfENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8) #9
  call void @_ZSt4swapImENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @_ZSt4swapIPN9apollonia11PolygonBodyEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  br label %36

36:                                               ; preds = %35, %32
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %39 = load i64, ptr %5, align 8, !tbaa !11
  %40 = call <2 x float> @_ZNK9apollonia11PolygonBody6EdgeAtEm(ptr noundef nonnull align 8 dereferenceable(112) %37, i64 noundef %39)
  store <2 x float> %40, ptr %10, align 8
  %41 = call <2 x float> @_ZNK9apollonia4Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %41, ptr %9, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  %42 = call noundef i64 @_ZN9apolloniaL16FindIncidentEdgeERKNS_4Vec2ERKNS_11PolygonBodyE(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(112) %38)
  %43 = add i64 %42, 1
  %44 = call noundef i64 @_ZNK9apollonia11PolygonBody5CountEv(ptr noundef nonnull align 8 dereferenceable(112) %38)
  %45 = urem i64 %43, %44
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %12) #9
  call void @_ZN9apollonia7ContactC1ERKNS_11PolygonBodyEm(ptr noundef nonnull align 8 dereferenceable(72) %12, ptr noundef nonnull align 8 dereferenceable(112) %38, i64 noundef %42)
  %46 = getelementptr inbounds i8, ptr %12, i64 72
  call void @_ZN9apollonia7ContactC1ERKNS_11PolygonBodyEm(ptr noundef nonnull align 8 dereferenceable(72) %46, ptr noundef nonnull align 8 dereferenceable(112) %38, i64 noundef %45)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #9
  call void @_ZNSaIN9apollonia7ContactEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #9
  invoke void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr nonnull %12, i64 2, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %47 unwind label %49

47:                                               ; preds = %36
  call void @_ZNSt15__new_allocatorIN9apollonia7ContactEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #9
  invoke void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %.preheader unwind label %51

.preheader:                                       ; preds = %47
  %48 = call noundef i64 @_ZNK9apollonia11PolygonBody5CountEv(ptr noundef nonnull align 8 dereferenceable(112) %37)
  %.not81.not = icmp eq i64 %48, 0
  br i1 %.not81.not, label %.critedge80, label %.lr.ph

49:                                               ; preds = %36
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIN9apollonia7ContactEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %12) #9
  br label %136

51:                                               ; preds = %47
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %135

.lr.ph:                                           ; preds = %.preheader, %82
  %.06682 = phi i64 [ %.pre-phi, %82 ], [ 0, %.preheader ]
  %53 = load i64, ptr %5, align 8, !tbaa !11
  %54 = icmp eq i64 %.06682, %53
  br i1 %54, label %.lr.ph._crit_edge, label %55

.lr.ph._crit_edge:                                ; preds = %.lr.ph
  %.pre = add nuw i64 %.06682, 1
  br label %82

55:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #9
  %56 = invoke <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112) %37, i64 noundef %.06682)
          to label %57 unwind label %70

57:                                               ; preds = %55
  store <2 x float> %56, ptr %16, align 8
  %58 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %37, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %59 unwind label %70

59:                                               ; preds = %57
  store <2 x float> %58, ptr %15, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #9
  %60 = add nuw i64 %.06682, 1
  %61 = call noundef i64 @_ZNK9apollonia11PolygonBody5CountEv(ptr noundef nonnull align 8 dereferenceable(112) %37)
  %62 = urem i64 %60, %61
  %63 = invoke <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112) %37, i64 noundef %62)
          to label %64 unwind label %72

64:                                               ; preds = %59
  store <2 x float> %63, ptr %18, align 8
  %65 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %37, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %66 unwind label %72

66:                                               ; preds = %64
  store <2 x float> %65, ptr %17, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #9
  %67 = invoke noundef i64 @_ZN9apolloniaL4ClipERSt6vectorINS_7ContactESaIS1_EERKS3_mRKNS_4Vec2ES9_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.06682, ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %17)
          to label %68 unwind label %74

68:                                               ; preds = %66
  %69 = icmp ugt i64 %67, 1
  br i1 %69, label %76, label %86

70:                                               ; preds = %57, %55
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  br label %85

72:                                               ; preds = %64, %59
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #9
  br label %84

74:                                               ; preds = %79, %66
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %84

76:                                               ; preds = %68
  %77 = icmp eq i64 %67, 2
  br i1 %77, label %79, label %78

78:                                               ; preds = %76
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 82, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9apollonia7CollideEPNS_11PolygonBodyES1_) #10
  unreachable

79:                                               ; preds = %76
  %80 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %81 unwind label %74

81:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  br label %82

82:                                               ; preds = %.lr.ph._crit_edge, %81
  %.pre-phi = phi i64 [ %.pre, %.lr.ph._crit_edge ], [ %60, %81 ]
  %83 = call noundef i64 @_ZNK9apollonia11PolygonBody5CountEv(ptr noundef nonnull align 8 dereferenceable(112) %37)
  %.not = icmp ult i64 %.pre-phi, %83
  br i1 %.not, label %.lr.ph, label %.critedge80, !llvm.loop !13

84:                                               ; preds = %74, %72
  %.pn = phi { ptr, i32 } [ %75, %74 ], [ %73, %72 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  br label %85

85:                                               ; preds = %84, %70
  %.pn.pn = phi { ptr, i32 } [ %.pn, %84 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  br label %134

86:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  br label %133

.critedge80:                                      ; preds = %82, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #9
  %87 = load i64, ptr %5, align 8, !tbaa !11
  %88 = invoke <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112) %37, i64 noundef %87)
          to label %89 unwind label %97

89:                                               ; preds = %.critedge80
  store <2 x float> %88, ptr %20, align 8
  %90 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %37, ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %91 unwind label %97

91:                                               ; preds = %89
  store <2 x float> %90, ptr %19, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %21) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %21, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #9
  %92 = invoke noundef ptr @_ZN9apollonia5World10NewArbiterERNS_4BodyES2_RKNS_4Vec2ERKSt6vectorINS_7ContactESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(88) %37, ptr noundef nonnull align 8 dereferenceable(88) %38, ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %93 unwind label %99

93:                                               ; preds = %91
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #9
  %94 = call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  store ptr %94, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #9
  %95 = call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  store ptr %95, ptr %23, align 8
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #9
  br i1 %96, label %.lr.ph83, label %._crit_edge

._crit_edge:                                      ; preds = %128, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #9
  br label %133

97:                                               ; preds = %89, %.critedge80
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #9
  br label %132

99:                                               ; preds = %91
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #9
  br label %132

.lr.ph83:                                         ; preds = %93, %128
  %101 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #9
  %102 = invoke <2 x float> @_ZN9apolloniamiERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %101, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %103 unwind label %120

103:                                              ; preds = %.lr.ph83
  store <2 x float> %102, ptr %24, align 8
  %104 = call noundef float @_ZN9apolloniaL3DotERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #9
  %105 = fcmp ugt float %104, 0.000000e+00
  br i1 %105, label %128, label %106

106:                                              ; preds = %103
  %107 = getelementptr inbounds i8, ptr %101, i64 48
  store float %104, ptr %107, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #9
  %108 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9apollonia4Body8centroidEv(ptr noundef nonnull align 8 dereferenceable(88) %37)
  %109 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %37, ptr noundef nonnull align 4 dereferenceable(8) %108)
          to label %110 unwind label %122

110:                                              ; preds = %106
  store <2 x float> %109, ptr %25, align 8
  %111 = invoke <2 x float> @_ZN9apolloniamiERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %101, ptr noundef nonnull align 4 dereferenceable(8) %25)
          to label %112 unwind label %122

112:                                              ; preds = %110
  %113 = getelementptr inbounds i8, ptr %101, i64 8
  store <2 x float> %111, ptr %113, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #9
  %114 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9apollonia4Body8centroidEv(ptr noundef nonnull align 8 dereferenceable(88) %38)
  %115 = invoke <2 x float> @_ZNK9apollonia4Body12LocalToWorldERKNS_4Vec2E(ptr noundef nonnull align 8 dereferenceable(88) %38, ptr noundef nonnull align 4 dereferenceable(8) %114)
          to label %116 unwind label %124

116:                                              ; preds = %112
  store <2 x float> %115, ptr %26, align 8
  %117 = invoke <2 x float> @_ZN9apolloniamiERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %101, ptr noundef nonnull align 4 dereferenceable(8) %26)
          to label %118 unwind label %124

118:                                              ; preds = %116
  %119 = getelementptr inbounds i8, ptr %101, i64 16
  store <2 x float> %117, ptr %119, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #9
  invoke void @_ZN9apollonia7Arbiter10AddContactERKNS_7ContactE(ptr noundef nonnull align 8 dereferenceable(48) %92, ptr noundef nonnull align 8 dereferenceable(72) %101)
          to label %128 unwind label %126

120:                                              ; preds = %.lr.ph83
  %121 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #9
  br label %131

122:                                              ; preds = %110, %106
  %123 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  br label %131

124:                                              ; preds = %116, %112
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #9
  br label %131

126:                                              ; preds = %118
  %127 = landingpad { ptr, i32 }
          cleanup
  br label %131

128:                                              ; preds = %118, %103
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  %130 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #9
  br i1 %130, label %.lr.ph83, label %._crit_edge

131:                                              ; preds = %126, %124, %122, %120
  %.pn72 = phi { ptr, i32 } [ %127, %126 ], [ %125, %124 ], [ %123, %122 ], [ %121, %120 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  br label %132

132:                                              ; preds = %99, %131, %97
  %.pn72.pn.pn = phi { ptr, i32 } [ %98, %97 ], [ %.pn72, %131 ], [ %100, %99 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #9
  br label %134

133:                                              ; preds = %86, %._crit_edge
  %.4 = phi ptr [ %92, %._crit_edge ], [ null, %86 ]
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %137

134:                                              ; preds = %132, %85
  %.pn72.pn.pn.pn = phi { ptr, i32 } [ %.pn72.pn.pn, %132 ], [ %.pn.pn, %85 ]
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  br label %135

135:                                              ; preds = %134, %51
  %.pn72.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn72.pn.pn.pn, %134 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  call void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #9
  br label %136

136:                                              ; preds = %135, %49
  %.pn72.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn72.pn.pn.pn.pn, %135 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  resume { ptr, i32 } %.pn72.pn.pn.pn.pn.pn

137:                                              ; preds = %29, %2, %133
  %.5 = phi ptr [ %.4, %133 ], [ null, %2 ], [ null, %29 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  ret ptr %.5
}

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

declare noundef float @_ZNK9apollonia11PolygonBody21FindMinSeparatingAxisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIfENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(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 void @_ZSt4swapImENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK9apollonia11PolygonBody6EdgeAtEm(ptr noundef nonnull align 8 dereferenceable(112), i64 noundef) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN9apolloniaL16FindIncidentEdgeERKNS_4Vec2ERKNS_11PolygonBodyE(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK9apollonia11PolygonBodyixEm(ptr noundef nonnull align 8 dereferenceable(112), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN9apolloniaL4ClipERSt6vectorINS_7ContactESaIS1_EERKS3_mRKNS_4Vec2ES9_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

declare noundef ptr @_ZN9apollonia5World10NewArbiterERNS_4BodyES2_RKNS_4Vec2ERKSt6vectorINS_7ContactESaIS7_EE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9apollonia7Arbiter10AddContactERKNS_7ContactE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #5 align 2

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

declare void @_ZN9apollonia7ContactC1ERKNS_11PolygonBodyEm(ptr, ptr, i64) local_unnamed_addr

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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"="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 = { noreturn 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn 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 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 48}
!16 = !{!"_ZTSN9apollonia7ContactE", !17, i64 0, !17, i64 8, !17, i64 16, !18, i64 24, !19, i64 32, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!17 = !{!"_ZTSN9apollonia4Vec2E", !10, i64 0, !10, i64 4}
!18 = !{!"_ZTSSt5arrayIbLm2EE", !7, i64 0}
!19 = !{!"_ZTSSt5arrayImLm2EE", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass