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

; 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::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.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 }
%"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] }>

@_ZTVN13Visualization18PointCloudRendererE = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13Visualization18PointCloudRendererC2Ev(ptr noundef nonnull align 8 dereferenceable(272) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZN13Visualization12RendererBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(164) %5) #3
  store ptr getelementptr inbounds inrange(-16, 48) ({ [8 x ptr] }, ptr @_ZTVN13Visualization18PointCloudRendererE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 1
  store float 5.000000e-01, ptr %6, align 4, !tbaa !11
  %7 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 2
  call void @_ZNSt8optionalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7) #3
  %8 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 3
  store i8 0, ptr %8, align 8, !tbaa !23
  %9 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 4
  store i32 0, ptr %9, align 4, !tbaa !24
  %10 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 5
  store i32 0, ptr %10, align 8, !tbaa !25
  %11 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 6
  store i32 0, ptr %11, align 4, !tbaa !26
  %12 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 7
  store i32 0, ptr %12, align 8, !tbaa !27
  %13 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 8
  store i32 0, ptr %13, align 4, !tbaa !28
  %14 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 9
  store i32 0, ptr %14, align 8, !tbaa !29
  %15 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 10
  store i32 0, ptr %15, align 4, !tbaa !30
  %16 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 11
  store i32 0, ptr %16, align 8, !tbaa !31
  %17 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 12
  store i32 0, ptr %17, align 4, !tbaa !32
  %18 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 13
  store i32 0, ptr %18, align 8, !tbaa !33
  %19 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 14
  store i32 0, ptr %19, align 4, !tbaa !34
  %20 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 15
  store i32 0, ptr %20, align 8, !tbaa !35
  %21 = getelementptr inbounds %"class.Visualization::PointCloudRenderer", ptr %5, i32 0, i32 16
  call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21) #3
  %22 = getelementptr inbounds %"class.Visualization::RendererBase", ptr %5, i32 0, i32 3
  %23 = getelementptr inbounds [4 x [4 x float]], ptr %22, i64 0, i64 0
  invoke void @_ZN7linmathL15mat4x4_identityEPA4_f(ptr noundef %23)
          to label %24 unwind label %28

24:                                               ; preds = %1
  %25 = getelementptr inbounds %"class.Visualization::RendererBase", ptr %5, i32 0, i32 4
  %26 = getelementptr inbounds [4 x [4 x float]], ptr %25, i64 0, i64 0
  invoke void @_ZN7linmathL15mat4x4_identityEPA4_f(ptr noundef %26)
          to label %27 unwind label %28

27:                                               ; preds = %24
  ret void

28:                                               ; preds = %24, %1
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %3, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %4, align 4
  call void @_ZN13Visualization12RendererBaseD2Ev(ptr noundef nonnull align 8 dereferenceable(164) %5) #3
  br label %32

32:                                               ; preds = %28
  %33 = load ptr, ptr %3, align 8
  %34 = load i32, ptr %4, align 4
  %35 = insertvalue { ptr, i32 } poison, ptr %33, 0
  %36 = insertvalue { ptr, i32 } %35, i32 %34, 1
  resume { ptr, i32 } %36
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN7linmathL15mat4x4_identityEPA4_f(ptr noundef) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13Visualization12RendererBaseD2Ev(ptr noundef nonnull align 8 dereferenceable(164)) unnamed_addr #2 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 = { 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 #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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !16, i64 164}
!12 = !{!"_ZTSN13Visualization18PointCloudRendererE", !13, i64 0, !16, i64 164, !17, i64 168, !14, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !15, i64 224, !21, i64 232}
!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 = !{!"float", !7, i64 0}
!17 = !{!"_ZTSSt8optionalIfE", !18, i64 0}
!18 = !{!"_ZTSSt14_Optional_baseIfLb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt17_Optional_payloadIfLb1ELb1ELb1EE", !20, i64 0}
!20 = !{!"_ZTSSt22_Optional_payload_baseIfE", !7, i64 0, !14, i64 4}
!21 = !{!"_ZTSSt5mutex", !22, i64 0}
!22 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!23 = !{!12, !14, i64 176}
!24 = !{!12, !15, i64 180}
!25 = !{!12, !15, i64 184}
!26 = !{!12, !15, i64 188}
!27 = !{!12, !15, i64 192}
!28 = !{!12, !15, i64 196}
!29 = !{!12, !15, i64 200}
!30 = !{!12, !15, i64 204}
!31 = !{!12, !15, i64 208}
!32 = !{!12, !15, i64 212}
!33 = !{!12, !15, i64 216}
!34 = !{!12, !15, i64 220}
!35 = !{!12, !15, i64 224}


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

@_ZTVN13Visualization18PointCloudRendererE = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13Visualization18PointCloudRendererC2Ev(ptr noundef nonnull align 8 dereferenceable(272) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN13Visualization12RendererBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(164) %0) #3
  store ptr getelementptr inbounds inrange(-16, 48) (i8, ptr @_ZTVN13Visualization18PointCloudRendererE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 164
  store float 5.000000e-01, ptr %2, align 4, !tbaa !8
  %3 = getelementptr inbounds i8, ptr %0, i64 168
  tail call void @_ZNSt8optionalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %3) #3
  %4 = getelementptr inbounds i8, ptr %0, i64 176
  store i8 0, ptr %4, align 8, !tbaa !22
  %5 = getelementptr inbounds i8, ptr %0, i64 180
  %6 = getelementptr inbounds i8, ptr %0, i64 232
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(48) %5, i8 0, i64 48, i1 false)
  tail call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  tail call void @_ZN7linmathL15mat4x4_identityEPA4_f(ptr noundef nonnull %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 76
  tail call void @_ZN7linmathL15mat4x4_identityEPA4_f(ptr noundef nonnull %8)
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN7linmathL15mat4x4_identityEPA4_f(ptr noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !15, i64 164}
!9 = !{!"_ZTSN13Visualization18PointCloudRendererE", !10, i64 0, !15, i64 164, !16, i64 168, !11, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !14, i64 196, !14, i64 200, !14, i64 204, !14, i64 208, !14, i64 212, !14, i64 216, !14, i64 220, !14, i64 224, !20, i64 232}
!10 = !{!"_ZTSN13Visualization12RendererBaseE", !11, i64 8, !12, i64 12, !12, i64 76, !13, i64 144, !14, i64 152, !14, i64 156, !14, i64 160}
!11 = !{!"bool", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!"int", !12, i64 0}
!15 = !{!"float", !12, i64 0}
!16 = !{!"_ZTSSt8optionalIfE", !17, i64 0}
!17 = !{!"_ZTSSt14_Optional_baseIfLb1ELb1EE", !18, i64 0}
!18 = !{!"_ZTSSt17_Optional_payloadIfLb1ELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt22_Optional_payload_baseIfE", !12, i64 0, !11, i64 4}
!20 = !{!"_ZTSSt5mutex", !21, i64 0}
!21 = !{!"_ZTSSt12__mutex_base", !12, i64 0}
!22 = !{!9, !11, i64 176}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass