; LLVM IR from Simple-XX/SimplePhysicsEngine :: test/system_test/demo_old/RigidBodySimulation/cpair.ll (ZN4clib5cpair14update_impulseEv)

; 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.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.clib::vec2" = type { double, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.clib::cpair" = type { %"class.std::weak_ptr", %"class.std::weak_ptr", %"struct.clib::vec2", %"class.std::vector.2" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.std::vector.2" = type { %"struct.std::_Vector_base.3" }
%"struct.std::_Vector_base.3" = type { %"struct.std::_Vector_base<clib::ccontact, std::allocator<clib::ccontact>>::_Vector_impl" }
%"struct.std::_Vector_base<clib::ccontact, std::allocator<clib::ccontact>>::_Vector_impl" = type { %"struct.std::_Vector_base<clib::ccontact, std::allocator<clib::ccontact>>::_Vector_impl_data" }
%"struct.std::_Vector_base<clib::ccontact, std::allocator<clib::ccontact>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.clib::ccontact" = type { %"struct.clib::vec2", %"struct.clib::vec2", %"struct.clib::vec2", %"struct.std::array", %"struct.std::array.0", double, double, double, double, double, double }
%"struct.std::array" = type { [2 x i8] }
%"struct.std::array.0" = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

declare { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt8weak_ptrIN4clib5cbodyEE4lockEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

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

declare noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare { double, double } @_ZN4clibmlEdRKNS_4vec2E(double noundef, ptr noundef nonnull align 8 dereferenceable(16)) #1

declare { double, double } @_ZN4clib5crossEdRKNS_4vec2E(double noundef, ptr noundef nonnull align 8 dereferenceable(16)) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4clib5cpair14update_impulseEv(ptr noundef nonnull align 8 dereferenceable(72) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.clib::vec2", align 8
  %4 = alloca %"class.std::shared_ptr", align 8
  %5 = alloca %"class.std::shared_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 %"struct.clib::vec2", align 8
  %11 = alloca %"struct.clib::vec2", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.clib::vec2", align 8
  %15 = alloca %"struct.clib::vec2", align 8
  %16 = alloca %"struct.clib::vec2", align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca %"struct.clib::vec2", align 8
  %28 = alloca %"struct.clib::vec2", align 8
  %29 = alloca %"struct.clib::vec2", align 8
  %30 = alloca %"struct.clib::vec2", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %31 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #6
  %32 = getelementptr inbounds %"class.clib::cpair", ptr %31, i32 0, i32 2
  %33 = call { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16) %32)
  %34 = getelementptr inbounds { double, double }, ptr %3, i32 0, i32 0
  %35 = extractvalue { double, double } %33, 0
  store double %35, ptr %34, align 8
  %36 = getelementptr inbounds { double, double }, ptr %3, i32 0, i32 1
  %37 = extractvalue { double, double } %33, 1
  store double %37, ptr %36, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  %38 = getelementptr inbounds %"class.clib::cpair", ptr %31, i32 0, i32 0
  call void @_ZNKSt8weak_ptrIN4clib5cbodyEE4lockEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %38) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %39 = getelementptr inbounds %"class.clib::cpair", ptr %31, i32 0, i32 1
  call void @_ZNKSt8weak_ptrIN4clib5cbodyEE4lockEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %39) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %40 = getelementptr inbounds %"class.clib::cpair", ptr %31, i32 0, i32 3
  store ptr %40, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = call ptr @_ZNSt6vectorIN4clib8ccontactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = call ptr @_ZNSt6vectorIN4clib8ccontactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #6
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  br label %47

47:                                               ; preds = %209, %1
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN4clib8ccontactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %51 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN4clib8ccontactESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  store ptr %51, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %52 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %53 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4clib5cbody12get_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %52)
          to label %54 unwind label %211

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %55 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %56 = invoke noundef double @_ZNK4clib5cbody20get_angular_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %55)
          to label %57 unwind label %215

57:                                               ; preds = %54
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.clib::ccontact", ptr %58, i32 0, i32 2
  %60 = invoke { double, double } @_ZN4clib5crossEdRKNS_4vec2E(double noundef %56, ptr noundef nonnull align 8 dereferenceable(16) %59)
          to label %61 unwind label %215

61:                                               ; preds = %57
  %62 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %63 = extractvalue { double, double } %60, 0
  store double %63, ptr %62, align 8
  %64 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %65 = extractvalue { double, double } %60, 1
  store double %65, ptr %64, align 8
  %66 = invoke { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %67 unwind label %215

67:                                               ; preds = %61
  %68 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %69 = extractvalue { double, double } %66, 0
  store double %69, ptr %68, align 8
  %70 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %71 = extractvalue { double, double } %66, 1
  store double %71, ptr %70, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %72 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %73 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4clib5cbody12get_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %72)
          to label %74 unwind label %219

74:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %75 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %76 = invoke noundef double @_ZNK4clib5cbody20get_angular_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %75)
          to label %77 unwind label %223

77:                                               ; preds = %74
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.clib::ccontact", ptr %78, i32 0, i32 1
  %80 = invoke { double, double } @_ZN4clib5crossEdRKNS_4vec2E(double noundef %76, ptr noundef nonnull align 8 dereferenceable(16) %79)
          to label %81 unwind label %223

81:                                               ; preds = %77
  %82 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %83 = extractvalue { double, double } %80, 0
  store double %83, ptr %82, align 8
  %84 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %85 = extractvalue { double, double } %80, 1
  store double %85, ptr %84, align 8
  %86 = invoke { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %87 unwind label %223

87:                                               ; preds = %81
  %88 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %89 = extractvalue { double, double } %86, 0
  store double %89, ptr %88, align 8
  %90 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %91 = extractvalue { double, double } %86, 1
  store double %91, ptr %90, align 8
  %92 = invoke { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %93 unwind label %223

93:                                               ; preds = %87
  %94 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %95 = extractvalue { double, double } %92, 0
  store double %95, ptr %94, align 8
  %96 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %97 = extractvalue { double, double } %92, 1
  store double %97, ptr %96, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %98 = getelementptr inbounds %"class.clib::cpair", ptr %31, i32 0, i32 2
  %99 = invoke noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %98)
          to label %100 unwind label %230

100:                                              ; preds = %93
  store double %99, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %101 = load double, ptr %17, align 8, !tbaa !9
  %102 = fneg double %101
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.clib::ccontact", ptr %103, i32 0, i32 8
  %105 = load double, ptr %104, align 8, !tbaa !11
  %106 = fadd double %102, %105
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.clib::ccontact", ptr %107, i32 0, i32 9
  %109 = load double, ptr %108, align 8, !tbaa !16
  %110 = fmul double %106, %109
  store double %110, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.clib::ccontact", ptr %111, i32 0, i32 6
  %113 = load double, ptr %112, align 8, !tbaa !17
  %114 = load double, ptr %18, align 8, !tbaa !9
  %115 = fadd double %113, %114
  store double %115, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store double 0.000000e+00, ptr %20, align 8, !tbaa !9
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %117 unwind label %234

117:                                              ; preds = %100
  %118 = load double, ptr %116, align 8, !tbaa !9
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.clib::ccontact", ptr %119, i32 0, i32 6
  %121 = load double, ptr %120, align 8, !tbaa !17
  %122 = fsub double %118, %121
  store double %122, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %123 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %124 = invoke noundef double @_ZNK4clib5cbody12get_frictionEv(ptr noundef nonnull align 8 dereferenceable(168) %123)
          to label %125 unwind label %238

125:                                              ; preds = %117
  %126 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %127 = invoke noundef double @_ZNK4clib5cbody12get_frictionEv(ptr noundef nonnull align 8 dereferenceable(168) %126)
          to label %128 unwind label %238

128:                                              ; preds = %125
  %129 = fmul double %124, %127
  %130 = call double @sqrt(double noundef %129) #6
  store double %130, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %131 = invoke noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %132 unwind label %242

132:                                              ; preds = %128
  store double %131, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %133 = load double, ptr %22, align 8, !tbaa !9
  %134 = fneg double %133
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.clib::ccontact", ptr %135, i32 0, i32 10
  %137 = load double, ptr %136, align 8, !tbaa !18
  %138 = fmul double %134, %137
  store double %138, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %139 = load double, ptr %21, align 8, !tbaa !9
  %140 = fneg double %139
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.clib::ccontact", ptr %141, i32 0, i32 6
  %143 = load double, ptr %142, align 8, !tbaa !17
  %144 = fmul double %140, %143
  store double %144, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %145 = load double, ptr %21, align 8, !tbaa !9
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.clib::ccontact", ptr %146, i32 0, i32 6
  %148 = load double, ptr %147, align 8, !tbaa !17
  %149 = fmul double %145, %148
  store double %149, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.clib::ccontact", ptr %150, i32 0, i32 7
  %152 = load double, ptr %151, align 8, !tbaa !19
  %153 = load double, ptr %23, align 8, !tbaa !9
  %154 = fadd double %152, %153
  store double %154, ptr %26, align 8, !tbaa !9
  %155 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %156 unwind label %246

156:                                              ; preds = %132
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %155)
          to label %158 unwind label %246

158:                                              ; preds = %156
  %159 = load double, ptr %157, align 8, !tbaa !9
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.clib::ccontact", ptr %160, i32 0, i32 7
  %162 = load double, ptr %161, align 8, !tbaa !19
  %163 = fsub double %159, %162
  store double %163, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  %164 = load double, ptr %18, align 8, !tbaa !9
  %165 = getelementptr inbounds %"class.clib::cpair", ptr %31, i32 0, i32 2
  %166 = invoke { double, double } @_ZN4clibmlEdRKNS_4vec2E(double noundef %164, ptr noundef nonnull align 8 dereferenceable(16) %165)
          to label %167 unwind label %250

167:                                              ; preds = %158
  %168 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %169 = extractvalue { double, double } %166, 0
  store double %169, ptr %168, align 8
  %170 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %171 = extractvalue { double, double } %166, 1
  store double %171, ptr %170, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  %172 = load double, ptr %23, align 8, !tbaa !9
  %173 = invoke { double, double } @_ZN4clibmlEdRKNS_4vec2E(double noundef %172, ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %174 unwind label %254

174:                                              ; preds = %167
  %175 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %176 = extractvalue { double, double } %173, 0
  store double %176, ptr %175, align 8
  %177 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %178 = extractvalue { double, double } %173, 1
  store double %178, ptr %177, align 8
  %179 = invoke { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %29)
          to label %180 unwind label %254

180:                                              ; preds = %174
  %181 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %182 = extractvalue { double, double } %179, 0
  store double %182, ptr %181, align 8
  %183 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %184 = extractvalue { double, double } %179, 1
  store double %184, ptr %183, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  %185 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #6
  %186 = invoke { double, double } @_ZNK4clib4vec2ngEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
          to label %187 unwind label %259

187:                                              ; preds = %180
  %188 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %189 = extractvalue { double, double } %186, 0
  store double %189, ptr %188, align 8
  %190 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %191 = extractvalue { double, double } %186, 1
  store double %191, ptr %190, align 8
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  %193 = getelementptr inbounds %"struct.clib::ccontact", ptr %192, i32 0, i32 1
  invoke void @_ZN4clib5cbody14update_impulseERKNS_4vec2ES3_(ptr noundef nonnull align 8 dereferenceable(168) %185, ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(16) %193)
          to label %194 unwind label %259

194:                                              ; preds = %187
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  %195 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.clib::ccontact", ptr %196, i32 0, i32 2
  invoke void @_ZN4clib5cbody14update_impulseERKNS_4vec2ES3_(ptr noundef nonnull align 8 dereferenceable(168) %195, ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %197)
          to label %198 unwind label %263

198:                                              ; preds = %194
  %199 = load double, ptr %18, align 8, !tbaa !9
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %"struct.clib::ccontact", ptr %200, i32 0, i32 6
  %202 = load double, ptr %201, align 8, !tbaa !17
  %203 = fadd double %202, %199
  store double %203, ptr %201, align 8, !tbaa !17
  %204 = load double, ptr %23, align 8, !tbaa !9
  %205 = load ptr, ptr %9, align 8, !tbaa !5
  %206 = getelementptr inbounds %"struct.clib::ccontact", ptr %205, i32 0, i32 7
  %207 = load double, ptr %206, align 8, !tbaa !19
  %208 = fadd double %207, %204
  store double %208, ptr %206, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %209

209:                                              ; preds = %198
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN4clib8ccontactESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br label %47

211:                                              ; preds = %50
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %12, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %13, align 4
  br label %229

215:                                              ; preds = %61, %57, %54
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %12, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %13, align 4
  br label %228

219:                                              ; preds = %67
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %12, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %13, align 4
  br label %227

223:                                              ; preds = %87, %81, %77, %74
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %12, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %227

227:                                              ; preds = %223, %219
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %228

228:                                              ; preds = %227, %215
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %229

229:                                              ; preds = %228, %211
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  br label %273

230:                                              ; preds = %93
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %12, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %13, align 4
  br label %272

234:                                              ; preds = %100
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %12, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %271

238:                                              ; preds = %125, %117
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %12, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %13, align 4
  br label %270

242:                                              ; preds = %128
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %12, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %13, align 4
  br label %269

246:                                              ; preds = %156, %132
  %247 = landingpad { ptr, i32 }
          cleanup
  %248 = extractvalue { ptr, i32 } %247, 0
  store ptr %248, ptr %12, align 8
  %249 = extractvalue { ptr, i32 } %247, 1
  store i32 %249, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %268

250:                                              ; preds = %158
  %251 = landingpad { ptr, i32 }
          cleanup
  %252 = extractvalue { ptr, i32 } %251, 0
  store ptr %252, ptr %12, align 8
  %253 = extractvalue { ptr, i32 } %251, 1
  store i32 %253, ptr %13, align 4
  br label %258

254:                                              ; preds = %174, %167
  %255 = landingpad { ptr, i32 }
          cleanup
  %256 = extractvalue { ptr, i32 } %255, 0
  store ptr %256, ptr %12, align 8
  %257 = extractvalue { ptr, i32 } %255, 1
  store i32 %257, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  br label %258

258:                                              ; preds = %254, %250
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %267

259:                                              ; preds = %187, %180
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %12, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  br label %267

263:                                              ; preds = %194
  %264 = landingpad { ptr, i32 }
          cleanup
  %265 = extractvalue { ptr, i32 } %264, 0
  store ptr %265, ptr %12, align 8
  %266 = extractvalue { ptr, i32 } %264, 1
  store i32 %266, ptr %13, align 4
  br label %267

267:                                              ; preds = %263, %259, %258
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #6
  br label %268

268:                                              ; preds = %267, %246
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %269

269:                                              ; preds = %268, %242
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %270

270:                                              ; preds = %269, %238
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %271

271:                                              ; preds = %270, %234
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %272

272:                                              ; preds = %271, %230
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %273

273:                                              ; preds = %272, %229
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  br label %275

274:                                              ; preds = %49
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  ret void

275:                                              ; preds = %273
  %276 = load ptr, ptr %12, align 8
  %277 = load i32, ptr %13, align 4
  %278 = insertvalue { ptr, i32 } poison, ptr %276, 0
  %279 = insertvalue { ptr, i32 } %278, i32 %277, 1
  resume { ptr, i32 } %279
}

declare { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4clib5cbody12get_velocityEv(ptr noundef nonnull align 8 dereferenceable(168)) #1

declare noundef double @_ZNK4clib5cbody20get_angular_velocityEv(ptr noundef nonnull align 8 dereferenceable(168)) #1

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #5

declare noundef double @_ZNK4clib5cbody12get_frictionEv(ptr noundef nonnull align 8 dereferenceable(168)) #1

declare void @_ZN4clib5cbody14update_impulseERKNS_4vec2ES3_(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare { double, double } @_ZNK4clib4vec2ngEv(ptr noundef nonnull align 8 dereferenceable(16)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 96}
!12 = !{!"_ZTSN4clib8ccontactE", !13, i64 0, !13, i64 16, !13, i64 32, !14, i64 48, !15, i64 56, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112}
!13 = !{!"_ZTSN4clib4vec2E", !10, i64 0, !10, i64 8}
!14 = !{!"_ZTSSt5arrayIbLm2EE", !7, i64 0}
!15 = !{!"_ZTSSt5arrayImLm2EE", !7, i64 0}
!16 = !{!12, !10, i64 104}
!17 = !{!12, !10, i64 80}
!18 = !{!12, !10, i64 112}
!19 = !{!12, !10, i64 88}


; 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.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.clib::vec2" = type { double, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; 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

declare i32 @__gxx_personality_v0(...)

declare { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt8weak_ptrIN4clib5cbodyEE4lockEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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

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

declare noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare { double, double } @_ZN4clibmlEdRKNS_4vec2E(double noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare { double, double } @_ZN4clib5crossEdRKNS_4vec2E(double noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4clib5cpair14update_impulseEv(ptr noundef nonnull align 8 dereferenceable(72) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.clib::vec2", align 8
  %3 = alloca %"class.std::shared_ptr", align 8
  %4 = alloca %"class.std::shared_ptr", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"struct.clib::vec2", align 8
  %8 = alloca %"struct.clib::vec2", align 8
  %9 = alloca %"struct.clib::vec2", align 8
  %10 = alloca %"struct.clib::vec2", align 8
  %11 = alloca %"struct.clib::vec2", align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca %"struct.clib::vec2", align 8
  %18 = alloca %"struct.clib::vec2", align 8
  %19 = alloca %"struct.clib::vec2", align 8
  %20 = alloca %"struct.clib::vec2", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = tail call { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16) %21)
  %23 = extractvalue { double, double } %22, 0
  store double %23, ptr %2, align 8
  %24 = getelementptr inbounds i8, ptr %2, i64 8
  %25 = extractvalue { double, double } %22, 1
  store double %25, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  call void @_ZNKSt8weak_ptrIN4clib5cbodyEE4lockEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %3, ptr noundef nonnull align 8 dereferenceable(16) %0) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZNKSt8weak_ptrIN4clib5cbodyEE4lockEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %26) #6
  %27 = getelementptr inbounds i8, ptr %0, i64 48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %28 = call ptr @_ZNSt6vectorIN4clib8ccontactESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #6
  store ptr %28, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %29 = call ptr @_ZNSt6vectorIN4clib8ccontactESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #6
  store ptr %29, ptr %6, align 8
  %30 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN4clib8ccontactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %31 = getelementptr inbounds i8, ptr %9, i64 8
  %32 = getelementptr inbounds i8, ptr %8, i64 8
  %33 = getelementptr inbounds i8, ptr %11, i64 8
  %34 = getelementptr inbounds i8, ptr %10, i64 8
  %35 = getelementptr inbounds i8, ptr %7, i64 8
  %36 = getelementptr inbounds i8, ptr %18, i64 8
  %37 = getelementptr inbounds i8, ptr %19, i64 8
  %38 = getelementptr inbounds i8, ptr %17, i64 8
  %39 = getelementptr inbounds i8, ptr %20, i64 8
  br label %40

._crit_edge:                                      ; preds = %135, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  ret void

40:                                               ; preds = %.lr.ph, %135
  %41 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN4clib8ccontactESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %42 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %43 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4clib5cbody12get_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %42)
          to label %44 unwind label %142

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %45 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %46 = invoke noundef double @_ZNK4clib5cbody20get_angular_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %45)
          to label %47 unwind label %144

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %41, i64 32
  %49 = invoke { double, double } @_ZN4clib5crossEdRKNS_4vec2E(double noundef %46, ptr noundef nonnull align 8 dereferenceable(16) %48)
          to label %50 unwind label %144

50:                                               ; preds = %47
  %51 = extractvalue { double, double } %49, 0
  store double %51, ptr %9, align 8
  %52 = extractvalue { double, double } %49, 1
  store double %52, ptr %31, align 8
  %53 = invoke { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %54 unwind label %144

54:                                               ; preds = %50
  %55 = extractvalue { double, double } %53, 0
  store double %55, ptr %8, align 8
  %56 = extractvalue { double, double } %53, 1
  store double %56, ptr %32, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  %57 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %58 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4clib5cbody12get_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %57)
          to label %59 unwind label %146

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  %60 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %61 = invoke noundef double @_ZNK4clib5cbody20get_angular_velocityEv(ptr noundef nonnull align 8 dereferenceable(168) %60)
          to label %62 unwind label %148

62:                                               ; preds = %59
  %63 = getelementptr inbounds i8, ptr %41, i64 16
  %64 = invoke { double, double } @_ZN4clib5crossEdRKNS_4vec2E(double noundef %61, ptr noundef nonnull align 8 dereferenceable(16) %63)
          to label %65 unwind label %148

65:                                               ; preds = %62
  %66 = extractvalue { double, double } %64, 0
  store double %66, ptr %11, align 8
  %67 = extractvalue { double, double } %64, 1
  store double %67, ptr %33, align 8
  %68 = invoke { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %58, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %69 unwind label %148

69:                                               ; preds = %65
  %70 = extractvalue { double, double } %68, 0
  store double %70, ptr %10, align 8
  %71 = extractvalue { double, double } %68, 1
  store double %71, ptr %34, align 8
  %72 = invoke { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %73 unwind label %148

73:                                               ; preds = %69
  %74 = extractvalue { double, double } %72, 0
  store double %74, ptr %7, align 8
  %75 = extractvalue { double, double } %72, 1
  store double %75, ptr %35, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  %76 = invoke noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %77 unwind label %153

77:                                               ; preds = %73
  %78 = getelementptr inbounds i8, ptr %41, i64 96
  %79 = load double, ptr %78, align 8, !tbaa !5
  %80 = fsub double %79, %76
  %81 = getelementptr inbounds i8, ptr %41, i64 104
  %82 = load double, ptr %81, align 8, !tbaa !13
  %83 = fmul double %80, %82
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %84 = getelementptr inbounds i8, ptr %41, i64 80
  %85 = load double, ptr %84, align 8, !tbaa !14
  %86 = fadd double %83, %85
  store double %86, ptr %12, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  store double 0.000000e+00, ptr %13, align 8, !tbaa !15
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %88 = load double, ptr %87, align 8, !tbaa !15
  %89 = load double, ptr %84, align 8, !tbaa !14
  %90 = fsub double %88, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %91 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %92 = invoke noundef double @_ZNK4clib5cbody12get_frictionEv(ptr noundef nonnull align 8 dereferenceable(168) %91)
          to label %93 unwind label %155

93:                                               ; preds = %77
  %94 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %95 = invoke noundef double @_ZNK4clib5cbody12get_frictionEv(ptr noundef nonnull align 8 dereferenceable(168) %94)
          to label %96 unwind label %155

96:                                               ; preds = %93
  %97 = fmul double %92, %95
  %98 = call double @sqrt(double noundef %97) #6
  %99 = invoke noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %100 unwind label %157

100:                                              ; preds = %96
  %101 = getelementptr inbounds i8, ptr %41, i64 112
  %102 = load double, ptr %101, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %103 = fneg double %98
  %104 = load double, ptr %84, align 8, !tbaa !14
  %105 = fmul double %104, %103
  store double %105, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %106 = fmul double %98, %104
  store double %106, ptr %15, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %107 = getelementptr inbounds i8, ptr %41, i64 88
  %108 = load double, ptr %107, align 8, !tbaa !17
  %109 = fmul double %99, %102
  %110 = fsub double %108, %109
  store double %110, ptr %16, align 8, !tbaa !15
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %111)
  %113 = load double, ptr %112, align 8, !tbaa !15
  %114 = load double, ptr %107, align 8, !tbaa !17
  %115 = fsub double %113, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #6
  %116 = invoke { double, double } @_ZN4clibmlEdRKNS_4vec2E(double noundef %90, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %117 unwind label %159

117:                                              ; preds = %100
  %118 = extractvalue { double, double } %116, 0
  store double %118, ptr %18, align 8
  %119 = extractvalue { double, double } %116, 1
  store double %119, ptr %36, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #6
  %120 = invoke { double, double } @_ZN4clibmlEdRKNS_4vec2E(double noundef %115, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %121 unwind label %161

121:                                              ; preds = %117
  %122 = extractvalue { double, double } %120, 0
  store double %122, ptr %19, align 8
  %123 = extractvalue { double, double } %120, 1
  store double %123, ptr %37, align 8
  %124 = invoke { double, double } @_ZN4clibplERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %125 unwind label %161

125:                                              ; preds = %121
  %126 = extractvalue { double, double } %124, 0
  store double %126, ptr %17, align 8
  %127 = extractvalue { double, double } %124, 1
  store double %127, ptr %38, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #6
  %128 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #6
  %129 = invoke { double, double } @_ZNK4clib4vec2ngEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %130 unwind label %164

130:                                              ; preds = %125
  %131 = extractvalue { double, double } %129, 0
  store double %131, ptr %20, align 8
  %132 = extractvalue { double, double } %129, 1
  store double %132, ptr %39, align 8
  invoke void @_ZN4clib5cbody14update_impulseERKNS_4vec2ES3_(ptr noundef nonnull align 8 dereferenceable(168) %128, ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %63)
          to label %133 unwind label %164

133:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  %134 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZN4clib5cbody14update_impulseERKNS_4vec2ES3_(ptr noundef nonnull align 8 dereferenceable(168) %134, ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %48)
          to label %135 unwind label %166

135:                                              ; preds = %133
  %136 = load <2 x double>, ptr %84, align 8, !tbaa !15
  %137 = insertelement <2 x double> poison, double %90, i64 0
  %138 = insertelement <2 x double> %137, double %115, i64 1
  %139 = fadd <2 x double> %138, %136
  store <2 x double> %139, ptr %84, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN4clib8ccontactESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %141 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN4clib8ccontactESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %141, label %40, label %._crit_edge

142:                                              ; preds = %40
  %143 = landingpad { ptr, i32 }
          cleanup
  br label %152

144:                                              ; preds = %50, %47, %44
  %145 = landingpad { ptr, i32 }
          cleanup
  br label %151

146:                                              ; preds = %54
  %147 = landingpad { ptr, i32 }
          cleanup
  br label %150

148:                                              ; preds = %69, %65, %62, %59
  %149 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %150

150:                                              ; preds = %148, %146
  %.pn = phi { ptr, i32 } [ %149, %148 ], [ %147, %146 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %151

151:                                              ; preds = %150, %144
  %.pn.pn = phi { ptr, i32 } [ %.pn, %150 ], [ %145, %144 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %152

152:                                              ; preds = %151, %142
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %151 ], [ %143, %142 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %169

153:                                              ; preds = %73
  %154 = landingpad { ptr, i32 }
          cleanup
  br label %169

155:                                              ; preds = %93, %77
  %156 = landingpad { ptr, i32 }
          cleanup
  br label %169

157:                                              ; preds = %96
  %158 = landingpad { ptr, i32 }
          cleanup
  br label %169

159:                                              ; preds = %100
  %160 = landingpad { ptr, i32 }
          cleanup
  br label %163

161:                                              ; preds = %121, %117
  %162 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  br label %163

163:                                              ; preds = %161, %159
  %.pn41 = phi { ptr, i32 } [ %162, %161 ], [ %160, %159 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #6
  br label %168

164:                                              ; preds = %130, %125
  %165 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  br label %168

166:                                              ; preds = %133
  %167 = landingpad { ptr, i32 }
          cleanup
  br label %168

168:                                              ; preds = %166, %164, %163
  %.pn43 = phi { ptr, i32 } [ %167, %166 ], [ %165, %164 ], [ %.pn41, %163 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #6
  br label %169

169:                                              ; preds = %153, %157, %168, %155, %152
  %.pn43.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %152 ], [ %154, %153 ], [ %156, %155 ], [ %.pn43, %168 ], [ %158, %157 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @_ZNSt12__shared_ptrIN4clib5cbodyELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn43.pn.pn.pn.pn
}

declare { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4clib5cbody12get_velocityEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1

declare noundef double @_ZNK4clib5cbody20get_angular_velocityEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5

declare noundef double @_ZNK4clib5cbody12get_frictionEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1

declare void @_ZN4clib5cbody14update_impulseERKNS_4vec2ES3_(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare { double, double } @_ZNK4clib4vec2ngEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 96}
!6 = !{!"_ZTSN4clib8ccontactE", !7, i64 0, !7, i64 16, !7, i64 32, !11, i64 48, !12, i64 56, !8, i64 72, !8, i64 80, !8, i64 88, !8, i64 96, !8, i64 104, !8, i64 112}
!7 = !{!"_ZTSN4clib4vec2E", !8, i64 0, !8, i64 8}
!8 = !{!"double", !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 104}
!14 = !{!6, !8, i64 80}
!15 = !{!8, !8, i64 0}
!16 = !{!6, !8, i64 112}
!17 = !{!6, !8, i64 88}


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