; LLVM IR from tangjz/acm-icpc :: lydsy/2994.ll (Z4readv)

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

@_Z3patB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@len = external dso_local global i32, align 4
@num = external dso_local global [301 x i32], align 16
@buf = external dso_local global [301 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4readv() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @buf)
  store i32 0, ptr @len, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %21, %0
  %6 = load i32, ptr @len, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %7
  %9 = load i8, ptr %8, align 1, !tbaa !9
  %10 = icmp ne i8 %9, 0
  br i1 %10, label %11, label %24

11:                                               ; preds = %5
  %12 = load i32, ptr @len, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %13
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = sext i8 %15 to i32
  %17 = sub nsw i32 %16, 48
  %18 = load i32, ptr @len, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %19
  store i32 %17, ptr %20, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %11
  %22 = load i32, ptr @len, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr @len, align 4, !tbaa !5
  br label %5, !llvm.loop !10

24:                                               ; preds = %5
  %25 = load i32, ptr @len, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr @num, i64 %26
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @num, ptr noundef %27)
  %28 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11, ptr noundef @.str.3)
  br label %29

29:                                               ; preds = %79, %24
  %30 = load i32, ptr @len, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %80

32:                                               ; preds = %29
  %33 = load i32, ptr @num, align 16, !tbaa !5
  %34 = and i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11, i8 noundef signext %37)
  %39 = load i32, ptr @num, align 16, !tbaa !5
  %40 = ashr i32 %39, 1
  store i32 %40, ptr @num, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %66, %32
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = load i32, ptr @len, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %69

46:                                               ; preds = %41
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = and i32 %50, 1
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %60

53:                                               ; preds = %46
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, 5
  store i32 %59, ptr %57, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %53, %46
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = ashr i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %60
  %67 = load i32, ptr %1, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %1, align 4, !tbaa !5
  br label %41, !llvm.loop !12

69:                                               ; preds = %45
  %70 = load i32, ptr @len, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %79, label %76

76:                                               ; preds = %69
  %77 = load i32, ptr @len, align 4, !tbaa !5
  %78 = add nsw i32 %77, -1
  store i32 %78, ptr @len, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %76, %69
  br label %29, !llvm.loop !13

80:                                               ; preds = %29
  %81 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11) #5
  %82 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %2, i32 0, i32 0
  store ptr %81, ptr %82, align 8
  %83 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11) #5
  %84 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %83, ptr %84, align 8
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %2, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvT_SA_(ptr %86, ptr %88)
  ret void
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #0 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) #0 align 2

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

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

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

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

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

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 = { "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 willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


; 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] }

@_Z3patB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@len = external dso_local local_unnamed_addr global i32, align 4
@num = external dso_local global [301 x i32], align 16
@buf = external dso_local global [301 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4readv() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @buf)
  %2 = load i8, ptr @buf, align 16, !tbaa !5
  %.not11 = icmp eq i8 %2, 0
  br i1 %.not11, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %3 = phi i8 [ %8, %.lr.ph ], [ %2, %0 ]
  %4 = sext i8 %3 to i32
  %5 = add nsw i32 %4, -48
  %6 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %indvars.iv
  store i32 %5, ptr %6, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %7 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %indvars.iv.next
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !10

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %9 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %storemerge.lcssa = phi i32 [ 0, %0 ], [ %9, %._crit_edge.loopexit ]
  %.lcssa10 = phi i64 [ 0, %0 ], [ %indvars.iv.next, %._crit_edge.loopexit ]
  store i32 %storemerge.lcssa, ptr @len, align 4, !tbaa !8
  %10 = getelementptr inbounds i32, ptr @num, i64 %.lcssa10
  tail call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @num, ptr noundef nonnull %10)
  %11 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11, ptr noundef nonnull @.str.3)
  %12 = load i32, ptr @len, align 4, !tbaa !8
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph20, label %._crit_edge21

.lr.ph20:                                         ; preds = %._crit_edge, %56
  %14 = load i32, ptr @num, align 16, !tbaa !8
  %15 = and i32 %14, 1
  %16 = zext nneg i32 %15 to i64
  %17 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %16
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %19 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11, i8 noundef signext %18)
  %20 = load i32, ptr @num, align 16, !tbaa !8
  %21 = ashr i32 %20, 1
  store i32 %21, ptr @num, align 16, !tbaa !8
  %22 = load i32, ptr @len, align 4, !tbaa !8
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %.lr.ph16.preheader, label %._crit_edge17

.lr.ph16.preheader:                               ; preds = %.lr.ph20
  %wide.trip.count = zext nneg i32 %22 to i64
  %24 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %24, 1
  %25 = icmp eq i32 %22, 2
  br i1 %25, label %._crit_edge17.loopexit.unr-lcssa, label %.lr.ph16.preheader.new

.lr.ph16.preheader.new:                           ; preds = %.lr.ph16.preheader
  %unroll_iter = and i64 %24, -2
  br label %.lr.ph16

._crit_edge17.loopexit.unr-lcssa:                 ; preds = %53, %.lr.ph16.preheader
  %.unr = phi i32 [ %21, %.lr.ph16.preheader ], [ %54, %53 ]
  %indvars.iv23.unr = phi i64 [ 1, %.lr.ph16.preheader ], [ %indvars.iv.next24.1, %53 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge17, label %.lr.ph16.epil

.lr.ph16.epil:                                    ; preds = %._crit_edge17.loopexit.unr-lcssa
  %26 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %indvars.iv23.unr
  %27 = load i32, ptr %26, align 4, !tbaa !8
  %28 = and i32 %27, 1
  %.not9.epil = icmp eq i32 %28, 0
  br i1 %.not9.epil, label %._crit_edge17.loopexit.epilog-lcssa, label %29

29:                                               ; preds = %.lr.ph16.epil
  %30 = add nsw i64 %indvars.iv23.unr, -1
  %31 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %30
  %32 = add nsw i32 %.unr, 5
  store i32 %32, ptr %31, align 4, !tbaa !8
  br label %._crit_edge17.loopexit.epilog-lcssa

._crit_edge17.loopexit.epilog-lcssa:              ; preds = %29, %.lr.ph16.epil
  %33 = ashr i32 %27, 1
  store i32 %33, ptr %26, align 4, !tbaa !8
  br label %._crit_edge17

._crit_edge17:                                    ; preds = %._crit_edge17.loopexit.epilog-lcssa, %._crit_edge17.loopexit.unr-lcssa, %.lr.ph20
  %34 = add nsw i32 %22, -1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !8
  %.not8 = icmp eq i32 %37, 0
  br i1 %.not8, label %55, label %56

.lr.ph16:                                         ; preds = %53, %.lr.ph16.preheader.new
  %38 = phi i32 [ %21, %.lr.ph16.preheader.new ], [ %54, %53 ]
  %indvars.iv23 = phi i64 [ 1, %.lr.ph16.preheader.new ], [ %indvars.iv.next24.1, %53 ]
  %niter = phi i64 [ 0, %.lr.ph16.preheader.new ], [ %niter.next.1, %53 ]
  %39 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %indvars.iv23
  %40 = load i32, ptr %39, align 4, !tbaa !8
  %41 = and i32 %40, 1
  %.not9 = icmp eq i32 %41, 0
  br i1 %.not9, label %.lr.ph16.1, label %42

42:                                               ; preds = %.lr.ph16
  %43 = add nsw i64 %indvars.iv23, -1
  %44 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %43
  %45 = add nsw i32 %38, 5
  store i32 %45, ptr %44, align 4, !tbaa !8
  br label %.lr.ph16.1

.lr.ph16.1:                                       ; preds = %42, %.lr.ph16
  %46 = ashr i32 %40, 1
  store i32 %46, ptr %39, align 4, !tbaa !8
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
  %47 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %indvars.iv.next24
  %48 = load i32, ptr %47, align 4, !tbaa !8
  %49 = and i32 %48, 1
  %.not9.1 = icmp eq i32 %49, 0
  br i1 %.not9.1, label %53, label %50

50:                                               ; preds = %.lr.ph16.1
  %51 = getelementptr inbounds [301 x i32], ptr @num, i64 0, i64 %indvars.iv23
  %52 = add nsw i32 %46, 5
  store i32 %52, ptr %51, align 4, !tbaa !8
  br label %53

53:                                               ; preds = %50, %.lr.ph16.1
  %54 = ashr i32 %48, 1
  store i32 %54, ptr %47, align 4, !tbaa !8
  %indvars.iv.next24.1 = add nuw nsw i64 %indvars.iv23, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge17.loopexit.unr-lcssa, label %.lr.ph16, !llvm.loop !12

55:                                               ; preds = %._crit_edge17
  store i32 %34, ptr @len, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %55, %._crit_edge17
  %57 = phi i32 [ %34, %55 ], [ %22, %._crit_edge17 ]
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph20, label %._crit_edge21, !llvm.loop !13

._crit_edge21:                                    ; preds = %56, %._crit_edge
  %59 = tail call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11) #4
  %60 = tail call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3patB5cxx11) #4
  tail call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvT_SA_(ptr %59, ptr %60)
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #0 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

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

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

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 = { nofree nounwind "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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass