; LLVM IR from yangfengzzz/DigitalVox4 :: vox.render/controls/free_control.ll (ZN3vox7control11FreeControlC2EPNS_6EntityE)

; 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.vox::control::FreeControl" = type <{ %"class.vox::Script", %"class.vox::Vector", %"class.vox::Vector", float, float, i8, [3 x i8], float, i8, [3 x i8], float, float, i8, i8, i8, i8, %"class.vox::Vector", %"class.vox::control::Spherical", %"struct.std::array", i8, [3 x i8], i32, i32, [4 x i8] }>
%"class.vox::Script" = type { %"class.vox::Component.base", i8, i64, i64, i64 }
%"class.vox::Component.base" = type <{ ptr, ptr, i8, i8, i8 }>
%"class.vox::Vector" = type { float, float, float }
%"class.vox::control::Spherical" = type { float, float, float }
%"struct.std::array" = type { [2 x double] }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox7control11FreeControlC2EPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3vox6ScriptC2EPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef %8)
  store ptr getelementptr inbounds inrange(-16, 176) ({ [24 x ptr] }, ptr @_ZTVN3vox7control11FreeControlE, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 1
  invoke void @_ZN3vox6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %10 unwind label %34

10:                                               ; preds = %2
  %11 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 2
  invoke void @_ZN3vox6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %12 unwind label %34

12:                                               ; preds = %10
  %13 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 3
  store float 1.000000e+00, ptr %13, align 8, !tbaa !11
  %14 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 4
  store float 1.000000e+00, ptr %14, align 4, !tbaa !22
  %15 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 5
  store i8 0, ptr %15, align 8, !tbaa !23
  %16 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 7
  store float 0.000000e+00, ptr %16, align 4, !tbaa !24
  %17 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 8
  store i8 0, ptr %17, align 8, !tbaa !25
  %18 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 10
  store float 0.000000e+00, ptr %18, align 4, !tbaa !26
  %19 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 11
  store float 0.000000e+00, ptr %19, align 8, !tbaa !27
  %20 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 12
  store i8 0, ptr %20, align 4, !tbaa !28
  %21 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 13
  store i8 0, ptr %21, align 1, !tbaa !29
  %22 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 14
  store i8 0, ptr %22, align 2, !tbaa !30
  %23 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 15
  store i8 0, ptr %23, align 1, !tbaa !31
  %24 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 16
  invoke void @_ZN3vox6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %24)
          to label %25 unwind label %34

25:                                               ; preds = %12
  %26 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 17
  invoke void @_ZN3vox7control9SphericalC1Efff(ptr noundef nonnull align 4 dereferenceable(12) %26, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %27 unwind label %34

27:                                               ; preds = %25
  %28 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 18
  %29 = getelementptr inbounds %"struct.std::array", ptr %28, i32 0, i32 0
  call void @llvm.memset.p0.i64(ptr align 8 %29, i8 0, i64 16, i1 false)
  %30 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 19
  store i8 1, ptr %30, align 8, !tbaa !32
  %31 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 21
  store i32 1000, ptr %31, align 4, !tbaa !33
  %32 = getelementptr inbounds %"class.vox::control::FreeControl", ptr %7, i32 0, i32 22
  store i32 1000, ptr %32, align 8, !tbaa !34
  invoke void @_ZN3vox7control11FreeControl15updateSphericalEv(ptr noundef nonnull align 8 dereferenceable(156) %7)
          to label %33 unwind label %34

33:                                               ; preds = %27
  ret void

34:                                               ; preds = %27, %25, %12, %10, %2
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %5, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %6, align 4
  call void @_ZN3vox9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  br label %38

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

declare void @_ZN3vox6ScriptC2EPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN3vox7control9SphericalC1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(19)) 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !18, i64 72}
!12 = !{!"_ZTSN3vox7control11FreeControlE", !13, i64 0, !17, i64 48, !17, i64 60, !18, i64 72, !18, i64 76, !15, i64 80, !18, i64 84, !15, i64 88, !18, i64 92, !18, i64 96, !15, i64 100, !15, i64 101, !15, i64 102, !15, i64 103, !17, i64 104, !19, i64 116, !20, i64 128, !15, i64 144, !21, i64 148, !21, i64 152}
!13 = !{!"_ZTSN3vox6ScriptE", !14, i64 0, !15, i64 19, !16, i64 24, !16, i64 32, !16, i64 40}
!14 = !{!"_ZTSN3vox9ComponentE", !6, i64 8, !15, i64 16, !15, i64 17, !15, i64 18}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN3vox6VectorIfLm3EEE", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSN3vox7control9SphericalE", !18, i64 0, !18, i64 4, !18, i64 8}
!20 = !{!"_ZTSSt5arrayIdLm2EE", !7, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!12, !18, i64 76}
!23 = !{!12, !15, i64 80}
!24 = !{!12, !18, i64 84}
!25 = !{!12, !15, i64 88}
!26 = !{!12, !18, i64 92}
!27 = !{!12, !18, i64 96}
!28 = !{!12, !15, i64 100}
!29 = !{!12, !15, i64 101}
!30 = !{!12, !15, i64 102}
!31 = !{!12, !15, i64 103}
!32 = !{!12, !15, i64 144}
!33 = !{!12, !21, i64 148}
!34 = !{!12, !21, i64 152}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox7control11FreeControlC2EPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN3vox6ScriptC2EPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1)
  store ptr getelementptr inbounds inrange(-16, 176) (i8, ptr @_ZTVN3vox7control11FreeControlE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZN3vox6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 60
  tail call void @_ZN3vox6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  store <2 x float> <float 1.000000e+00, float 1.000000e+00>, ptr %5, align 8, !tbaa !8
  %6 = getelementptr inbounds i8, ptr %0, i64 80
  store i8 0, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds i8, ptr %0, i64 84
  store float 0.000000e+00, ptr %7, align 4, !tbaa !22
  %8 = getelementptr inbounds i8, ptr %0, i64 88
  store i8 0, ptr %8, align 8, !tbaa !23
  %9 = getelementptr inbounds i8, ptr %0, i64 92
  %10 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, i8 0, i64 12, i1 false)
  tail call void @_ZN3vox6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 116
  invoke void @_ZN3vox7control9SphericalC1Efff(ptr noundef nonnull align 4 dereferenceable(12) %11, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %12 unwind label %18

12:                                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %13, i8 0, i64 16, i1 false)
  %14 = getelementptr inbounds i8, ptr %0, i64 144
  store i8 1, ptr %14, align 8, !tbaa !24
  %15 = getelementptr inbounds i8, ptr %0, i64 148
  store i32 1000, ptr %15, align 4, !tbaa !25
  %16 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 1000, ptr %16, align 8, !tbaa !26
  invoke void @_ZN3vox7control11FreeControl15updateSphericalEv(ptr noundef nonnull align 8 dereferenceable(156) %0)
          to label %17 unwind label %18

17:                                               ; preds = %12
  ret void

18:                                               ; preds = %12, %2
  %19 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3vox9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  resume { ptr, i32 } %19
}

declare void @_ZN3vox6ScriptC2EPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN3vox7control9SphericalC1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(19)) 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 = { "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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !16, i64 80}
!12 = !{!"_ZTSN3vox7control11FreeControlE", !13, i64 0, !18, i64 48, !18, i64 60, !9, i64 72, !9, i64 76, !16, i64 80, !9, i64 84, !16, i64 88, !9, i64 92, !9, i64 96, !16, i64 100, !16, i64 101, !16, i64 102, !16, i64 103, !18, i64 104, !19, i64 116, !20, i64 128, !16, i64 144, !21, i64 148, !21, i64 152}
!13 = !{!"_ZTSN3vox6ScriptE", !14, i64 0, !16, i64 19, !17, i64 24, !17, i64 32, !17, i64 40}
!14 = !{!"_ZTSN3vox9ComponentE", !15, i64 8, !16, i64 16, !16, i64 17, !16, i64 18}
!15 = !{!"any pointer", !10, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = !{!"long", !10, i64 0}
!18 = !{!"_ZTSN3vox6VectorIfLm3EEE", !9, i64 0, !9, i64 4, !9, i64 8}
!19 = !{!"_ZTSN3vox7control9SphericalE", !9, i64 0, !9, i64 4, !9, i64 8}
!20 = !{!"_ZTSSt5arrayIdLm2EE", !10, i64 0}
!21 = !{!"int", !10, i64 0}
!22 = !{!12, !9, i64 84}
!23 = !{!12, !16, i64 88}
!24 = !{!12, !16, i64 144}
!25 = !{!12, !21, i64 148}
!26 = !{!12, !21, i64 152}


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