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

; 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::LinearSegmentParameter" = type { ptr, i8, i8, i16, i16, %"class.DIS::Vector3Double", %"class.DIS::EulerAngles", i16, i16, i16, i16 }
%"class.DIS::Vector3Double" = type { ptr, double, double, double }
%"class.DIS::EulerAngles" = type <{ ptr, float, float, float, [4 x i8] }>

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3DIS22LinearSegmentParameterC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %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
  store ptr getelementptr inbounds inrange(-16, 40) ({ [7 x ptr] }, ptr @_ZTVN3DIS22LinearSegmentParameterE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 1
  store i8 0, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 2
  store i8 0, ptr %7, align 1, !tbaa !18
  %8 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 3
  store i16 0, ptr %8, align 2, !tbaa !19
  %9 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 4
  store i16 0, ptr %9, align 4, !tbaa !20
  %10 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 5
  call void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %11 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 6
  invoke void @_ZN3DIS11EulerAnglesC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %11)
          to label %12 unwind label %17

12:                                               ; preds = %1
  %13 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 7
  store i16 0, ptr %13, align 8, !tbaa !21
  %14 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 8
  store i16 0, ptr %14, align 2, !tbaa !22
  %15 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 9
  store i16 0, ptr %15, align 4, !tbaa !23
  %16 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 10
  store i16 0, ptr %16, align 2, !tbaa !24
  ret void

17:                                               ; preds = %1
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = extractvalue { ptr, i32 } %18, 0
  store ptr %19, ptr %3, align 8
  %20 = extractvalue { ptr, i32 } %18, 1
  store i32 %20, ptr %4, align 4
  call void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #3
  br label %21

21:                                               ; preds = %17
  %22 = load ptr, ptr %3, align 8
  %23 = load i32, ptr %4, align 4
  %24 = insertvalue { ptr, i32 } poison, ptr %22, 0
  %25 = insertvalue { ptr, i32 } %24, i32 %23, 1
  resume { ptr, i32 } %25
}

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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, !7, i64 8}
!12 = !{!"_ZTSN3DIS22LinearSegmentParameterE", !7, i64 8, !7, i64 9, !13, i64 10, !13, i64 12, !14, i64 16, !16, i64 48, !13, i64 72, !13, i64 74, !13, i64 76, !13, i64 78}
!13 = !{!"short", !7, i64 0}
!14 = !{!"_ZTSN3DIS13Vector3DoubleE", !15, i64 8, !15, i64 16, !15, i64 24}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN3DIS11EulerAnglesE", !17, i64 8, !17, i64 12, !17, i64 16}
!17 = !{!"float", !7, i64 0}
!18 = !{!12, !7, i64 9}
!19 = !{!12, !13, i64 10}
!20 = !{!12, !13, i64 12}
!21 = !{!12, !13, i64 72}
!22 = !{!12, !13, i64 74}
!23 = !{!12, !13, i64 76}
!24 = !{!12, !13, i64 78}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3DIS22LinearSegmentParameterC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 40) (i8, ptr @_ZTVN3DIS22LinearSegmentParameterE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(6) %2, i8 0, i64 6, i1 false)
  tail call void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  invoke void @_ZN3DIS11EulerAnglesC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %4)
          to label %5 unwind label %7

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 0, ptr %6, align 8
  ret void

7:                                                ; preds = %1
  %8 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  resume { ptr, i32 } %8
}

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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: EarlyCSEPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass