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

; 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::TwoByteChunk" = type <{ ptr, [2 x i8], [6 x i8] }>
%"class.DIS::GridAxisRecordRepresentation1" = type { %"class.DIS::GridAxisRecord.base", float, float, i16, %"class.std::vector" }
%"class.DIS::GridAxisRecord.base" = type <{ ptr, i16, i16 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3DIS12TwoByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(10)) 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 @_ZNK3DIS29GridAxisRecordRepresentation117getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(48) %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::TwoByteChunk", 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 @_ZNK3DIS14GridAxisRecord17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12) %8)
  store i32 %9, ptr %3, align 4, !tbaa !9
  %10 = load i32, ptr %3, align 4, !tbaa !9
  %11 = add nsw i32 %10, 4
  store i32 %11, ptr %3, align 4, !tbaa !9
  %12 = load i32, ptr %3, align 4, !tbaa !9
  %13 = add nsw i32 %12, 4
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !11
  br label %16

16:                                               ; preds = %30, %1
  %17 = load i64, ptr %4, align 8, !tbaa !11
  %18 = getelementptr inbounds %"class.DIS::GridAxisRecordRepresentation1", ptr %8, i32 0, i32 4
  %19 = call noundef i64 @_ZNKSt6vectorIN3DIS12TwoByteChunkESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %20 = icmp ult i64 %17, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %23 = getelementptr inbounds %"class.DIS::GridAxisRecordRepresentation1", ptr %8, i32 0, i32 4
  %24 = load i64, ptr %4, align 8, !tbaa !11
  %25 = call noundef nonnull align 8 dereferenceable(10) ptr @_ZNKSt6vectorIN3DIS12TwoByteChunkESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %24) #6
  call void @_ZN3DIS12TwoByteChunkC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(10) %5, ptr noundef nonnull align 8 dereferenceable(10) %25) #6
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = invoke noundef i32 @_ZNK3DIS12TwoByteChunk17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(10) %5)
          to label %28 unwind label %33

28:                                               ; preds = %22
  %29 = add nsw i32 %26, %27
  store i32 %29, ptr %3, align 4, !tbaa !9
  call void @_ZN3DIS12TwoByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(10) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  br label %30

30:                                               ; preds = %28
  %31 = load i64, ptr %4, align 8, !tbaa !11
  %32 = add i64 %31, 1
  store i64 %32, ptr %4, align 8, !tbaa !11
  br label %16, !llvm.loop !13

33:                                               ; preds = %22
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %6, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %7, align 4
  call void @_ZN3DIS12TwoByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(10) %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 %39

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

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

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

declare noundef i32 @_ZNK3DIS12TwoByteChunk17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(10)) 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::TwoByteChunk" = type <{ ptr, [2 x i8], [6 x i8] }>

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3DIS12TwoByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(10)) 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 @_ZNK3DIS29GridAxisRecordRepresentation117getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(48) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.DIS::TwoByteChunk", align 8
  %3 = tail call noundef i32 @_ZNK3DIS14GridAxisRecord17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(12) %0)
  %4 = add nsw i32 %3, 10
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = tail call noundef i64 @_ZNKSt6vectorIN3DIS12TwoByteChunkESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %9, %1
  %.0.lcssa = phi i32 [ %4, %1 ], [ %10, %9 ]
  ret i32 %.0.lcssa

.lr.ph:                                           ; preds = %1, %9
  %.013 = phi i32 [ %10, %9 ], [ %4, %1 ]
  %.01012 = phi i64 [ %11, %9 ], [ 0, %1 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  %7 = call noundef nonnull align 8 dereferenceable(10) ptr @_ZNKSt6vectorIN3DIS12TwoByteChunkESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.01012) #6
  call void @_ZN3DIS12TwoByteChunkC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(10) %2, ptr noundef nonnull align 8 dereferenceable(10) %7) #6
  %8 = invoke noundef i32 @_ZNK3DIS12TwoByteChunk17getMarshalledSizeEv(ptr noundef nonnull align 8 dereferenceable(10) %2)
          to label %9 unwind label %14

9:                                                ; preds = %.lr.ph
  %10 = add nsw i32 %8, %.013
  call void @_ZN3DIS12TwoByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(10) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  %11 = add nuw i64 %.01012, 1
  %12 = call noundef i64 @_ZNKSt6vectorIN3DIS12TwoByteChunkESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %13 = icmp ult i64 %11, %12
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !5

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

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

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