; LLVM IR from DionysiosB/CodeForces :: 0500-0599 (540C-IceCave)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #0 {
  %6 = alloca i1, align 1
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store i64 %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !9
  %12 = load i64, ptr %7, align 8, !tbaa !5
  %13 = icmp slt i64 %12, 0
  br i1 %13, label %19, label %14

14:                                               ; preds = %5
  %15 = load i64, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %9, align 8, !tbaa !9
  %17 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #2
  %18 = icmp uge i64 %15, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %14, %5
  store i1 false, ptr %6, align 1
  br label %93

20:                                               ; preds = %14
  %21 = load i64, ptr %8, align 8, !tbaa !5
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %29, label %23

23:                                               ; preds = %20
  %24 = load i64, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %9, align 8, !tbaa !9
  %26 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef 0) #2
  %27 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %26) #2
  %28 = icmp uge i64 %24, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %23, %20
  store i1 false, ptr %6, align 1
  br label %93

30:                                               ; preds = %23
  %31 = load ptr, ptr %9, align 8, !tbaa !9
  %32 = load i64, ptr %7, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %32) #2
  %34 = load i64, ptr %8, align 8, !tbaa !5
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %33, i64 noundef %34)
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 88
  br i1 %38, label %39, label %51

39:                                               ; preds = %30
  %40 = load i64, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %10, align 8, !tbaa !9
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = icmp eq i64 %40, %42
  br i1 %43, label %44, label %49

44:                                               ; preds = %39
  %45 = load i64, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %11, align 8, !tbaa !9
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = icmp eq i64 %45, %47
  br label %49

49:                                               ; preds = %44, %39
  %50 = phi i1 [ false, %39 ], [ %48, %44 ]
  store i1 %50, ptr %6, align 1
  br label %93

51:                                               ; preds = %30
  %52 = load ptr, ptr %9, align 8, !tbaa !9
  %53 = load i64, ptr %7, align 8, !tbaa !5
  %54 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %53) #2
  %55 = load i64, ptr %8, align 8, !tbaa !5
  %56 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %54, i64 noundef %55)
  store i8 88, ptr %56, align 1, !tbaa !11
  %57 = load i64, ptr %7, align 8, !tbaa !5
  %58 = sub nsw i64 %57, 1
  %59 = load i64, ptr %8, align 8, !tbaa !5
  %60 = load ptr, ptr %9, align 8, !tbaa !9
  %61 = load ptr, ptr %10, align 8, !tbaa !9
  %62 = load ptr, ptr %11, align 8, !tbaa !9
  %63 = call noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %58, i64 noundef %59, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(8) %62)
  br i1 %63, label %64, label %65

64:                                               ; preds = %51
  store i1 true, ptr %6, align 1
  br label %93

65:                                               ; preds = %51
  %66 = load i64, ptr %7, align 8, !tbaa !5
  %67 = add nsw i64 %66, 1
  %68 = load i64, ptr %8, align 8, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  %70 = load ptr, ptr %10, align 8, !tbaa !9
  %71 = load ptr, ptr %11, align 8, !tbaa !9
  %72 = call noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %67, i64 noundef %68, ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull align 8 dereferenceable(8) %71)
  br i1 %72, label %73, label %74

73:                                               ; preds = %65
  store i1 true, ptr %6, align 1
  br label %93

74:                                               ; preds = %65
  %75 = load i64, ptr %7, align 8, !tbaa !5
  %76 = load i64, ptr %8, align 8, !tbaa !5
  %77 = sub nsw i64 %76, 1
  %78 = load ptr, ptr %9, align 8, !tbaa !9
  %79 = load ptr, ptr %10, align 8, !tbaa !9
  %80 = load ptr, ptr %11, align 8, !tbaa !9
  %81 = call noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %75, i64 noundef %77, ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull align 8 dereferenceable(8) %80)
  br i1 %81, label %82, label %83

82:                                               ; preds = %74
  store i1 true, ptr %6, align 1
  br label %93

83:                                               ; preds = %74
  %84 = load i64, ptr %7, align 8, !tbaa !5
  %85 = load i64, ptr %8, align 8, !tbaa !5
  %86 = add nsw i64 %85, 1
  %87 = load ptr, ptr %9, align 8, !tbaa !9
  %88 = load ptr, ptr %10, align 8, !tbaa !9
  %89 = load ptr, ptr %11, align 8, !tbaa !9
  %90 = call noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %84, i64 noundef %86, ptr noundef nonnull align 8 dereferenceable(24) %87, ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull align 8 dereferenceable(8) %89)
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  store i1 true, ptr %6, align 1
  br label %93

92:                                               ; preds = %83
  store i1 false, ptr %6, align 1
  br label %93

93:                                               ; preds = %92, %91, %82, %73, %64, %49, %29, %19
  %94 = load i1, ptr %6, align 1
  ret i1 %94
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #0 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 = { 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}


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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) local_unnamed_addr #0 {
  %6 = icmp slt i64 %0, 0
  br i1 %6, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %7 = add nsw i64 %0, -1
  %8 = add nuw nsw i64 %0, 1
  %9 = icmp slt i64 %1, 0
  %10 = tail call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #2
  %.not57 = icmp ule i64 %10, %0
  %or.cond58 = or i1 %9, %.not57
  br i1 %or.cond58, label %.loopexit, label %.lr.ph60

.lr.ph60:                                         ; preds = %.lr.ph, %tailrecurse
  %.tr394459 = phi i64 [ %33, %tailrecurse ], [ %1, %.lr.ph ]
  %11 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #2
  %12 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #2
  %.not38 = icmp ugt i64 %12, %.tr394459
  br i1 %.not38, label %13, label %.loopexit

13:                                               ; preds = %.lr.ph60
  %14 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %0) #2
  %15 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %14, i64 noundef %.tr394459)
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = icmp eq i8 %16, 88
  br i1 %17, label %18, label %24

18:                                               ; preds = %13
  %19 = load i64, ptr %3, align 8, !tbaa !8
  %20 = icmp eq i64 %19, %0
  %21 = load i64, ptr %4, align 8
  %22 = icmp eq i64 %21, %.tr394459
  %23 = select i1 %20, i1 %22, i1 false
  br label %.loopexit

24:                                               ; preds = %13
  %25 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %0) #2
  %26 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %25, i64 noundef %.tr394459)
  store i8 88, ptr %26, align 1, !tbaa !5
  %27 = tail call noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %7, i64 noundef %.tr394459, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %27, label %.loopexit, label %28

28:                                               ; preds = %24
  %29 = tail call noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %8, i64 noundef %.tr394459, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %29, label %.loopexit, label %30

30:                                               ; preds = %28
  %31 = add nsw i64 %.tr394459, -1
  %32 = tail call noundef zeroext i1 @_Z3dfsllRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EERKlSA_(i64 noundef %0, i64 noundef %31, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %32, label %.loopexit, label %tailrecurse

tailrecurse:                                      ; preds = %30
  %33 = add nuw nsw i64 %.tr394459, 1
  %34 = tail call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #2
  %.not = icmp ule i64 %34, %0
  %or.cond = or i1 %9, %.not
  br i1 %or.cond, label %.loopexit, label %.lr.ph60

.loopexit:                                        ; preds = %30, %28, %24, %.lr.ph60, %tailrecurse, %.lr.ph, %5, %18
  %.0 = phi i1 [ %23, %18 ], [ false, %5 ], [ false, %.lr.ph ], [ false, %tailrecurse ], [ false, %.lr.ph60 ], [ true, %24 ], [ true, %28 ], [ true, %30 ]
  ret i1 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 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 = { 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 = { 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 = !{!"long", !6, i64 0}


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