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

; 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::lock_guard" = type { ptr }
%"class.Visualization::WindowController3d" = type { i8, i32, i32, i8, %class.ViewControl, %class.ViewControl, %class.ViewControl, %class.ViewControl, %"struct.std::array", %"class.Visualization::PointCloudRenderer", %"class.Visualization::SkeletonRenderer", %"class.Visualization::FloorRenderer", double, float, i32, i32, i32, i32, float, float, ptr, i8, i8, i32, [2 x float], ptr, ptr, ptr, ptr, %"class.std::mutex" }
%class.ViewControl = type { %struct.ViewParameters, %struct.Viewport, i8, float, float, float }
%struct.ViewParameters = type { [3 x float], float, [3 x float], float, float, [3 x float], [3 x float], [3 x float] }
%struct.Viewport = type { i32, i32, i32, i32 }
%"struct.std::array" = type { [4 x ptr] }
%"class.Visualization::PointCloudRenderer" = type { %"class.Visualization::RendererBase.base", float, %"class.std::optional", i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %"class.std::mutex" }
%"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::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [3 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<float>::_Storage", i8 }>
%"union.std::_Optional_payload_base<float>::_Storage" = type { float }
%"class.Visualization::SkeletonRenderer" = type { %"class.Visualization::RendererBase.base", i8, i8, float, float, float, float, %"class.Visualization::Sphere", %"class.Visualization::Cylinder", %"class.Visualization::CoordinateAxes", %"class.std::vector.10", %"class.std::vector.15" }
%"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.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 }
%"class.Visualization::Cylinder" = type <{ %"class.Visualization::RendererBase.base", float, float, i32, %"class.std::vector", %"class.std::vector.0", i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>
%"class.Visualization::CoordinateAxes" = type { %"class.Visualization::RendererBase.base", float, float, %"class.std::vector.5", %"class.std::vector.0", i32, i32, i32, i32, i32, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Visualization::ColorVertex, std::allocator<Visualization::ColorVertex>>::_Vector_impl" }
%"struct.std::_Vector_base<Visualization::ColorVertex, std::allocator<Visualization::ColorVertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<Visualization::ColorVertex, std::allocator<Visualization::ColorVertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Visualization::ColorVertex, std::allocator<Visualization::ColorVertex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<Visualization::Joint, std::allocator<Visualization::Joint>>::_Vector_impl" }
%"struct.std::_Vector_base<Visualization::Joint, std::allocator<Visualization::Joint>>::_Vector_impl" = type { %"struct.std::_Vector_base<Visualization::Joint, std::allocator<Visualization::Joint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Visualization::Joint, std::allocator<Visualization::Joint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<Visualization::Bone, std::allocator<Visualization::Bone>>::_Vector_impl" }
%"struct.std::_Vector_base<Visualization::Bone, std::allocator<Visualization::Bone>>::_Vector_impl" = type { %"struct.std::_Vector_base<Visualization::Bone, std::allocator<Visualization::Bone>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Visualization::Bone, std::allocator<Visualization::Bone>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Visualization::FloorRenderer" = type <{ %"class.Visualization::RendererBase.base", [4 x [4 x float]], float, float, [4 x i8], %"class.std::vector", %"class.std::vector.0", i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13Visualization18WindowController3d21SetDefaultVerticalFOVEf(ptr noundef nonnull align 8 dereferenceable(2184) %0, float noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca %"class.std::lock_guard", align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %13 = getelementptr inbounds %"class.Visualization::WindowController3d", ptr %12, i32 0, i32 29
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %14 = getelementptr inbounds %"class.Visualization::WindowController3d", ptr %12, i32 0, i32 8
  store ptr %14, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = call noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  store ptr %16, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  store ptr %18, ptr %8, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %30, %2
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %37

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %26, ptr %9, align 8, !tbaa !5
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load float, ptr %4, align 4, !tbaa !9
  invoke void @_ZN11ViewControl21SetDefaultVerticalFOVEf(ptr noundef nonnull align 4 dereferenceable(104) %27, float noundef %28)
          to label %29 unwind label %33

29:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds ptr, ptr %31, i32 1
  store ptr %32, ptr %7, align 8, !tbaa !5
  br label %19

33:                                               ; preds = %24
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %10, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %38

37:                                               ; preds = %23
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

38:                                               ; preds = %33
  %39 = load ptr, ptr %10, align 8
  %40 = load i32, ptr %11, align 4
  %41 = insertvalue { ptr, i32 } poison, ptr %39, 0
  %42 = insertvalue { ptr, i32 } %41, i32 %40, 1
  resume { ptr, i32 } %42
}

; Function Attrs: mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE3endEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

declare void @_ZN11ViewControl21SetDefaultVerticalFOVEf(ptr noundef nonnull align 4 dereferenceable(104), float noundef) #4

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

!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}


; 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::lock_guard" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13Visualization18WindowController3d21SetDefaultVerticalFOVEf(ptr noundef nonnull align 8 dereferenceable(2184) %0, float noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::lock_guard", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %4 = getelementptr inbounds i8, ptr %0, i64 2144
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 432
  %6 = call noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  %7 = call noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  %.not10 = icmp eq ptr %6, %7
  br i1 %.not10, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %9, %2
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret void

.lr.ph:                                           ; preds = %2, %9
  %.011 = phi ptr [ %10, %9 ], [ %6, %2 ]
  %8 = load ptr, ptr %.011, align 8, !tbaa !5
  invoke void @_ZN11ViewControl21SetDefaultVerticalFOVEf(ptr noundef nonnull align 4 dereferenceable(104) %8, float noundef %1)
          to label %9 unwind label %11

9:                                                ; preds = %.lr.ph
  %10 = getelementptr inbounds i8, ptr %.011, i64 8
  %.not = icmp eq ptr %10, %7
  br i1 %.not, label %._crit_edge, label %.lr.ph

11:                                               ; preds = %.lr.ph
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %12
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef ptr @_ZNSt5arrayIP11ViewControlLm4EE3endEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

declare void @_ZN11ViewControl21SetDefaultVerticalFOVEf(ptr noundef nonnull align 4 dereferenceable(104), float noundef) local_unnamed_addr #4

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

!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"}


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