; LLVM IR from AF-GRILL/DISPluginForUnreal :: Source/ThirdParty/include/dis7 (ElectromagneticEmissionBeamData)

; 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::TrackJamData" = type <{ ptr, %"class.DIS::EntityID", i8, i8, [6 x i8] }>
%"class.DIS::EntityID" = type <{ ptr, %"class.DIS::SimulationAddress", i16, [6 x i8] }>
%"class.DIS::SimulationAddress" = type <{ ptr, i16, i16, [4 x i8] }>
%"class.DIS::ElectromagneticEmissionBeamData" = type { ptr, i8, i8, i16, [4 x i8], %"class.DIS::EEFundamentalParameterData", %"class.DIS::BeamData", i8, i8, i8, i8, [4 x i8], %"class.DIS::JammingTechnique", %"class.std::vector" }
%"class.DIS::EEFundamentalParameterData" = type <{ ptr, float, float, float, float, float, [4 x i8] }>
%"class.DIS::BeamData" = type <{ ptr, float, float, float, float, float, [4 x i8] }>
%"class.DIS::JammingTechnique" = type <{ ptr, i8, i8, i8, i8, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<DIS::TrackJamData, std::allocator<DIS::TrackJamData>>::_Vector_impl" }
%"struct.std::_Vector_base<DIS::TrackJamData, std::allocator<DIS::TrackJamData>>::_Vector_impl" = type { %"struct.std::_Vector_base<DIS::TrackJamData, std::allocator<DIS::TrackJamData>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DIS::TrackJamData, std::allocator<DIS::TrackJamData>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_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(42) ptr @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

; Function Attrs: nounwind
declare void @_ZN3DIS12TrackJamDataD1Ev(ptr noundef nonnull align 8 dereferenceable(42)) 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 @_ZNK3DIS31ElectromagneticEmissionBeamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %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::TrackJamData", 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 = load i32, ptr %3, align 4, !tbaa !9
  %10 = add nsw i32 %9, 1
  store i32 %10, ptr %3, align 4, !tbaa !9
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr %3, align 4, !tbaa !9
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = add nsw i32 %13, 2
  store i32 %14, ptr %3, align 4, !tbaa !9
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = getelementptr inbounds %"class.DIS::ElectromagneticEmissionBeamData", ptr %8, i32 0, i32 5
  %17 = call noundef i32 @_ZNK3DIS26EEFundamentalParameterData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %16)
  %18 = add nsw i32 %15, %17
  store i32 %18, ptr %3, align 4, !tbaa !9
  %19 = load i32, ptr %3, align 4, !tbaa !9
  %20 = getelementptr inbounds %"class.DIS::ElectromagneticEmissionBeamData", ptr %8, i32 0, i32 6
  %21 = call noundef i32 @_ZNK3DIS8BeamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %20)
  %22 = add nsw i32 %19, %21
  store i32 %22, ptr %3, align 4, !tbaa !9
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %3, align 4, !tbaa !9
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %3, align 4, !tbaa !9
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %3, align 4, !tbaa !9
  %29 = load i32, ptr %3, align 4, !tbaa !9
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %3, align 4, !tbaa !9
  %31 = load i32, ptr %3, align 4, !tbaa !9
  %32 = getelementptr inbounds %"class.DIS::ElectromagneticEmissionBeamData", ptr %8, i32 0, i32 12
  %33 = call noundef i32 @_ZNK3DIS16JammingTechnique17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12) %32)
  %34 = add nsw i32 %31, %33
  store i32 %34, 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 %35

35:                                               ; preds = %49, %1
  %36 = load i64, ptr %4, align 8, !tbaa !11
  %37 = getelementptr inbounds %"class.DIS::ElectromagneticEmissionBeamData", ptr %8, i32 0, i32 13
  %38 = call noundef i64 @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #6
  %39 = icmp ult i64 %36, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #6
  %42 = getelementptr inbounds %"class.DIS::ElectromagneticEmissionBeamData", ptr %8, i32 0, i32 13
  %43 = load i64, ptr %4, align 8, !tbaa !11
  %44 = call noundef nonnull align 8 dereferenceable(42) ptr @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %43) #6
  call void @_ZN3DIS12TrackJamDataC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(42) %5, ptr noundef nonnull align 8 dereferenceable(42) %44) #6
  %45 = load i32, ptr %3, align 4, !tbaa !9
  %46 = invoke noundef i32 @_ZNK3DIS12TrackJamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(42) %5)
          to label %47 unwind label %52

47:                                               ; preds = %41
  %48 = add nsw i32 %45, %46
  store i32 %48, ptr %3, align 4, !tbaa !9
  call void @_ZN3DIS12TrackJamDataD1Ev(ptr noundef nonnull align 8 dereferenceable(42) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #6
  br label %49

49:                                               ; preds = %47
  %50 = load i64, ptr %4, align 8, !tbaa !11
  %51 = add i64 %50, 1
  store i64 %51, ptr %4, align 8, !tbaa !11
  br label %35, !llvm.loop !13

52:                                               ; preds = %41
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %6, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %7, align 4
  call void @_ZN3DIS12TrackJamDataD1Ev(ptr noundef nonnull align 8 dereferenceable(42) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, 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 %58

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

58:                                               ; preds = %52
  %59 = load ptr, ptr %6, align 8
  %60 = load i32, ptr %7, align 4
  %61 = insertvalue { ptr, i32 } poison, ptr %59, 0
  %62 = insertvalue { ptr, i32 } %61, i32 %60, 1
  resume { ptr, i32 } %62
}

declare noundef i32 @_ZNK3DIS26EEFundamentalParameterData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS8BeamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #5

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

declare noundef i32 @_ZNK3DIS12TrackJamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(42)) 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::TrackJamData" = type <{ ptr, %"class.DIS::EntityID", i8, i8, [6 x i8] }>
%"class.DIS::EntityID" = type <{ ptr, %"class.DIS::SimulationAddress", i16, [6 x i8] }>
%"class.DIS::SimulationAddress" = type <{ ptr, i16, i16, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_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(42) ptr @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_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 @_ZN3DIS12TrackJamDataC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(42), ptr noundef nonnull align 8 dereferenceable(42)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN3DIS12TrackJamDataD1Ev(ptr noundef nonnull align 8 dereferenceable(42)) 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 @_ZNK3DIS31ElectromagneticEmissionBeamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.DIS::TrackJamData", align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = tail call noundef i32 @_ZNK3DIS26EEFundamentalParameterData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %3)
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  %6 = tail call noundef i32 @_ZNK3DIS8BeamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %5)
  %7 = getelementptr inbounds i8, ptr %0, i64 88
  %8 = tail call noundef i32 @_ZNK3DIS16JammingTechnique17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12) %7)
  %9 = add i32 %4, 8
  %10 = add i32 %9, %6
  %11 = add nsw i32 %10, %8
  %12 = getelementptr inbounds i8, ptr %0, i64 104
  %13 = tail call noundef i64 @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %16, %1
  %.0.lcssa = phi i32 [ %11, %1 ], [ %17, %16 ]
  ret i32 %.0.lcssa

.lr.ph:                                           ; preds = %1, %16
  %.020 = phi i32 [ %17, %16 ], [ %11, %1 ]
  %.01719 = phi i64 [ %18, %16 ], [ 0, %1 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #6
  %14 = call noundef nonnull align 8 dereferenceable(42) ptr @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %.01719) #6
  call void @_ZN3DIS12TrackJamDataC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(42) %2, ptr noundef nonnull align 8 dereferenceable(42) %14) #6
  %15 = invoke noundef i32 @_ZNK3DIS12TrackJamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(42) %2)
          to label %16 unwind label %21

16:                                               ; preds = %.lr.ph
  %17 = add nsw i32 %15, %.020
  call void @_ZN3DIS12TrackJamDataD1Ev(ptr noundef nonnull align 8 dereferenceable(42) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  %18 = add nuw i64 %.01719, 1
  %19 = call noundef i64 @_ZNKSt6vectorIN3DIS12TrackJamDataESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %20 = icmp ult i64 %18, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !5

21:                                               ; preds = %.lr.ph
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3DIS12TrackJamDataD1Ev(ptr noundef nonnull align 8 dereferenceable(42) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  resume { ptr, i32 } %22
}

declare noundef i32 @_ZNK3DIS26EEFundamentalParameterData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #5

declare noundef i32 @_ZNK3DIS8BeamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #5

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

declare noundef i32 @_ZNK3DIS12TrackJamData17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(42)) 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