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

; 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::MinefieldQueryPdu" = type { %"class.DIS::MinefieldFamilyPdu.base", [4 x i8], %"class.DIS::EntityID", %"class.DIS::EntityID", i8, i8, i8, i8, i32, %"class.DIS::EntityType", %"class.std::vector", %"class.std::vector.0" }
%"class.DIS::MinefieldFamilyPdu.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::EntityType" = type { ptr, i8, i8, i16, i8, i8, i8, i8 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<DIS::Point, std::allocator<DIS::Point>>::_Vector_impl" }
%"struct.std::_Vector_base<DIS::Point, std::allocator<DIS::Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<DIS::Point, std::allocator<DIS::Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DIS::Point, std::allocator<DIS::Point>>::_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<DIS::TwoByteChunk, std::allocator<DIS::TwoByteChunk>>::_Vector_impl" }
%"struct.std::_Vector_base<DIS::TwoByteChunk, std::allocator<DIS::TwoByteChunk>>::_Vector_impl" = type { %"struct.std::_Vector_base<DIS::TwoByteChunk, std::allocator<DIS::TwoByteChunk>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DIS::TwoByteChunk, std::allocator<DIS::TwoByteChunk>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

7:                                                ; preds = %1
  %8 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 3
  invoke void @_ZN3DIS8EntityIDC1Ev(ptr noundef nonnull align 8 dereferenceable(14) %8)
          to label %9 unwind label %24

9:                                                ; preds = %7
  %10 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 4
  store i8 0, ptr %10, align 8, !tbaa !11
  %11 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 5
  store i8 0, ptr %11, align 1, !tbaa !27
  %12 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 6
  store i8 0, ptr %12, align 2, !tbaa !28
  %13 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 7
  store i8 0, ptr %13, align 1, !tbaa !29
  %14 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 8
  store i32 0, ptr %14, align 4, !tbaa !30
  %15 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 9
  invoke void @_ZN3DIS10EntityTypeC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %16 unwind label %28

16:                                               ; preds = %9
  %17 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 10
  call void @_ZNSt6vectorIN3DIS5PointESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  %18 = getelementptr inbounds %"class.DIS::MinefieldQueryPdu", ptr %5, i32 0, i32 11
  call void @_ZNSt6vectorIN3DIS12TwoByteChunkESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  invoke void @_ZN3DIS3Pdu10setPduTypeEh(ptr noundef nonnull align 8 dereferenceable(20) %5, i8 noundef zeroext 38)
          to label %19 unwind label %32

19:                                               ; preds = %16
  ret void

20:                                               ; preds = %1
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %3, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %4, align 4
  br label %38

24:                                               ; preds = %7
  %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 %37

28:                                               ; preds = %9
  %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 %36

32:                                               ; preds = %16
  %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
  call void @_ZNSt6vectorIN3DIS12TwoByteChunkESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  call void @_ZNSt6vectorIN3DIS5PointESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  call void @_ZN3DIS10EntityTypeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  br label %36

36:                                               ; preds = %32, %28
  call void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %8) #4
  br label %37

37:                                               ; preds = %36, %24
  call void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %6) #4
  br label %38

38:                                               ; preds = %37, %20
  call void @_ZN3DIS18MinefieldFamilyPduD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #4
  br label %39

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

declare void @_ZN3DIS18MinefieldFamilyPduC2Ev(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 @_ZN3DIS10EntityTypeC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

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

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

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

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

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

; Function Attrs: nounwind
declare void @_ZN3DIS10EntityTypeD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

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

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

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 = { 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 #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, !7, i64 56}
!12 = !{!"_ZTSN3DIS17MinefieldQueryPduE", !13, i64 0, !17, i64 24, !17, i64 40, !7, i64 56, !7, i64 57, !7, i64 58, !7, i64 59, !15, i64 60, !18, i64 64, !19, i64 80, !23, i64 104}
!13 = !{!"_ZTSN3DIS18MinefieldFamilyPduE", !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 = !{!"_ZTSN3DIS10EntityTypeE", !7, i64 8, !7, i64 9, !16, i64 10, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15}
!19 = !{!"_ZTSSt6vectorIN3DIS5PointESaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIN3DIS5PointESaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN3DIS5PointESaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN3DIS5PointESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt6vectorIN3DIS12TwoByteChunkESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN3DIS12TwoByteChunkESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN3DIS12TwoByteChunkESaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN3DIS12TwoByteChunkESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!12, !7, i64 57}
!28 = !{!12, !7, i64 58}
!29 = !{!12, !7, i64 59}
!30 = !{!12, !15, i64 60}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3DIS17MinefieldQueryPduC2Ev(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN3DIS18MinefieldFamilyPduC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0)
  store ptr getelementptr inbounds inrange(-16, 40) (i8, ptr @_ZTVN3DIS17MinefieldQueryPduE, 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 %12

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

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 0, ptr %6, align 8
  invoke void @_ZN3DIS10EntityTypeC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %8 unwind label %16

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZNSt6vectorIN3DIS5PointESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @_ZNSt6vectorIN3DIS12TwoByteChunkESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  invoke void @_ZN3DIS3Pdu10setPduTypeEh(ptr noundef nonnull align 8 dereferenceable(20) %0, i8 noundef zeroext 38)
          to label %11 unwind label %18

11:                                               ; preds = %8
  ret void

12:                                               ; preds = %1
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %22

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

16:                                               ; preds = %5
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %20

18:                                               ; preds = %8
  %19 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt6vectorIN3DIS12TwoByteChunkESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  tail call void @_ZNSt6vectorIN3DIS5PointESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  tail call void @_ZN3DIS10EntityTypeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  br label %20

20:                                               ; preds = %18, %16
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %17, %16 ]
  tail call void @_ZN3DIS8EntityIDD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %4) #4
  br label %21

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

22:                                               ; preds = %21, %12
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %21 ], [ %13, %12 ]
  tail call void @_ZN3DIS18MinefieldFamilyPduD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #4
  resume { ptr, i32 } %.pn.pn.pn
}

declare void @_ZN3DIS18MinefieldFamilyPduC2Ev(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 @_ZN3DIS10EntityTypeC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

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

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

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

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

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

; Function Attrs: nounwind
declare void @_ZN3DIS10EntityTypeD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

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

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

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 = { 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 #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"}


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