; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics/qbody.ll (ZN5QBody10UpdateAABBEv)

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

%struct.QVector = type { float, float }
%class.QBody = type <{ ptr, float, float, ptr, %struct.QVector, %struct.QVector, float, float, %class.QAABB, i32, i8, i8, i8, i8, float, i32, i8, [3 x i8], float, i8, i8, [2 x i8], %struct.QVector, float, float, float, float, float, i32, i32, i8, i8, i8, i8, i32, i32, i32, i8, [3 x i8], %"class.std::function", %"class.std::function", %"class.std::function.0", i8, [7 x i8], %"class.std::vector", i32, i8, [3 x i8] }>
%class.QAABB = type { %struct.QVector, %struct.QVector, %struct.QVector, float }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::function.0" = type { %"class.std::_Function_base", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl" }
%"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.QMesh = type { %"class.std::vector.2", %struct.QVector, %struct.QVector, float, float, %"class.std::vector.7", %"class.std::vector.12", %"class.std::vector.2", %"class.std::vector.17", %"class.std::vector.22", float, ptr, i32, %"class.std::vector.27", i8, i8, %"class.std::vector.32", float, i8, i8, i8, i8 }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_Vector_impl" }
%"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl" }
%"struct.std::_Vector_base<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.2" = type { %"struct.std::_Vector_base.3" }
%"struct.std::_Vector_base.3" = type { %"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_Vector_impl" }
%"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = type { %"struct.std::_Vector_base<QVector, std::allocator<QVector>>::_Vector_impl" }
%"struct.std::_Vector_base<QVector, std::allocator<QVector>>::_Vector_impl" = type { %"struct.std::_Vector_base<QVector, std::allocator<QVector>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QVector, std::allocator<QVector>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.27" = type { %"struct.std::_Vector_base.28" }
%"struct.std::_Vector_base.28" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN6QWorld14MAX_WORLD_SIZEE = external dso_local global float, align 4

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5QBody10UpdateAABBEv(ptr noundef nonnull align 8 dereferenceable(293) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca %struct.QVector, align 4
  %15 = alloca float, align 4
  %16 = alloca %struct.QVector, align 4
  %17 = alloca float, align 4
  %18 = alloca %struct.QVector, align 4
  %19 = alloca float, align 4
  %20 = alloca %struct.QVector, align 4
  %21 = alloca %struct.QVector, align 4
  %22 = alloca %struct.QVector, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %23 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %24 = load float, ptr @_ZN6QWorld14MAX_WORLD_SIZEE, align 4, !tbaa !9
  store float %24, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %25 = load float, ptr @_ZN6QWorld14MAX_WORLD_SIZEE, align 4, !tbaa !9
  store float %25, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %26 = load float, ptr @_ZN6QWorld14MAX_WORLD_SIZEE, align 4, !tbaa !9
  %27 = fneg float %26
  store float %27, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %28 = load float, ptr @_ZN6QWorld14MAX_WORLD_SIZEE, align 4, !tbaa !9
  %29 = fneg float %28
  store float %29, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %30

30:                                               ; preds = %119, %1
  %31 = load i32, ptr %7, align 4, !tbaa !11
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %class.QBody, ptr %23, i32 0, i32 44
  %34 = call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #4
  %35 = icmp ult i64 %32, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %30
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %122

37:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %38 = getelementptr inbounds %class.QBody, ptr %23, i32 0, i32 44
  %39 = load i32, ptr %7, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %40) #4
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  store ptr %42, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %115, %37
  %44 = load i32, ptr %10, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.QMesh, ptr %46, i32 0, i32 0
  %48 = call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #4
  %49 = icmp ult i64 %45, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.QMesh, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %10, align 4, !tbaa !11
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %55) #4
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  store ptr %57, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = call noundef float @_ZN9QParticle9GetRadiusEv(ptr noundef nonnull align 8 dereferenceable(290) %58)
  %60 = fcmp ogt float %59, 5.000000e-01
  br i1 %60, label %61, label %64

61:                                               ; preds = %51
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = call noundef float @_ZN9QParticle9GetRadiusEv(ptr noundef nonnull align 8 dereferenceable(290) %62)
  br label %65

64:                                               ; preds = %51
  br label %65

65:                                               ; preds = %64, %61
  %66 = phi float [ %63, %61 ], [ 0.000000e+00, %64 ]
  store float %66, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %67)
  store <2 x float> %68, ptr %14, align 4
  %69 = getelementptr inbounds %struct.QVector, ptr %14, i32 0, i32 0
  %70 = load float, ptr %69, align 4, !tbaa !13
  %71 = load float, ptr %12, align 4, !tbaa !9
  %72 = fsub float %70, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  store float %72, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %73)
  store <2 x float> %74, ptr %16, align 4
  %75 = getelementptr inbounds %struct.QVector, ptr %16, i32 0, i32 1
  %76 = load float, ptr %75, align 4, !tbaa !15
  %77 = load float, ptr %12, align 4, !tbaa !9
  %78 = fsub float %76, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  store float %78, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %79)
  store <2 x float> %80, ptr %18, align 4
  %81 = getelementptr inbounds %struct.QVector, ptr %18, i32 0, i32 0
  %82 = load float, ptr %81, align 4, !tbaa !13
  %83 = load float, ptr %12, align 4, !tbaa !9
  %84 = fadd float %82, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  store float %84, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %85)
  store <2 x float> %86, ptr %20, align 4
  %87 = getelementptr inbounds %struct.QVector, ptr %20, i32 0, i32 1
  %88 = load float, ptr %87, align 4, !tbaa !15
  %89 = load float, ptr %12, align 4, !tbaa !9
  %90 = fadd float %88, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  store float %90, ptr %19, align 4, !tbaa !9
  %91 = load float, ptr %13, align 4, !tbaa !9
  %92 = load float, ptr %3, align 4, !tbaa !9
  %93 = fcmp olt float %91, %92
  br i1 %93, label %94, label %96

94:                                               ; preds = %65
  %95 = load float, ptr %13, align 4, !tbaa !9
  store float %95, ptr %3, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %94, %65
  %97 = load float, ptr %15, align 4, !tbaa !9
  %98 = load float, ptr %4, align 4, !tbaa !9
  %99 = fcmp olt float %97, %98
  br i1 %99, label %100, label %102

100:                                              ; preds = %96
  %101 = load float, ptr %15, align 4, !tbaa !9
  store float %101, ptr %4, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %100, %96
  %103 = load float, ptr %17, align 4, !tbaa !9
  %104 = load float, ptr %5, align 4, !tbaa !9
  %105 = fcmp ogt float %103, %104
  br i1 %105, label %106, label %108

106:                                              ; preds = %102
  %107 = load float, ptr %17, align 4, !tbaa !9
  store float %107, ptr %5, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %106, %102
  %109 = load float, ptr %19, align 4, !tbaa !9
  %110 = load float, ptr %6, align 4, !tbaa !9
  %111 = fcmp ogt float %109, %110
  br i1 %111, label %112, label %114

112:                                              ; preds = %108
  %113 = load float, ptr %19, align 4, !tbaa !9
  store float %113, ptr %6, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %112, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %10, align 4, !tbaa !11
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %10, align 4, !tbaa !11
  br label %43, !llvm.loop !16

118:                                              ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %7, align 4, !tbaa !11
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !11
  br label %30, !llvm.loop !18

122:                                              ; preds = %36
  %123 = getelementptr inbounds %class.QBody, ptr %23, i32 0, i32 8
  %124 = load float, ptr %3, align 4, !tbaa !9
  %125 = load float, ptr %4, align 4, !tbaa !9
  call void @_ZN7QVectorC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %21, float noundef %124, float noundef %125)
  %126 = load float, ptr %5, align 4, !tbaa !9
  %127 = load float, ptr %6, align 4, !tbaa !9
  call void @_ZN7QVectorC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %22, float noundef %126, float noundef %127)
  %128 = load <2 x float>, ptr %21, align 4
  %129 = load <2 x float>, ptr %22, align 4
  %130 = call noundef ptr @_ZN5QAABB9SetMinMaxE7QVectorS0_(ptr noundef nonnull align 4 dereferenceable(28) %123, <2 x float> %128, <2 x float> %129)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290)) #3 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nounwind 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS7QVector", !10, i64 0, !10, i64 4}
!15 = !{!14, !10, i64 4}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


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

%struct.QVector = type { float, float }

@_ZN6QWorld14MAX_WORLD_SIZEE = external dso_local local_unnamed_addr global float, align 4

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5QBody10UpdateAABBEv(ptr noundef nonnull align 8 dereferenceable(293) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %struct.QVector, align 8
  %3 = alloca %struct.QVector, align 8
  %4 = load float, ptr @_ZN6QWorld14MAX_WORLD_SIZEE, align 4, !tbaa !5
  %5 = fneg float %4
  %6 = getelementptr inbounds i8, ptr %0, i64 264
  %7 = tail call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %._crit_edge69, label %.lr.ph68

._crit_edge69:                                    ; preds = %._crit_edge, %1
  %.043.lcssa = phi float [ %5, %1 ], [ %.144.lcssa, %._crit_edge ]
  %.040.lcssa = phi float [ %5, %1 ], [ %.141.lcssa, %._crit_edge ]
  %.037.lcssa = phi float [ %4, %1 ], [ %.138.lcssa, %._crit_edge ]
  %.0.lcssa = phi float [ %4, %1 ], [ %.1.lcssa, %._crit_edge ]
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  call void @_ZN7QVectorC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef %.0.lcssa, float noundef %.037.lcssa)
  call void @_ZN7QVectorC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %3, float noundef %.040.lcssa, float noundef %.043.lcssa)
  %9 = load <2 x float>, ptr %2, align 8
  %10 = load <2 x float>, ptr %3, align 8
  %11 = call noundef ptr @_ZN5QAABB9SetMinMaxE7QVectorS0_(ptr noundef nonnull align 4 dereferenceable(28) %8, <2 x float> %9, <2 x float> %10)
  ret void

.lr.ph68:                                         ; preds = %1, %._crit_edge
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %._crit_edge ], [ 0, %1 ]
  %.066 = phi float [ %.1.lcssa, %._crit_edge ], [ %4, %1 ]
  %.03765 = phi float [ %.138.lcssa, %._crit_edge ], [ %4, %1 ]
  %.04064 = phi float [ %.141.lcssa, %._crit_edge ], [ %5, %1 ]
  %.04363 = phi float [ %.144.lcssa, %._crit_edge ], [ %5, %1 ]
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv76) #3
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = tail call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #3
  %.not74 = icmp eq i64 %14, 0
  br i1 %.not74, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %23, %.lr.ph68
  %.144.lcssa = phi float [ %.04363, %.lr.ph68 ], [ %.245, %23 ]
  %.141.lcssa = phi float [ %.04064, %.lr.ph68 ], [ %.242, %23 ]
  %.138.lcssa = phi float [ %.03765, %.lr.ph68 ], [ %.239, %23 ]
  %.1.lcssa = phi float [ %.066, %.lr.ph68 ], [ %.2, %23 ]
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %15 = tail call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  %16 = icmp ugt i64 %15, %indvars.iv.next77
  br i1 %16, label %.lr.ph68, label %._crit_edge69, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph68, %23
  %indvars.iv = phi i64 [ %indvars.iv.next, %23 ], [ 0, %.lr.ph68 ]
  %.158 = phi float [ %.2, %23 ], [ %.066, %.lr.ph68 ]
  %.13857 = phi float [ %.239, %23 ], [ %.03765, %.lr.ph68 ]
  %.14156 = phi float [ %.242, %23 ], [ %.04064, %.lr.ph68 ]
  %.14455 = phi float [ %.245, %23 ], [ %.04363, %.lr.ph68 ]
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv) #3
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = tail call noundef float @_ZN9QParticle9GetRadiusEv(ptr noundef nonnull align 8 dereferenceable(290) %18)
  %20 = fcmp ogt float %19, 5.000000e-01
  br i1 %20, label %21, label %23

21:                                               ; preds = %.lr.ph
  %22 = tail call noundef float @_ZN9QParticle9GetRadiusEv(ptr noundef nonnull align 8 dereferenceable(290) %18)
  br label %23

23:                                               ; preds = %.lr.ph, %21
  %24 = phi float [ %22, %21 ], [ 0.000000e+00, %.lr.ph ]
  %25 = tail call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %18)
  %.sroa.08.0.vec.extract = extractelement <2 x float> %25, i64 0
  %26 = fsub float %.sroa.08.0.vec.extract, %24
  %27 = tail call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %18)
  %.sroa.05.4.vec.extract = extractelement <2 x float> %27, i64 1
  %28 = fsub float %.sroa.05.4.vec.extract, %24
  %29 = tail call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %18)
  %.sroa.02.0.vec.extract = extractelement <2 x float> %29, i64 0
  %30 = fadd float %24, %.sroa.02.0.vec.extract
  %31 = tail call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %18)
  %.sroa.0.4.vec.extract = extractelement <2 x float> %31, i64 1
  %32 = fadd float %24, %.sroa.0.4.vec.extract
  %33 = fcmp olt float %26, %.158
  %.2 = select i1 %33, float %26, float %.158
  %34 = fcmp olt float %28, %.13857
  %.239 = select i1 %34, float %28, float %.13857
  %35 = fcmp ogt float %30, %.14156
  %.242 = select i1 %35, float %30, float %.14156
  %36 = fcmp ogt float %32, %.14455
  %.245 = select i1 %36, float %32, float %.14455
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = tail call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #3
  %38 = icmp ugt i64 %37, %indvars.iv.next
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !13
}

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

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

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

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

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

attributes #0 = { 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 #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"="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 #3 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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