; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/AssetLib/Obj (ObjFileParser)

; 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::ObjFileParser" = type { %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.std::unique_ptr", i32, [4096 x i8], ptr, ptr, ptr, %"class.std::__cxx11::basic_string" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN6Assimp13ObjFileParser32getNumComponentsInDataDefinitionEv(ptr noundef nonnull align 8 dereferenceable(4184) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %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 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %9 = getelementptr inbounds %"class.Assimp::ObjFileParser", ptr %8, i32 0, i32 0
  %10 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 0) #5
  store ptr %10, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 0, ptr %5, align 1, !tbaa !11
  br label %11

11:                                               ; preds = %57, %1
  %12 = load i8, ptr %5, align 1, !tbaa !11, !range !13, !noundef !14
  %13 = trunc i8 %12 to i1
  %14 = xor i1 %13, true
  br i1 %14, label %15, label %58

15:                                               ; preds = %11
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef zeroext i1 @_ZN6AssimpL19isDataDefinitionEndEPKc(ptr noundef %16)
  br i1 %17, label %18, label %21

18:                                               ; preds = %15
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 2
  store ptr %20, ptr %4, align 8, !tbaa !5
  br label %27

21:                                               ; preds = %15
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load i8, ptr %22, align 1, !tbaa !15
  %24 = call noundef zeroext i1 @_ZN6Assimp9IsLineEndIcEEbT_(i8 noundef signext %23)
  br i1 %24, label %25, label %26

25:                                               ; preds = %21
  store i8 1, ptr %5, align 1, !tbaa !11
  br label %26

26:                                               ; preds = %25, %21
  br label %27

27:                                               ; preds = %26, %18
  %28 = getelementptr inbounds %"class.Assimp::ObjFileParser", ptr %8, i32 0, i32 5
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = call noundef zeroext i1 @_ZN6Assimp10SkipSpacesIcEEbPPKT_S3_(ptr noundef %4, ptr noundef %29)
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  br label %58

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load i8, ptr %33, align 1, !tbaa !15
  %35 = call noundef zeroext i1 @_ZN6Assimp9IsNumericIcEEbT_(i8 noundef signext %34)
  br i1 %35, label %39, label %36

36:                                               ; preds = %32
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZN6AssimpL10isNanOrInfEPKc(ptr noundef %37)
  br label %39

39:                                               ; preds = %36, %32
  %40 = phi i1 [ true, %32 ], [ %38, %36 ]
  %41 = zext i1 %40 to i8
  store i8 %41, ptr %6, align 1, !tbaa !11
  %42 = getelementptr inbounds %"class.Assimp::ObjFileParser", ptr %8, i32 0, i32 5
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  call void @_ZN6Assimp9SkipTokenERPKcS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %43)
  %44 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %49

46:                                               ; preds = %39
  %47 = load i64, ptr %3, align 8, !tbaa !9
  %48 = add i64 %47, 1
  store i64 %48, ptr %3, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %46, %39
  %50 = getelementptr inbounds %"class.Assimp::ObjFileParser", ptr %8, i32 0, i32 5
  %51 = load ptr, ptr %50, align 8, !tbaa !16
  %52 = call noundef zeroext i1 @_ZN6Assimp10SkipSpacesIcEEbPPKT_S3_(ptr noundef %4, ptr noundef %51)
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 3, ptr %7, align 4
  br label %55

54:                                               ; preds = %49
  store i32 0, ptr %7, align 4
  br label %55

55:                                               ; preds = %54, %53
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  %56 = load i32, ptr %7, align 4
  switch i32 %56, label %60 [
    i32 0, label %57
    i32 3, label %58
  ]

57:                                               ; preds = %55
  br label %11, !llvm.loop !28

58:                                               ; preds = %55, %31, %11
  %59 = load i64, ptr %3, align 8, !tbaa !9
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret i64 %59

60:                                               ; preds = %55
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEixEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN6AssimpL19isDataDefinitionEndEPKc(ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Assimp9IsLineEndIcEEbT_(i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6Assimp10SkipSpacesIcEEbPPKT_S3_(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Assimp9IsNumericIcEEbT_(i8 noundef signext) #3

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN6AssimpL10isNanOrInfEPKc(ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Assimp9SkipTokenERPKcS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !6, i64 4128}
!17 = !{!"_ZTSN6Assimp13ObjFileParserE", !18, i64 0, !18, i64 8, !19, i64 16, !25, i64 24, !7, i64 28, !6, i64 4128, !6, i64 4136, !6, i64 4144, !26, i64 4152}
!18 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEE", !6, i64 0}
!19 = !{!"_ZTSSt10unique_ptrIN6Assimp7ObjFile5ModelESt14default_deleteIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_dataIN6Assimp7ObjFile5ModelESt14default_deleteIS2_ELb1ELb1EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_implIN6Assimp7ObjFile5ModelESt14default_deleteIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt5tupleIJPN6Assimp7ObjFile5ModelESt14default_deleteIS2_EEE", !23, i64 0}
!23 = !{!"_ZTSSt11_Tuple_implILm0EJPN6Assimp7ObjFile5ModelESt14default_deleteIS2_EEE", !24, i64 0}
!24 = !{!"_ZTSSt10_Head_baseILm0EPN6Assimp7ObjFile5ModelELb0EE", !6, i64 0}
!25 = !{!"int", !7, i64 0}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !27, i64 0, !10, i64 8, !7, i64 16}
!27 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"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"

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN6Assimp13ObjFileParser32getNumComponentsInDataDefinitionEv(ptr noundef nonnull align 8 dereferenceable(4184) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %3 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %0, i64 noundef 0) #5
  store ptr %3, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 4128
  br label %5

5:                                                ; preds = %28, %1
  %.06 = phi i1 [ false, %1 ], [ %.17, %28 ]
  %.05 = phi i64 [ 0, %1 ], [ %spec.select9, %28 ]
  br i1 %.06, label %31, label %6

6:                                                ; preds = %5
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = call noundef zeroext i1 @_ZN6AssimpL19isDataDefinitionEndEPKc(ptr noundef %7)
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  br i1 %8, label %10, label %12

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %9, i64 2
  store ptr %11, ptr %2, align 8, !tbaa !5
  br label %15

12:                                               ; preds = %6
  %13 = load i8, ptr %9, align 1, !tbaa !9
  %14 = call noundef zeroext i1 @_ZN6Assimp9IsLineEndIcEEbT_(i8 noundef signext %13)
  br label %15

15:                                               ; preds = %12, %10
  %.17 = phi i1 [ false, %10 ], [ %14, %12 ]
  %16 = load ptr, ptr %4, align 8, !tbaa !10
  %17 = call noundef zeroext i1 @_ZN6Assimp10SkipSpacesIcEEbPPKT_S3_(ptr noundef nonnull %2, ptr noundef %16)
  br i1 %17, label %18, label %31

18:                                               ; preds = %15
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = call noundef zeroext i1 @_ZN6Assimp9IsNumericIcEEbT_(i8 noundef signext %20)
  br i1 %21, label %.thread, label %23

.thread:                                          ; preds = %18
  %22 = load ptr, ptr %4, align 8, !tbaa !10
  call void @_ZN6Assimp9SkipTokenERPKcS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %22)
  br label %28

23:                                               ; preds = %18
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = call noundef zeroext i1 @_ZN6AssimpL10isNanOrInfEPKc(ptr noundef %24)
  %26 = load ptr, ptr %4, align 8, !tbaa !10
  call void @_ZN6Assimp9SkipTokenERPKcS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %26)
  %27 = zext i1 %25 to i64
  br label %28

28:                                               ; preds = %23, %.thread
  %.sink = phi i64 [ %27, %23 ], [ 1, %.thread ]
  %spec.select9 = add i64 %.05, %.sink
  %29 = load ptr, ptr %4, align 8, !tbaa !10
  %30 = call noundef zeroext i1 @_ZN6Assimp10SkipSpacesIcEEbPPKT_S3_(ptr noundef nonnull %2, ptr noundef %29)
  br i1 %30, label %5, label %31

31:                                               ; preds = %28, %15, %5
  %.2 = phi i64 [ %spec.select9, %28 ], [ %.05, %15 ], [ %.05, %5 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret i64 %.2
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEixEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN6AssimpL19isDataDefinitionEndEPKc(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Assimp9IsLineEndIcEEbT_(i8 noundef signext) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6Assimp10SkipSpacesIcEEbPPKT_S3_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Assimp9IsNumericIcEEbT_(i8 noundef signext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN6AssimpL10isNanOrInfEPKc(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Assimp9SkipTokenERPKcS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 4128}
!11 = !{!"_ZTSN6Assimp13ObjFileParserE", !12, i64 0, !12, i64 8, !13, i64 16, !19, i64 24, !7, i64 28, !6, i64 4128, !6, i64 4136, !6, i64 4144, !20, i64 4152}
!12 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEE", !6, i64 0}
!13 = !{!"_ZTSSt10unique_ptrIN6Assimp7ObjFile5ModelESt14default_deleteIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIN6Assimp7ObjFile5ModelESt14default_deleteIS2_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIN6Assimp7ObjFile5ModelESt14default_deleteIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPN6Assimp7ObjFile5ModelESt14default_deleteIS2_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPN6Assimp7ObjFile5ModelESt14default_deleteIS2_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EPN6Assimp7ObjFile5ModelELb0EE", !6, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !22, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!"long", !7, i64 0}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass