; LLVM IR from AF-GRILL/DISPluginForUnreal :: Source/ThirdParty/include/dis6 (GriddedDataPdu)

; 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::GridAxisRecord" = type <{ ptr, i16, i16, [4 x i8] }>
%"class.DIS::GriddedDataPdu" = type { %"class.DIS::SyntheticEnvironmentFamilyPdu.base", [4 x i8], %"class.DIS::EntityID", i16, i16, i16, i16, i8, i8, %"class.DIS::EntityType", %"class.DIS::Orientation", i64, i32, i8, i16, i8, %"class.std::vector" }
%"class.DIS::SyntheticEnvironmentFamilyPdu.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.DIS::Orientation" = type <{ ptr, float, float, float, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<DIS::GridAxisRecord, std::allocator<DIS::GridAxisRecord>>::_Vector_impl" }
%"struct.std::_Vector_base<DIS::GridAxisRecord, std::allocator<DIS::GridAxisRecord>>::_Vector_impl" = type { %"struct.std::_Vector_base<DIS::GridAxisRecord, std::allocator<DIS::GridAxisRecord>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DIS::GridAxisRecord, std::allocator<DIS::GridAxisRecord>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3DIS14GridAxisRecordC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2 align 2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3DIS14GriddedDataPdu17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(144) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca %"class.DIS::GridAxisRecord", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  %9 = call noundef i32 @_ZNK3DIS29SyntheticEnvironmentFamilyPdu17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20) %8)
  store i32 %9, ptr %3, align 4, !tbaa !9
  %10 = load i32, ptr %3, align 4, !tbaa !9
  %11 = getelementptr inbounds %"class.DIS::GriddedDataPdu", ptr %8, i32 0, i32 2
  %12 = call noundef i32 @_ZNK3DIS8EntityID17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(14) %11)
  %13 = add nsw i32 %10, %12
  store i32 %13, ptr %3, align 4, !tbaa !9
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = add nsw i32 %14, 2
  store i32 %15, ptr %3, align 4, !tbaa !9
  %16 = load i32, ptr %3, align 4, !tbaa !9
  %17 = add nsw i32 %16, 2
  store i32 %17, ptr %3, align 4, !tbaa !9
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = add nsw i32 %18, 2
  store i32 %19, ptr %3, align 4, !tbaa !9
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = add nsw i32 %20, 2
  store i32 %21, ptr %3, align 4, !tbaa !9
  %22 = load i32, ptr %3, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !9
  %24 = load i32, ptr %3, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !9
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = getelementptr inbounds %"class.DIS::GriddedDataPdu", ptr %8, i32 0, i32 9
  %28 = call noundef i32 @_ZNK3DIS10EntityType17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
  %29 = add nsw i32 %26, %28
  store i32 %29, ptr %3, align 4, !tbaa !9
  %30 = load i32, ptr %3, align 4, !tbaa !9
  %31 = getelementptr inbounds %"class.DIS::GriddedDataPdu", ptr %8, i32 0, i32 10
  %32 = call noundef i32 @_ZNK3DIS11Orientation17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20) %31)
  %33 = add nsw i32 %30, %32
  store i32 %33, ptr %3, align 4, !tbaa !9
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = add nsw i32 %34, 8
  store i32 %35, ptr %3, align 4, !tbaa !9
  %36 = load i32, ptr %3, align 4, !tbaa !9
  %37 = add nsw i32 %36, 4
  store i32 %37, ptr %3, align 4, !tbaa !9
  %38 = load i32, ptr %3, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %3, align 4, !tbaa !9
  %40 = load i32, ptr %3, align 4, !tbaa !9
  %41 = add nsw i32 %40, 2
  store i32 %41, ptr %3, align 4, !tbaa !9
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !11
  br label %44

44:                                               ; preds = %58, %1
  %45 = load i64, ptr %4, align 8, !tbaa !11
  %46 = getelementptr inbounds %"class.DIS::GriddedDataPdu", ptr %8, i32 0, i32 16
  %47 = call noundef i64 @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #6
  %48 = icmp ult i64 %45, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %65

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %51 = getelementptr inbounds %"class.DIS::GriddedDataPdu", ptr %8, i32 0, i32 16
  %52 = load i64, ptr %4, align 8, !tbaa !11
  %53 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %52) #6
  call void @_ZN3DIS14GridAxisRecordC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull align 8 dereferenceable(12) %53) #6
  %54 = load i32, ptr %3, align 4, !tbaa !9
  %55 = invoke noundef i32 @_ZNK3DIS14GridAxisRecord17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12) %5)
          to label %56 unwind label %61

56:                                               ; preds = %50
  %57 = add nsw i32 %54, %55
  store i32 %57, ptr %3, align 4, !tbaa !9
  call void @_ZN3DIS14GridAxisRecordD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  br label %58

58:                                               ; preds = %56
  %59 = load i64, ptr %4, align 8, !tbaa !11
  %60 = add i64 %59, 1
  store i64 %60, ptr %4, align 8, !tbaa !11
  br label %44, !llvm.loop !13

61:                                               ; preds = %50
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  call void @_ZN3DIS14GridAxisRecordD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %67

65:                                               ; preds = %49
  %66 = load i32, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret i32 %66

67:                                               ; preds = %61
  %68 = load ptr, ptr %6, align 8
  %69 = load i32, ptr %7, align 4
  %70 = insertvalue { ptr, i32 } poison, ptr %68, 0
  %71 = insertvalue { ptr, i32 } %70, i32 %69, 1
  resume { ptr, i32 } %71
}

declare noundef i32 @_ZNK3DIS29SyntheticEnvironmentFamilyPdu17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS8EntityID17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS10EntityType17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS11Orientation17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS14GridAxisRecord17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #5

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 #5 = { "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 #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

%"class.DIS::GridAxisRecord" = type <{ ptr, i16, i16, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3DIS14GridAxisRecordC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3DIS14GriddedDataPdu17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(144) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.DIS::GridAxisRecord", align 8
  %3 = tail call noundef i32 @_ZNK3DIS29SyntheticEnvironmentFamilyPdu17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0)
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = tail call noundef i32 @_ZNK3DIS8EntityID17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(14) %4)
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  %7 = tail call noundef i32 @_ZNK3DIS10EntityType17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = tail call noundef i32 @_ZNK3DIS11Orientation17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20) %8)
  %10 = add i32 %3, 26
  %11 = add i32 %10, %5
  %12 = add i32 %11, %7
  %13 = add i32 %12, %9
  %14 = getelementptr inbounds i8, ptr %0, i64 120
  %15 = tail call noundef i64 @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %.not = icmp eq i64 %15, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %18, %1
  %.0.lcssa = phi i32 [ %13, %1 ], [ %19, %18 ]
  ret i32 %.0.lcssa

.lr.ph:                                           ; preds = %1, %18
  %.024 = phi i32 [ %19, %18 ], [ %13, %1 ]
  %.02123 = phi i64 [ %20, %18 ], [ 0, %1 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  %16 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %.02123) #6
  call void @_ZN3DIS14GridAxisRecordC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(12) %2, ptr noundef nonnull align 8 dereferenceable(12) %16) #6
  %17 = invoke noundef i32 @_ZNK3DIS14GridAxisRecord17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12) %2)
          to label %18 unwind label %23

18:                                               ; preds = %.lr.ph
  %19 = add nsw i32 %17, %.024
  call void @_ZN3DIS14GridAxisRecordD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  %20 = add nuw i64 %.02123, 1
  %21 = call noundef i64 @_ZNKSt6vectorIN3DIS14GridAxisRecordESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %22 = icmp ult i64 %20, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !5

23:                                               ; preds = %.lr.ph
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3DIS14GridAxisRecordD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  resume { ptr, i32 } %24
}

declare noundef i32 @_ZNK3DIS29SyntheticEnvironmentFamilyPdu17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS8EntityID17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS10EntityType17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS11Orientation17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS14GridAxisRecord17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #5

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 #5 = { "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 #6 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass