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

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

%"struct.ts::DiagnosticMessageStore" = type { i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"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] }
%struct.ptr.100 = type { %"class.std::shared_ptr.101" }
%"class.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.ts::data::DiagnosticMessage" = type <{ i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::vector.104", %"class.std::vector.104", i8, [7 x i8] }>
%"class.std::vector.104" = type { %"struct.std::_Vector_base.105" }
%"struct.std::_Vector_base.105" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { 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 } }

@_ZN2ts11DiagnosticsL29Unterminated_template_literalE = external hidden global %"struct.ts::DiagnosticMessageStore", align 8
@.str.6452 = external hidden unnamed_addr constant [1 x i32], align 4
@.str.6456 = external hidden unnamed_addr constant [2 x i32], align 4

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIwEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2IS3_EEPKwRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(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 noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #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 hidden void @_ZN2tsL5debugEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ts4data17DiagnosticMessageC2ERNS_22DiagnosticMessageStoreE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ptrIN2ts4data17DiagnosticMessageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(121)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121)) unnamed_addr #3 align 2

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

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

; 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 uwtable
declare dso_local void @_ZN2ts7Scanner18scanEscapeSequenceB5cxx11Eb(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(176), i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner28scanTemplateAndSetTokenValueEb(ptr noundef nonnull align 8 dereferenceable(176) %0, i1 noundef zeroext %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.ptr.100, align 8
  %13 = alloca %"struct.ts::data::DiagnosticMessage", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.0", align 1
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::__cxx11::basic_string", align 8
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %23 = zext i1 %1 to i8
  store i8 %23, ptr %4, align 1, !tbaa !9
  %24 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  %25 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %26 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %25, i32 noundef %27)
  %29 = icmp eq i32 %28, 96
  %30 = zext i1 %29 to i8
  store i8 %30, ptr %5, align 1, !tbaa !9
  %31 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %31, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %34 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %35 = load i32, ptr %34, align 8, !tbaa !11
  store i32 %35, ptr %6, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  br label %36

36:                                               ; preds = %258, %256, %2
  br label %37

37:                                               ; preds = %36
  %38 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %39 = load i32, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 6
  %41 = load i32, ptr %40, align 4, !tbaa !31
  %42 = icmp sge i32 %39, %41
  br i1 %42, label %43, label %94

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  %44 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %45 = load i32, ptr %6, align 4, !tbaa !30
  %46 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %47 = load i32, ptr %46, align 8, !tbaa !11
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %44, i32 noundef %45, i32 noundef %47)
          to label %48 unwind label %62

48:                                               ; preds = %43
  %49 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %50 unwind label %66

50:                                               ; preds = %48
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  %51 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 11
  %52 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN2tsoRERNS_10TokenFlagsES0_(ptr noundef nonnull align 4 dereferenceable(4) %51, i32 noundef 4)
          to label %53 unwind label %71

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 128, ptr %13) #4
  invoke void @_ZN2ts4data17DiagnosticMessageC2ERNS_22DiagnosticMessageStoreE(ptr noundef nonnull align 8 dereferenceable(121) %13, ptr noundef nonnull align 8 dereferenceable(72) @_ZN2ts11DiagnosticsL29Unterminated_template_literalE)
          to label %54 unwind label %75

54:                                               ; preds = %53
  invoke void @_ZN3ptrIN2ts4data17DiagnosticMessageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(121) %13)
          to label %55 unwind label %79

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  call void @_ZNSaIwEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #4
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2IS3_EEPKwRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef @.str.6452, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %56 unwind label %83

56:                                               ; preds = %55
  invoke void @_ZN2ts7Scanner5errorE3ptrINS_4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE(ptr noundef nonnull align 8 dereferenceable(176) %24, ptr noundef %12, i32 noundef -1, i32 noundef 0, ptr noundef %14)
          to label %57 unwind label %87

57:                                               ; preds = %56
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %13) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %13) #4
  %58 = load i8, ptr %5, align 1, !tbaa !9, !range !32, !noundef !33
  %59 = trunc i8 %58 to i1
  %60 = zext i1 %59 to i64
  %61 = select i1 %59, i32 15, i32 18
  store i32 %61, ptr %8, align 4, !tbaa !34
  br label %260

62:                                               ; preds = %43
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  br label %70

66:                                               ; preds = %48
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %10, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  br label %268

71:                                               ; preds = %263, %260, %50
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %10, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %11, align 4
  br label %268

75:                                               ; preds = %53
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %10, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %11, align 4
  br label %93

79:                                               ; preds = %54
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %10, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %11, align 4
  br label %92

83:                                               ; preds = %55
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %10, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %11, align 4
  br label %91

87:                                               ; preds = %56
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %10, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  br label %91

91:                                               ; preds = %87, %83
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  br label %92

92:                                               ; preds = %91, %79
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %13) #4
  br label %93

93:                                               ; preds = %92, %75
  call void @llvm.lifetime.end.p0(i64 128, ptr %13) #4
  br label %268

94:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %95 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %96 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %97 = load i32, ptr %96, align 8, !tbaa !11
  %98 = invoke noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %95, i32 noundef %97)
          to label %99 unwind label %117

99:                                               ; preds = %94
  store i32 %98, ptr %16, align 4, !tbaa !35
  %100 = load i32, ptr %16, align 4, !tbaa !35
  %101 = icmp eq i32 %100, 96
  br i1 %101, label %102, label %130

102:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #4
  %103 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %104 = load i32, ptr %6, align 4, !tbaa !30
  %105 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %106 = load i32, ptr %105, align 8, !tbaa !11
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %17, ptr noundef nonnull align 8 dereferenceable(32) %103, i32 noundef %104, i32 noundef %106)
          to label %107 unwind label %121

107:                                              ; preds = %102
  %108 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %109 unwind label %125

109:                                              ; preds = %107
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  %110 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %111 = load i32, ptr %110, align 8, !tbaa !11
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 8, !tbaa !11
  %113 = load i8, ptr %5, align 1, !tbaa !9, !range !32, !noundef !33
  %114 = trunc i8 %113 to i1
  %115 = zext i1 %114 to i64
  %116 = select i1 %114, i32 15, i32 18
  store i32 %116, ptr %8, align 4, !tbaa !34
  store i32 3, ptr %18, align 4
  br label %256

117:                                              ; preds = %247, %227, %140, %94
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %10, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %11, align 4
  br label %259

121:                                              ; preds = %102
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %10, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %11, align 4
  br label %129

125:                                              ; preds = %107
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %10, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  br label %129

129:                                              ; preds = %125, %121
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  br label %259

130:                                              ; preds = %99
  %131 = load i32, ptr %16, align 4, !tbaa !35
  %132 = icmp eq i32 %131, 36
  br i1 %132, label %133, label %172

133:                                              ; preds = %130
  %134 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %135 = load i32, ptr %134, align 8, !tbaa !11
  %136 = add nsw i32 %135, 1
  %137 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 6
  %138 = load i32, ptr %137, align 4, !tbaa !31
  %139 = icmp slt i32 %136, %138
  br i1 %139, label %140, label %172

140:                                              ; preds = %133
  %141 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %142 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %143 = load i32, ptr %142, align 8, !tbaa !11
  %144 = add nsw i32 %143, 1
  %145 = invoke noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %141, i32 noundef %144)
          to label %146 unwind label %117

146:                                              ; preds = %140
  %147 = icmp eq i32 %145, 123
  br i1 %147, label %148, label %172

148:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  %149 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %150 = load i32, ptr %6, align 4, !tbaa !30
  %151 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %152 = load i32, ptr %151, align 8, !tbaa !11
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef nonnull align 8 dereferenceable(32) %149, i32 noundef %150, i32 noundef %152)
          to label %153 unwind label %163

153:                                              ; preds = %148
  %154 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %155 unwind label %167

155:                                              ; preds = %153
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  %156 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %157 = load i32, ptr %156, align 8, !tbaa !11
  %158 = add nsw i32 %157, 2
  store i32 %158, ptr %156, align 8, !tbaa !11
  %159 = load i8, ptr %5, align 1, !tbaa !9, !range !32, !noundef !33
  %160 = trunc i8 %159 to i1
  %161 = zext i1 %160 to i64
  %162 = select i1 %160, i32 16, i32 17
  store i32 %162, ptr %8, align 4, !tbaa !34
  store i32 3, ptr %18, align 4
  br label %256

163:                                              ; preds = %148
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %10, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %11, align 4
  br label %171

167:                                              ; preds = %153
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %10, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #4
  br label %171

171:                                              ; preds = %167, %163
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  br label %259

172:                                              ; preds = %146, %133, %130
  %173 = load i32, ptr %16, align 4, !tbaa !35
  %174 = icmp eq i32 %173, 92
  br i1 %174, label %175, label %208

175:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #4
  %176 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %177 = load i32, ptr %6, align 4, !tbaa !30
  %178 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %179 = load i32, ptr %178, align 8, !tbaa !11
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %20, ptr noundef nonnull align 8 dereferenceable(32) %176, i32 noundef %177, i32 noundef %179)
          to label %180 unwind label %190

180:                                              ; preds = %175
  %181 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %182 unwind label %194

182:                                              ; preds = %180
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #4
  %183 = load i8, ptr %4, align 1, !tbaa !9, !range !32, !noundef !33
  %184 = trunc i8 %183 to i1
  invoke void @_ZN2ts7Scanner18scanEscapeSequenceB5cxx11Eb(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %21, ptr noundef nonnull align 8 dereferenceable(176) %24, i1 noundef zeroext %184)
          to label %185 unwind label %199

185:                                              ; preds = %182
  %186 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %187 unwind label %203

187:                                              ; preds = %185
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #4
  %188 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %189 = load i32, ptr %188, align 8, !tbaa !11
  store i32 %189, ptr %6, align 4, !tbaa !30
  store i32 2, ptr %18, align 4
  br label %256, !llvm.loop !37

190:                                              ; preds = %175
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %10, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %11, align 4
  br label %198

194:                                              ; preds = %180
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %10, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  br label %198

198:                                              ; preds = %194, %190
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #4
  br label %259

199:                                              ; preds = %182
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %10, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %11, align 4
  br label %207

203:                                              ; preds = %185
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %10, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #4
  br label %207

207:                                              ; preds = %203, %199
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #4
  br label %259

208:                                              ; preds = %172
  %209 = load i32, ptr %16, align 4, !tbaa !35
  %210 = icmp eq i32 %209, 13
  br i1 %210, label %211, label %252

211:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #4
  %212 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %213 = load i32, ptr %6, align 4, !tbaa !30
  %214 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %215 = load i32, ptr %214, align 8, !tbaa !11
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %22, ptr noundef nonnull align 8 dereferenceable(32) %212, i32 noundef %213, i32 noundef %215)
          to label %216 unwind label %238

216:                                              ; preds = %211
  %217 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %218 unwind label %242

218:                                              ; preds = %216
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #4
  %219 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %220 = load i32, ptr %219, align 8, !tbaa !11
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %219, align 8, !tbaa !11
  %222 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %223 = load i32, ptr %222, align 8, !tbaa !11
  %224 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 6
  %225 = load i32, ptr %224, align 4, !tbaa !31
  %226 = icmp slt i32 %223, %225
  br i1 %226, label %227, label %247

227:                                              ; preds = %218
  %228 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 4
  %229 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %230 = load i32, ptr %229, align 8, !tbaa !11
  %231 = invoke noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %228, i32 noundef %230)
          to label %232 unwind label %117

232:                                              ; preds = %227
  %233 = icmp eq i32 %231, 10
  br i1 %233, label %234, label %247

234:                                              ; preds = %232
  %235 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %236 = load i32, ptr %235, align 8, !tbaa !11
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %235, align 8, !tbaa !11
  br label %247

238:                                              ; preds = %211
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %10, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %11, align 4
  br label %246

242:                                              ; preds = %216
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %10, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  br label %246

246:                                              ; preds = %242, %238
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #4
  br label %259

247:                                              ; preds = %234, %232, %218
  %248 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLEPKw(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef @.str.6456)
          to label %249 unwind label %117

249:                                              ; preds = %247
  %250 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %251 = load i32, ptr %250, align 8, !tbaa !11
  store i32 %251, ptr %6, align 4, !tbaa !30
  store i32 2, ptr %18, align 4
  br label %256, !llvm.loop !37

252:                                              ; preds = %208
  %253 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 5
  %254 = load i32, ptr %253, align 8, !tbaa !11
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr %253, align 8, !tbaa !11
  store i32 0, ptr %18, align 4
  br label %256

256:                                              ; preds = %252, %249, %187, %155, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %257 = load i32, ptr %18, align 4
  switch i32 %257, label %274 [
    i32 0, label %258
    i32 3, label %260
    i32 2, label %36
  ]

258:                                              ; preds = %256
  br label %36, !llvm.loop !37

259:                                              ; preds = %246, %207, %198, %171, %129, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %268

260:                                              ; preds = %256, %57
  %261 = load i32, ptr %8, align 4, !tbaa !34
  %262 = icmp ne i32 %261, 0
  invoke void @_ZN2tsL5debugEb(i1 noundef zeroext %262)
          to label %263 unwind label %71

263:                                              ; preds = %260
  %264 = getelementptr inbounds %"class.ts::Scanner", ptr %24, i32 0, i32 10
  %265 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %264, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %266 unwind label %71

266:                                              ; preds = %263
  %267 = load i32, ptr %8, align 4, !tbaa !34
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  ret i32 %267

268:                                              ; preds = %259, %93, %71, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  br label %269

269:                                              ; preds = %268
  %270 = load ptr, ptr %10, align 8
  %271 = load i32, ptr %11, align 4
  %272 = insertvalue { ptr, i32 } poison, ptr %270, 0
  %273 = insertvalue { ptr, i32 } %272, i32 %271, 1
  resume { ptr, i32 } %273

274:                                              ; preds = %256
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 = { 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 = { 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 = !{!20, !20, i64 0}
!31 = !{!12, !20, i64 52}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!21, !21, i64 0}
!35 = !{!36, !36, i64 0}
!36 = !{!"_ZTS14CharacterCodes", !7, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"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"

%"struct.ts::DiagnosticMessageStore" = type { i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"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] }
%struct.ptr.100 = type { %"class.std::shared_ptr.101" }
%"class.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.ts::data::DiagnosticMessage" = type <{ i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::vector.104", %"class.std::vector.104", i8, [7 x i8] }>
%"class.std::vector.104" = type { %"struct.std::_Vector_base.105" }
%"struct.std::_Vector_base.105" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { i8 }

@_ZN2ts11DiagnosticsL29Unterminated_template_literalE = external hidden global %"struct.ts::DiagnosticMessageStore", align 8
@.str.6452 = external hidden unnamed_addr constant [1 x i32], align 4
@.str.6456 = external hidden unnamed_addr constant [2 x i32], align 4

; 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 nounwind uwtable
declare void @_ZNSaIwEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2IS3_EEPKwRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(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 noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) 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 hidden void @_ZN2tsL5debugEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ts4data17DiagnosticMessageC2ERNS_22DiagnosticMessageStoreE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ptrIN2ts4data17DiagnosticMessageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(121)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121)) unnamed_addr #3 align 2

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

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

; 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 uwtable
declare dso_local void @_ZN2ts7Scanner18scanEscapeSequenceB5cxx11Eb(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(176), i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner28scanTemplateAndSetTokenValueEb(ptr noundef nonnull align 8 dereferenceable(176) %0, i1 noundef zeroext %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %struct.ptr.100, align 8
  %6 = alloca %"struct.ts::data::DiagnosticMessage", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator.0", align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load i32, ptr %15, align 8, !tbaa !5
  %17 = tail call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %16)
  %18 = icmp eq i32 %17, 96
  %19 = load i32, ptr %15, align 8, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  %21 = getelementptr inbounds i8, ptr %0, i64 52
  %22 = load i32, ptr %15, align 8, !tbaa !5
  %23 = load i32, ptr %21, align 4, !tbaa !28
  %.not80 = icmp slt i32 %22, %23
  br i1 %.not80, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %138, %2
  %.018.lcssa = phi i32 [ %20, %2 ], [ %.1, %138 ]
  %.lcssa = phi i32 [ %22, %2 ], [ %139, %138 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  invoke 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) %14, i32 noundef %.018.lcssa, i32 noundef %.lcssa)
          to label %24 unwind label %34

24:                                               ; preds = %._crit_edge
  %25 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %26 unwind label %36

26:                                               ; preds = %24
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  %27 = getelementptr inbounds i8, ptr %0, i64 104
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN2tsoRERNS_10TokenFlagsES0_(ptr noundef nonnull align 4 dereferenceable(4) %27, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #4
  invoke void @_ZN2ts4data17DiagnosticMessageC2ERNS_22DiagnosticMessageStoreE(ptr noundef nonnull align 8 dereferenceable(121) %6, ptr noundef nonnull align 8 dereferenceable(72) @_ZN2ts11DiagnosticsL29Unterminated_template_literalE)
          to label %29 unwind label %41

29:                                               ; preds = %26
  invoke void @_ZN3ptrIN2ts4data17DiagnosticMessageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(121) %6)
          to label %30 unwind label %43

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #4
  call void @_ZNSaIwEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2IS3_EEPKwRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.6452, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %31 unwind label %45

31:                                               ; preds = %30
  invoke void @_ZN2ts7Scanner5errorE3ptrINS_4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull %5, i32 noundef -1, i32 noundef 0, ptr noundef nonnull %7)
          to label %32 unwind label %47

32:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %6) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #4
  %33 = select i1 %18, i32 15, i32 18
  br label %.thread

34:                                               ; preds = %._crit_edge
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %24
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br label %38

38:                                               ; preds = %36, %34
  %.pn49 = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %144

39:                                               ; preds = %.thread
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %144

41:                                               ; preds = %26
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %51

43:                                               ; preds = %29
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %50

45:                                               ; preds = %30
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %31
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  br label %49

49:                                               ; preds = %47, %45
  %.pn51 = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  br label %50

50:                                               ; preds = %49, %43
  %.pn51.pn = phi { ptr, i32 } [ %.pn51, %49 ], [ %44, %43 ]
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %6) #4
  br label %51

51:                                               ; preds = %50, %41
  %.pn51.pn.pn = phi { ptr, i32 } [ %.pn51.pn, %50 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #4
  br label %144

.lr.ph:                                           ; preds = %2, %138
  %52 = phi i32 [ %139, %138 ], [ %22, %2 ]
  %.01881 = phi i32 [ %.1, %138 ], [ %20, %2 ]
  %53 = invoke noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %52)
          to label %54 unwind label %63

54:                                               ; preds = %.lr.ph
  switch i32 %53, label %._crit_edge93 [
    i32 96, label %55
    i32 36, label %70
    i32 92, label %91
    i32 13, label %110
  ]

._crit_edge93:                                    ; preds = %54
  %.pre = load i32, ptr %15, align 8, !tbaa !5
  br label %135

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #4
  %56 = load i32, ptr %15, align 8, !tbaa !5
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %.01881, i32 noundef %56)
          to label %57 unwind label %65

57:                                               ; preds = %55
  %58 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %59 unwind label %67

59:                                               ; preds = %57
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #4
  %60 = load i32, ptr %15, align 8, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %15, align 8, !tbaa !5
  %62 = select i1 %18, i32 15, i32 18
  br label %.thread

63:                                               ; preds = %131, %119, %75, %.lr.ph
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %144

65:                                               ; preds = %55
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %69

67:                                               ; preds = %57
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  br label %69

69:                                               ; preds = %67, %65
  %.pn46 = phi { ptr, i32 } [ %68, %67 ], [ %66, %65 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #4
  br label %144

70:                                               ; preds = %54
  %71 = load i32, ptr %15, align 8, !tbaa !5
  %72 = add nsw i32 %71, 1
  %73 = load i32, ptr %21, align 4, !tbaa !28
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %75, label %135

75:                                               ; preds = %70
  %76 = invoke noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %72)
          to label %77 unwind label %63

77:                                               ; preds = %75
  %78 = icmp eq i32 %76, 123
  %.pre94 = load i32, ptr %15, align 8, !tbaa !5
  br i1 %78, label %79, label %135

79:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #4
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %.01881, i32 noundef %.pre94)
          to label %80 unwind label %86

80:                                               ; preds = %79
  %81 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %82 unwind label %88

82:                                               ; preds = %80
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #4
  %83 = load i32, ptr %15, align 8, !tbaa !5
  %84 = add nsw i32 %83, 2
  store i32 %84, ptr %15, align 8, !tbaa !5
  %85 = select i1 %18, i32 16, i32 17
  br label %.thread

86:                                               ; preds = %79
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %90

88:                                               ; preds = %80
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  br label %90

90:                                               ; preds = %88, %86
  %.pn44 = phi { ptr, i32 } [ %89, %88 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #4
  br label %144

91:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #4
  %92 = load i32, ptr %15, align 8, !tbaa !5
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %.01881, i32 noundef %92)
          to label %93 unwind label %100

93:                                               ; preds = %91
  %94 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %95 unwind label %102

95:                                               ; preds = %93
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #4
  invoke void @_ZN2ts7Scanner18scanEscapeSequenceB5cxx11Eb(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %12, ptr noundef nonnull align 8 dereferenceable(176) %0, i1 noundef zeroext %1)
          to label %96 unwind label %105

96:                                               ; preds = %95
  %97 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %98 unwind label %107

98:                                               ; preds = %96
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #4
  %99 = load i32, ptr %15, align 8, !tbaa !5
  br label %138, !llvm.loop !29

100:                                              ; preds = %91
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %93
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  br label %104

104:                                              ; preds = %102, %100
  %.pn40 = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #4
  br label %144

105:                                              ; preds = %95
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %109

107:                                              ; preds = %96
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  br label %109

109:                                              ; preds = %107, %105
  %.pn42 = phi { ptr, i32 } [ %108, %107 ], [ %106, %105 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #4
  br label %144

110:                                              ; preds = %54
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #4
  %111 = load i32, ptr %15, align 8, !tbaa !5
  invoke void @_ZN2ts11safe_string9substringB5cxx11Eii(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %.01881, i32 noundef %111)
          to label %112 unwind label %126

112:                                              ; preds = %110
  %113 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %114 unwind label %128

114:                                              ; preds = %112
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #4
  %115 = load i32, ptr %15, align 8, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %15, align 8, !tbaa !5
  %117 = load i32, ptr %21, align 4, !tbaa !28
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %119, label %131

119:                                              ; preds = %114
  %120 = invoke noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %116)
          to label %121 unwind label %63

121:                                              ; preds = %119
  %122 = icmp eq i32 %120, 10
  br i1 %122, label %123, label %131

123:                                              ; preds = %121
  %124 = load i32, ptr %15, align 8, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %15, align 8, !tbaa !5
  br label %131

126:                                              ; preds = %110
  %127 = landingpad { ptr, i32 }
          cleanup
  br label %130

128:                                              ; preds = %112
  %129 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  br label %130

130:                                              ; preds = %128, %126
  %.pn = phi { ptr, i32 } [ %129, %128 ], [ %127, %126 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #4
  br label %144

131:                                              ; preds = %123, %121, %114
  %132 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLEPKw(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.6456)
          to label %133 unwind label %63

133:                                              ; preds = %131
  %134 = load i32, ptr %15, align 8, !tbaa !5
  br label %138, !llvm.loop !29

135:                                              ; preds = %._crit_edge93, %70, %77
  %136 = phi i32 [ %.pre, %._crit_edge93 ], [ %71, %70 ], [ %.pre94, %77 ]
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %15, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %135, %133, %98
  %139 = phi i32 [ %99, %98 ], [ %134, %133 ], [ %137, %135 ]
  %.1 = phi i32 [ %99, %98 ], [ %134, %133 ], [ %.01881, %135 ]
  %140 = load i32, ptr %21, align 4, !tbaa !28
  %.not = icmp slt i32 %139, %140
  br i1 %.not, label %.lr.ph, label %._crit_edge

.thread:                                          ; preds = %82, %59, %32
  %.234 = phi i32 [ %33, %32 ], [ %85, %82 ], [ %62, %59 ]
  call void @_ZN2tsL5debugEb(i1 noundef zeroext true)
  %141 = getelementptr inbounds i8, ptr %0, i64 72
  %142 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %141, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %143 unwind label %39

143:                                              ; preds = %.thread
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  ret i32 %.234

144:                                              ; preds = %63, %69, %90, %104, %109, %130, %51, %39, %38
  %.pn55 = phi { ptr, i32 } [ %40, %39 ], [ %.pn51.pn.pn, %51 ], [ %.pn49, %38 ], [ %.pn46, %69 ], [ %.pn44, %90 ], [ %.pn42, %109 ], [ %.pn40, %104 ], [ %64, %63 ], [ %.pn, %130 ]
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn55
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 = { 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 = { 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"}


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