; LLVM IR from eyangch/competitive-programming :: Codeforces/2/b.ll (Z9backtrackB5cxx11RA1000_A1000_iS1_)

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

@N = 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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9backtrackB5cxx11RA1000_A1000_iS1_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 4 dereferenceable(4000000) %1, ptr noundef nonnull align 4 dereferenceable(4000000) %2) #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i1, align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %14 = load i32, ptr @N, align 4, !tbaa !9
  %15 = sub nsw i32 %14, 1
  store i32 %15, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %16 = load i32, ptr @N, align 4, !tbaa !9
  %17 = sub nsw i32 %16, 1
  store i32 %17, ptr %8, align 4, !tbaa !9
  store i1 false, ptr %9, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %18

18:                                               ; preds = %104, %102, %61, %3
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %24, label %21

21:                                               ; preds = %18
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = icmp sgt i32 %22, 0
  br label %24

24:                                               ; preds = %21, %18
  %25 = phi i1 [ true, %18 ], [ %23, %21 ]
  br i1 %25, label %26, label %105

26:                                               ; preds = %24
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %67

29:                                               ; preds = %26
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = sub nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1000 x [1000 x i32]], ptr %30, i64 0, i64 %33
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1000 x i32], ptr %34, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1000 x [1000 x i32]], ptr %39, i64 0, i64 %41
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1000 x i32], ptr %42, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1000 x [1000 x i32]], ptr %47, i64 0, i64 %49
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1000 x i32], ptr %50, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = sub nsw i32 %46, %54
  %56 = icmp eq i32 %38, %55
  br i1 %56, label %57, label %66

57:                                               ; preds = %29
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %7, align 4, !tbaa !9
  %60 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 68)
          to label %61 unwind label %62

61:                                               ; preds = %57
  br label %18, !llvm.loop !11

62:                                               ; preds = %105, %98, %57
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %118

66:                                               ; preds = %29
  br label %67

67:                                               ; preds = %66, %26
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %70, label %104

70:                                               ; preds = %67
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1000 x [1000 x i32]], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1000 x i32], ptr %74, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1000 x [1000 x i32]], ptr %80, i64 0, i64 %82
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1000 x i32], ptr %83, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1000 x [1000 x i32]], ptr %88, i64 0, i64 %90
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1000 x i32], ptr %91, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = sub nsw i32 %87, %95
  %97 = icmp eq i32 %79, %96
  br i1 %97, label %98, label %103

98:                                               ; preds = %70
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %8, align 4, !tbaa !9
  %101 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 82)
          to label %102 unwind label %62

102:                                              ; preds = %98
  br label %18, !llvm.loop !11

103:                                              ; preds = %70
  br label %104

104:                                              ; preds = %103, %67
  br label %18, !llvm.loop !11

105:                                              ; preds = %24
  %106 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %107 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %106, ptr %107, align 8
  %108 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %109 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvT_SA_(ptr %111, ptr %113)
          to label %114 unwind label %62

114:                                              ; preds = %105
  store i1 true, ptr %9, align 1
  %115 = load i1, ptr %9, align 1
  br i1 %115, label %117, label %116

116:                                              ; preds = %114
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %117

117:                                              ; preds = %116, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void

118:                                              ; preds = %62
  %119 = load ptr, ptr %10, align 8
  %120 = load i32, ptr %11, align 4
  %121 = insertvalue { ptr, i32 } poison, ptr %119, 0
  %122 = insertvalue { ptr, i32 } %121, i32 %120, 1
  resume { ptr, i32 } %122
}

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvT_SA_(ptr, ptr) #3

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

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

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

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

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

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


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@N = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9backtrackB5cxx11RA1000_A1000_iS1_(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4000000) %1, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4000000) %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = load i32, ptr @N, align 4, !tbaa !5
  %.fr128 = freeze i32 %4
  %5 = add i32 %.fr128, -1
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %.outer

.outer:                                           ; preds = %.split37.us.split.us, %3
  %.027.ph = phi i32 [ %.us-phi39, %.split37.us.split.us ], [ %5, %3 ]
  %.0.ph = phi i32 [ %.us-phi38, %.split37.us.split.us ], [ %5, %3 ]
  %6 = icmp sgt i32 %.027.ph, 0
  %7 = sext i32 %.027.ph to i64
  br i1 %6, label %.outer31.us.preheader, label %.outer31

.outer31.us.preheader:                            ; preds = %.outer
  %smin = tail call i32 @llvm.smin.i32(i32 %.0.ph, i32 0)
  br label %.outer31.us

.outer31.us:                                      ; preds = %.outer31.us.preheader, %.split.us.us
  %.0.ph32.us = phi i32 [ %9, %.split.us.us ], [ %.0.ph, %.outer31.us.preheader ]
  %8 = icmp sgt i32 %.0.ph32.us, 0
  %9 = add nsw i32 %.0.ph32.us, -1
  br i1 %8, label %.lr.ph.split.us.us, label %.lr.ph.split

.lr.ph.split.us.us:                               ; preds = %.outer31.us
  %10 = zext nneg i32 %.0.ph32.us to i64
  %11 = getelementptr inbounds [1000 x [1000 x i32]], ptr %1, i64 0, i64 %10, i64 %7
  %12 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %10, i64 %7
  %13 = zext nneg i32 %9 to i64
  %14 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %13, i64 %7
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = load i32, ptr %12, align 4, !tbaa !5
  %17 = load i32, ptr %11, align 4, !tbaa !5
  %18 = sub nsw i32 %16, %17
  %19 = icmp eq i32 %15, %18
  br i1 %19, label %.split.us.us, label %.lr.ph.split.us.split

.split.us.us:                                     ; preds = %.lr.ph.split.us.us
  %20 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 68)
          to label %.outer31.us unwind label %.loopexit.loopexit.split.us, !llvm.loop !9

.loopexit.loopexit.split.us:                      ; preds = %.split.us.us
  %lpad.loopexit28.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.outer31:                                         ; preds = %.outer, %.split.us
  %.0.ph32 = phi i32 [ %22, %.split.us ], [ %.0.ph, %.outer ]
  %21 = icmp sgt i32 %.0.ph32, 0
  br i1 %21, label %.lr.ph, label %.outer31._crit_edge

.lr.ph:                                           ; preds = %.outer31
  %22 = add nsw i32 %.0.ph32, -1
  %23 = zext nneg i32 %22 to i64
  %24 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %23, i64 %7
  %25 = zext nneg i32 %.0.ph32 to i64
  %26 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %25, i64 %7
  %27 = getelementptr inbounds [1000 x [1000 x i32]], ptr %1, i64 0, i64 %25, i64 %7
  %28 = load i32, ptr %24, align 4, !tbaa !5
  %29 = load i32, ptr %26, align 4, !tbaa !5
  %30 = load i32, ptr %27, align 4, !tbaa !5
  %31 = sub nsw i32 %29, %30
  %32 = icmp eq i32 %28, %31
  br i1 %32, label %.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split:                            ; preds = %.lr.ph, %.lr.ph.split.us.us
  %.us-phi123 = phi i32 [ %.0.ph32.us, %.lr.ph.split.us.us ], [ %.0.ph32, %.lr.ph ]
  tail call void @llvm.assume(i1 %6)
  %33 = zext nneg i32 %.us-phi123 to i64
  %34 = zext nneg i32 %.027.ph to i64
  %35 = getelementptr inbounds [1000 x [1000 x i32]], ptr %1, i64 0, i64 %33, i64 %34
  %36 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %33, i64 %34
  %37 = add nsw i32 %.027.ph, -1
  %38 = zext nneg i32 %37 to i64
  %39 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %33, i64 %38
  br label %.split37.us.split.us

.split.us:                                        ; preds = %.lr.ph
  %40 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 68)
          to label %.outer31 unwind label %.loopexit.loopexit.split, !llvm.loop !9

.lr.ph.split:                                     ; preds = %.outer31.us
  %41 = sext i32 %smin to i64
  %42 = add nsw i32 %.027.ph, -1
  %43 = zext nneg i32 %42 to i64
  %44 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %41, i64 %43
  %45 = zext nneg i32 %.027.ph to i64
  %46 = getelementptr inbounds [1000 x [1000 x i32]], ptr %2, i64 0, i64 %41, i64 %45
  %47 = getelementptr inbounds [1000 x [1000 x i32]], ptr %1, i64 0, i64 %41, i64 %45
  br label %.split37.us.split.us

.loopexit.loopexit.split:                         ; preds = %.split.us
  %lpad.loopexit28 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.loopexit.split-lp:                      ; preds = %.split37.us.split.us
  %lpad.loopexit.split-lp29 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.split-lp:                               ; preds = %.outer31._crit_edge
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit.split-lp, %.loopexit.loopexit.split.us, %.loopexit.loopexit.split, %.loopexit.split-lp
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit.split-lp29, %.loopexit.loopexit.split-lp ], [ %lpad.loopexit28, %.loopexit.loopexit.split ], [ %lpad.loopexit28.us, %.loopexit.loopexit.split.us ]
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  resume { ptr, i32 } %lpad.phi

.split37.us.split.us:                             ; preds = %.lr.ph.split, %.lr.ph.split.us.split
  %.sink = phi ptr [ %44, %.lr.ph.split ], [ %39, %.lr.ph.split.us.split ]
  %.sink146 = phi ptr [ %46, %.lr.ph.split ], [ %36, %.lr.ph.split.us.split ]
  %.sink145 = phi ptr [ %47, %.lr.ph.split ], [ %35, %.lr.ph.split.us.split ]
  %.us-phi38 = phi i32 [ %smin, %.lr.ph.split ], [ %.us-phi123, %.lr.ph.split.us.split ]
  %.us-phi39 = phi i32 [ %42, %.lr.ph.split ], [ %37, %.lr.ph.split.us.split ]
  %48 = load i32, ptr %.sink, align 4, !tbaa !5
  %49 = load i32, ptr %.sink146, align 4, !tbaa !5
  %50 = load i32, ptr %.sink145, align 4, !tbaa !5
  %51 = sub nsw i32 %49, %50
  %52 = icmp eq i32 %48, %51
  tail call void @llvm.assume(i1 %52)
  %53 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 82)
          to label %.outer unwind label %.loopexit.loopexit.split-lp, !llvm.loop !9

.outer31._crit_edge:                              ; preds = %.outer31
  %54 = tail call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %55 = tail call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvT_SA_(ptr %54, ptr %55)
          to label %56 unwind label %.loopexit.split-lp

56:                                               ; preds = %.outer31._crit_edge
  ret void
}

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvT_SA_(ptr, ptr) local_unnamed_addr #2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4

attributes #0 = { 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 #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 = { inlinehint 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { 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: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass