; LLVM IR from AF-GRILL/DISPluginForUnreal :: Source/ThirdParty/include/dis6/DesignatorPdu.ll (ZN3DIS13DesignatorPduC2Ev)

; 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::DesignatorPdu" = type { %"class.DIS::DistributedEmissionsFamilyPdu.base", [4 x i8], %"class.DIS::EntityID", i16, [6 x i8], %"class.DIS::EntityID", i16, float, float, [4 x i8], %"class.DIS::Vector3Float", %"class.DIS::Vector3Double", i8, i16, i8, [3 x i8], %"class.DIS::Vector3Float" }
%"class.DIS::DistributedEmissionsFamilyPdu.base" = type { %"class.DIS::Pdu.base" }
%"class.DIS::Pdu.base" = type <{ ptr, i8, i8, i8, i8, i32, i16, i16 }>
%"class.DIS::EntityID" = type <{ ptr, i16, i16, i16, [2 x i8] }>
%"class.DIS::Vector3Double" = type { ptr, double, double, double }
%"class.DIS::Vector3Float" = type <{ ptr, float, float, float, [4 x i8] }>

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3DIS13DesignatorPduC2Ev(ptr noundef nonnull align 8 dereferenceable(168) %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 @_ZN3DIS29DistributedEmissionsFamilyPduC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5)
  store ptr getelementptr inbounds inrange(-16, 40) ({ [7 x ptr] }, ptr @_ZTVN3DIS13DesignatorPduE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 2
  invoke void @_ZN3DIS8EntityIDC1Ev(ptr noundef nonnull align 8 dereferenceable(14) %6)
          to label %7 unwind label %24

7:                                                ; preds = %1
  %8 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 3
  store i16 0, ptr %8, align 8, !tbaa !11
  %9 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 5
  invoke void @_ZN3DIS8EntityIDC1Ev(ptr noundef nonnull align 8 dereferenceable(14) %9)
          to label %10 unwind label %28

10:                                               ; preds = %7
  %11 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 6
  store i16 0, ptr %11, align 8, !tbaa !22
  %12 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 7
  store float 0.000000e+00, ptr %12, align 4, !tbaa !23
  %13 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 8
  store float 0.000000e+00, ptr %13, align 8, !tbaa !24
  %14 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 10
  invoke void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %14)
          to label %15 unwind label %32

15:                                               ; preds = %10
  %16 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 11
  invoke void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %17 unwind label %36

17:                                               ; preds = %15
  %18 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 12
  store i8 0, ptr %18, align 8, !tbaa !25
  %19 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 13
  store i16 0, ptr %19, align 2, !tbaa !26
  %20 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 14
  store i8 0, ptr %20, align 4, !tbaa !27
  %21 = getelementptr inbounds %"class.DIS::DesignatorPdu", ptr %5, i32 0, i32 16
  invoke void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %21)
          to label %22 unwind label %40

22:                                               ; preds = %17
  invoke void @_ZN3DIS3Pdu10setPduTypeEh(ptr noundef nonnull align 8 dereferenceable(20) %5, i8 noundef zeroext 24)
          to label %23 unwind label %44

23:                                               ; preds = %22
  ret void

24:                                               ; preds = %1
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %3, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %4, align 4
  br label %52

28:                                               ; preds = %7
  %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
  br label %51

32:                                               ; preds = %10
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %3, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %4, align 4
  br label %50

36:                                               ; preds = %15
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %3, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %4, align 4
  br label %49

40:                                               ; preds = %17
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %3, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %4, align 4
  br label %48

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

48:                                               ; preds = %44, %40
  call void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #3
  br label %49

49:                                               ; preds = %48, %36
  call void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %14) #3
  br label %50

50:                                               ; preds = %49, %32
  call void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %9) #3
  br label %51

51:                                               ; preds = %50, %28
  call void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %6) #3
  br label %52

52:                                               ; preds = %51, %24
  call void @_ZN3DIS29DistributedEmissionsFamilyPduD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #3
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %3, align 8
  %55 = load i32, ptr %4, align 4
  %56 = insertvalue { ptr, i32 } poison, ptr %54, 0
  %57 = insertvalue { ptr, i32 } %56, i32 %55, 1
  resume { ptr, i32 } %57
}

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

declare void @_ZN3DIS8EntityIDC1Ev(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

declare void @_ZN3DIS3Pdu10setPduTypeEh(ptr noundef nonnull align 8 dereferenceable(20), i8 noundef zeroext) #1

; Function Attrs: nounwind
declare void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3DIS29DistributedEmissionsFamilyPduD2Ev(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, !16, i64 40}
!12 = !{!"_ZTSN3DIS13DesignatorPduE", !13, i64 0, !17, i64 24, !16, i64 40, !17, i64 48, !16, i64 64, !18, i64 68, !18, i64 72, !19, i64 80, !20, i64 104, !7, i64 136, !16, i64 138, !7, i64 140, !19, i64 144}
!13 = !{!"_ZTSN3DIS29DistributedEmissionsFamilyPduE", !14, i64 0}
!14 = !{!"_ZTSN3DIS3PduE", !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !15, i64 12, !16, i64 16, !16, i64 18}
!15 = !{!"int", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"_ZTSN3DIS8EntityIDE", !16, i64 8, !16, i64 10, !16, i64 12}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSN3DIS12Vector3FloatE", !18, i64 8, !18, i64 12, !18, i64 16}
!20 = !{!"_ZTSN3DIS13Vector3DoubleE", !21, i64 8, !21, i64 16, !21, i64 24}
!21 = !{!"double", !7, i64 0}
!22 = !{!12, !16, i64 64}
!23 = !{!12, !18, i64 68}
!24 = !{!12, !18, i64 72}
!25 = !{!12, !7, i64 136}
!26 = !{!12, !16, i64 138}
!27 = !{!12, !7, i64 140}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3DIS13DesignatorPduC2Ev(ptr noundef nonnull align 8 dereferenceable(168) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN3DIS29DistributedEmissionsFamilyPduC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0)
  store ptr getelementptr inbounds inrange(-16, 40) (i8, ptr @_ZTVN3DIS13DesignatorPduE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  invoke void @_ZN3DIS8EntityIDC1Ev(ptr noundef nonnull align 8 dereferenceable(14) %2)
          to label %3 unwind label %19

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  store i16 0, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  invoke void @_ZN3DIS8EntityIDC1Ev(ptr noundef nonnull align 8 dereferenceable(14) %5)
          to label %6 unwind label %21

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  store i16 0, ptr %7, align 8, !tbaa !20
  %8 = getelementptr inbounds i8, ptr %0, i64 68
  store <2 x float> zeroinitializer, ptr %8, align 4, !tbaa !21
  %9 = getelementptr inbounds i8, ptr %0, i64 80
  invoke void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %9)
          to label %10 unwind label %23

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 104
  invoke void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %12 unwind label %25

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 136
  store i8 0, ptr %13, align 8, !tbaa !22
  %14 = getelementptr inbounds i8, ptr %0, i64 138
  store i16 0, ptr %14, align 2, !tbaa !23
  %15 = getelementptr inbounds i8, ptr %0, i64 140
  store i8 0, ptr %15, align 4, !tbaa !24
  %16 = getelementptr inbounds i8, ptr %0, i64 144
  invoke void @_ZN3DIS12Vector3FloatC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %16)
          to label %17 unwind label %27

17:                                               ; preds = %12
  invoke void @_ZN3DIS3Pdu10setPduTypeEh(ptr noundef nonnull align 8 dereferenceable(20) %0, i8 noundef zeroext 24)
          to label %18 unwind label %29

18:                                               ; preds = %17
  ret void

19:                                               ; preds = %1
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %35

21:                                               ; preds = %3
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %34

23:                                               ; preds = %6
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %33

25:                                               ; preds = %10
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %32

27:                                               ; preds = %12
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %31

29:                                               ; preds = %17
  %30 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %16) #3
  br label %31

31:                                               ; preds = %29, %27
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %28, %27 ]
  tail call void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #3
  br label %32

32:                                               ; preds = %31, %25
  %.pn.pn = phi { ptr, i32 } [ %.pn, %31 ], [ %26, %25 ]
  tail call void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %9) #3
  br label %33

33:                                               ; preds = %32, %23
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %32 ], [ %24, %23 ]
  tail call void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %5) #3
  br label %34

34:                                               ; preds = %33, %21
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %33 ], [ %22, %21 ]
  tail call void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %2) #3
  br label %35

35:                                               ; preds = %34, %19
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %34 ], [ %20, %19 ]
  tail call void @_ZN3DIS29DistributedEmissionsFamilyPduD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #3
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

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

declare void @_ZN3DIS8EntityIDC1Ev(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

declare void @_ZN3DIS3Pdu10setPduTypeEh(ptr noundef nonnull align 8 dereferenceable(20), i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN3DIS12Vector3FloatD1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3DIS29DistributedEmissionsFamilyPduD2Ev(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, !14, i64 40}
!9 = !{!"_ZTSN3DIS13DesignatorPduE", !10, i64 0, !15, i64 24, !14, i64 40, !15, i64 48, !14, i64 64, !16, i64 68, !16, i64 72, !17, i64 80, !18, i64 104, !12, i64 136, !14, i64 138, !12, i64 140, !17, i64 144}
!10 = !{!"_ZTSN3DIS29DistributedEmissionsFamilyPduE", !11, i64 0}
!11 = !{!"_ZTSN3DIS3PduE", !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !13, i64 12, !14, i64 16, !14, i64 18}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"int", !12, i64 0}
!14 = !{!"short", !12, i64 0}
!15 = !{!"_ZTSN3DIS8EntityIDE", !14, i64 8, !14, i64 10, !14, i64 12}
!16 = !{!"float", !12, i64 0}
!17 = !{!"_ZTSN3DIS12Vector3FloatE", !16, i64 8, !16, i64 12, !16, i64 16}
!18 = !{!"_ZTSN3DIS13Vector3DoubleE", !19, i64 8, !19, i64 16, !19, i64 24}
!19 = !{!"double", !12, i64 0}
!20 = !{!9, !14, i64 64}
!21 = !{!16, !16, i64 0}
!22 = !{!9, !12, i64 136}
!23 = !{!9, !14, i64 138}
!24 = !{!9, !12, i64 140}


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