; LLVM IR from AF-GRILL/DISPluginForUnreal :: Source/ThirdParty/include/dis7/DirectedEnergyDamage.ll (ZN3DIS20DirectedEnergyDamageC2Ev)

; 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.DIS::DirectedEnergyDamage" = type <{ ptr, i32, i16, i16, %"class.DIS::Vector3Float", float, float, i8, i8, i8, i8, [4 x i8], %"class.DIS::EventIdentifier", i16, [6 x i8] }>
%"class.DIS::Vector3Float" = type <{ ptr, float, float, float, [4 x i8] }>
%"class.DIS::EventIdentifier" = type <{ ptr, %"class.DIS::SimulationAddress", i16, [6 x i8] }>
%"class.DIS::SimulationAddress" = type <{ ptr, i16, i16, [4 x i8] }>

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3DIS20DirectedEnergyDamageC2Ev(ptr noundef nonnull align 8 dereferenceable(90) %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
  store ptr getelementptr inbounds inrange(-16, 40) ({ [7 x ptr] }, ptr @_ZTVN3DIS20DirectedEnergyDamageE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 1
  store i32 4500, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 2
  store i16 40, ptr %7, align 4, !tbaa !19
  %8 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 3
  store i16 0, ptr %8, align 2, !tbaa !20
  %9 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 4
  call void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %9)
  %10 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 5
  store float 0.000000e+00, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 6
  store float 0xC071126660000000, ptr %11, align 4, !tbaa !22
  %12 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 7
  store i8 0, ptr %12, align 8, !tbaa !23
  %13 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 8
  store i8 0, ptr %13, align 1, !tbaa !24
  %14 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 9
  store i8 0, ptr %14, align 2, !tbaa !25
  %15 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 10
  store i8 0, ptr %15, align 1, !tbaa !26
  %16 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 12
  invoke void @_ZN3DIS15EventIdentifierC1Ev(ptr noundef nonnull align 8 dereferenceable(26) %16)
          to label %17 unwind label %19

17:                                               ; preds = %1
  %18 = getelementptr inbounds %"class.DIS::DirectedEnergyDamage", ptr %5, i32 0, i32 13
  store i16 0, ptr %18, align 8, !tbaa !27
  ret void

19:                                               ; preds = %1
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %3, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %4, align 4
  call void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %9) #3
  br label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr %3, align 8
  %25 = load i32, ptr %4, align 4
  %26 = insertvalue { ptr, i32 } poison, ptr %24, 0
  %27 = insertvalue { ptr, i32 } %26, i32 %25, 1
  resume { ptr, i32 } %27
}

declare void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #1

declare void @_ZN3DIS15EventIdentifierC1Ev(ptr noundef nonnull align 8 dereferenceable(26)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #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 = { nounwind "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, !13, i64 8}
!12 = !{!"_ZTSN3DIS20DirectedEnergyDamageE", !13, i64 8, !14, i64 12, !14, i64 14, !15, i64 16, !16, i64 40, !16, i64 44, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !17, i64 56, !14, i64 88}
!13 = !{!"int", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTSN3DIS12Vector3FloatE", !16, i64 8, !16, i64 12, !16, i64 16}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTSN3DIS15EventIdentifierE", !18, i64 8, !14, i64 24}
!18 = !{!"_ZTSN3DIS17SimulationAddressE", !14, i64 8, !14, i64 10}
!19 = !{!12, !14, i64 12}
!20 = !{!12, !14, i64 14}
!21 = !{!12, !16, i64 40}
!22 = !{!12, !16, i64 44}
!23 = !{!12, !7, i64 48}
!24 = !{!12, !7, i64 49}
!25 = !{!12, !7, i64 50}
!26 = !{!12, !7, i64 51}
!27 = !{!12, !14, i64 88}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3DIS20DirectedEnergyDamageC2Ev(ptr noundef nonnull align 8 dereferenceable(90) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 40) (i8, ptr @_ZTVN3DIS20DirectedEnergyDamageE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 4500, ptr %2, align 8, !tbaa !8
  %3 = getelementptr inbounds i8, ptr %0, i64 12
  store i16 40, ptr %3, align 4, !tbaa !17
  %4 = getelementptr inbounds i8, ptr %0, i64 14
  store i16 0, ptr %4, align 2, !tbaa !18
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  store <2 x float> <float 0.000000e+00, float 0xC071126660000000>, ptr %6, align 8, !tbaa !19
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 0, ptr %7, align 8
  invoke void @_ZN3DIS15EventIdentifierC1Ev(ptr noundef nonnull align 8 dereferenceable(26) %8)
          to label %9 unwind label %11

9:                                                ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 88
  store i16 0, ptr %10, align 8, !tbaa !20
  ret void

11:                                               ; preds = %1
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #3
  resume { ptr, i32 } %12
}

declare void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #1

declare void @_ZN3DIS15EventIdentifierC1Ev(ptr noundef nonnull align 8 dereferenceable(26)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #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 = { nounwind "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTSN3DIS20DirectedEnergyDamageE", !10, i64 8, !12, i64 12, !12, i64 14, !13, i64 16, !14, i64 40, !14, i64 44, !11, i64 48, !11, i64 49, !11, i64 50, !11, i64 51, !15, i64 56, !12, i64 88}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"short", !11, i64 0}
!13 = !{!"_ZTSN3DIS12Vector3FloatE", !14, i64 8, !14, i64 12, !14, i64 16}
!14 = !{!"float", !11, i64 0}
!15 = !{!"_ZTSN3DIS15EventIdentifierE", !16, i64 8, !12, i64 24}
!16 = !{!"_ZTSN3DIS17SimulationAddressE", !12, i64 8, !12, i64 10}
!17 = !{!9, !12, i64 12}
!18 = !{!9, !12, i64 14}
!19 = !{!14, !14, i64 0}
!20 = !{!9, !12, i64 88}


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