; LLVM IR from wgtdkp/apollonia :: src/world.ll (ZN9apollonia5World4StepEf)

; 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.std::_Rb_tree_iterator" = type { ptr }
%"class.apollonia::ArbiterKey" = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.18" = type { ptr }
%"class.apollonia::World" = type { %"class.std::mutex", %"struct.apollonia::Vec2", i64, %"class.std::vector", %"class.std::vector.0", %"class.std::map" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"struct.apollonia::Vec2" = type { float, float }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<apollonia::Body *, std::allocator<apollonia::Body *>>::_Vector_impl" }
%"struct.std::_Vector_base<apollonia::Body *, std::allocator<apollonia::Body *>>::_Vector_impl" = type { %"struct.std::_Vector_base<apollonia::Body *, std::allocator<apollonia::Body *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<apollonia::Body *, std::allocator<apollonia::Body *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<apollonia::Joint *, std::allocator<apollonia::Joint *>>::_Vector_impl" }
%"struct.std::_Vector_base<apollonia::Joint *, std::allocator<apollonia::Joint *>>::_Vector_impl" = type { %"struct.std::_Vector_base<apollonia::Joint *, std::allocator<apollonia::Joint *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<apollonia::Joint *, std::allocator<apollonia::Joint *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<apollonia::ArbiterKey, std::pair<const apollonia::ArbiterKey, apollonia::Arbiter *>, std::_Select1st<std::pair<const apollonia::ArbiterKey, apollonia::Arbiter *>>, std::less<apollonia::ArbiterKey>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<apollonia::ArbiterKey, std::pair<const apollonia::ArbiterKey, apollonia::Arbiter *>, std::_Select1st<std::pair<const apollonia::ArbiterKey, apollonia::Arbiter *>>, std::less<apollonia::ArbiterKey>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { %"class.apollonia::ArbiterKey", ptr }

@_ZTIN9apollonia4BodyE = external dso_local constant { ptr, ptr }, align 8
@_ZTIN9apollonia11PolygonBodyE = external dso_local constant { ptr, ptr, ptr }, align 8

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9apollonia5World4StepEf(ptr noundef nonnull align 8 dereferenceable(152) %0, float noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"class.apollonia::ArbiterKey", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca %"class.apollonia::ArbiterKey", align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca ptr, align 8
  %27 = alloca i64, align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %38 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %39 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %40 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store i64 0, ptr %5, align 8, !tbaa !11
  br label %41

41:                                               ; preds = %138, %2
  %42 = load i64, ptr %5, align 8, !tbaa !11
  %43 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 3
  %44 = call noundef i64 @_ZNKSt6vectorIPN9apollonia4BodyESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #8
  %45 = icmp ult i64 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %141

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %48 = load i64, ptr %5, align 8, !tbaa !11
  %49 = add i64 %48, 1
  store i64 %49, ptr %7, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %134, %47
  %51 = load i64, ptr %7, align 8, !tbaa !11
  %52 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 3
  %53 = call noundef i64 @_ZNKSt6vectorIPN9apollonia4BodyESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #8
  %54 = icmp ult i64 %51, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %50
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %137

56:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %57 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 3
  %58 = load i64, ptr %5, align 8, !tbaa !11
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %58) #8
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = call ptr @__dynamic_cast(ptr %60, ptr @_ZTIN9apollonia4BodyE, ptr @_ZTIN9apollonia11PolygonBodyE, i64 0) #8
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %64

63:                                               ; preds = %56
  call void @__cxa_bad_cast() #9
  unreachable

64:                                               ; preds = %56
  store ptr %61, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %65 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 3
  %66 = load i64, ptr %7, align 8, !tbaa !11
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %66) #8
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = call ptr @__dynamic_cast(ptr %68, ptr @_ZTIN9apollonia4BodyE, ptr @_ZTIN9apollonia11PolygonBodyE, i64 0) #8
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %72

71:                                               ; preds = %64
  call void @__cxa_bad_cast() #9
  unreachable

72:                                               ; preds = %64
  store ptr %69, ptr %9, align 8, !tbaa !5
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = call noundef zeroext i1 @_ZNK9apollonia4Body13ShouldCollideERKS0_(ptr noundef nonnull align 8 dereferenceable(88) %73, ptr noundef nonnull align 8 dereferenceable(88) %74)
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 7, ptr %6, align 4
  br label %131

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = call noundef ptr @_ZN9apollonia7CollideEPNS_11PolygonBodyES1_(ptr noundef %78, ptr noundef %79)
  store ptr %80, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %81 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN9apollonia10ArbiterKeyC2ERKNS_4BodyES3_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(88) %82, ptr noundef nonnull align 8 dereferenceable(88) %83)
  %84 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48) %81, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %85 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = icmp eq ptr %86, null
  br i1 %87, label %88, label %106

88:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %89 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 5
  %90 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %89) #8
  %91 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %90, ptr %91, align 8
  %92 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br i1 %92, label %93, label %105

93:                                               ; preds = %88
  %94 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %95 = getelementptr inbounds %"struct.std::pair", ptr %94, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8, !tbaa !13
  %97 = icmp eq ptr %96, null
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  call void @_ZN9apollonia7ArbiterD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %96) #8
  call void @_ZdlPvm(ptr noundef %96, i64 noundef 48) #10
  br label %99

99:                                               ; preds = %98, %93
  %100 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !16
  %101 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8
  %103 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(48) %100, ptr %102)
  %104 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %15, i32 0, i32 0
  store ptr %103, ptr %104, align 8
  br label %105

105:                                              ; preds = %99, %88
  br label %130

106:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %107 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 5
  %108 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %107) #8
  %109 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  %110 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br i1 %110, label %111, label %116

111:                                              ; preds = %106
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN9apollonia10ArbiterKeyC2ERKNS_7ArbiterE(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(48) %114)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %113, ptr noundef nonnull align 8 dereferenceable(16) %17)
  store ptr %112, ptr %115, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  br label %129

116:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %117 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 1
  store ptr %118, ptr %18, align 8, !tbaa !5
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  %121 = load ptr, ptr %120, align 8, !tbaa !5
  call void @_ZN9apollonia7Arbiter17AccumulateImpulseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %119, ptr noundef nonnull align 8 dereferenceable(48) %121)
  %122 = load ptr, ptr %18, align 8, !tbaa !5
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %126, label %125

125:                                              ; preds = %116
  call void @_ZN9apollonia7ArbiterD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %123) #8
  call void @_ZdlPvm(ptr noundef %123, i64 noundef 48) #10
  br label %126

126:                                              ; preds = %125, %116
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %127, ptr %128, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %129

129:                                              ; preds = %126, %111
  br label %130

130:                                              ; preds = %129, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  store i32 0, ptr %6, align 4
  br label %131

131:                                              ; preds = %130, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %132 = load i32, ptr %6, align 4
  switch i32 %132, label %250 [
    i32 0, label %133
    i32 7, label %134
  ]

133:                                              ; preds = %131
  br label %134

134:                                              ; preds = %133, %131
  %135 = load i64, ptr %7, align 8, !tbaa !11
  %136 = add i64 %135, 1
  store i64 %136, ptr %7, align 8, !tbaa !11
  br label %50, !llvm.loop !17

137:                                              ; preds = %55
  br label %138

138:                                              ; preds = %137
  %139 = load i64, ptr %5, align 8, !tbaa !11
  %140 = add i64 %139, 1
  store i64 %140, ptr %5, align 8, !tbaa !11
  br label %41, !llvm.loop !19

141:                                              ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %142 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 5
  store ptr %142, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %143 = load ptr, ptr %19, align 8, !tbaa !5
  %144 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %143) #8
  %145 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %144, ptr %145, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %146) #8
  %148 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %147, ptr %148, align 8
  br label %149

149:                                              ; preds = %158, %141
  %150 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %150, label %152, label %151

151:                                              ; preds = %149
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %160

152:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %153 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  store ptr %153, ptr %22, align 8, !tbaa !5
  %154 = load ptr, ptr %22, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.std::pair", ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !13
  %157 = load float, ptr %4, align 4, !tbaa !9
  call void @_ZN9apollonia7Arbiter7PreStepEf(ptr noundef nonnull align 8 dereferenceable(48) %156, float noundef %157)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %158

158:                                              ; preds = %152
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  br label %149

160:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %161 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 4
  store ptr %161, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %162 = load ptr, ptr %23, align 8, !tbaa !5
  %163 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %162) #8
  %164 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %163, ptr %164, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %165 = load ptr, ptr %23, align 8, !tbaa !5
  %166 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %165) #8
  %167 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %166, ptr %167, align 8
  br label %168

168:                                              ; preds = %179, %160
  %169 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #8
  br i1 %169, label %171, label %170

170:                                              ; preds = %168
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %181

171:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #8
  %173 = load ptr, ptr %172, align 8, !tbaa !5
  store ptr %173, ptr %26, align 8, !tbaa !5
  %174 = load ptr, ptr %26, align 8, !tbaa !5
  %175 = load float, ptr %4, align 4, !tbaa !9
  %176 = load ptr, ptr %174, align 8, !tbaa !20
  %177 = getelementptr inbounds ptr, ptr %176, i64 0
  %178 = load ptr, ptr %177, align 8
  call void %178(ptr noundef nonnull align 8 dereferenceable(24) %174, float noundef %175)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %179

179:                                              ; preds = %171
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #8
  br label %168

181:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  store i64 0, ptr %27, align 8, !tbaa !11
  br label %182

182:                                              ; preds = %227, %181
  %183 = load i64, ptr %27, align 8, !tbaa !11
  %184 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 2
  %185 = load i64, ptr %184, align 8, !tbaa !22
  %186 = icmp ult i64 %183, %185
  br i1 %186, label %188, label %187

187:                                              ; preds = %182
  store i32 12, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %230

188:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %189 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 5
  store ptr %189, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %190 = load ptr, ptr %28, align 8, !tbaa !5
  %191 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %190) #8
  %192 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %29, i32 0, i32 0
  store ptr %191, ptr %192, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %193 = load ptr, ptr %28, align 8, !tbaa !5
  %194 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %193) #8
  %195 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  store ptr %194, ptr %195, align 8
  br label %196

196:                                              ; preds = %204, %188
  %197 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #8
  br i1 %197, label %199, label %198

198:                                              ; preds = %196
  store i32 15, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %206

199:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %200 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #8
  store ptr %200, ptr %31, align 8, !tbaa !5
  %201 = load ptr, ptr %31, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.std::pair", ptr %201, i32 0, i32 1
  %203 = load ptr, ptr %202, align 8, !tbaa !13
  call void @_ZN9apollonia7Arbiter12ApplyImpulseEv(ptr noundef nonnull align 8 dereferenceable(48) %203)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  br label %204

204:                                              ; preds = %199
  %205 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #8
  br label %196

206:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %207 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 4
  store ptr %207, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %208 = load ptr, ptr %32, align 8, !tbaa !5
  %209 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %208) #8
  %210 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %33, i32 0, i32 0
  store ptr %209, ptr %210, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %211 = load ptr, ptr %32, align 8, !tbaa !5
  %212 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %211) #8
  %213 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %212, ptr %213, align 8
  br label %214

214:                                              ; preds = %224, %206
  %215 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %34) #8
  br i1 %215, label %217, label %216

216:                                              ; preds = %214
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %226

217:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #8
  %219 = load ptr, ptr %218, align 8, !tbaa !5
  store ptr %219, ptr %35, align 8, !tbaa !5
  %220 = load ptr, ptr %35, align 8, !tbaa !5
  %221 = load ptr, ptr %220, align 8, !tbaa !20
  %222 = getelementptr inbounds ptr, ptr %221, i64 1
  %223 = load ptr, ptr %222, align 8
  call void %223(ptr noundef nonnull align 8 dereferenceable(24) %220)
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  br label %224

224:                                              ; preds = %217
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #8
  br label %214

226:                                              ; preds = %216
  br label %227

227:                                              ; preds = %226
  %228 = load i64, ptr %27, align 8, !tbaa !11
  %229 = add i64 %228, 1
  store i64 %229, ptr %27, align 8, !tbaa !11
  br label %182, !llvm.loop !43

230:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %231 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 3
  store ptr %231, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %232 = load ptr, ptr %36, align 8, !tbaa !5
  %233 = call ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %232) #8
  %234 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %37, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  %235 = load ptr, ptr %36, align 8, !tbaa !5
  %236 = call ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %235) #8
  %237 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %38, i32 0, i32 0
  store ptr %236, ptr %237, align 8
  br label %238

238:                                              ; preds = %247, %230
  %239 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia4BodyESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  br i1 %239, label %241, label %240

240:                                              ; preds = %238
  store i32 19, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  br label %249

241:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN9apollonia4BodyESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %37) #8
  %243 = load ptr, ptr %242, align 8, !tbaa !5
  store ptr %243, ptr %39, align 8, !tbaa !5
  %244 = load ptr, ptr %39, align 8, !tbaa !5
  %245 = getelementptr inbounds %"class.apollonia::World", ptr %40, i32 0, i32 1
  %246 = load float, ptr %4, align 4, !tbaa !9
  call void @_ZN9apollonia4Body9IntegrateERKNS_4Vec2Ef(ptr noundef nonnull align 8 dereferenceable(88) %244, ptr noundef nonnull align 4 dereferenceable(8) %245, float noundef %246)
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  br label %247

247:                                              ; preds = %241
  %248 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN9apollonia4BodyESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %37) #8
  br label %238

249:                                              ; preds = %240
  ret void

250:                                              ; preds = %131
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #4

declare void @__cxa_bad_cast()

declare noundef zeroext i1 @_ZNK9apollonia4Body13ShouldCollideERKS0_(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88)) #5

declare noundef ptr @_ZN9apollonia7CollideEPNS_11PolygonBodyES1_(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9apollonia10ArbiterKeyC2ERKNS_4BodyES3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9apollonia7ArbiterD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) #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) #7

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9apollonia10ArbiterKeyC2ERKNS_7ArbiterE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

declare void @_ZN9apollonia7Arbiter17AccumulateImpulseERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #5

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

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

declare void @_ZN9apollonia7Arbiter7PreStepEf(ptr noundef nonnull align 8 dereferenceable(48), float noundef) #5

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

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

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

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

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

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

declare void @_ZN9apollonia7Arbiter12ApplyImpulseEv(ptr noundef nonnull align 8 dereferenceable(48)) #5

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

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

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

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

declare void @_ZN9apollonia4Body9IntegrateERKNS_4Vec2Ef(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 4 dereferenceable(8), float noundef) #5

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 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 = { nounwind willreturn memory(read) }
attributes #5 = { "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 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { noreturn }
attributes #10 = { builtin 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 16}
!14 = !{!"_ZTSSt4pairIKN9apollonia10ArbiterKeyEPNS0_7ArbiterEE", !15, i64 0, !6, i64 16}
!15 = !{!"_ZTSN9apollonia10ArbiterKeyE", !6, i64 0, !6, i64 8}
!16 = !{i64 0, i64 8, !5}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = !{!23, !12, i64 48}
!23 = !{!"_ZTSN9apollonia5WorldE", !24, i64 0, !26, i64 40, !12, i64 48, !27, i64 56, !31, i64 80, !35, i64 104}
!24 = !{!"_ZTSSt5mutex", !25, i64 0}
!25 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!26 = !{!"_ZTSN9apollonia4Vec2E", !10, i64 0, !10, i64 4}
!27 = !{!"_ZTSSt6vectorIPN9apollonia4BodyESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIPN9apollonia4BodyESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia4BodyESaIS2_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia4BodyESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTSSt6vectorIPN9apollonia5JointESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIPN9apollonia5JointESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia5JointESaIS2_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia5JointESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!"_ZTSSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE", !36, i64 0}
!36 = !{!"_ZTSSt8_Rb_treeIN9apollonia10ArbiterKeyESt4pairIKS1_PNS0_7ArbiterEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE", !37, i64 0}
!37 = !{!"_ZTSNSt8_Rb_treeIN9apollonia10ArbiterKeyESt4pairIKS1_PNS0_7ArbiterEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE13_Rb_tree_implISA_Lb1EEE", !38, i64 0, !40, i64 8}
!38 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN9apollonia10ArbiterKeyEEE", !39, i64 0}
!39 = !{!"_ZTSSt4lessIN9apollonia10ArbiterKeyEE"}
!40 = !{!"_ZTSSt15_Rb_tree_header", !41, i64 0, !12, i64 32}
!41 = !{!"_ZTSSt18_Rb_tree_node_base", !42, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!42 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!43 = distinct !{!43, !18}


; 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.std::_Rb_tree_iterator" = type { ptr }
%"class.apollonia::ArbiterKey" = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.18" = type { ptr }

@_ZTIN9apollonia4BodyE = external dso_local constant { ptr, ptr }, align 8
@_ZTIN9apollonia11PolygonBodyE = external dso_local constant { ptr, ptr, ptr }, align 8

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9apollonia5World4StepEf(ptr noundef nonnull align 8 dereferenceable(152) %0, float noundef %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %4 = alloca %"class.apollonia::ArbiterKey", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca %"class.apollonia::ArbiterKey", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %18 = getelementptr inbounds i8, ptr %0, i64 56
  %19 = tail call noundef i64 @_ZNKSt6vectorIPN9apollonia4BodyESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph53

.lr.ph53:                                         ; preds = %2
  %20 = getelementptr inbounds i8, ptr %0, i64 104
  br label %27

.loopexit:                                        ; preds = %73, %27
  %21 = call noundef i64 @_ZNKSt6vectorIPN9apollonia4BodyESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  %22 = icmp ult i64 %28, %21
  br i1 %22, label %27, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %.loopexit, %2
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %24 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %23) #7
  store ptr %24, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %25 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %23) #7
  store ptr %25, ptr %9, align 8
  %26 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %26, label %.lr.ph55, label %._crit_edge56

27:                                               ; preds = %.lr.ph53, %.loopexit
  %.052 = phi i64 [ 0, %.lr.ph53 ], [ %28, %.loopexit ]
  %28 = add nuw i64 %.052, 1
  %29 = call noundef i64 @_ZNKSt6vectorIPN9apollonia4BodyESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  %30 = icmp ult i64 %28, %29
  br i1 %30, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %27, %73
  %.04251 = phi i64 [ %74, %73 ], [ %28, %27 ]
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %.052) #7
  %32 = load ptr, ptr %31, align 8, !tbaa !7
  %33 = call ptr @__dynamic_cast(ptr %32, ptr nonnull @_ZTIN9apollonia4BodyE, ptr nonnull @_ZTIN9apollonia11PolygonBodyE, i64 0) #7
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %36

35:                                               ; preds = %.lr.ph
  call void @__cxa_bad_cast() #8
  unreachable

36:                                               ; preds = %.lr.ph
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %.04251) #7
  %38 = load ptr, ptr %37, align 8, !tbaa !7
  %39 = call ptr @__dynamic_cast(ptr %38, ptr nonnull @_ZTIN9apollonia4BodyE, ptr nonnull @_ZTIN9apollonia11PolygonBodyE, i64 0) #7
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %36
  call void @__cxa_bad_cast() #8
  unreachable

42:                                               ; preds = %36
  %43 = call noundef zeroext i1 @_ZNK9apollonia4Body13ShouldCollideERKS0_(ptr noundef nonnull align 8 dereferenceable(88) %33, ptr noundef nonnull align 8 dereferenceable(88) %39)
  br i1 %43, label %44, label %73

44:                                               ; preds = %42
  %45 = call noundef ptr @_ZN9apollonia7CollideEPNS_11PolygonBodyES1_(ptr noundef nonnull %33, ptr noundef nonnull %39)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @_ZN9apollonia10ArbiterKeyC2ERKNS_4BodyES3_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(88) %33, ptr noundef nonnull align 8 dereferenceable(88) %39)
  %46 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr noundef nonnull align 8 dereferenceable(16) %4)
  store ptr %46, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %47 = icmp eq ptr %45, null
  br i1 %47, label %48, label %59

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %49 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #7
  store ptr %49, ptr %5, align 8
  %50 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br i1 %50, label %51, label %72

51:                                               ; preds = %48
  %52 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = icmp eq ptr %54, null
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  call void @_ZN9apollonia7ArbiterD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %54) #7
  call void @_ZdlPvm(ptr noundef nonnull %54, i64 noundef 48) #9
  br label %57

57:                                               ; preds = %56, %51
  %.sroa.019.0.copyload = load ptr, ptr %3, align 8, !tbaa !7
  %58 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr %.sroa.019.0.copyload)
  br label %72

59:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %60 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #7
  store ptr %60, ptr %6, align 8
  %61 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZN9apollonia10ArbiterKeyC2ERKNS_7ArbiterE(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(48) %45)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr noundef nonnull align 8 dereferenceable(16) %7)
  store ptr %45, ptr %63, align 8, !tbaa !7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %72

64:                                               ; preds = %59
  %65 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  %67 = load ptr, ptr %66, align 8, !tbaa !7
  call void @_ZN9apollonia7Arbiter17AccumulateImpulseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %45, ptr noundef nonnull align 8 dereferenceable(48) %67)
  %68 = load ptr, ptr %66, align 8, !tbaa !7
  %69 = icmp eq ptr %68, null
  br i1 %69, label %71, label %70

70:                                               ; preds = %64
  call void @_ZN9apollonia7ArbiterD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %68) #7
  call void @_ZdlPvm(ptr noundef nonnull %68, i64 noundef 48) #9
  br label %71

71:                                               ; preds = %70, %64
  store ptr %45, ptr %66, align 8, !tbaa !7
  br label %72

72:                                               ; preds = %62, %71, %48, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %73

73:                                               ; preds = %42, %72
  %74 = add nuw i64 %.04251, 1
  %75 = call noundef i64 @_ZNKSt6vectorIPN9apollonia4BodyESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  %76 = icmp ult i64 %74, %75
  br i1 %76, label %.lr.ph, label %.loopexit, !llvm.loop !14

._crit_edge56:                                    ; preds = %.lr.ph55, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %77 = getelementptr inbounds i8, ptr %0, i64 80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %78 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #7
  store ptr %78, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %79 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #7
  store ptr %79, ptr %11, align 8
  %80 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %80, label %.lr.ph58, label %._crit_edge59

.lr.ph55:                                         ; preds = %._crit_edge, %.lr.ph55
  %81 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  call void @_ZN9apollonia7Arbiter7PreStepEf(ptr noundef nonnull align 8 dereferenceable(48) %83, float noundef %1)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %85 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %85, label %.lr.ph55, label %._crit_edge56

._crit_edge59:                                    ; preds = %.lr.ph58, %._crit_edge56
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %86 = getelementptr inbounds i8, ptr %0, i64 48
  %87 = load i64, ptr %86, align 8, !tbaa !15
  %.not73 = icmp eq i64 %87, 0
  br i1 %.not73, label %._crit_edge69, label %.lr.ph68

.lr.ph58:                                         ; preds = %._crit_edge56, %.lr.ph58
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %89 = load ptr, ptr %88, align 8, !tbaa !7
  %90 = load ptr, ptr %89, align 8, !tbaa !38
  %91 = load ptr, ptr %90, align 8
  call void %91(ptr noundef nonnull align 8 dereferenceable(24) %89, float noundef %1)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %93 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %93, label %.lr.ph58, label %._crit_edge59

._crit_edge69:                                    ; preds = %._crit_edge65, %._crit_edge59
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %94 = call ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  store ptr %94, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %95 = call ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  store ptr %95, ptr %17, align 8
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia4BodyESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br i1 %96, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %._crit_edge69
  %97 = getelementptr inbounds i8, ptr %0, i64 40
  br label %119

.lr.ph68:                                         ; preds = %._crit_edge59, %._crit_edge65
  %.04366 = phi i64 [ %109, %._crit_edge65 ], [ 0, %._crit_edge59 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %98 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %23) #7
  store ptr %98, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %99 = call ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %23) #7
  store ptr %99, ptr %13, align 8
  %100 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %100, label %.lr.ph61, label %._crit_edge62

._crit_edge62:                                    ; preds = %.lr.ph61, %.lr.ph68
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %101 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #7
  store ptr %101, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %102 = call ptr @_ZNSt6vectorIPN9apollonia5JointESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #7
  store ptr %102, ptr %15, align 8
  %103 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br i1 %103, label %.lr.ph64, label %._crit_edge65

.lr.ph61:                                         ; preds = %.lr.ph68, %.lr.ph61
  %104 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %106 = load ptr, ptr %105, align 8, !tbaa !11
  call void @_ZN9apollonia7Arbiter12ApplyImpulseEv(ptr noundef nonnull align 8 dereferenceable(48) %106)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %108 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %108, label %.lr.ph61, label %._crit_edge62

._crit_edge65:                                    ; preds = %.lr.ph64, %._crit_edge62
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  %109 = add nuw i64 %.04366, 1
  %110 = load i64, ptr %86, align 8, !tbaa !15
  %111 = icmp ult i64 %109, %110
  br i1 %111, label %.lr.ph68, label %._crit_edge69, !llvm.loop !40

.lr.ph64:                                         ; preds = %._crit_edge62, %.lr.ph64
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  %113 = load ptr, ptr %112, align 8, !tbaa !7
  %114 = load ptr, ptr %113, align 8, !tbaa !38
  %115 = getelementptr inbounds i8, ptr %114, i64 8
  %116 = load ptr, ptr %115, align 8
  call void %116(ptr noundef nonnull align 8 dereferenceable(24) %113)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  %118 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia5JointESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br i1 %118, label %.lr.ph64, label %._crit_edge65

._crit_edge72:                                    ; preds = %119, %._crit_edge69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  ret void

119:                                              ; preds = %.lr.ph71, %119
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN9apollonia4BodyESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %121 = load ptr, ptr %120, align 8, !tbaa !7
  call void @_ZN9apollonia4Body9IntegrateERKNS_4Vec2Ef(ptr noundef nonnull align 8 dereferenceable(88) %121, ptr noundef nonnull align 4 dereferenceable(8) %97, float noundef %1)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN9apollonia4BodyESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %123 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN9apollonia4BodyESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br i1 %123, label %119, label %._crit_edge72
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN9apollonia4BodyESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #4

declare void @__cxa_bad_cast() local_unnamed_addr

declare noundef zeroext i1 @_ZNK9apollonia4Body13ShouldCollideERKS0_(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #5

declare noundef ptr @_ZN9apollonia7CollideEPNS_11PolygonBodyES1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9apollonia10ArbiterKeyC2ERKNS_4BodyES3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(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 ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9apollonia7ArbiterD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKN9apollonia10ArbiterKeyEPNS1_7ArbiterEEES9_(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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9apollonia10ArbiterKeyC2ERKNS_7ArbiterE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

declare void @_ZN9apollonia7Arbiter17AccumulateImpulseERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #5

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

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

declare void @_ZN9apollonia7Arbiter7PreStepEf(ptr noundef nonnull align 8 dereferenceable(48), float noundef) local_unnamed_addr #5

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

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

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

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

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

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

declare void @_ZN9apollonia7Arbiter12ApplyImpulseEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #5

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

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

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

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

declare void @_ZN9apollonia4Body9IntegrateERKNS_4Vec2Ef(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 4 dereferenceable(8), float noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 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 nofree nounwind willreturn memory(read) }
attributes #5 = { "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 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }
attributes #9 = { builtin 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !8, i64 16}
!12 = !{!"_ZTSSt4pairIKN9apollonia10ArbiterKeyEPNS0_7ArbiterEE", !13, i64 0, !8, i64 16}
!13 = !{!"_ZTSN9apollonia10ArbiterKeyE", !8, i64 0, !8, i64 8}
!14 = distinct !{!14, !6}
!15 = !{!16, !21, i64 48}
!16 = !{!"_ZTSN9apollonia5WorldE", !17, i64 0, !19, i64 40, !21, i64 48, !22, i64 56, !26, i64 80, !30, i64 104}
!17 = !{!"_ZTSSt5mutex", !18, i64 0}
!18 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!19 = !{!"_ZTSN9apollonia4Vec2E", !20, i64 0, !20, i64 4}
!20 = !{!"float", !9, i64 0}
!21 = !{!"long", !9, i64 0}
!22 = !{!"_ZTSSt6vectorIPN9apollonia4BodyESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIPN9apollonia4BodyESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia4BodyESaIS2_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia4BodyESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!26 = !{!"_ZTSSt6vectorIPN9apollonia5JointESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIPN9apollonia5JointESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia5JointESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPN9apollonia5JointESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!30 = !{!"_ZTSSt3mapIN9apollonia10ArbiterKeyEPNS0_7ArbiterESt4lessIS1_ESaISt4pairIKS1_S3_EEE", !31, i64 0}
!31 = !{!"_ZTSSt8_Rb_treeIN9apollonia10ArbiterKeyESt4pairIKS1_PNS0_7ArbiterEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE", !32, i64 0}
!32 = !{!"_ZTSNSt8_Rb_treeIN9apollonia10ArbiterKeyESt4pairIKS1_PNS0_7ArbiterEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE13_Rb_tree_implISA_Lb1EEE", !33, i64 0, !35, i64 8}
!33 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN9apollonia10ArbiterKeyEEE", !34, i64 0}
!34 = !{!"_ZTSSt4lessIN9apollonia10ArbiterKeyEE"}
!35 = !{!"_ZTSSt15_Rb_tree_header", !36, i64 0, !21, i64 32}
!36 = !{!"_ZTSSt18_Rb_tree_node_base", !37, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!37 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!38 = !{!39, !39, i64 0}
!39 = !{!"vtable pointer", !10, i64 0}
!40 = distinct !{!40, !6}


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