; LLVM IR from unitreerobotics/kinect_teleoperate :: src/sample_helper_libs/window_controller_3d (Sphere)

; 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.Visualization::Sphere" = type <{ %"class.Visualization::RendererBase.base", float, i32, i32, %"class.std::vector", %"class.std::vector.0", i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>
%"class.Visualization::RendererBase.base" = type <{ ptr, i8, [3 x i8], [4 x [4 x float]], [4 x [4 x float]], [4 x i8], ptr, i32, i32, i32 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Visualization::MonoVertex, std::allocator<Visualization::MonoVertex>>::_Vector_impl" }
%"struct.std::_Vector_base<Visualization::MonoVertex, std::allocator<Visualization::MonoVertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<Visualization::MonoVertex, std::allocator<Visualization::MonoVertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Visualization::MonoVertex, std::allocator<Visualization::MonoVertex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Visualization::MonoVertex" = type { [3 x float], [3 x float] }
%"class.Visualization::RendererBase" = type <{ ptr, i8, [3 x i8], [4 x [4 x float]], [4 x [4 x float]], [4 x i8], ptr, i32, i32, i32, [4 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13Visualization6Sphere9SetRadiusEf(ptr noundef nonnull align 8 dereferenceable(252) %0, float noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %7 = load ptr, ptr %3, align 8
  %8 = load float, ptr %4, align 4, !tbaa !9
  %9 = fcmp ole float %8, 0.000000e+00
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %58

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %12 = load float, ptr %4, align 4, !tbaa !9
  %13 = getelementptr inbounds %"class.Visualization::Sphere", ptr %7, i32 0, i32 1
  %14 = load float, ptr %13, align 4, !tbaa !11
  %15 = fdiv float %12, %14
  store float %15, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store i64 0, ptr %6, align 8, !tbaa !24
  br label %16

16:                                               ; preds = %47, %11
  %17 = load i64, ptr %6, align 8, !tbaa !24
  %18 = getelementptr inbounds %"class.Visualization::Sphere", ptr %7, i32 0, i32 4
  %19 = call noundef i64 @_ZNKSt6vectorIN13Visualization10MonoVertexESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  %20 = icmp ult i64 %17, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %50

22:                                               ; preds = %16
  %23 = load float, ptr %5, align 4, !tbaa !9
  %24 = getelementptr inbounds %"class.Visualization::Sphere", ptr %7, i32 0, i32 4
  %25 = load i64, ptr %6, align 8, !tbaa !24
  %26 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt6vectorIN13Visualization10MonoVertexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %25) #3
  %27 = getelementptr inbounds %"struct.Visualization::MonoVertex", ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds [3 x float], ptr %27, i64 0, i64 0
  %29 = load float, ptr %28, align 4, !tbaa !9
  %30 = fmul float %29, %23
  store float %30, ptr %28, align 4, !tbaa !9
  %31 = load float, ptr %5, align 4, !tbaa !9
  %32 = getelementptr inbounds %"class.Visualization::Sphere", ptr %7, i32 0, i32 4
  %33 = load i64, ptr %6, align 8, !tbaa !24
  %34 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt6vectorIN13Visualization10MonoVertexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %33) #3
  %35 = getelementptr inbounds %"struct.Visualization::MonoVertex", ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds [3 x float], ptr %35, i64 0, i64 1
  %37 = load float, ptr %36, align 4, !tbaa !9
  %38 = fmul float %37, %31
  store float %38, ptr %36, align 4, !tbaa !9
  %39 = load float, ptr %5, align 4, !tbaa !9
  %40 = getelementptr inbounds %"class.Visualization::Sphere", ptr %7, i32 0, i32 4
  %41 = load i64, ptr %6, align 8, !tbaa !24
  %42 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt6vectorIN13Visualization10MonoVertexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %41) #3
  %43 = getelementptr inbounds %"struct.Visualization::MonoVertex", ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds [3 x float], ptr %43, i64 0, i64 2
  %45 = load float, ptr %44, align 4, !tbaa !9
  %46 = fmul float %45, %39
  store float %46, ptr %44, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %22
  %48 = load i64, ptr %6, align 8, !tbaa !24
  %49 = add i64 %48, 1
  store i64 %49, ptr %6, align 8, !tbaa !24
  br label %16, !llvm.loop !26

50:                                               ; preds = %21
  %51 = load float, ptr %4, align 4, !tbaa !9
  %52 = getelementptr inbounds %"class.Visualization::Sphere", ptr %7, i32 0, i32 1
  store float %51, ptr %52, align 4, !tbaa !11
  %53 = getelementptr inbounds %"class.Visualization::RendererBase", ptr %7, i32 0, i32 1
  %54 = load i8, ptr %53, align 8, !tbaa !28, !range !29, !noundef !30
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  call void @_ZN13Visualization6Sphere9UpdateVAOEv(ptr noundef nonnull align 8 dereferenceable(252) %7)
  br label %57

57:                                               ; preds = %56, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %58

58:                                               ; preds = %57, %10
  ret void
}

; 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 @_ZNKSt6vectorIN13Visualization10MonoVertexESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13Visualization6Sphere9UpdateVAOEv(ptr noundef nonnull align 8 dereferenceable(252)) #0 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !10, i64 164}
!12 = !{!"_ZTSN13Visualization6SphereE", !13, i64 0, !10, i64 164, !15, i64 168, !15, i64 172, !16, i64 176, !20, i64 200, !15, i64 224, !15, i64 228, !15, i64 232, !15, i64 236, !15, i64 240, !15, i64 244, !15, i64 248}
!13 = !{!"_ZTSN13Visualization12RendererBaseE", !14, i64 8, !7, i64 12, !7, i64 76, !6, i64 144, !15, i64 152, !15, i64 156, !15, i64 160}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIN13Visualization10MonoVertexESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN13Visualization10MonoVertexESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN13Visualization10MonoVertexESaIS1_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN13Visualization10MonoVertexESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSSt6vectorIjSaIjEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!25, !25, i64 0}
!25 = !{!"long", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!13, !14, i64 8}
!29 = !{i8 0, i8 2}
!30 = !{}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13Visualization6Sphere9SetRadiusEf(ptr noundef nonnull align 8 dereferenceable(252) %0, float noundef %1) local_unnamed_addr #0 align 2 {
  %3 = fcmp ugt float %1, 0.000000e+00
  br i1 %3, label %4, label %28

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 164
  %6 = load float, ptr %5, align 4, !tbaa !5
  %7 = fdiv float %1, %6
  %8 = getelementptr inbounds i8, ptr %0, i64 176
  %9 = tail call noundef i64 @_ZNKSt6vectorIN13Visualization10MonoVertexESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #2
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %4
  store float %1, ptr %5, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i8, ptr %10, align 8, !tbaa !22, !range !23, !noundef !24
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %27, label %28

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.012 = phi i64 [ %24, %.lr.ph ], [ 0, %4 ]
  %13 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt6vectorIN13Visualization10MonoVertexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %.012) #2
  %14 = load float, ptr %13, align 4, !tbaa !25
  %15 = fmul float %7, %14
  store float %15, ptr %13, align 4, !tbaa !25
  %16 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt6vectorIN13Visualization10MonoVertexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %.012) #2
  %17 = getelementptr inbounds i8, ptr %16, i64 4
  %18 = load float, ptr %17, align 4, !tbaa !25
  %19 = fmul float %7, %18
  store float %19, ptr %17, align 4, !tbaa !25
  %20 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt6vectorIN13Visualization10MonoVertexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %.012) #2
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = load float, ptr %21, align 4, !tbaa !25
  %23 = fmul float %7, %22
  store float %23, ptr %21, align 4, !tbaa !25
  %24 = add nuw i64 %.012, 1
  %25 = tail call noundef i64 @_ZNKSt6vectorIN13Visualization10MonoVertexESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #2
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !26

27:                                               ; preds = %._crit_edge
  tail call void @_ZN13Visualization6Sphere9UpdateVAOEv(ptr noundef nonnull align 8 dereferenceable(252) %0)
  br label %28

28:                                               ; preds = %._crit_edge, %27, %2
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13Visualization6Sphere9UpdateVAOEv(ptr noundef nonnull align 8 dereferenceable(252)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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, !13, i64 164}
!6 = !{!"_ZTSN13Visualization6SphereE", !7, i64 0, !13, i64 164, !12, i64 168, !12, i64 172, !14, i64 176, !18, i64 200, !12, i64 224, !12, i64 228, !12, i64 232, !12, i64 236, !12, i64 240, !12, i64 244, !12, i64 248}
!7 = !{!"_ZTSN13Visualization12RendererBaseE", !8, i64 8, !9, i64 12, !9, i64 76, !11, i64 144, !12, i64 152, !12, i64 156, !12, i64 160}
!8 = !{!"bool", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"float", !9, i64 0}
!14 = !{!"_ZTSSt6vectorIN13Visualization10MonoVertexESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIN13Visualization10MonoVertexESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN13Visualization10MonoVertexESaIS1_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN13Visualization10MonoVertexESaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!18 = !{!"_ZTSSt6vectorIjSaIjEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!22 = !{!7, !8, i64 8}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!13, !13, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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