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

; 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

; 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 i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2ts7Scanner22isWhiteSpaceSingleLineE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) #1 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 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
define dso_local noundef i32 @_ZN2ts7Scanner25scanJSDocCommentTextTokenEb(ptr noundef nonnull align 8 dereferenceable(176) %0, i1 noundef zeroext %1) #2 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %9 = zext i1 %1 to i8
  store i8 %9, ptr %5, align 1, !tbaa !9
  %10 = load ptr, ptr %4, align 8
  %11 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %12 = load i32, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 8
  store i32 %12, ptr %13, align 4, !tbaa !30
  %14 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 7
  store i32 %12, ptr %14, align 8, !tbaa !31
  %15 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 11
  store i32 0, ptr %15, align 8, !tbaa !32
  %16 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 6
  %19 = load i32, ptr %18, align 4, !tbaa !33
  %20 = icmp sge i32 %17, %19
  br i1 %20, label %21, label %23

21:                                               ; preds = %2
  %22 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 9
  store i32 1, ptr %22, align 8, !tbaa !34
  store i32 1, ptr %3, align 4
  br label %109

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %24 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 4
  %25 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %24, i32 noundef %26)
  store i32 %27, ptr %6, align 4, !tbaa !35
  br label %28

28:                                               ; preds = %85, %23
  %29 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %30 = load i32, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 6
  %32 = load i32, ptr %31, align 4, !tbaa !33
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %34, label %42

34:                                               ; preds = %28
  %35 = load i32, ptr %6, align 4, !tbaa !35
  %36 = call noundef zeroext i1 @_ZN2ts7Scanner11isLineBreakE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %10, i32 noundef %35)
  br i1 %36, label %40, label %37

37:                                               ; preds = %34
  %38 = load i32, ptr %6, align 4, !tbaa !35
  %39 = icmp ne i32 %38, 96
  br label %40

40:                                               ; preds = %37, %34
  %41 = phi i1 [ false, %34 ], [ %39, %37 ]
  br label %42

42:                                               ; preds = %40, %28
  %43 = phi i1 [ false, %28 ], [ %41, %40 ]
  br i1 %43, label %45, label %44

44:                                               ; preds = %42
  store i32 2, ptr %7, align 4
  br label %91

45:                                               ; preds = %42
  %46 = load i8, ptr %5, align 1, !tbaa !9, !range !37, !noundef !38
  %47 = trunc i8 %46 to i1
  br i1 %47, label %84, label %48

48:                                               ; preds = %45
  %49 = load i32, ptr %6, align 4, !tbaa !35
  %50 = icmp eq i32 %49, 123
  br i1 %50, label %51, label %52

51:                                               ; preds = %48
  store i32 2, ptr %7, align 4
  br label %91

52:                                               ; preds = %48
  %53 = load i32, ptr %6, align 4, !tbaa !35
  %54 = icmp eq i32 %53, 64
  br i1 %54, label %55, label %82

55:                                               ; preds = %52
  %56 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %57 = load i32, ptr %56, align 8, !tbaa !11
  %58 = sub nsw i32 %57, 1
  %59 = icmp sge i32 %58, 0
  br i1 %59, label %60, label %82

60:                                               ; preds = %55
  %61 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 4
  %62 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %63 = load i32, ptr %62, align 8, !tbaa !11
  %64 = sub nsw i32 %63, 1
  %65 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef %64)
  %66 = call noundef zeroext i1 @_ZN2ts7Scanner22isWhiteSpaceSingleLineE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %10, i32 noundef %65)
  br i1 %66, label %67, label %82

67:                                               ; preds = %60
  %68 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = add nsw i32 %69, 1
  %71 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 6
  %72 = load i32, ptr %71, align 4, !tbaa !33
  %73 = icmp slt i32 %70, %72
  br i1 %73, label %74, label %81

74:                                               ; preds = %67
  %75 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 4
  %76 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = add nsw i32 %77, 1
  %79 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %75, i32 noundef %78)
  %80 = call noundef zeroext i1 @_ZN2ts7Scanner16isWhiteSpaceLikeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %10, i32 noundef %79)
  br i1 %80, label %82, label %81

81:                                               ; preds = %74, %67
  store i32 2, ptr %7, align 4
  br label %91

82:                                               ; preds = %74, %60, %55, %52
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83, %45
  br label %85

85:                                               ; preds = %84
  %86 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 4
  %87 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %88 = load i32, ptr %87, align 8, !tbaa !11
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %87, align 8, !tbaa !11
  %90 = call noundef i32 @_ZN2ts7Scanner11codePointAtERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %10, ptr noundef nonnull align 8 dereferenceable(32) %86, i32 noundef %89)
  store i32 %90, ptr %6, align 4, !tbaa !35
  br label %28, !llvm.loop !39

91:                                               ; preds = %81, %51, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %92

92:                                               ; preds = %91
  %93 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %94 = load i32, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 8
  %96 = load i32, ptr %95, align 4, !tbaa !30
  %97 = icmp eq i32 %94, %96
  br i1 %97, label %98, label %100

98:                                               ; preds = %92
  %99 = call noundef i32 @_ZN2ts7Scanner14scanJsDocTokenEv(ptr noundef nonnull align 8 dereferenceable(176) %10)
  store i32 %99, ptr %3, align 4
  br label %109

100:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #3
  %101 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 4
  %102 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 8
  %103 = load i32, ptr %102, align 4, !tbaa !30
  %104 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 5
  %105 = load i32, ptr %104, align 8, !tbaa !11
  call void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %101, i32 noundef %103, i32 noundef %105)
  %106 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 10
  %107 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %106, ptr noundef nonnull align 8 dereferenceable(32) %8) #3
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #3
  %108 = getelementptr inbounds %"class.ts::Scanner", ptr %10, i32 0, i32 9
  store i32 82, ptr %108, align 8, !tbaa !34
  store i32 82, ptr %3, align 4
  br label %109

109:                                              ; preds = %100, %98, %21
  %110 = load i32, ptr %3, align 4
  ret i32 %110
}

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

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

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

; 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 i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2ts7Scanner22isWhiteSpaceSingleLineE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) local_unnamed_addr #1 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 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
define dso_local noundef i32 @_ZN2ts7Scanner25scanJSDocCommentTextTokenEb(ptr noundef nonnull align 8 dereferenceable(176) %0, i1 noundef zeroext %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 %5, ptr %6, align 4, !tbaa !28
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 %5, ptr %7, align 8, !tbaa !29
  %8 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 0, ptr %8, align 8, !tbaa !30
  %9 = getelementptr inbounds i8, ptr %0, i64 52
  %10 = load i32, ptr %9, align 4, !tbaa !31
  %.not = icmp slt i32 %5, %10
  br i1 %.not, label %13, label %11

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 1, ptr %12, align 8, !tbaa !32
  br label %62

13:                                               ; preds = %2
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = tail call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %5)
  %16 = load i32, ptr %4, align 8, !tbaa !5
  %17 = load i32, ptr %9, align 4, !tbaa !31
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %13
  br i1 %1, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %21
  %.012.us = phi i32 [ %24, %21 ], [ %15, %.lr.ph ]
  %19 = tail call noundef zeroext i1 @_ZN2ts7Scanner11isLineBreakE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %.012.us)
  %20 = icmp eq i32 %.012.us, 96
  %.not11.us = or i1 %20, %19
  br i1 %.not11.us, label %.critedge, label %21

21:                                               ; preds = %.lr.ph.split.us
  %22 = load i32, ptr %4, align 8, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %4, align 8, !tbaa !5
  %24 = tail call noundef i32 @_ZN2ts7Scanner11codePointAtERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %23)
  %25 = load i32, ptr %4, align 8, !tbaa !5
  %26 = load i32, ptr %9, align 4, !tbaa !31
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph.split.us, label %.critedge, !llvm.loop !33

.lr.ph.split:                                     ; preds = %.lr.ph, %46
  %.012 = phi i32 [ %49, %46 ], [ %15, %.lr.ph ]
  %28 = tail call noundef zeroext i1 @_ZN2ts7Scanner11isLineBreakE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %.012)
  %29 = icmp eq i32 %.012, 96
  %.not11 = or i1 %29, %28
  br i1 %.not11, label %.critedge, label %30

30:                                               ; preds = %.lr.ph.split
  switch i32 %.012, label %46 [
    i32 123, label %.critedge
    i32 64, label %31
  ]

31:                                               ; preds = %30
  %32 = load i32, ptr %4, align 8, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %34, label %46

34:                                               ; preds = %31
  %35 = add nsw i32 %32, -1
  %36 = tail call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %35)
  %37 = tail call noundef zeroext i1 @_ZN2ts7Scanner22isWhiteSpaceSingleLineE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %36)
  br i1 %37, label %38, label %46

38:                                               ; preds = %34
  %39 = load i32, ptr %4, align 8, !tbaa !5
  %40 = add nsw i32 %39, 1
  %41 = load i32, ptr %9, align 4, !tbaa !31
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %.critedge

43:                                               ; preds = %38
  %44 = tail call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %40)
  %45 = tail call noundef zeroext i1 @_ZN2ts7Scanner16isWhiteSpaceLikeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %44)
  br i1 %45, label %46, label %.critedge

46:                                               ; preds = %30, %31, %34, %43
  %47 = load i32, ptr %4, align 8, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %4, align 8, !tbaa !5
  %49 = tail call noundef i32 @_ZN2ts7Scanner11codePointAtERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %48)
  %50 = load i32, ptr %4, align 8, !tbaa !5
  %51 = load i32, ptr %9, align 4, !tbaa !31
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph.split, label %.critedge, !llvm.loop !33

.critedge:                                        ; preds = %46, %.lr.ph.split, %30, %43, %38, %21, %.lr.ph.split.us, %13
  %53 = load i32, ptr %4, align 8, !tbaa !5
  %54 = load i32, ptr %6, align 4, !tbaa !28
  %55 = icmp eq i32 %53, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %.critedge
  %57 = tail call noundef i32 @_ZN2ts7Scanner14scanJsDocTokenEv(ptr noundef nonnull align 8 dereferenceable(176) %0)
  br label %62

58:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #3
  call void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %54, i32 noundef %53)
  %59 = getelementptr inbounds i8, ptr %0, i64 72
  %60 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %59, ptr noundef nonnull align 8 dereferenceable(32) %3) #3
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #3
  %61 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 82, ptr %61, align 8, !tbaa !32
  br label %62

62:                                               ; preds = %58, %56, %11
  %.06 = phi i32 [ 1, %11 ], [ %57, %56 ], [ 82, %58 ]
  ret i32 %.06
}

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

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 60}
!29 = !{!6, !18, i64 56}
!30 = !{!6, !20, i64 104}
!31 = !{!6, !18, i64 52}
!32 = !{!6, !19, i64 64}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass