; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/AssetLib/FBX (FBXParser)

; 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.Assimp::FBX::Parser" = type <{ ptr, ptr, ptr, ptr, %"class.__gnu_cxx::__normal_iterator", ptr, i8, [7 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN6Assimp14StackAllocator8AllocateEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Assimp3FBX6ParserC2ERKSt6vectorIPKNS0_5TokenESaIS5_EERNS_14StackAllocatorEb(ptr noundef nonnull align 8 dereferenceable(49) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, i1 noundef zeroext %3) unnamed_addr #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %9 = zext i1 %3 to i8
  store i8 %9, ptr %8, align 1, !tbaa !9
  %10 = load ptr, ptr %5, align 8
  %11 = getelementptr inbounds %"class.Assimp::FBX::Parser", ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %12, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.Assimp::FBX::Parser", ptr %10, i32 0, i32 1
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %14, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.Assimp::FBX::Parser", ptr %10, i32 0, i32 2
  store ptr null, ptr %15, align 8, !tbaa !11
  %16 = getelementptr inbounds %"class.Assimp::FBX::Parser", ptr %10, i32 0, i32 3
  store ptr null, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds %"class.Assimp::FBX::Parser", ptr %10, i32 0, i32 4
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = call ptr @_ZNKSt6vectorIPKN6Assimp3FBX5TokenESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  %20 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  %21 = getelementptr inbounds %"class.Assimp::FBX::Parser", ptr %10, i32 0, i32 6
  %22 = load i8, ptr %8, align 1, !tbaa !9, !range !15, !noundef !16
  %23 = trunc i8 %22 to i1
  %24 = zext i1 %23 to i8
  store i8 %24, ptr %21, align 8, !tbaa !17
  %25 = call noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
  call void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12) %25, ptr noundef @.str.10)
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = call noundef ptr @_ZN6Assimp14StackAllocator8AllocateEm(ptr noundef nonnull align 8 dereferenceable(40) %26, i64 noundef 48)
  call void @_ZN6Assimp3FBX5ScopeC1ERNS0_6ParserEb(ptr noundef nonnull align 8 dereferenceable(48) %27, ptr noundef nonnull align 8 dereferenceable(49) %10, i1 noundef zeroext true)
  %28 = getelementptr inbounds %"class.Assimp::FBX::Parser", ptr %10, i32 0, i32 5
  store ptr %27, ptr %28, align 8, !tbaa !18
  ret void
}

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

declare noundef ptr @_ZN6Assimp13DefaultLogger3getEv() #3

declare void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) #3

declare void @_ZN6Assimp3FBX5ScopeC1ERNS0_6ParserEb(ptr, ptr, i1)

attributes #0 = { inlinehint 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 = { 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 #2 = { 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 = { "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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"_ZTSN6Assimp3FBX6ParserE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !6, i64 40, !10, i64 48}
!13 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPKPKN6Assimp3FBX5TokenESt6vectorIS5_SaIS5_EEEE", !6, i64 0}
!14 = !{!12, !6, i64 24}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!12, !10, i64 48}
!18 = !{!12, !6, i64 40}


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

@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN6Assimp14StackAllocator8AllocateEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Assimp3FBX6ParserC2ERKSt6vectorIPKNS0_5TokenESaIS5_EERNS_14StackAllocatorEb(ptr noundef nonnull align 8 dereferenceable(49) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, i1 noundef zeroext %3) unnamed_addr #1 align 2 {
  %5 = zext i1 %3 to i8
  store ptr %1, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, i8 0, i64 16, i1 false)
  %9 = tail call ptr @_ZNKSt6vectorIPKN6Assimp3FBX5TokenESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  store ptr %9, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 %5, ptr %10, align 8, !tbaa !9
  %11 = tail call noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
  tail call void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12) %11, ptr noundef nonnull @.str.10)
  %12 = tail call noundef ptr @_ZN6Assimp14StackAllocator8AllocateEm(ptr noundef nonnull align 8 dereferenceable(40) %2, i64 noundef 48)
  tail call void @_ZN6Assimp3FBX5ScopeC1ERNS0_6ParserEb(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(49) %0, i1 noundef zeroext true)
  %13 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %12, ptr %13, align 8, !tbaa !13
  ret void
}

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

declare noundef ptr @_ZN6Assimp13DefaultLogger3getEv() local_unnamed_addr #3

declare void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) local_unnamed_addr #3

declare void @_ZN6Assimp3FBX5ScopeC1ERNS0_6ParserEb(ptr, ptr, i1) local_unnamed_addr

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { inlinehint 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 = { 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 #2 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !12, i64 48}
!10 = !{!"_ZTSN6Assimp3FBX6ParserE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !6, i64 40, !12, i64 48}
!11 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPKPKN6Assimp3FBX5TokenESt6vectorIS5_SaIS5_EEEE", !6, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!10, !6, i64 40}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass