; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 09. String/rabin_karp_algo_pattern_match.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 [2 x i8], align 1
@.str.1 = 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
  %14 = alloca i8, align 1
  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
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call i64 @strlen(ptr noundef %15) #6
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call i64 @strlen(ptr noundef %18) #6
  %20 = trunc i64 %19 to i32
  store i32 %20, 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 %21

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

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

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

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

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

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

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

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

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

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

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

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

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

97:                                               ; preds = %81
  store i8 0, ptr %14, align 1, !tbaa !15
  br label %109

98:                                               ; preds = %81
  %99 = load i8, ptr %14, align 1, !tbaa !15, !range !17, !noundef !18
  %100 = trunc i8 %99 to i1
  br i1 %100, label %101, label %105

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

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

106:                                              ; preds = %105
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %10, align 4, !tbaa !9
  br label %77, !llvm.loop !19

109:                                              ; preds = %97, %77
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = icmp eq i32 %110, %111
  br i1 %112, label %113, label %118

113:                                              ; preds = %109
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %114, i32 noundef %115)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %118

118:                                              ; preds = %113, %109
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  br label %119

119:                                              ; preds = %118, %72
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = load i32, ptr %8, align 4, !tbaa !9
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = sub nsw i32 %121, %122
  %124 = icmp slt i32 %120, %123
  br i1 %124, label %125, label %155

125:                                              ; preds = %119
  %126 = load i32, ptr %12, align 4, !tbaa !9
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = load i32, ptr %9, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %127, i64 %129
  %131 = load i8, ptr %130, align 1, !tbaa !13
  %132 = sext i8 %131 to i32
  %133 = load i32, ptr %13, align 4, !tbaa !9
  %134 = mul nsw i32 %132, %133
  %135 = sub nsw i32 %126, %134
  %136 = mul nsw i32 256, %135
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load i32, ptr %9, align 4, !tbaa !9
  %139 = load i32, ptr %7, align 4, !tbaa !9
  %140 = add nsw i32 %138, %139
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %137, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !13
  %144 = sext i8 %143 to i32
  %145 = add nsw i32 %136, %144
  %146 = load i32, ptr %6, align 4, !tbaa !9
  %147 = srem i32 %145, %146
  store i32 %147, ptr %12, align 4, !tbaa !9
  %148 = load i32, ptr %12, align 4, !tbaa !9
  %149 = icmp slt i32 %148, 0
  br i1 %149, label %150, label %154

150:                                              ; preds = %125
  %151 = load i32, ptr %12, align 4, !tbaa !9
  %152 = load i32, ptr %6, align 4, !tbaa !9
  %153 = add nsw i32 %151, %152
  store i32 %153, ptr %12, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %150, %125
  br label %155

155:                                              ; preds = %154, %119
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %9, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %9, align 4, !tbaa !9
  br label %66, !llvm.loop !20

159:                                              ; preds = %66
  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 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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 [2 x i8], align 1
@.str.1 = 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 %.preheader62

.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 %.preheader62.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

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

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

.preheader62:                                     ; preds = %.preheader62.loopexit.unr-lcssa, %.lr.ph.epil, %3
  %.0.lcssa = phi i32 [ 1, %3 ], [ %.lcssa137.ph, %.preheader62.loopexit.unr-lcssa ], [ %13, %.lr.ph.epil ]
  %14 = icmp sgt i32 %5, 0
  br i1 %14, label %.lr.ph68.preheader, label %.preheader61.thread

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

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.064 = 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 %.064, 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 %.preheader62.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !7

.preheader61:                                     ; preds = %.lr.ph68
  %23 = sub nsw i32 %7, %5
  %.not76 = icmp slt i32 %23, 0
  br i1 %.not76, label %._crit_edge80, label %.lr.ph79

.preheader61.thread:                              ; preds = %.preheader62
  %24 = sub nsw i32 %7, %5
  %.not76115 = icmp slt i32 %24, 0
  br i1 %.not76115, label %._crit_edge80, label %.lr.ph79.split

.lr.ph79:                                         ; preds = %.preheader61
  br i1 %14, label %.lr.ph79.split.us.preheader, label %.lr.ph79.split

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

.lr.ph79.split.us:                                ; preds = %.lr.ph79.split.us.preheader, %55
  %indvars.iv108 = phi i64 [ 0, %.lr.ph79.split.us.preheader ], [ %indvars.iv.next109, %55 ]
  %.178.us = phi i32 [ %93, %.lr.ph79.split.us.preheader ], [ %.2.us, %55 ]
  %29 = icmp eq i32 %87, %.178.us
  br i1 %29, label %.preheader.us.preheader, label %40

.preheader.us.preheader:                          ; preds = %.lr.ph79.split.us
  %invariant.gep = getelementptr inbounds i8, ptr %1, i64 %indvars.iv108
  %30 = trunc nuw nsw i64 %indvars.iv108 to i32
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %56
  %indvars.iv103 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next104, %56 ]
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv103
  %31 = load i8, ptr %gep, align 1, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv103
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %.not60.us = icmp eq i8 %31, %33
  br i1 %.not60.us, label %56, label %._crit_edge.us

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

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

40:                                               ; preds = %._crit_edge.us.thread, %._crit_edge.us, %.lr.ph79.split.us
  %41 = icmp ult i64 %indvars.iv108, %25
  br i1 %41, label %42, label %55

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

55:                                               ; preds = %42, %40
  %.2.us = phi i32 [ %.178.us, %40 ], [ %spec.select.us, %42 ]
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %exitcond112.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count111
  br i1 %exitcond112.not, label %._crit_edge80, label %.lr.ph79.split.us, !llvm.loop !12

56:                                               ; preds = %.preheader.us
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %30)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str)
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next104, %26
  br i1 %exitcond107.not, label %._crit_edge.us.thread, label %.preheader.us, !llvm.loop !13

.lr.ph79.split:                                   ; preds = %.preheader61.thread, %.lr.ph79
  %.051.lcssa116121 = phi i32 [ %87, %.lr.ph79 ], [ 0, %.preheader61.thread ]
  %.050.lcssa117120 = phi i32 [ %93, %.lr.ph79 ], [ 0, %.preheader61.thread ]
  %59 = phi i32 [ %23, %.lr.ph79 ], [ %24, %.preheader61.thread ]
  %60 = icmp eq i32 %5, 0
  br i1 %60, label %.lr.ph79.split.split.us.preheader, label %._crit_edge80

.lr.ph79.split.split.us.preheader:                ; preds = %.lr.ph79.split
  %61 = zext nneg i32 %59 to i64
  %62 = add i64 %6, 1
  %wide.trip.count101 = and i64 %62, 4294967295
  br label %.lr.ph79.split.split.us

.lr.ph79.split.split.us:                          ; preds = %.lr.ph79.split.split.us.preheader, %77
  %indvars.iv98 = phi i64 [ 0, %.lr.ph79.split.split.us.preheader ], [ %indvars.iv.next99, %77 ]
  %.178.us81 = phi i32 [ %.050.lcssa117120, %.lr.ph79.split.split.us.preheader ], [ %.2.us84, %77 ]
  %63 = icmp eq i32 %.051.lcssa116121, %.178.us81
  br i1 %63, label %.preheader.us86, label %64

64:                                               ; preds = %.preheader.us86, %.lr.ph79.split.split.us
  %65 = icmp ult i64 %indvars.iv98, %61
  br i1 %65, label %66, label %77

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

77:                                               ; preds = %66, %64
  %.2.us84 = phi i32 [ %.178.us81, %64 ], [ %spec.select.us83, %66 ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
  br i1 %exitcond102.not, label %._crit_edge80, label %.lr.ph79.split.split.us, !llvm.loop !12

.preheader.us86:                                  ; preds = %.lr.ph79.split.split.us
  %78 = 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.1)
  %79 = trunc nuw nsw i64 %indvars.iv98 to i32
  %80 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef %79)
  %81 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %64

.lr.ph68:                                         ; preds = %.lr.ph68.preheader, %.lr.ph68
  %indvars.iv = phi i64 [ 0, %.lr.ph68.preheader ], [ %indvars.iv.next, %.lr.ph68 ]
  %.05067 = phi i32 [ 0, %.lr.ph68.preheader ], [ %93, %.lr.ph68 ]
  %.05166 = phi i32 [ 0, %.lr.ph68.preheader ], [ %87, %.lr.ph68 ]
  %82 = shl nsw i32 %.05166, 8
  %83 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv
  %84 = load i8, ptr %83, align 1, !tbaa !9
  %85 = sext i8 %84 to i32
  %86 = add nsw i32 %82, %85
  %87 = srem i32 %86, %2
  %88 = shl nsw i32 %.05067, 8
  %89 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %91 = sext i8 %90 to i32
  %92 = add nsw i32 %88, %91
  %93 = srem i32 %92, %2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond94.not, label %.preheader61, label %.lr.ph68, !llvm.loop !14

._crit_edge80:                                    ; preds = %77, %55, %.lr.ph79.split, %.preheader61.thread, %.preheader61
  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,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass