; 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::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.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 }

@_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_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; 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 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 uwtable
define dso_local void @_ZN2ts7Scanner10getShebangERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(176) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %12 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::__cxx11::regex_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::__cxx11::match_results", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #4
  %21 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %9, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKwNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEC2IPwvEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %11, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKwNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEC2IPwvEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.109", ptr %8, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.109", ptr %10, i32 0, i32 0
  %28 = load ptr, ptr %27, 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) %7, ptr %26, ptr %28, ptr noundef nonnull align 8 dereferenceable(32) @_ZN2ts7Scanner18shebangTriviaRegexB5cxx11E, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #4
  call void @llvm.memset.p0.i64(ptr align 8 %12, 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) %12)
          to label %29 unwind label %34

29:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #4
  invoke void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEC2ERKSD_(ptr noundef nonnull align 8 dereferenceable(64) %15, ptr noundef nonnull align 8 dereferenceable(64) %7)
          to label %30 unwind label %38

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %57, %30
  %32 = call noundef zeroext i1 @_ZNKSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEEneERKSD_(ptr noundef nonnull align 8 dereferenceable(64) %15, ptr noundef nonnull align 8 dereferenceable(64) %12) #4
  br i1 %32, label %42, label %33

33:                                               ; preds = %31
  store i32 2, ptr %16, align 4
  br label %62

34:                                               ; preds = %3
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %13, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %14, align 4
  br label %68

38:                                               ; preds = %29
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %13, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %14, align 4
  br label %65

42:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #4
  %43 = 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) %15) #4
  invoke void @_ZNSt7__cxx1113match_resultsIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEESaINS_9sub_matchISA_EEEEC2ERKSE_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(32) %43)
          to label %44 unwind label %46

44:                                               ; preds = %42
  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 %0, ptr noundef nonnull align 8 dereferenceable(32) %17, i64 noundef 0)
          to label %45 unwind label %50

45:                                               ; preds = %44
  store i32 1, ptr %16, align 4
  call void @_ZNSt6vectorINSt7__cxx119sub_matchIN9__gnu_cxx17__normal_iteratorIPKwNS0_12basic_stringIwSt11char_traitsIwESaIwEEEEEEESaISC_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  br label %62

46:                                               ; preds = %42
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %13, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %14, align 4
  br label %54

50:                                               ; preds = %44
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %13, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %14, align 4
  call void @_ZNSt6vectorINSt7__cxx119sub_matchIN9__gnu_cxx17__normal_iteratorIPKwNS0_12basic_stringIwSt11char_traitsIwESaIwEEEEEEESaISC_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  br label %54

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  br label %64

55:                                               ; No predecessors!
  %56 = 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) %15)
          to label %57 unwind label %58

57:                                               ; preds = %55
  br label %31, !llvm.loop !9

58:                                               ; preds = %55
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %13, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %14, align 4
  br label %64

62:                                               ; preds = %45, %33
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %15) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #4
  %63 = load i32, ptr %16, align 4
  switch i32 %63, label %67 [
    i32 2, label %66
  ]

64:                                               ; preds = %58, %54
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %15) #4
  br label %65

65:                                               ; preds = %64, %38
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %12) #4
  br label %68

66:                                               ; preds = %62
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  store i32 1, ptr %16, align 4
  br label %67

67:                                               ; preds = %66, %62
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %12) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #4
  ret void

68:                                               ; preds = %65, %34
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #4
  call void @_ZNSt7__cxx1114regex_iteratorIN9__gnu_cxx17__normal_iteratorIPKwNS_12basic_stringIwSt11char_traitsIwESaIwEEEEEwNS_12regex_traitsIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #4
  br label %69

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

; 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 = distinct !{!9, !10}
!10 = !{!"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::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.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 }

@_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_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; 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 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 uwtable
define dso_local void @_ZN2ts7Scanner10getShebangERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(176) %1, ptr noundef nonnull align 8 dereferenceable(32) %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
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %12 = tail call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  store ptr %12, 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
  %13 = call ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  store ptr %13, 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
  %14 = load ptr, ptr %5, align 8
  %15 = 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 %14, ptr %15, 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 %16 unwind label %19

16:                                               ; 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 %17 unwind label %21

17:                                               ; preds = %16
  %18 = 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 %18, label %23, label %33

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

21:                                               ; preds = %16
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %32

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #4
  %24 = 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) %24)
          to label %25 unwind label %27

25:                                               ; preds = %23
  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 %0, ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef 0)
          to label %26 unwind label %29

26:                                               ; preds = %25
  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
  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
  br label %34

27:                                               ; preds = %23
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %31

29:                                               ; preds = %25
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorINSt7__cxx119sub_matchIN9__gnu_cxx17__normal_iteratorIPKwNS0_12basic_stringIwSt11char_traitsIwESaIwEEEEEEESaISC_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  br label %31

31:                                               ; preds = %29, %27
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %28, %27 ]
  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 %32

32:                                               ; preds = %31, %21
  %.pn.pn = phi { ptr, i32 } [ %.pn, %31 ], [ %22, %21 ]
  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 %35

33:                                               ; preds = %17
  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__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %34

34:                                               ; preds = %26, %33
  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 void

35:                                               ; preds = %32, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %32 ], [ %20, %19 ]
  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 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,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass