; LLVM IR from ASDAlexander77/TypeScriptCompiler :: tsc/tsc-new-parser (scanner)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.ts::Scanner" = type { i32, i32, i8, i32, %"struct.ts::safe_string", i32, i32, i32, i32, i32, %"class.std::__cxx11::basic_string", i32, %"class.std::vector.41", i32, i32, %"class.std::function" }
%"struct.ts::safe_string" = type { %"class.std::__cxx11::basic_string" }
%"class.std::vector.41" = type { %"struct.std::_Vector_base.42" }
%"struct.std::_Vector_base.42" = type { %"struct.std::_Vector_base<ptr<ts::data::CommentDirective>, std::allocator<ptr<ts::data::CommentDirective>>>::_Vector_impl" }
%"struct.std::_Vector_base<ptr<ts::data::CommentDirective>, std::allocator<ptr<ts::data::CommentDirective>>>::_Vector_impl" = type { %"struct.std::_Vector_base<ptr<ts::data::CommentDirective>, std::allocator<ptr<ts::data::CommentDirective>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ptr<ts::data::CommentDirective>, std::allocator<ptr<ts::data::CommentDirective>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

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

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2ts7Scanner17isIdentifierStartE14CharacterCodesNS_12ScriptTargetE(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2ts7Scanner16isIdentifierPartE14CharacterCodesNS_12ScriptTargetENS_15LanguageVariantE(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts7Scanner11codePointAtERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ts7Scanner19scanIdentifierPartsB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(176)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts7Scanner18getIdentifierTokenEv(ptr noundef nonnull align 8 dereferenceable(176)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner14scanIdentifierE14CharacterCodesNS_12ScriptTargetE(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  %14 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %15 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %15, ptr %8, align 4, !tbaa !9
  %16 = load i32, ptr %8, align 4, !tbaa !9
  %17 = load i32, ptr %7, align 4, !tbaa !11
  %18 = call noundef zeroext i1 @_ZN2ts7Scanner17isIdentifierStartE14CharacterCodesNS_12ScriptTargetE(ptr noundef nonnull align 8 dereferenceable(176) %14, i32 noundef %16, i32 noundef %17)
  br i1 %18, label %19, label %66

19:                                               ; preds = %3
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = call noundef i32 @_ZN2ts7Scanner8charSizeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %14, i32 noundef %20)
  %22 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 5
  %23 = load i32, ptr %22, align 8, !tbaa !13
  %24 = add nsw i32 %23, %21
  store i32 %24, ptr %22, align 8, !tbaa !13
  br label %25

25:                                               ; preds = %40, %19
  %26 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 5
  %27 = load i32, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 6
  %29 = load i32, ptr %28, align 4, !tbaa !32
  %30 = icmp slt i32 %27, %29
  br i1 %30, label %31, label %38

31:                                               ; preds = %25
  %32 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 4
  %33 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 5
  %34 = load i32, ptr %33, align 8, !tbaa !13
  %35 = call noundef i32 @_ZN2ts7Scanner11codePointAtERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %14, ptr noundef nonnull align 8 dereferenceable(32) %32, i32 noundef %34)
  store i32 %35, ptr %8, align 4, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !11
  %37 = call noundef zeroext i1 @_ZN2ts7Scanner16isIdentifierPartE14CharacterCodesNS_12ScriptTargetENS_15LanguageVariantE(ptr noundef nonnull align 8 dereferenceable(176) %14, i32 noundef %35, i32 noundef %36, i32 noundef 0)
  br label %38

38:                                               ; preds = %31, %25
  %39 = phi i1 [ false, %25 ], [ %37, %31 ]
  br i1 %39, label %40, label %46

40:                                               ; preds = %38
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = call noundef i32 @_ZN2ts7Scanner8charSizeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %14, i32 noundef %41)
  %43 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 5
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %45 = add nsw i32 %44, %42
  store i32 %45, ptr %43, align 8, !tbaa !13
  br label %25, !llvm.loop !33

46:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #3
  %47 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 4
  %48 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 8
  %49 = load i32, ptr %48, align 4, !tbaa !35
  %50 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 5
  %51 = load i32, ptr %50, align 8, !tbaa !13
  call void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %47, i32 noundef %49, i32 noundef %51)
  %52 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 10
  %53 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %52, ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 92
  br i1 %55, label %56, label %64

56:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #3
  call void @_ZN2ts7Scanner19scanIdentifierPartsB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef nonnull align 8 dereferenceable(176) %14)
  %57 = getelementptr inbounds %"class.ts::Scanner", ptr %14, i32 0, i32 10
  %58 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %57, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %59 unwind label %60

59:                                               ; preds = %56
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #3
  br label %64

60:                                               ; preds = %56
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %11, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %69

64:                                               ; preds = %59, %46
  %65 = call noundef i32 @_ZN2ts7Scanner18getIdentifierTokenEv(ptr noundef nonnull align 8 dereferenceable(176) %14)
  store i32 %65, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %67

66:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %67

67:                                               ; preds = %66, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %68 = load i32, ptr %4, align 4
  ret i32 %68

69:                                               ; preds = %60
  %70 = load ptr, ptr %11, align 8
  %71 = load i32, ptr %12, align 4
  %72 = insertvalue { ptr, i32 } poison, ptr %70, 0
  %73 = insertvalue { ptr, i32 } %72, i32 %71, 1
  resume { ptr, i32 } %73
}

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 = { 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 = !{!"_ZTS14CharacterCodes", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN2ts12ScriptTargetE", !7, i64 0}
!13 = !{!14, !22, i64 48}
!14 = !{!"_ZTSN2ts7ScannerE", !15, i64 0, !12, i64 4, !16, i64 8, !17, i64 12, !18, i64 16, !22, i64 48, !22, i64 52, !22, i64 56, !22, i64 60, !23, i64 64, !19, i64 72, !24, i64 104, !25, i64 112, !22, i64 136, !29, i64 140, !30, i64 144}
!15 = !{!"_ZTSN2ts10ScriptKindE", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN2ts15LanguageVariantE", !7, i64 0}
!18 = !{!"_ZTSN2ts11safe_stringE", !19, i64 0}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE", !20, i64 0, !21, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!"_ZTS10SyntaxKind", !7, i64 0}
!24 = !{!"_ZTSN2ts10TokenFlagsE", !7, i64 0}
!25 = !{!"_ZTSSt6vectorI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSN2ts16JSDocParsingModeE", !7, i64 0}
!30 = !{!"_ZTSSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEE", !31, i64 0, !6, i64 24}
!31 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!32 = !{!14, !22, i64 52}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!14, !22, i64 60}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

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

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2ts7Scanner17isIdentifierStartE14CharacterCodesNS_12ScriptTargetE(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2ts7Scanner16isIdentifierPartE14CharacterCodesNS_12ScriptTargetENS_15LanguageVariantE(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts7Scanner11codePointAtERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ts7Scanner19scanIdentifierPartsB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts7Scanner18getIdentifierTokenEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner14scanIdentifierE14CharacterCodesNS_12ScriptTargetE(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = tail call noundef zeroext i1 @_ZN2ts7Scanner17isIdentifierStartE14CharacterCodesNS_12ScriptTargetE(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2)
  br i1 %6, label %7, label %39

7:                                                ; preds = %3
  %8 = tail call noundef i32 @_ZN2ts7Scanner8charSizeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1)
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = add nsw i32 %10, %8
  %12 = getelementptr inbounds i8, ptr %0, i64 52
  store i32 %11, ptr %9, align 8, !tbaa !5
  %13 = load i32, ptr %12, align 4, !tbaa !28
  %14 = icmp slt i32 %11, %13
  br i1 %14, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %7
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  br label %16

16:                                               ; preds = %.lr.ph, %19
  %storemerge12 = phi i32 [ %11, %.lr.ph ], [ %22, %19 ]
  %17 = tail call noundef i32 @_ZN2ts7Scanner11codePointAtERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %storemerge12)
  %18 = tail call noundef zeroext i1 @_ZN2ts7Scanner16isIdentifierPartE14CharacterCodesNS_12ScriptTargetENS_15LanguageVariantE(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %17, i32 noundef %2, i32 noundef 0)
  br i1 %18, label %19, label %..critedge.loopexit_crit_edge

..critedge.loopexit_crit_edge:                    ; preds = %16
  %.pre.pre = load i32, ptr %9, align 8, !tbaa !5
  br label %.critedge

19:                                               ; preds = %16
  %20 = tail call noundef i32 @_ZN2ts7Scanner8charSizeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %17)
  %21 = load i32, ptr %9, align 8, !tbaa !5
  %22 = add nsw i32 %21, %20
  store i32 %22, ptr %9, align 8, !tbaa !5
  %23 = load i32, ptr %12, align 4, !tbaa !28
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %16, label %.critedge, !llvm.loop !29

.critedge:                                        ; preds = %19, %..critedge.loopexit_crit_edge, %7
  %25 = phi i32 [ %11, %7 ], [ %.pre.pre, %..critedge.loopexit_crit_edge ], [ %22, %19 ]
  %.1 = phi i32 [ %1, %7 ], [ %17, %..critedge.loopexit_crit_edge ], [ %17, %19 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = getelementptr inbounds i8, ptr %0, i64 60
  %28 = load i32, ptr %27, align 4, !tbaa !31
  call void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %26, i32 noundef %28, i32 noundef %25)
  %29 = getelementptr inbounds i8, ptr %0, i64 72
  %30 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  %31 = icmp eq i32 %.1, 92
  br i1 %31, label %32, label %37

32:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  call void @_ZN2ts7Scanner19scanIdentifierPartsB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(176) %0)
  %33 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %34 unwind label %35

34:                                               ; preds = %32
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  br label %37

35:                                               ; preds = %32
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  resume { ptr, i32 } %36

37:                                               ; preds = %34, %.critedge
  %38 = call noundef i32 @_ZN2ts7Scanner18getIdentifierTokenEv(ptr noundef nonnull align 8 dereferenceable(176) %0)
  br label %39

39:                                               ; preds = %3, %37
  %.0 = phi i32 [ %38, %37 ], [ 0, %3 ]
  ret i32 %.0
}

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 = { 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, !18, i64 48}
!6 = !{!"_ZTSN2ts7ScannerE", !7, i64 0, !10, i64 4, !11, i64 8, !12, i64 12, !13, i64 16, !18, i64 48, !18, i64 52, !18, i64 56, !18, i64 60, !19, i64 64, !14, i64 72, !20, i64 104, !21, i64 112, !18, i64 136, !25, i64 140, !26, i64 144}
!7 = !{!"_ZTSN2ts10ScriptKindE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN2ts12ScriptTargetE", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN2ts15LanguageVariantE", !8, i64 0}
!13 = !{!"_ZTSN2ts11safe_stringE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE", !15, i64 0, !17, i64 8, !8, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderE", !16, i64 0}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!"int", !8, i64 0}
!19 = !{!"_ZTS10SyntaxKind", !8, i64 0}
!20 = !{!"_ZTSN2ts10TokenFlagsE", !8, i64 0}
!21 = !{!"_ZTSSt6vectorI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI3ptrIN2ts4data16CommentDirectiveEESaIS4_EE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!25 = !{!"_ZTSN2ts16JSDocParsingModeE", !8, i64 0}
!26 = !{!"_ZTSSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEE", !27, i64 0, !16, i64 24}
!27 = !{!"_ZTSSt14_Function_base", !8, i64 0, !16, i64 16}
!28 = !{!6, !18, i64 52}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!6, !18, i64 60}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass