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

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

%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }
%"struct.apollonia::Vec2" = type { float, float }
%"class.apollonia::Arbiter" = type { ptr, ptr, %"struct.apollonia::Vec2", %"class.std::vector.0" }
%"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] }

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 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)) #2 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)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9apollonia7Arbiter17AccumulateImpulseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %14 = alloca %"struct.apollonia::Vec2", align 4
  %15 = alloca %"struct.apollonia::Vec2", align 4
  %16 = alloca %"struct.apollonia::Vec2", align 4
  %17 = alloca %"struct.apollonia::Vec2", align 4
  %18 = alloca %"struct.apollonia::Vec2", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.apollonia::Arbiter", ptr %20, i32 0, i32 3
  store ptr %21, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %22 = getelementptr inbounds %"class.apollonia::Arbiter", ptr %19, i32 0, i32 3
  store ptr %22, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #7
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %27, ptr %28, align 8
  br label %29

29:                                               ; preds = %84, %2
  %30 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %30, label %32, label %31

31:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %86

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %33 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  store ptr %33, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call ptr @_ZNKSt6vectorIN9apollonia7ContactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #7
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %11, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call ptr @_ZNKSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %12, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %11, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %12, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8
  %45 = call ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS3_SaIS3_EEEES3_ET_SA_SA_RKT0_(ptr %42, ptr %44, ptr noundef nonnull align 8 dereferenceable(72) %40)
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %10, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call ptr @_ZNKSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #7
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %13, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br i1 %50, label %51, label %83

51:                                               ; preds = %32
  %52 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %53 = getelementptr inbounds %"struct.apollonia::Contact", ptr %52, i32 0, i32 6
  %54 = load float, ptr %53, align 4, !tbaa !9
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.apollonia::Contact", ptr %55, i32 0, i32 6
  store float %54, ptr %56, align 4, !tbaa !9
  %57 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %58 = getelementptr inbounds %"struct.apollonia::Contact", ptr %57, i32 0, i32 7
  %59 = load float, ptr %58, align 8, !tbaa !15
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.apollonia::Contact", ptr %60, i32 0, i32 7
  store float %59, ptr %61, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %62 = getelementptr inbounds %"class.apollonia::Arbiter", ptr %19, i32 0, i32 2
  %63 = call <2 x float> @_ZNK9apollonia4Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8) %62)
  store <2 x float> %63, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.apollonia::Contact", ptr %64, i32 0, i32 6
  %66 = load float, ptr %65, align 4, !tbaa !9
  %67 = getelementptr inbounds %"class.apollonia::Arbiter", ptr %19, i32 0, i32 2
  %68 = call <2 x float> @_ZN9apolloniamlEfRKNS_4Vec2E(float noundef %66, ptr noundef nonnull align 4 dereferenceable(8) %67)
  store <2 x float> %68, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.apollonia::Contact", ptr %69, i32 0, i32 7
  %71 = load float, ptr %70, align 8, !tbaa !15
  %72 = call <2 x float> @_ZN9apolloniamlEfRKNS_4Vec2E(float noundef %71, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %72, ptr %17, align 4
  %73 = call <2 x float> @_ZN9apolloniaplERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %17)
  store <2 x float> %73, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %74 = getelementptr inbounds %"class.apollonia::Arbiter", ptr %19, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %76 = call <2 x float> @_ZNK9apollonia4Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %76, ptr %18, align 4
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.apollonia::Contact", ptr %77, i32 0, i32 1
  call void @_ZN9apollonia4Body12ApplyImpulseERKNS_4Vec2ES3_(ptr noundef nonnull align 8 dereferenceable(88) %75, ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(8) %78)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %79 = getelementptr inbounds %"class.apollonia::Arbiter", ptr %19, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.apollonia::Contact", ptr %81, i32 0, i32 2
  call void @_ZN9apollonia4Body12ApplyImpulseERKNS_4Vec2ES3_(ptr noundef nonnull align 8 dereferenceable(88) %80, ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %82)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %83

83:                                               ; preds = %51, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %84

84:                                               ; preds = %83
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br label %29

86:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS3_SaIS3_EEEES3_ET_SA_SA_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(72)) #6

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #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 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 }

!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, !12, i64 52}
!10 = !{!"_ZTSN9apollonia7ContactE", !11, i64 0, !11, i64 8, !11, i64 16, !13, i64 24, !14, i64 32, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68}
!11 = !{!"_ZTSN9apollonia4Vec2E", !12, i64 0, !12, i64 4}
!12 = !{!"float", !7, i64 0}
!13 = !{!"_ZTSSt5arrayIbLm2EE", !7, i64 0}
!14 = !{!"_ZTSSt5arrayImLm2EE", !7, i64 0}
!15 = !{!10, !12, i64 56}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSN9apollonia7ArbiterE", !6, i64 0, !6, i64 8, !11, i64 16, !18, i64 24}
!18 = !{!"_ZTSSt6vectorIN9apollonia7ContactESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN9apollonia7ContactESaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN9apollonia7ContactESaIS1_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN9apollonia7ContactESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!17, !6, i64 8}


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

%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }
%"struct.apollonia::Vec2" = type { float, float }

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 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 #2 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 #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9apollonia7Arbiter17AccumulateImpulseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %7 = alloca %"struct.apollonia::Vec2", align 8
  %8 = alloca %"struct.apollonia::Vec2", align 8
  %9 = alloca %"struct.apollonia::Vec2", align 8
  %10 = alloca %"struct.apollonia::Vec2", align 8
  %11 = alloca %"struct.apollonia::Vec2", align 8
  %12 = getelementptr inbounds i8, ptr %1, i64 24
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %14 = tail call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  store ptr %14, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %15 = tail call ptr @_ZNSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  store ptr %15, ptr %4, align 8
  %16 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  br label %19

._crit_edge:                                      ; preds = %46, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret void

19:                                               ; preds = %.lr.ph, %46
  %20 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %21 = call ptr @_ZNKSt6vectorIN9apollonia7ContactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %22 = call ptr @_ZNKSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %23 = call ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS3_SaIS3_EEEES3_ET_SA_SA_RKT0_(ptr %21, ptr %22, ptr noundef nonnull align 8 dereferenceable(72) %20)
  store ptr %23, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %24 = call ptr @_ZNKSt6vectorIN9apollonia7ContactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  store ptr %24, ptr %6, align 8
  %25 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %25, label %26, label %46

26:                                               ; preds = %19
  %27 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %28 = getelementptr inbounds i8, ptr %27, i64 52
  %29 = load float, ptr %28, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %20, i64 52
  store float %29, ptr %30, align 4, !tbaa !5
  %31 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %32 = getelementptr inbounds i8, ptr %31, i64 56
  %33 = load float, ptr %32, align 8, !tbaa !13
  %34 = getelementptr inbounds i8, ptr %20, i64 56
  store float %33, ptr %34, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %35 = call <2 x float> @_ZNK9apollonia4Vec26NormalEv(ptr noundef nonnull align 4 dereferenceable(8) %17)
  store <2 x float> %35, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %36 = load float, ptr %30, align 4, !tbaa !5
  %37 = call <2 x float> @_ZN9apolloniamlEfRKNS_4Vec2E(float noundef %36, ptr noundef nonnull align 4 dereferenceable(8) %17)
  store <2 x float> %37, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %38 = load float, ptr %34, align 8, !tbaa !13
  %39 = call <2 x float> @_ZN9apolloniamlEfRKNS_4Vec2E(float noundef %38, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %39, ptr %10, align 8
  %40 = call <2 x float> @_ZN9apolloniaplERKNS_4Vec2ES2_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %40, ptr %8, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %41 = load ptr, ptr %0, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %42 = call <2 x float> @_ZNK9apollonia4Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %42, ptr %11, align 8
  %43 = getelementptr inbounds i8, ptr %20, i64 8
  call void @_ZN9apollonia4Body12ApplyImpulseERKNS_4Vec2ES3_(ptr noundef nonnull align 8 dereferenceable(88) %41, ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %43)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %44 = load ptr, ptr %18, align 8, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %20, i64 16
  call void @_ZN9apollonia4Body12ApplyImpulseERKNS_4Vec2ES3_(ptr noundef nonnull align 8 dereferenceable(88) %44, ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %45)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %46

46:                                               ; preds = %26, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN9apollonia7ContactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %48, label %19, label %._crit_edge
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKN9apollonia7ContactESt6vectorIS3_SaIS3_EEEES3_ET_SA_SA_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #6

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #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 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 }

!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, !8, i64 52}
!6 = !{!"_ZTSN9apollonia7ContactE", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !12, i64 32, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68}
!7 = !{!"_ZTSN9apollonia4Vec2E", !8, i64 0, !8, i64 4}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt5arrayIbLm2EE", !9, i64 0}
!12 = !{!"_ZTSSt5arrayImLm2EE", !9, i64 0}
!13 = !{!6, !8, i64 56}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTSN9apollonia7ArbiterE", !16, i64 0, !16, i64 8, !7, i64 16, !17, i64 24}
!16 = !{!"any pointer", !9, i64 0}
!17 = !{!"_ZTSSt6vectorIN9apollonia7ContactESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN9apollonia7ContactESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN9apollonia7ContactESaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN9apollonia7ContactESaIS1_EE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!21 = !{!15, !16, i64 8}


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