; LLVM IR from div-bargali/Data-Structures-and-Algorithms :: C++/Algorithms/Pattern-Searching/Rabin-Karp_Algorithm.ll (Z6searchPcS_i)

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6searchPcS_i(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %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
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call i64 @strlen(ptr noundef %14) #6
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i64 @strlen(ptr noundef %17) #6
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %30, %3
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = sub nsw i32 %22, 1
  %24 = icmp slt i32 %21, %23
  br i1 %24, label %25, label %33

25:                                               ; preds = %20
  %26 = load i32, ptr %13, align 4, !tbaa !9
  %27 = mul nsw i32 %26, 256
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = srem i32 %27, %28
  store i32 %29, ptr %13, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %25
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %9, align 4, !tbaa !9
  br label %20, !llvm.loop !11

33:                                               ; preds = %20
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %61, %33
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %64

38:                                               ; preds = %34
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = mul nsw i32 256, %39
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !13
  %46 = sext i8 %45 to i32
  %47 = add nsw i32 %40, %46
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = srem i32 %47, %48
  store i32 %49, ptr %11, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = mul nsw i32 256, %50
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !13
  %57 = sext i8 %56 to i32
  %58 = add nsw i32 %51, %57
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = srem i32 %58, %59
  store i32 %60, ptr %12, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %38
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %9, align 4, !tbaa !9
  br label %34, !llvm.loop !14

64:                                               ; preds = %34
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %148, %64
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = sub nsw i32 %67, %68
  %70 = icmp sle i32 %66, %69
  br i1 %70, label %71, label %151

71:                                               ; preds = %65
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = icmp eq i32 %72, %73
  br i1 %74, label %75, label %111

75:                                               ; preds = %71
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %98, %75
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %101

80:                                               ; preds = %76
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = add nsw i32 %82, %83
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %81, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !13
  %88 = sext i8 %87 to i32
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !13
  %94 = sext i8 %93 to i32
  %95 = icmp ne i32 %88, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %80
  br label %101

97:                                               ; preds = %80
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %10, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %10, align 4, !tbaa !9
  br label %76, !llvm.loop !15

101:                                              ; preds = %96, %76
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = load i32, ptr %7, align 4, !tbaa !9
  %104 = icmp eq i32 %102, %103
  br i1 %104, label %105, label %110

105:                                              ; preds = %101
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %106, i32 noundef %107)
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %108, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %110

110:                                              ; preds = %105, %101
  br label %111

111:                                              ; preds = %110, %71
  %112 = load i32, ptr %9, align 4, !tbaa !9
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = load i32, ptr %7, align 4, !tbaa !9
  %115 = sub nsw i32 %113, %114
  %116 = icmp slt i32 %112, %115
  br i1 %116, label %117, label %147

117:                                              ; preds = %111
  %118 = load i32, ptr %12, align 4, !tbaa !9
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i8, ptr %119, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !13
  %124 = sext i8 %123 to i32
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = mul nsw i32 %124, %125
  %127 = sub nsw i32 %118, %126
  %128 = mul nsw i32 256, %127
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !9
  %131 = load i32, ptr %7, align 4, !tbaa !9
  %132 = add nsw i32 %130, %131
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i8, ptr %129, i64 %133
  %135 = load i8, ptr %134, align 1, !tbaa !13
  %136 = sext i8 %135 to i32
  %137 = add nsw i32 %128, %136
  %138 = load i32, ptr %6, align 4, !tbaa !9
  %139 = srem i32 %137, %138
  store i32 %139, ptr %12, align 4, !tbaa !9
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = icmp slt i32 %140, 0
  br i1 %141, label %142, label %146

142:                                              ; preds = %117
  %143 = load i32, ptr %12, align 4, !tbaa !9
  %144 = load i32, ptr %6, align 4, !tbaa !9
  %145 = add nsw i32 %143, %144
  store i32 %145, ptr %12, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %142, %117
  br label %147

147:                                              ; preds = %146, %111
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %9, align 4, !tbaa !9
  br label %65, !llvm.loop !16

151:                                              ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  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
  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: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #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) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

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

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

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 = { nounwind willreturn memory(read) "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 }
attributes #6 = { nounwind willreturn memory(read) }

!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"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6searchPcS_i(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #4
  %.fr = freeze i64 %4
  %5 = trunc i64 %.fr to i32
  %6 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #4
  %7 = trunc i64 %6 to i32
  %8 = icmp sgt i32 %5, 1
  br i1 %8, label %.lr.ph.preheader, label %.preheader60

.lr.ph.preheader:                                 ; preds = %3
  %9 = add nsw i32 %5, -2
  %10 = add nsw i32 %5, -1
  %xtraiter = and i32 %10, 3
  %11 = icmp ult i32 %9, 3
  br i1 %11, label %.preheader60.loopexit.unr-lcssa, label %.lr.ph.preheader.new

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

.preheader60.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa135.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %22, %.lr.ph ]
  %.062.unr = phi i32 [ 1, %.lr.ph.preheader ], [ %22, %.lr.ph ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader60, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader60.loopexit.unr-lcssa, %.lr.ph.epil
  %.062.epil = phi i32 [ %13, %.lr.ph.epil ], [ %.062.unr, %.preheader60.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader60.loopexit.unr-lcssa ]
  %12 = shl nsw i32 %.062.epil, 8
  %13 = srem i32 %12, %2
  %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 %.preheader60, label %.lr.ph.epil, !llvm.loop !5

.preheader60:                                     ; preds = %.preheader60.loopexit.unr-lcssa, %.lr.ph.epil, %3
  %.0.lcssa = phi i32 [ 1, %3 ], [ %.lcssa135.ph, %.preheader60.loopexit.unr-lcssa ], [ %13, %.lr.ph.epil ]
  %14 = icmp sgt i32 %5, 0
  br i1 %14, label %.lr.ph66.preheader, label %.preheader59.thread

.lr.ph66.preheader:                               ; preds = %.preheader60
  %wide.trip.count = and i64 %.fr, 2147483647
  br label %.lr.ph66

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.062 = phi i32 [ 1, %.lr.ph.preheader.new ], [ %22, %.lr.ph ]
  %niter = phi i32 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %15 = shl nsw i32 %.062, 8
  %16 = srem i32 %15, %2
  %17 = shl nsw i32 %16, 8
  %18 = srem i32 %17, %2
  %19 = shl nsw i32 %18, 8
  %20 = srem i32 %19, %2
  %21 = shl nsw i32 %20, 8
  %22 = srem i32 %21, %2
  %niter.next.3 = add i32 %niter, 4
  %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader60.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !7

.preheader59:                                     ; preds = %.lr.ph66
  %23 = sub nsw i32 %7, %5
  %.not74 = icmp slt i32 %23, 0
  br i1 %.not74, label %._crit_edge78, label %.lr.ph77

.preheader59.thread:                              ; preds = %.preheader60
  %24 = sub nsw i32 %7, %5
  %.not74113 = icmp slt i32 %24, 0
  br i1 %.not74113, label %._crit_edge78, label %.lr.ph77.split

.lr.ph77:                                         ; preds = %.preheader59
  br i1 %14, label %.lr.ph77.split.us.preheader, label %.lr.ph77.split

.lr.ph77.split.us.preheader:                      ; preds = %.lr.ph77
  %25 = zext nneg i32 %23 to i64
  %26 = and i64 %.fr, 2147483647
  %27 = add i64 %6, 1
  %28 = sub i64 %27, %.fr
  %wide.trip.count109 = and i64 %28, 4294967295
  %invariant.gep126 = getelementptr inbounds i8, ptr %1, i64 %26
  br label %.lr.ph77.split.us

.lr.ph77.split.us:                                ; preds = %.lr.ph77.split.us.preheader, %54
  %indvars.iv106 = phi i64 [ 0, %.lr.ph77.split.us.preheader ], [ %indvars.iv.next107, %54 ]
  %.176.us = phi i32 [ %90, %.lr.ph77.split.us.preheader ], [ %.2.us, %54 ]
  %29 = icmp eq i32 %84, %.176.us
  br i1 %29, label %.preheader.us.preheader, label %39

.preheader.us.preheader:                          ; preds = %.lr.ph77.split.us
  %invariant.gep = getelementptr inbounds i8, ptr %1, i64 %indvars.iv106
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %55
  %indvars.iv101 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next102, %55 ]
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv101
  %30 = load i8, ptr %gep, align 1, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv101
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %.not58.us = icmp eq i8 %30, %32
  br i1 %.not58.us, label %55, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.preheader.us
  %33 = trunc nuw nsw i64 %indvars.iv101 to i32
  %34 = icmp eq i32 %33, %5
  br i1 %34, label %._crit_edge.us.thread, label %39

._crit_edge.us.thread:                            ; preds = %55, %._crit_edge.us
  %35 = 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)
  %36 = trunc nuw nsw i64 %indvars.iv106 to i32
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %35, i32 noundef %36)
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %39

39:                                               ; preds = %._crit_edge.us.thread, %._crit_edge.us, %.lr.ph77.split.us
  %40 = icmp ult i64 %indvars.iv106, %25
  br i1 %40, label %41, label %54

41:                                               ; preds = %39
  %42 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv106
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = sext i8 %43 to i32
  %45 = mul nsw i32 %.0.lcssa, %44
  %46 = sub nsw i32 %.176.us, %45
  %47 = shl nsw i32 %46, 8
  %gep127 = getelementptr inbounds i8, ptr %invariant.gep126, i64 %indvars.iv106
  %48 = load i8, ptr %gep127, align 1, !tbaa !9
  %49 = sext i8 %48 to i32
  %50 = add nsw i32 %47, %49
  %51 = srem i32 %50, %2
  %52 = icmp slt i32 %51, 0
  %53 = select i1 %52, i32 %2, i32 0
  %spec.select.us = add nsw i32 %53, %51
  br label %54

54:                                               ; preds = %41, %39
  %.2.us = phi i32 [ %.176.us, %39 ], [ %spec.select.us, %41 ]
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109
  br i1 %exitcond110.not, label %._crit_edge78, label %.lr.ph77.split.us, !llvm.loop !12

55:                                               ; preds = %.preheader.us
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %26
  br i1 %exitcond105.not, label %._crit_edge.us.thread, label %.preheader.us, !llvm.loop !13

.lr.ph77.split:                                   ; preds = %.preheader59.thread, %.lr.ph77
  %.049.lcssa114119 = phi i32 [ %84, %.lr.ph77 ], [ 0, %.preheader59.thread ]
  %.048.lcssa115118 = phi i32 [ %90, %.lr.ph77 ], [ 0, %.preheader59.thread ]
  %56 = phi i32 [ %23, %.lr.ph77 ], [ %24, %.preheader59.thread ]
  %57 = icmp eq i32 %5, 0
  br i1 %57, label %.lr.ph77.split.split.us.preheader, label %._crit_edge78

.lr.ph77.split.split.us.preheader:                ; preds = %.lr.ph77.split
  %58 = zext nneg i32 %56 to i64
  %59 = add i64 %6, 1
  %wide.trip.count99 = and i64 %59, 4294967295
  br label %.lr.ph77.split.split.us

.lr.ph77.split.split.us:                          ; preds = %.lr.ph77.split.split.us.preheader, %74
  %indvars.iv96 = phi i64 [ 0, %.lr.ph77.split.split.us.preheader ], [ %indvars.iv.next97, %74 ]
  %.176.us79 = phi i32 [ %.048.lcssa115118, %.lr.ph77.split.split.us.preheader ], [ %.2.us82, %74 ]
  %60 = icmp eq i32 %.049.lcssa114119, %.176.us79
  br i1 %60, label %.preheader.us84, label %61

61:                                               ; preds = %.preheader.us84, %.lr.ph77.split.split.us
  %62 = icmp ult i64 %indvars.iv96, %58
  br i1 %62, label %63, label %74

63:                                               ; preds = %61
  %64 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv96
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = sext i8 %65 to i32
  %67 = mul nsw i32 %.0.lcssa, %66
  %68 = sub nsw i32 %.176.us79, %67
  %69 = shl nsw i32 %68, 8
  %70 = add nsw i32 %69, %66
  %71 = srem i32 %70, %2
  %72 = icmp slt i32 %71, 0
  %73 = select i1 %72, i32 %2, i32 0
  %spec.select.us81 = add nsw i32 %73, %71
  br label %74

74:                                               ; preds = %63, %61
  %.2.us82 = phi i32 [ %.176.us79, %61 ], [ %spec.select.us81, %63 ]
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
  br i1 %exitcond100.not, label %._crit_edge78, label %.lr.ph77.split.split.us, !llvm.loop !12

.preheader.us84:                                  ; preds = %.lr.ph77.split.split.us
  %75 = 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)
  %76 = trunc nuw nsw i64 %indvars.iv96 to i32
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %75, i32 noundef %76)
  %78 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %61

.lr.ph66:                                         ; preds = %.lr.ph66.preheader, %.lr.ph66
  %indvars.iv = phi i64 [ 0, %.lr.ph66.preheader ], [ %indvars.iv.next, %.lr.ph66 ]
  %.04865 = phi i32 [ 0, %.lr.ph66.preheader ], [ %90, %.lr.ph66 ]
  %.04964 = phi i32 [ 0, %.lr.ph66.preheader ], [ %84, %.lr.ph66 ]
  %79 = shl nsw i32 %.04964, 8
  %80 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = sext i8 %81 to i32
  %83 = add nsw i32 %79, %82
  %84 = srem i32 %83, %2
  %85 = shl nsw i32 %.04865, 8
  %86 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  %87 = load i8, ptr %86, align 1, !tbaa !9
  %88 = sext i8 %87 to i32
  %89 = add nsw i32 %85, %88
  %90 = srem i32 %89, %2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond92.not, label %.preheader59, label %.lr.ph66, !llvm.loop !14

._crit_edge78:                                    ; preds = %74, %54, %.lr.ph77.split, %.preheader59.thread, %.preheader59
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #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) 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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 nofree nounwind willreturn memory(argmem: read) "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 willreturn memory(read) }

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


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