; LLVM IR from AF-GRILL/DISPluginForUnreal :: Source/ThirdParty/include/dis6 (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, [7 x i8], %"class.DIS::SixByteChunk", %"class.DIS::Vector3Double", %"class.DIS::Orientation", i16, i16, i16, i16, i32, [4 x i8] }>
%"class.DIS::SixByteChunk" = type <{ ptr, [6 x i8], [2 x i8] }>
%"class.DIS::Vector3Double" = type { ptr, double, double, double }
%"class.DIS::Orientation" = 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(100) %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 3
  call void @_ZN3DIS12SixByteChunkC1Ev(ptr noundef nonnull align 8 dereferenceable(14) %7)
  %8 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 4
  invoke void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %9 unwind label %17

9:                                                ; preds = %1
  %10 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 5
  invoke void @_ZN3DIS11OrientationC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %10)
          to label %11 unwind label %21

11:                                               ; preds = %9
  %12 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 6
  store i16 0, ptr %12, align 8, !tbaa !20
  %13 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 7
  store i16 0, ptr %13, align 2, !tbaa !21
  %14 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 8
  store i16 0, ptr %14, align 4, !tbaa !22
  %15 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 9
  store i16 0, ptr %15, align 2, !tbaa !23
  %16 = getelementptr inbounds %"class.DIS::LinearSegmentParameter", ptr %5, i32 0, i32 10
  store i32 0, ptr %16, align 8, !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
  br label %25

21:                                               ; preds = %9
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %3, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %4, align 4
  call void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #3
  br label %25

25:                                               ; preds = %21, %17
  call void @_ZN3DIS12SixByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %7) #3
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr %3, align 8
  %28 = load i32, ptr %4, align 4
  %29 = insertvalue { ptr, i32 } poison, ptr %27, 0
  %30 = insertvalue { ptr, i32 } %29, i32 %28, 1
  resume { ptr, i32 } %30
}

declare void @_ZN3DIS12SixByteChunkC1Ev(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nounwind
declare void @_ZN3DIS12SixByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(14)) 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, !13, i64 16, !14, i64 32, !16, i64 64, !18, i64 88, !18, i64 90, !18, i64 92, !18, i64 94, !19, i64 96}
!13 = !{!"_ZTSN3DIS12SixByteChunkE", !7, i64 8}
!14 = !{!"_ZTSN3DIS13Vector3DoubleE", !15, i64 8, !15, i64 16, !15, i64 24}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN3DIS11OrientationE", !17, i64 8, !17, i64 12, !17, i64 16}
!17 = !{!"float", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!12, !18, i64 88}
!21 = !{!12, !18, i64 90}
!22 = !{!12, !18, i64 92}
!23 = !{!12, !18, i64 94}
!24 = !{!12, !19, i64 96}


; 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(100) %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
  store i8 0, ptr %2, align 8, !tbaa !8
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZN3DIS12SixByteChunkC1Ev(ptr noundef nonnull align 8 dereferenceable(14) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  invoke void @_ZN3DIS13Vector3DoubleC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %5 unwind label %9

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 64
  invoke void @_ZN3DIS11OrientationC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %6)
          to label %7 unwind label %11

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %8, i8 0, i64 12, i1 false)
  ret void

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

11:                                               ; preds = %5
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3DIS13Vector3DoubleD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br label %13

13:                                               ; preds = %11, %9
  %.pn = phi { ptr, i32 } [ %12, %11 ], [ %10, %9 ]
  tail call void @_ZN3DIS12SixByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(14) %3) #4
  resume { ptr, i32 } %.pn
}

declare void @_ZN3DIS12SixByteChunkC1Ev(ptr noundef nonnull align 8 dereferenceable(14)) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nounwind
declare void @_ZN3DIS12SixByteChunkD1Ev(ptr noundef nonnull align 8 dereferenceable(14)) 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"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTSN3DIS22LinearSegmentParameterE", !10, i64 8, !11, i64 16, !12, i64 32, !14, i64 64, !16, i64 88, !16, i64 90, !16, i64 92, !16, i64 94, !17, i64 96}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!"_ZTSN3DIS12SixByteChunkE", !10, i64 8}
!12 = !{!"_ZTSN3DIS13Vector3DoubleE", !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"double", !10, i64 0}
!14 = !{!"_ZTSN3DIS11OrientationE", !15, i64 8, !15, i64 12, !15, i64 16}
!15 = !{!"float", !10, i64 0}
!16 = !{!"short", !10, i64 0}
!17 = !{!"int", !10, i64 0}


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