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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_regex" = type { i32, %"class.std::locale", %"class.std::shared_ptr" }
%"class.std::locale" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::__cxx11::regex_iterator" = type { %"class.__gnu_cxx::__normal_iterator.109", %"class.__gnu_cxx::__normal_iterator.109", ptr, i32, %"class.std::__cxx11::match_results" }
%"class.__gnu_cxx::__normal_iterator.109" = type { ptr }
%"class.std::__cxx11::match_results" = type { %"class.std::vector.110", %"class.__gnu_cxx::__normal_iterator.109" }
%"class.std::vector.110" = type { %"struct.std::_Vector_base.111" }
%"struct.std::_Vector_base.111" = type { %"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.115" = type { ptr }
%"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] }

@_ZN2ts7Scanner18shebangTriviaRegexB5cxx11E = external dso_local global %"class.std::__cxx11::basic_regex", align 8

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner17scanShebangTriviaERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %13 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::__cxx11::match_results", align 8
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %21) #4
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %10, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKwNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEC2IPwvEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %24) #4
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %12, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKwNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEC2IPwvEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.109", ptr %9, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.109", ptr %11, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ESA_SA_RKNS_11basic_regexIwSC_EENSt15regex_constants15match_flag_typeE(ptr noundef nonnull align 8 dereferenceable(64) %8, ptr %28, ptr %30, ptr noundef nonnull align 8 dereferenceable(32) @_ZN2ts7Scanner18shebangTriviaRegexB5cxx11E, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #4
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 64, i1 false)
  invoke void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(64) %13)
          to label %31 unwind label %36

31:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #4
  invoke void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ERKSD_(ptr noundef nonnull align 8 dereferenceable(64) %16, ptr noundef nonnull align 8 dereferenceable(64) %8)
          to label %32 unwind label %40

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %65, %32
  %34 = call noundef zeroext i1 @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEneERKSD_(ptr noundef nonnull align 8 dereferenceable(64) %16, ptr noundef nonnull align 8 dereferenceable(64) %13) #4
  br i1 %34, label %44, label %35

35:                                               ; preds = %33
  store i32 2, ptr %17, align 4
  br label %70

36:                                               ; preds = %3
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %14, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %15, align 4
  br label %78

40:                                               ; preds = %31
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %14, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %15, align 4
  br label %73

44:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #4
  %45 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEdeEv(ptr noundef nonnull align 8 dereferenceable(64) %16) #4
  invoke void @_ZNSt7__cxx1113match_resultsIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEESaINS_9sub_matchISA_EEEEC2ERKSE_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %45)
          to label %46 unwind label %54

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  invoke void @_ZNKSt7__cxx1113match_resultsIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEESaINS_9sub_matchISA_EEEE3strEm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef nonnull align 8 dereferenceable(32) %18, i64 noundef 0)
          to label %47 unwind label %58

47:                                               ; preds = %46
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #4
  %51 = add i64 %49, %50
  %52 = trunc i64 %51 to i32
  store i32 %52, ptr %7, align 4, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %53, ptr %4, align 4
  store i32 1, ptr %17, align 4
  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
  call void @_ZNSt6vectorINSt7__cxx119sub_matchIN9__gnu_cxx17__normal_iteratorIPKwNS0_12basic_stringIwSt11char_traitsIwESaIwEEEEEEESaISC_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #4
  br label %70

54:                                               ; preds = %44
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %14, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %15, align 4
  br label %62

58:                                               ; preds = %46
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %14, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  call void @_ZNSt6vectorINSt7__cxx119sub_matchIN9__gnu_cxx17__normal_iteratorIPKwNS0_12basic_stringIwSt11char_traitsIwESaIwEEEEEEESaISC_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  br label %62

62:                                               ; preds = %58, %54
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #4
  br label %72

63:                                               ; No predecessors!
  %64 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEppEv(ptr noundef nonnull align 8 dereferenceable(64) %16)
          to label %65 unwind label %66

65:                                               ; preds = %63
  br label %33, !llvm.loop !11

66:                                               ; preds = %63
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %14, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %15, align 4
  br label %72

70:                                               ; preds = %47, %35
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %16) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #4
  %71 = load i32, ptr %17, align 4
  switch i32 %71, label %76 [
    i32 2, label %74
  ]

72:                                               ; preds = %66, %62
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %16) #4
  br label %73

73:                                               ; preds = %72, %40
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %13) #4
  br label %78

74:                                               ; preds = %70
  %75 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %75, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %76

76:                                               ; preds = %74, %70
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %13) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #4
  %77 = load i32, ptr %4, align 4
  ret i32 %77

78:                                               ; preds = %73, %36
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #4
  br label %79

79:                                               ; preds = %78
  %80 = load ptr, ptr %14, align 8
  %81 = load i32, ptr %15, align 4
  %82 = insertvalue { ptr, i32 } poison, ptr %80, 0
  %83 = insertvalue { ptr, i32 } %82, i32 %81, 1
  resume { ptr, i32 } %83
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ESA_SA_RKNS_11basic_regexIwSC_EENSt15regex_constants15match_flag_typeE(ptr noundef nonnull align 8 dereferenceable(64), ptr, ptr, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ERKSD_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEneERKSD_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEdeEv(ptr noundef nonnull align 8 dereferenceable(64)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEppEv(ptr noundef nonnull align 8 dereferenceable(64)) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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_regex" = type { i32, %"class.std::locale", %"class.std::shared_ptr" }
%"class.std::locale" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::__cxx11::regex_iterator" = type { %"class.__gnu_cxx::__normal_iterator.109", %"class.__gnu_cxx::__normal_iterator.109", ptr, i32, %"class.std::__cxx11::match_results" }
%"class.__gnu_cxx::__normal_iterator.109" = type { ptr }
%"class.std::__cxx11::match_results" = type { %"class.std::vector.110", %"class.__gnu_cxx::__normal_iterator.109" }
%"class.std::vector.110" = type { %"struct.std::_Vector_base.111" }
%"struct.std::_Vector_base.111" = type { %"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const wchar_t *, std::__cxx11::basic_string<wchar_t>>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.115" = type { ptr }
%"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] }

@_ZN2ts7Scanner18shebangTriviaRegexB5cxx11E = external dso_local global %"class.std::__cxx11::basic_regex", align 8

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner17scanShebangTriviaERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEi(ptr nocapture noundef nonnull readnone align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %9 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %10 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %11 = alloca %"class.std::__cxx11::match_results", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %13 = tail call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  store ptr %13, ptr %6, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKwNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEC2IPwvEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %14 = call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  store ptr %14, ptr %8, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKwNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEC2IPwvEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %15 = load ptr, ptr %5, align 8
  %16 = load ptr, ptr %7, align 8
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ESA_SA_RKNS_11basic_regexIwSC_EENSt15regex_constants15match_flag_typeE(ptr noundef nonnull align 8 dereferenceable(64) %4, ptr %15, ptr %16, ptr noundef nonnull align 8 dereferenceable(32) @_ZN2ts7Scanner18shebangTriviaRegexB5cxx11E, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  invoke void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %17 unwind label %20

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #4
  invoke void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ERKSD_(ptr noundef nonnull align 8 dereferenceable(64) %10, ptr noundef nonnull align 8 dereferenceable(64) %4)
          to label %18 unwind label %22

18:                                               ; preds = %17
  %19 = call noundef zeroext i1 @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEneERKSD_(ptr noundef nonnull align 8 dereferenceable(64) %10, ptr noundef nonnull align 8 dereferenceable(64) %9) #4
  br i1 %19, label %24, label %36

20:                                               ; preds = %3
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %38

22:                                               ; preds = %17
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %37

24:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #4
  %25 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEdeEv(ptr noundef nonnull align 8 dereferenceable(64) %10) #4
  invoke void @_ZNSt7__cxx1113match_resultsIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEESaINS_9sub_matchISA_EEEEC2ERKSE_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %26 unwind label %31

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #4
  invoke void @_ZNKSt7__cxx1113match_resultsIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEESaINS_9sub_matchISA_EEEE3strEm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef 0)
          to label %27 unwind label %33

27:                                               ; preds = %26
  %28 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  %29 = trunc i64 %28 to i32
  %30 = add i32 %29, %2
  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
  call void @_ZNSt6vectorINSt7__cxx119sub_matchIN9__gnu_cxx17__normal_iteratorIPKwNS0_12basic_stringIwSt11char_traitsIwESaIwEEEEEEESaISC_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #4
  br label %36

31:                                               ; preds = %24
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %35

33:                                               ; preds = %26
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #4
  call void @_ZNSt6vectorINSt7__cxx119sub_matchIN9__gnu_cxx17__normal_iteratorIPKwNS0_12basic_stringIwSt11char_traitsIwESaIwEEEEEEESaISC_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  br label %35

35:                                               ; preds = %33, %31
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %10) #4
  br label %37

36:                                               ; preds = %18, %27
  %spec.select = phi i32 [ %30, %27 ], [ %2, %18 ]
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %10) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %4) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  ret i32 %spec.select

37:                                               ; preds = %35, %22
  %.pn.pn = phi { ptr, i32 } [ %.pn, %35 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #4
  br label %38

38:                                               ; preds = %37, %20
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %37 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %4) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ESA_SA_RKNS_11basic_regexIwSC_EENSt15regex_constants15match_flag_typeE(ptr noundef nonnull align 8 dereferenceable(64), ptr, ptr, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ERKSD_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEdeEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #2 align 2

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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)"}


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