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

; 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::function.98" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner10skipTriviaERNS_11safe_stringEibbb(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2, i1 noundef zeroext %3, i1 noundef zeroext %4, i1 noundef zeroext %5) #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::function.98", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  %20 = zext i1 %3 to i8
  store i8 %20, ptr %11, align 1, !tbaa !11
  %21 = zext i1 %4 to i8
  store i8 %21, ptr %12, align 1, !tbaa !11
  %22 = zext i1 %5 to i8
  store i8 %22, ptr %13, align 1, !tbaa !11
  %23 = load ptr, ptr %8, align 8
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = call noundef zeroext i1 @_ZN2ts21positionIsSynthesizedEi(i32 noundef %24)
  br i1 %25, label %26, label %28

26:                                               ; preds = %6
  %27 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %27, ptr %7, align 4
  br label %172

28:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  store i8 0, ptr %14, align 1, !tbaa !11
  br label %29

29:                                               ; preds = %169, %28
  br label %30

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %31, i32 noundef %32)
  store i32 %33, ptr %15, align 4, !tbaa !13
  %34 = load i32, ptr %15, align 4, !tbaa !13
  switch i32 %34, label %157 [
    i32 13, label %35
    i32 10, label %45
    i32 9, label %58
    i32 11, label %58
    i32 12, label %58
    i32 32, label %58
    i32 47, label %61
    i32 60, label %122
    i32 124, label %122
    i32 61, label %122
    i32 62, label %122
    i32 35, label %136
    i32 42, label %150
  ]

35:                                               ; preds = %30
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  %39 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %36, i32 noundef %38)
  %40 = icmp eq i32 %39, 10
  br i1 %40, label %41, label %44

41:                                               ; preds = %35
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %10, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %41, %35
  br label %45

45:                                               ; preds = %44, %30
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %10, align 4, !tbaa !9
  %48 = load i8, ptr %11, align 1, !tbaa !11, !range !15, !noundef !16
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %52

50:                                               ; preds = %45
  %51 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %51, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %169

52:                                               ; preds = %45
  %53 = load i8, ptr %13, align 1, !tbaa !11, !range !15, !noundef !16
  %54 = trunc i8 %53 to i1
  %55 = xor i1 %54, true
  %56 = xor i1 %55, true
  %57 = zext i1 %56 to i8
  store i8 %57, ptr %14, align 1, !tbaa !11
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

58:                                               ; preds = %30, %30, %30, %30
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %10, align 4, !tbaa !9
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

61:                                               ; preds = %30
  %62 = load i8, ptr %12, align 1, !tbaa !11, !range !15, !noundef !16
  %63 = trunc i8 %62 to i1
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  br label %167

65:                                               ; preds = %61
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  %69 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %66, i32 noundef %68)
  %70 = icmp eq i32 %69, 47
  br i1 %70, label %71, label %89

71:                                               ; preds = %65
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = add nsw i32 %72, 2
  store i32 %73, ptr %10, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %85, %71
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %76)
  %78 = icmp slt i32 %75, %77
  br i1 %78, label %79, label %88

79:                                               ; preds = %74
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %80, i32 noundef %81)
  %83 = call noundef zeroext i1 @_ZN2ts7Scanner11isLineBreakE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %23, i32 noundef %82)
  br i1 %83, label %84, label %85

84:                                               ; preds = %79
  br label %88

85:                                               ; preds = %79
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %10, align 4, !tbaa !9
  br label %74, !llvm.loop !19

88:                                               ; preds = %84, %74
  store i8 0, ptr %14, align 1, !tbaa !11
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

89:                                               ; preds = %65
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  %93 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %90, i32 noundef %92)
  %94 = icmp eq i32 %93, 42
  br i1 %94, label %95, label %121

95:                                               ; preds = %89
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = add nsw i32 %96, 2
  store i32 %97, ptr %10, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %117, %95
  %99 = load i32, ptr %10, align 4, !tbaa !9
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %100)
  %102 = icmp slt i32 %99, %101
  br i1 %102, label %103, label %120

103:                                              ; preds = %98
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = load i32, ptr %10, align 4, !tbaa !9
  %106 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %104, i32 noundef %105)
  %107 = icmp eq i32 %106, 42
  br i1 %107, label %108, label %117

108:                                              ; preds = %103
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  %112 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %109, i32 noundef %111)
  %113 = icmp eq i32 %112, 47
  br i1 %113, label %114, label %117

114:                                              ; preds = %108
  %115 = load i32, ptr %10, align 4, !tbaa !9
  %116 = add nsw i32 %115, 2
  store i32 %116, ptr %10, align 4, !tbaa !9
  br label %120

117:                                              ; preds = %108, %103
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !9
  br label %98, !llvm.loop !20

120:                                              ; preds = %114, %98
  store i8 0, ptr %14, align 1, !tbaa !11
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

121:                                              ; preds = %89
  br label %167

122:                                              ; preds = %30, %30, %30, %30
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = call noundef zeroext i1 @_ZN2ts7Scanner22isConflictMarkerTriviaERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %23, ptr noundef nonnull align 8 dereferenceable(32) %123, i32 noundef %124)
  br i1 %125, label %126, label %135

126:                                              ; preds = %122
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZNSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEEC2EDn(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr null) #4
  %129 = invoke noundef i32 @_ZN2ts7Scanner24scanConflictMarkerTriviaERNS_11safe_stringEiSt8functionIFv3ptrINS_4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEE(ptr noundef nonnull align 8 dereferenceable(176) %23, ptr noundef nonnull align 8 dereferenceable(32) %127, i32 noundef %128, ptr noundef %17)
          to label %130 unwind label %131

130:                                              ; preds = %126
  store i32 %129, ptr %10, align 4, !tbaa !9
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  store i8 0, ptr %14, align 1, !tbaa !11
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

131:                                              ; preds = %126
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %18, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %19, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  br label %174

135:                                              ; preds = %122
  br label %167

136:                                              ; preds = %30
  %137 = load i32, ptr %10, align 4, !tbaa !9
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %139, label %149

139:                                              ; preds = %136
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2ts11safe_stringcvRNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEv(ptr noundef nonnull align 8 dereferenceable(32) %140)
  %142 = load i32, ptr %10, align 4, !tbaa !9
  %143 = call noundef zeroext i1 @_ZN2ts7Scanner15isShebangTriviaERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEi(ptr noundef nonnull align 8 dereferenceable(176) %23, ptr noundef nonnull align 8 dereferenceable(32) %141, i32 noundef %142)
  br i1 %143, label %144, label %149

144:                                              ; preds = %139
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2ts11safe_stringcvRNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEv(ptr noundef nonnull align 8 dereferenceable(32) %145)
  %147 = load i32, ptr %10, align 4, !tbaa !9
  %148 = call noundef i32 @_ZN2ts7Scanner17scanShebangTriviaERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEi(ptr noundef nonnull align 8 dereferenceable(176) %23, ptr noundef nonnull align 8 dereferenceable(32) %146, i32 noundef %147)
  store i32 %148, ptr %10, align 4, !tbaa !9
  store i8 0, ptr %14, align 1, !tbaa !11
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

149:                                              ; preds = %139, %136
  br label %167

150:                                              ; preds = %30
  %151 = load i8, ptr %14, align 1, !tbaa !11, !range !15, !noundef !16
  %152 = trunc i8 %151 to i1
  br i1 %152, label %153, label %156

153:                                              ; preds = %150
  %154 = load i32, ptr %10, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %10, align 4, !tbaa !9
  store i8 0, ptr %14, align 1, !tbaa !11
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

156:                                              ; preds = %150
  br label %167

157:                                              ; preds = %30
  %158 = load i32, ptr %15, align 4, !tbaa !13
  %159 = icmp sgt i32 %158, 127
  br i1 %159, label %160, label %166

160:                                              ; preds = %157
  %161 = load i32, ptr %15, align 4, !tbaa !13
  %162 = call noundef zeroext i1 @_ZN2ts7Scanner16isWhiteSpaceLikeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %23, i32 noundef %161)
  br i1 %162, label %163, label %166

163:                                              ; preds = %160
  %164 = load i32, ptr %10, align 4, !tbaa !9
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %10, align 4, !tbaa !9
  store i32 2, ptr %16, align 4
  br label %169, !llvm.loop !17

166:                                              ; preds = %160, %157
  br label %167

167:                                              ; preds = %166, %156, %149, %135, %121, %64
  %168 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %168, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %169

169:                                              ; preds = %167, %163, %153, %144, %130, %120, %88, %58, %52, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  %170 = load i32, ptr %16, align 4
  switch i32 %170, label %171 [
    i32 2, label %29
  ]

171:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  br label %172

172:                                              ; preds = %171, %26
  %173 = load i32, ptr %7, align 4
  ret i32 %173

174:                                              ; preds = %131
  %175 = load ptr, ptr %18, align 8
  %176 = load i32, ptr %19, align 4
  %177 = insertvalue { ptr, i32 } poison, ptr %175, 0
  %178 = insertvalue { ptr, i32 } %177, i32 %176, 1
  resume { ptr, i32 } %178
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2ts21positionIsSynthesizedEi(i32 noundef) #3

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS14CharacterCodes", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; 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::function.98" = 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 } }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 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 #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts7Scanner10skipTriviaERNS_11safe_stringEibbb(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2, i1 noundef zeroext %3, i1 noundef zeroext %4, i1 noundef zeroext %5) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::function.98", align 8
  %8 = tail call noundef zeroext i1 @_ZN2ts21positionIsSynthesizedEi(i32 noundef %2)
  br i1 %8, label %.thread, label %.outer

.outer:                                           ; preds = %6, %.outer.backedge
  %.056.ph = phi i1 [ %.056.ph.be, %.outer.backedge ], [ false, %6 ]
  %.052.ph = phi i32 [ %.052.ph.be, %.outer.backedge ], [ %2, %6 ]
  br label %9

9:                                                ; preds = %.backedge, %.outer
  %.052 = phi i32 [ %.052.ph, %.outer ], [ %.052.be, %.backedge ]
  %10 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.052)
  switch i32 %10, label %66 [
    i32 13, label %11
    i32 10, label %.loopexit64
    i32 9, label %.backedge
    i32 11, label %.backedge
    i32 12, label %.backedge
    i32 32, label %.backedge
    i32 47, label %16
    i32 60, label %48
    i32 124, label %48
    i32 61, label %48
    i32 62, label %48
    i32 35, label %55
    i32 42, label %63
  ]

11:                                               ; preds = %9
  %12 = add nsw i32 %.052, 1
  %13 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %12)
  %14 = icmp eq i32 %13, 10
  %spec.select = select i1 %14, i32 %12, i32 %.052
  br label %.loopexit64

.loopexit64:                                      ; preds = %9, %11
  %.153 = phi i32 [ %spec.select, %11 ], [ %.052, %9 ]
  %15 = add nsw i32 %.153, 1
  br i1 %3, label %.thread, label %.outer.backedge

.outer.backedge:                                  ; preds = %.lr.ph._crit_edge, %.lr.ph81, %27, %.loopexit64, %44, %21, %34, %64, %60, %52
  %.056.ph.be = phi i1 [ %5, %.loopexit64 ], [ false, %44 ], [ false, %21 ], [ false, %34 ], [ false, %64 ], [ false, %60 ], [ false, %52 ], [ false, %27 ], [ false, %.lr.ph81 ], [ false, %.lr.ph._crit_edge ]
  %.052.ph.be = phi i32 [ %15, %.loopexit64 ], [ %45, %44 ], [ %22, %21 ], [ %35, %34 ], [ %65, %64 ], [ %62, %60 ], [ %51, %52 ], [ %.25480, %.lr.ph81 ], [ %28, %27 ], [ %40, %.lr.ph._crit_edge ]
  br label %.outer, !llvm.loop !5

.backedge:                                        ; preds = %68, %9, %9, %9, %9
  %.052.be = add nsw i32 %.052, 1
  br label %9

16:                                               ; preds = %9
  br i1 %4, label %.thread, label %17

17:                                               ; preds = %16
  %18 = add nsw i32 %.052, 1
  %19 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %18)
  %20 = icmp eq i32 %19, 47
  br i1 %20, label %21, label %31

21:                                               ; preds = %17
  %22 = add nsw i32 %.052, 2
  %23 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %.lr.ph81, label %.outer.backedge

.lr.ph81:                                         ; preds = %21, %27
  %.25480 = phi i32 [ %28, %27 ], [ %22, %21 ]
  %25 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.25480)
  %26 = call noundef zeroext i1 @_ZN2ts7Scanner11isLineBreakE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %25)
  br i1 %26, label %.outer.backedge, label %27, !llvm.loop !5

27:                                               ; preds = %.lr.ph81
  %28 = add nsw i32 %.25480, 1
  %29 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %.lr.ph81, label %.outer.backedge, !llvm.loop !7

31:                                               ; preds = %17
  %32 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %18)
  %33 = icmp eq i32 %32, 42
  br i1 %33, label %34, label %.thread

34:                                               ; preds = %31
  %35 = add nsw i32 %.052, 2
  %36 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %.lr.ph, label %.outer.backedge

.lr.ph:                                           ; preds = %34, %.lr.ph._crit_edge
  %.379 = phi i32 [ %40, %.lr.ph._crit_edge ], [ %35, %34 ]
  %38 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.379)
  %39 = icmp eq i32 %38, 42
  %40 = add nsw i32 %.379, 1
  br i1 %39, label %41, label %.lr.ph._crit_edge

41:                                               ; preds = %.lr.ph
  %42 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %40)
  %43 = icmp eq i32 %42, 47
  br i1 %43, label %44, label %.lr.ph._crit_edge

44:                                               ; preds = %41
  %45 = add nsw i32 %.379, 2
  br label %.outer.backedge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %41
  %46 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %47 = icmp slt i32 %40, %46
  br i1 %47, label %.lr.ph, label %.outer.backedge, !llvm.loop !8

48:                                               ; preds = %9, %9, %9, %9
  %49 = call noundef zeroext i1 @_ZN2ts7Scanner22isConflictMarkerTriviaERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.052)
  br i1 %49, label %50, label %.thread

50:                                               ; preds = %48
  call void @_ZNSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEEC2EDn(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr null) #3
  %51 = invoke noundef i32 @_ZN2ts7Scanner24scanConflictMarkerTriviaERNS_11safe_stringEiSt8functionIFv3ptrINS_4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEE(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.052, ptr noundef nonnull %7)
          to label %52 unwind label %53

52:                                               ; preds = %50
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #3
  br label %.outer.backedge

53:                                               ; preds = %50
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #3
  resume { ptr, i32 } %54

55:                                               ; preds = %9
  %56 = icmp eq i32 %.052, 0
  br i1 %56, label %57, label %.thread

57:                                               ; preds = %55
  %58 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2ts11safe_stringcvRNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %59 = call noundef zeroext i1 @_ZN2ts7Scanner15isShebangTriviaERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %58, i32 noundef 0)
  br i1 %59, label %60, label %.thread

60:                                               ; preds = %57
  %61 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2ts11safe_stringcvRNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %62 = call noundef i32 @_ZN2ts7Scanner17scanShebangTriviaERNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 0)
  br label %.outer.backedge

63:                                               ; preds = %9
  br i1 %.056.ph, label %64, label %.thread

64:                                               ; preds = %63
  %65 = add nsw i32 %.052, 1
  br label %.outer.backedge

66:                                               ; preds = %9
  %67 = icmp sgt i32 %10, 127
  br i1 %67, label %68, label %.thread

68:                                               ; preds = %66
  %69 = call noundef zeroext i1 @_ZN2ts7Scanner16isWhiteSpaceLikeE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %10)
  br i1 %69, label %.backedge, label %.thread

.thread:                                          ; preds = %.loopexit64, %16, %31, %48, %57, %55, %63, %68, %66, %6
  %.2 = phi i32 [ %2, %6 ], [ %.052, %66 ], [ %.052, %68 ], [ %15, %.loopexit64 ], [ %.052, %16 ], [ %.052, %31 ], [ %.052, %48 ], [ 0, %57 ], [ %.052, %55 ], [ %.052, %63 ]
  ret i32 %.2
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2ts21positionIsSynthesizedEi(i32 noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


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