; LLVM IR from smv1999/CompetitiveProgrammingQuestionBank :: Strings (Rabin_Karp_Algorithm)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15Rabin_Karp_AlgoNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %16 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %18 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %44, %2
  %21 = load i32, ptr %12, align 4, !tbaa !9
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %47

25:                                               ; preds = %20
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = mul nsw i32 %26, 256
  %28 = load i32, ptr %12, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %29)
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = sext i8 %31 to i32
  %33 = add nsw i32 %27, %32
  %34 = srem i32 %33, 1283
  store i32 %34, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = mul nsw i32 %35, 256
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %38)
  %40 = load i8, ptr %39, align 1, !tbaa !11
  %41 = sext i8 %40 to i32
  %42 = add nsw i32 %36, %41
  %43 = srem i32 %42, 1283
  store i32 %43, ptr %11, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %25
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %12, align 4, !tbaa !9
  br label %20, !llvm.loop !12

47:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %58, %47
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  %52 = icmp sle i32 %49, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %61

54:                                               ; preds = %48
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = mul nsw i32 %55, 256
  %57 = srem i32 %56, 1283
  store i32 %57, ptr %8, align 4, !tbaa !9
  br label %58

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

61:                                               ; preds = %53
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %139, %61
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = load i32, ptr %6, align 4, !tbaa !9
  %66 = sub nsw i32 %64, %65
  %67 = icmp sle i32 %63, %66
  br i1 %67, label %68, label %142

68:                                               ; preds = %62
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp eq i32 %69, %70
  br i1 %71, label %72, label %107

72:                                               ; preds = %68
  store i32 1, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %94, %72
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 10, ptr %15, align 4
  br label %97

78:                                               ; preds = %73
  %79 = load i32, ptr %14, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %80)
  %82 = load i8, ptr %81, align 1, !tbaa !11
  %83 = sext i8 %82 to i32
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = load i32, ptr %14, align 4, !tbaa !9
  %86 = add nsw i32 %84, %85
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %87)
  %89 = load i8, ptr %88, align 1, !tbaa !11
  %90 = sext i8 %89 to i32
  %91 = icmp eq i32 %83, %90
  br i1 %91, label %92, label %93

92:                                               ; preds = %78
  br label %94

93:                                               ; preds = %78
  store i32 0, ptr %7, align 4, !tbaa !9
  store i32 10, ptr %15, align 4
  br label %97

94:                                               ; preds = %92
  %95 = load i32, ptr %14, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %14, align 4, !tbaa !9
  br label %73, !llvm.loop !15

97:                                               ; preds = %93, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %101, label %106

101:                                              ; preds = %98
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %102, i32 noundef %103)
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef @.str.1)
  br label %106

106:                                              ; preds = %101, %98
  br label %107

107:                                              ; preds = %106, %68
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = load i32, ptr %6, align 4, !tbaa !9
  %111 = sub nsw i32 %109, %110
  %112 = icmp slt i32 %108, %111
  br i1 %112, label %113, label %139

113:                                              ; preds = %107
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %116)
  %118 = load i8, ptr %117, align 1, !tbaa !11
  %119 = sext i8 %118 to i32
  %120 = load i32, ptr %8, align 4, !tbaa !9
  %121 = mul nsw i32 %119, %120
  %122 = sub nsw i32 %114, %121
  %123 = mul nsw i32 256, %122
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = load i32, ptr %6, align 4, !tbaa !9
  %126 = add nsw i32 %124, %125
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %127)
  %129 = load i8, ptr %128, align 1, !tbaa !11
  %130 = sext i8 %129 to i32
  %131 = add nsw i32 %123, %130
  %132 = srem i32 %131, 1283
  store i32 %132, ptr %11, align 4, !tbaa !9
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = icmp slt i32 %133, 0
  br i1 %134, label %135, label %138

135:                                              ; preds = %113
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1283
  store i32 %137, ptr %11, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %135, %113
  br label %139

139:                                              ; preds = %138, %107
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %9, align 4, !tbaa !9
  br label %62, !llvm.loop !16

142:                                              ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = !{!"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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15Rabin_Karp_AlgoNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %4 = trunc i64 %3 to i32
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %6 = trunc i64 %5 to i32
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %.preheader47.thread

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = and i64 %5, 2147483647
  br label %.lr.ph

.preheader48:                                     ; preds = %.lr.ph
  %.not.not53.not = icmp eq i32 %6, 1
  br i1 %.not.not53.not, label %.preheader47, label %.lr.ph56.preheader

.lr.ph56.preheader:                               ; preds = %.preheader48
  %8 = add nsw i32 %6, -1
  %9 = add nsw i32 %6, -2
  %xtraiter = and i32 %8, 3
  %10 = icmp ult i32 %9, 3
  br i1 %10, label %.preheader47.loopexit.unr-lcssa, label %.lr.ph56.preheader.new

.lr.ph56.preheader.new:                           ; preds = %.lr.ph56.preheader
  %unroll_iter = and i32 %8, -4
  br label %.lr.ph56

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.03750 = phi i32 [ 0, %.lr.ph.preheader ], [ %22, %.lr.ph ]
  %.03849 = phi i32 [ 0, %.lr.ph.preheader ], [ %16, %.lr.ph ]
  %11 = shl nsw i32 %.03849, 8
  %12 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %14 = sext i8 %13 to i32
  %15 = add nsw i32 %11, %14
  %16 = srem i32 %15, 1283
  %17 = shl nsw i32 %.03750, 8
  %18 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = sext i8 %19 to i32
  %21 = add nsw i32 %17, %20
  %22 = srem i32 %21, 1283
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader48, label %.lr.ph, !llvm.loop !8

.preheader47.loopexit.unr-lcssa:                  ; preds = %.lr.ph56, %.lr.ph56.preheader
  %.lcssa.ph = phi i32 [ poison, %.lr.ph56.preheader ], [ %72, %.lr.ph56 ]
  %.04054.unr = phi i32 [ 1, %.lr.ph56.preheader ], [ %72, %.lr.ph56 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader47, label %.lr.ph56.epil

.lr.ph56.epil:                                    ; preds = %.preheader47.loopexit.unr-lcssa, %.lr.ph56.epil
  %.04054.epil = phi i32 [ %24, %.lr.ph56.epil ], [ %.04054.unr, %.preheader47.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph56.epil ], [ 0, %.preheader47.loopexit.unr-lcssa ]
  %23 = shl nuw nsw i32 %.04054.epil, 8
  %24 = urem i32 %23, 1283
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader47, label %.lr.ph56.epil, !llvm.loop !10

.preheader47:                                     ; preds = %.preheader47.loopexit.unr-lcssa, %.lr.ph56.epil, %.preheader48
  %.040.lcssa = phi i32 [ 1, %.preheader48 ], [ %.lcssa.ph, %.preheader47.loopexit.unr-lcssa ], [ %24, %.lr.ph56.epil ]
  %25 = sub nsw i32 %4, %6
  %.not61 = icmp slt i32 %25, 0
  br i1 %.not61, label %._crit_edge, label %.lr.ph64

.preheader47.thread:                              ; preds = %2
  %26 = sub nsw i32 %4, %6
  %.not6194 = icmp slt i32 %26, 0
  br i1 %.not6194, label %._crit_edge, label %.lr.ph64.split.preheader

.lr.ph64:                                         ; preds = %.preheader47
  br i1 %7, label %.lr.ph64.split.us.preheader, label %.lr.ph64.split.preheader

.lr.ph64.split.preheader:                         ; preds = %.preheader47.thread, %.lr.ph64
  %.037.lcssa9095103 = phi i32 [ %22, %.lr.ph64 ], [ 0, %.preheader47.thread ]
  %.038.lcssa8996102 = phi i32 [ %16, %.lr.ph64 ], [ 0, %.preheader47.thread ]
  %.040.lcssa97101 = phi i32 [ %.040.lcssa, %.lr.ph64 ], [ 1, %.preheader47.thread ]
  %27 = phi i32 [ %25, %.lr.ph64 ], [ %26, %.preheader47.thread ]
  %sext = shl i64 %5, 32
  %28 = ashr exact i64 %sext, 32
  %29 = zext nneg i32 %27 to i64
  %30 = add i64 %3, 1
  %31 = sub i64 %30, %5
  %wide.trip.count74 = and i64 %31, 4294967295
  br label %.lr.ph64.split

.lr.ph64.split.us.preheader:                      ; preds = %.lr.ph64
  %32 = zext nneg i32 %25 to i64
  %33 = and i64 %5, 2147483647
  %34 = add i64 %3, 1
  %35 = sub i64 %34, %5
  %wide.trip.count84 = and i64 %35, 4294967295
  br label %.lr.ph64.split.us

.lr.ph64.split.us:                                ; preds = %.lr.ph64.split.us.preheader, %60
  %indvars.iv81 = phi i64 [ 0, %.lr.ph64.split.us.preheader ], [ %indvars.iv.next82, %60 ]
  %.163.us = phi i32 [ %22, %.lr.ph64.split.us.preheader ], [ %.2.us, %60 ]
  %36 = icmp eq i32 %16, %.163.us
  br i1 %36, label %.preheader.us, label %.loopexit.us

37:                                               ; preds = %.preheader.us
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next77, %33
  br i1 %exitcond80.not, label %..critedge_crit_edge.us, label %.preheader.us, !llvm.loop !12

.preheader.us:                                    ; preds = %.lr.ph64.split.us, %37
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %37 ], [ 0, %.lr.ph64.split.us ]
  %38 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv76)
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = add nuw nsw i64 %indvars.iv76, %indvars.iv81
  %41 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %40)
  %42 = load i8, ptr %41, align 1, !tbaa !5
  %43 = icmp eq i8 %39, %42
  br i1 %43, label %37, label %.loopexit.us

.loopexit.us:                                     ; preds = %.preheader.us, %..critedge_crit_edge.us, %.lr.ph64.split.us
  %44 = icmp ult i64 %indvars.iv81, %32
  br i1 %44, label %45, label %60

45:                                               ; preds = %.loopexit.us
  %46 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv81)
  %47 = load i8, ptr %46, align 1, !tbaa !5
  %48 = sext i8 %47 to i32
  %49 = mul nsw i32 %.040.lcssa, %48
  %50 = sub nsw i32 %.163.us, %49
  %51 = shl nsw i32 %50, 8
  %52 = add nuw nsw i64 %indvars.iv81, %33
  %53 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %52)
  %54 = load i8, ptr %53, align 1, !tbaa !5
  %55 = sext i8 %54 to i32
  %56 = add nsw i32 %51, %55
  %57 = srem i32 %56, 1283
  %58 = icmp slt i32 %57, 0
  %59 = add nsw i32 %57, 1283
  %spec.select.us = select i1 %58, i32 %59, i32 %57
  br label %60

60:                                               ; preds = %45, %.loopexit.us
  %.2.us = phi i32 [ %.163.us, %.loopexit.us ], [ %spec.select.us, %45 ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
  br i1 %exitcond85.not, label %._crit_edge, label %.lr.ph64.split.us, !llvm.loop !13

..critedge_crit_edge.us:                          ; preds = %37
  %61 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %62 = trunc nuw nsw i64 %indvars.iv81 to i32
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %61, i32 noundef %62)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str.1)
  br label %.loopexit.us

.lr.ph56:                                         ; preds = %.lr.ph56, %.lr.ph56.preheader.new
  %.04054 = phi i32 [ 1, %.lr.ph56.preheader.new ], [ %72, %.lr.ph56 ]
  %niter = phi i32 [ 0, %.lr.ph56.preheader.new ], [ %niter.next.3, %.lr.ph56 ]
  %65 = shl nuw nsw i32 %.04054, 8
  %66 = urem i32 %65, 1283
  %67 = shl nuw nsw i32 %66, 8
  %68 = urem i32 %67, 1283
  %69 = shl nuw nsw i32 %68, 8
  %70 = urem i32 %69, 1283
  %71 = shl nuw nsw i32 %70, 8
  %72 = urem i32 %71, 1283
  %niter.next.3 = add i32 %niter, 4
  %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader47.loopexit.unr-lcssa, label %.lr.ph56, !llvm.loop !14

.lr.ph64.split:                                   ; preds = %.lr.ph64.split.preheader, %95
  %indvars.iv71 = phi i64 [ 0, %.lr.ph64.split.preheader ], [ %indvars.iv.next72, %95 ]
  %.163 = phi i32 [ %.037.lcssa9095103, %.lr.ph64.split.preheader ], [ %.2, %95 ]
  %73 = icmp eq i32 %.038.lcssa8996102, %.163
  br i1 %73, label %.preheader, label %78

.preheader:                                       ; preds = %.lr.ph64.split
  %74 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %75 = trunc nuw nsw i64 %indvars.iv71 to i32
  %76 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %74, i32 noundef %75)
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str.1)
  br label %78

78:                                               ; preds = %.preheader, %.lr.ph64.split
  %79 = icmp ult i64 %indvars.iv71, %29
  br i1 %79, label %80, label %95

80:                                               ; preds = %78
  %81 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv71)
  %82 = load i8, ptr %81, align 1, !tbaa !5
  %83 = sext i8 %82 to i32
  %84 = mul nsw i32 %.040.lcssa97101, %83
  %85 = sub nsw i32 %.163, %84
  %86 = shl nsw i32 %85, 8
  %87 = add nsw i64 %indvars.iv71, %28
  %88 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %87)
  %89 = load i8, ptr %88, align 1, !tbaa !5
  %90 = sext i8 %89 to i32
  %91 = add nsw i32 %86, %90
  %92 = srem i32 %91, 1283
  %93 = icmp slt i32 %92, 0
  %94 = add nsw i32 %92, 1283
  %spec.select = select i1 %93, i32 %94, i32 %92
  br label %95

95:                                               ; preds = %80, %78
  %.2 = phi i32 [ %.163, %78 ], [ %spec.select, %80 ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge, label %.lr.ph64.split, !llvm.loop !13

._crit_edge:                                      ; preds = %95, %60, %.preheader47.thread, %.preheader47
  ret void
}

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

; Function Attrs: mustprogress nounwind 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 #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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 = { "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 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}


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