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

@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [67 x i8], align 1

; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK6Assimp3FBX5Token4TypeEv(ptr noundef nonnull align 8 dereferenceable(36)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6Assimp3FBX5Token8IsBinaryEv(ptr noundef nonnull align 8 dereferenceable(36)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN6Assimp3FBX17ParseTokenAsFloatERKNS0_5TokenERPKc(ptr noundef nonnull align 8 dereferenceable(36) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #2 {
  %3 = alloca float, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca [32 x i8], align 16
  %10 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr null, ptr %11, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noundef i32 @_ZNK6Assimp3FBX5Token4TypeEv(ptr noundef nonnull align 8 dereferenceable(36) %12)
  %14 = icmp ne i32 %13, 2
  br i1 %14, label %15, label %17

15:                                               ; preds = %2
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr @.str.11, ptr %16, align 8, !tbaa !5
  store float 0.000000e+00, ptr %3, align 4
  br label %80

17:                                               ; preds = %2
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef zeroext i1 @_ZNK6Assimp3FBX5Token8IsBinaryEv(ptr noundef nonnull align 8 dereferenceable(36) %18)
  br i1 %19, label %20, label %56

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noundef ptr @_ZNK6Assimp3FBX5Token5beginEv(ptr noundef nonnull align 8 dereferenceable(36) %21)
  store ptr %22, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 0
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = icmp ne i32 %26, 70
  br i1 %27, label %28, label %36

28:                                               ; preds = %20
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 0
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = icmp ne i32 %32, 68
  br i1 %33, label %34, label %36

34:                                               ; preds = %28
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr @.str.18, ptr %35, align 8, !tbaa !5
  store float 0.000000e+00, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %55

36:                                               ; preds = %28, %20
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 0
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = sext i8 %39 to i32
  %41 = icmp eq i32 %40, 70
  br i1 %41, label %42, label %48

42:                                               ; preds = %36
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %45)
  %47 = call noundef float @_ZN12_GLOBAL__N_19SafeParseIfEET_PKcS3_(ptr noundef %44, ptr noundef %46)
  store float %47, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %55

48:                                               ; preds = %36
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 1
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %51)
  %53 = call noundef double @_ZN12_GLOBAL__N_19SafeParseIdEET_PKcS3_(ptr noundef %50, ptr noundef %52)
  %54 = fptrunc double %53 to float
  store float %54, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %55

55:                                               ; preds = %48, %42, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %80

56:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %57)
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = call noundef ptr @_ZNK6Assimp3FBX5Token5beginEv(ptr noundef nonnull align 8 dereferenceable(36) %59)
  %61 = ptrtoint ptr %58 to i64
  %62 = ptrtoint ptr %60 to i64
  %63 = sub i64 %61, %62
  store i64 %63, ptr %8, align 8, !tbaa !10
  %64 = load i64, ptr %8, align 8, !tbaa !10
  %65 = icmp ugt i64 %64, 31
  br i1 %65, label %66, label %67

66:                                               ; preds = %56
  store float 0.000000e+00, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %79

67:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = call noundef ptr @_ZNK6Assimp3FBX5Token5beginEv(ptr noundef nonnull align 8 dereferenceable(36) %68)
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %70)
  %72 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %73 = call noundef ptr @_ZSt4copyIPKcPcET0_T_S4_S3_(ptr noundef %69, ptr noundef %71, ptr noundef %72)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 31, ptr %10, align 8, !tbaa !10
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %75 = load i64, ptr %74, align 8, !tbaa !10
  %76 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 %75
  store i8 0, ptr %76, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %77 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %78 = call noundef float @_ZN6Assimp9fast_atofI17DeadlyImportErrorEEfPKc(ptr noundef %77)
  store float %78, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  br label %79

79:                                               ; preds = %67, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %80

80:                                               ; preds = %79, %55, %15
  %81 = load float, ptr %3, align 4
  ret float %81
}

; Function Attrs: mustprogress uwtable
declare hidden noundef float @_ZN12_GLOBAL__N_19SafeParseIfEET_PKcS3_(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden noundef double @_ZN12_GLOBAL__N_19SafeParseIdEET_PKcS3_(ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPKcPcET0_T_S4_S3_(ptr noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN6Assimp9fast_atofI17DeadlyImportErrorEEfPKc(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #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, !11, i64 0}
!11 = !{!"long", !7, i64 0}


; 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.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [67 x i8], align 1

; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK6Assimp3FBX5Token4TypeEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6Assimp3FBX5Token8IsBinaryEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN6Assimp3FBX17ParseTokenAsFloatERKNS0_5TokenERPKc(ptr noundef nonnull align 8 dereferenceable(36) %0, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %1) local_unnamed_addr #2 {
  %3 = alloca i64, align 8
  %4 = alloca [32 x i8], align 16
  %5 = alloca i64, align 8
  store ptr null, ptr %1, align 8, !tbaa !5
  %6 = tail call noundef i32 @_ZNK6Assimp3FBX5Token4TypeEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %.not = icmp eq i32 %6, 2
  br i1 %.not, label %8, label %7

7:                                                ; preds = %2
  store ptr @.str.11, ptr %1, align 8, !tbaa !5
  br label %39

8:                                                ; preds = %2
  %9 = tail call noundef zeroext i1 @_ZNK6Assimp3FBX5Token8IsBinaryEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  br i1 %9, label %10, label %23

10:                                               ; preds = %8
  %11 = tail call noundef ptr @_ZNK6Assimp3FBX5Token5beginEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %12 = load i8, ptr %11, align 1, !tbaa !9
  switch i8 %12, label %13 [
    i8 70, label %14
    i8 68, label %18
  ]

13:                                               ; preds = %10
  store ptr @.str.18, ptr %1, align 8, !tbaa !5
  br label %39

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %11, i64 1
  %16 = tail call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %17 = tail call noundef float @_ZN12_GLOBAL__N_19SafeParseIfEET_PKcS3_(ptr noundef nonnull %15, ptr noundef %16)
  br label %39

18:                                               ; preds = %10
  %19 = getelementptr inbounds i8, ptr %11, i64 1
  %20 = tail call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %21 = tail call noundef double @_ZN12_GLOBAL__N_19SafeParseIdEET_PKcS3_(ptr noundef nonnull %19, ptr noundef %20)
  %22 = fptrunc double %21 to float
  br label %39

23:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %24 = tail call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %25 = tail call noundef ptr @_ZNK6Assimp3FBX5Token5beginEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %26 = ptrtoint ptr %24 to i64
  %27 = ptrtoint ptr %25 to i64
  %28 = sub i64 %26, %27
  store i64 %28, ptr %3, align 8, !tbaa !10
  %29 = icmp ugt i64 %28, 31
  br i1 %29, label %38, label %30

30:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  %31 = tail call noundef ptr @_ZNK6Assimp3FBX5Token5beginEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %32 = tail call noundef ptr @_ZNK6Assimp3FBX5Token3endEv(ptr noundef nonnull align 8 dereferenceable(36) %0)
  %33 = call noundef ptr @_ZSt4copyIPKcPcET0_T_S4_S3_(ptr noundef %31, ptr noundef %32, ptr noundef nonnull %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store i64 31, ptr %5, align 8, !tbaa !10
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %35 = load i64, ptr %34, align 8, !tbaa !10
  %36 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 %35
  store i8 0, ptr %36, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %37 = call noundef float @_ZN6Assimp9fast_atofI17DeadlyImportErrorEEfPKc(ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %38

38:                                               ; preds = %23, %30
  %.1 = phi float [ %37, %30 ], [ 0.000000e+00, %23 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %39

39:                                               ; preds = %13, %14, %18, %38, %7
  %.2 = phi float [ 0.000000e+00, %7 ], [ %.1, %38 ], [ 0.000000e+00, %13 ], [ %17, %14 ], [ %22, %18 ]
  ret float %.2
}

; Function Attrs: mustprogress uwtable
declare hidden noundef float @_ZN12_GLOBAL__N_19SafeParseIfEET_PKcS3_(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden noundef double @_ZN12_GLOBAL__N_19SafeParseIdEET_PKcS3_(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPKcPcET0_T_S4_S3_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN6Assimp9fast_atofI17DeadlyImportErrorEEfPKc(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #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, !11, i64 0}
!11 = !{!"long", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass