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

%"struct.ts::DiagnosticMessageStore" = type { i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.ptr.100 = type { %"class.std::shared_ptr.101" }
%"class.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.ts::data::DiagnosticMessage" = type <{ i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::vector.104", %"class.std::vector.104", i8, [7 x i8] }>
%"class.std::vector.104" = type { %"struct.std::_Vector_base.105" }
%"struct.std::_Vector_base.105" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN2ts11DiagnosticsL33Merge_conflict_marker_encounteredE = external hidden global %"struct.ts::DiagnosticMessageStore", align 8
@_ZN2ts7Scanner25mergeConflictMarkerLengthE = external dso_local global i32, align 4

; 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 void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress 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 nounwind uwtable
declare hidden void @_ZN2tsL5debugEb(i1 noundef zeroext) #1

; 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
define dso_local 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 %2, ptr noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %struct.ptr.100, align 8
  %10 = alloca %"struct.ts::data::DiagnosticMessage", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  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
  store ptr %3, ptr %8, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8
  %19 = call noundef zeroext i1 @_ZNKSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  br i1 %19, label %20, label %34

20:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 128, ptr %10) #4
  call void @_ZN2ts4data17DiagnosticMessageC2ERNS_22DiagnosticMessageStoreE(ptr noundef nonnull align 8 dereferenceable(121) %10, ptr noundef nonnull align 8 dereferenceable(72) @_ZN2ts11DiagnosticsL33Merge_conflict_marker_encounteredE)
  invoke void @_ZN3ptrIN2ts4data17DiagnosticMessageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(121) %10)
          to label %21 unwind label %25

21:                                               ; preds = %20
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = load i32, ptr @_ZN2ts7Scanner25mergeConflictMarkerLengthE, align 4, !tbaa !9
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  invoke void @_ZNKSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEEclES4_iiSA_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %9, i32 noundef %22, i32 noundef %23, ptr noundef %13)
          to label %24 unwind label %29

24:                                               ; preds = %21
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %10) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %10) #4
  br label %34

25:                                               ; preds = %20
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %11, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %12, align 4
  br label %33

29:                                               ; preds = %21
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %11, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  br label %33

33:                                               ; preds = %29, %25
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %10) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %10) #4
  br label %101

34:                                               ; preds = %24, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %35, i32 noundef %36)
  store i32 %37, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %38)
  store i32 %39, ptr %15, align 4, !tbaa !9
  %40 = load i32, ptr %14, align 4, !tbaa !11
  %41 = icmp eq i32 %40, 60
  br i1 %41, label %45, label %42

42:                                               ; preds = %34
  %43 = load i32, ptr %14, align 4, !tbaa !11
  %44 = icmp eq i32 %43, 62
  br i1 %44, label %45, label %62

45:                                               ; preds = %42, %34
  br label %46

46:                                               ; preds = %58, %45
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = load i32, ptr %15, align 4, !tbaa !9
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %56

50:                                               ; preds = %46
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %51, i32 noundef %52)
  %54 = call noundef zeroext i1 @_ZN2ts7Scanner11isLineBreakE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %18, i32 noundef %53)
  %55 = xor i1 %54, true
  br label %56

56:                                               ; preds = %50, %46
  %57 = phi i1 [ false, %46 ], [ %55, %50 ]
  br i1 %57, label %58, label %61

58:                                               ; preds = %56
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %7, align 4, !tbaa !9
  br label %46, !llvm.loop !13

61:                                               ; preds = %56
  br label %99

62:                                               ; preds = %42
  %63 = load i32, ptr %14, align 4, !tbaa !11
  %64 = icmp eq i32 %63, 124
  br i1 %64, label %68, label %65

65:                                               ; preds = %62
  %66 = load i32, ptr %14, align 4, !tbaa !11
  %67 = icmp eq i32 %66, 61
  br label %68

68:                                               ; preds = %65, %62
  %69 = phi i1 [ true, %62 ], [ %67, %65 ]
  call void @_ZN2tsL5debugEb(i1 noundef zeroext %69)
  br label %70

70:                                               ; preds = %97, %68
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = load i32, ptr %15, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %98

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %75, i32 noundef %76)
  store i32 %77, ptr %16, align 4, !tbaa !11
  %78 = load i32, ptr %16, align 4, !tbaa !11
  %79 = icmp eq i32 %78, 61
  br i1 %79, label %83, label %80

80:                                               ; preds = %74
  %81 = load i32, ptr %16, align 4, !tbaa !11
  %82 = icmp eq i32 %81, 62
  br i1 %82, label %83, label %92

83:                                               ; preds = %80, %74
  %84 = load i32, ptr %16, align 4, !tbaa !11
  %85 = load i32, ptr %14, align 4, !tbaa !11
  %86 = icmp ne i32 %84, %85
  br i1 %86, label %87, label %92

87:                                               ; preds = %83
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = call noundef zeroext i1 @_ZN2ts7Scanner22isConflictMarkerTriviaERNS_11safe_stringEi(ptr noundef nonnull align 8 dereferenceable(176) %18, ptr noundef nonnull align 8 dereferenceable(32) %88, i32 noundef %89)
  br i1 %90, label %91, label %92

91:                                               ; preds = %87
  store i32 5, ptr %17, align 4
  br label %95

92:                                               ; preds = %87, %83, %80
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !9
  store i32 0, ptr %17, align 4
  br label %95

95:                                               ; preds = %92, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %96 = load i32, ptr %17, align 4
  switch i32 %96, label %106 [
    i32 0, label %97
    i32 5, label %98
  ]

97:                                               ; preds = %95
  br label %70, !llvm.loop !15

98:                                               ; preds = %95, %70
  br label %99

99:                                               ; preds = %98, %61
  %100 = load i32, ptr %7, align 4, !tbaa !9
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  ret i32 %100

101:                                              ; preds = %33
  %102 = load ptr, ptr %11, align 8
  %103 = load i32, ptr %12, align 4
  %104 = insertvalue { ptr, i32 } poison, ptr %102, 0
  %105 = insertvalue { ptr, i32 } %104, i32 %103, 1
  resume { ptr, i32 } %105

106:                                              ; preds = %95
  unreachable
}

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

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

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

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

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

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

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 = !{!"_ZTS14CharacterCodes", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.ts::DiagnosticMessageStore" = type { i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.ptr.100 = type { %"class.std::shared_ptr.101" }
%"class.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.ts::data::DiagnosticMessage" = type <{ i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::vector.104", %"class.std::vector.104", i8, [7 x i8] }>
%"class.std::vector.104" = type { %"struct.std::_Vector_base.105" }
%"struct.std::_Vector_base.105" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<wchar_t>, std::allocator<std::__cxx11::basic_string<wchar_t>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN2ts11DiagnosticsL33Merge_conflict_marker_encounteredE = external hidden global %"struct.ts::DiagnosticMessageStore", align 8
@_ZN2ts7Scanner25mergeConflictMarkerLengthE = external dso_local local_unnamed_addr global i32, align 4

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN2tsL5debugEb(i1 noundef zeroext) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local 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 %2, ptr noundef nonnull %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.ptr.100, align 8
  %6 = alloca %"struct.ts::data::DiagnosticMessage", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = tail call noundef zeroext i1 @_ZNKSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  br i1 %8, label %9, label %18

9:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #4
  call void @_ZN2ts4data17DiagnosticMessageC2ERNS_22DiagnosticMessageStoreE(ptr noundef nonnull align 8 dereferenceable(121) %6, ptr noundef nonnull align 8 dereferenceable(72) @_ZN2ts11DiagnosticsL33Merge_conflict_marker_encounteredE)
  invoke void @_ZN3ptrIN2ts4data17DiagnosticMessageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(121) %6)
          to label %10 unwind label %13

10:                                               ; preds = %9
  %11 = load i32, ptr @_ZN2ts7Scanner25mergeConflictMarkerLengthE, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  invoke void @_ZNKSt8functionIFv3ptrIN2ts4data17DiagnosticMessageEEiiNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEEEclES4_iiSA_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull %5, i32 noundef %2, i32 noundef %11, ptr noundef nonnull %7)
          to label %12 unwind label %15

12:                                               ; preds = %10
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %6) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #4
  br label %18

13:                                               ; preds = %9
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %17

15:                                               ; preds = %10
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @_ZN3ptrIN2ts4data17DiagnosticMessageEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  br label %17

17:                                               ; preds = %15, %13
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %14, %13 ]
  call void @_ZN2ts4data17DiagnosticMessageD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %6) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn

18:                                               ; preds = %12, %4
  %19 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2)
  %20 = call noundef i32 @_ZN2ts11safe_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %21 = and i32 %19, -3
  %or.cond = icmp eq i32 %21, 60
  br i1 %or.cond, label %.preheader, label %27

.preheader:                                       ; preds = %18
  %22 = icmp sgt i32 %20, %2
  br i1 %22, label %.lr.ph45, label %.critedge

.lr.ph45:                                         ; preds = %.preheader, %25
  %.03144 = phi i32 [ %26, %25 ], [ %2, %.preheader ]
  %23 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.03144)
  %24 = call noundef zeroext i1 @_ZN2ts7Scanner11isLineBreakE14CharacterCodes(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %23)
  br i1 %24, label %.critedge, label %25

25:                                               ; preds = %.lr.ph45
  %26 = add i32 %.03144, 1
  %exitcond51.not = icmp eq i32 %26, %20
  br i1 %exitcond51.not, label %.critedge, label %.lr.ph45, !llvm.loop !9

27:                                               ; preds = %18
  %28 = icmp eq i32 %19, 124
  %29 = icmp eq i32 %19, 61
  %30 = or i1 %28, %29
  call void @_ZN2tsL5debugEb(i1 noundef zeroext %30)
  %31 = icmp sgt i32 %20, %2
  br i1 %31, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %27, %36
  %.141 = phi i32 [ %37, %36 ], [ %2, %27 ]
  %32 = call noundef i32 @_ZN2ts11safe_stringixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.141)
  %33 = add i32 %32, -63
  %or.cond3 = icmp ult i32 %33, -2
  %.not = icmp eq i32 %32, %19
  %or.cond36 = or i1 %.not, %or.cond3
  br i1 %or.cond36, label %36, label %34

34:                                               ; preds = %.lr.ph
  %35 = 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 %.141)
  br i1 %35, label %.critedge, label %36

36:                                               ; preds = %34, %.lr.ph
  %37 = add i32 %.141, 1
  %exitcond.not = icmp eq i32 %37, %20
  br i1 %exitcond.not, label %.critedge, label %.lr.ph

.critedge:                                        ; preds = %36, %34, %25, %.lr.ph45, %27, %.preheader
  %.3 = phi i32 [ %2, %.preheader ], [ %2, %27 ], [ %20, %25 ], [ %.03144, %.lr.ph45 ], [ %20, %36 ], [ %.141, %34 ]
  ret i32 %.3
}

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

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

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

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

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

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

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

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

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


; Effective O3 passes: GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass