; LLVM IR from amritansh22/Data-Structures-and-Algorithms-in-cpp :: Rabin_Karp_Algorithm.ll/Z9rabinKarpNSt7 (cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z9fastPoweriii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z10createHashNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z9rabinKarpNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %20 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #3
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %22 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = invoke noundef i64 @_Z10createHashNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef %9, i32 noundef %24)
          to label %26 unwind label %40

26:                                               ; preds = %2
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  store i64 %25, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %0)
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = invoke noundef i64 @_Z10createHashNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef %13, i32 noundef %27)
          to label %29 unwind label %44

29:                                               ; preds = %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #3
  store i64 %28, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = sub nsw i32 %30, 1
  %32 = call noundef i64 @_Z9fastPoweriii(i32 noundef 101, i32 noundef %31, i32 noundef 1009)
  store i64 %32, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %121, %29
  %34 = load i32, ptr %15, align 4, !tbaa !9
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = sub nsw i32 %35, %36
  %38 = icmp sle i32 %34, %37
  br i1 %38, label %48, label %39

39:                                               ; preds = %33
  store i32 2, ptr %16, align 4
  br label %124

40:                                               ; preds = %2
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %10, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  br label %129

44:                                               ; preds = %26
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %10, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %129

48:                                               ; preds = %33
  %49 = load i64, ptr %8, align 8, !tbaa !11
  %50 = load i64, ptr %12, align 8, !tbaa !11
  %51 = icmp eq i64 %49, %50
  br i1 %51, label %52, label %88

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #3
  store i8 1, ptr %17, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %53 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %53, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %73, %52
  %55 = load i32, ptr %19, align 4, !tbaa !9
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 5, ptr %16, align 4
  br label %78

59:                                               ; preds = %54
  %60 = load i32, ptr %19, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %61) #3
  %63 = load i8, ptr %62, align 1, !tbaa !15
  %64 = sext i8 %63 to i32
  %65 = load i32, ptr %18, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %66) #3
  %68 = load i8, ptr %67, align 1, !tbaa !15
  %69 = sext i8 %68 to i32
  %70 = icmp ne i32 %64, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %59
  store i8 0, ptr %17, align 1, !tbaa !13
  store i32 5, ptr %16, align 4
  br label %78

72:                                               ; preds = %59
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %18, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %18, align 4, !tbaa !9
  %76 = load i32, ptr %19, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %19, align 4, !tbaa !9
  br label %54, !llvm.loop !16

78:                                               ; preds = %71, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %79

79:                                               ; preds = %78
  %80 = load i8, ptr %17, align 1, !tbaa !13, !range !18, !noundef !19
  %81 = trunc i8 %80 to i1
  br i1 %81, label %82, label %84

82:                                               ; preds = %79
  %83 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %83, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %85

84:                                               ; preds = %79
  store i32 0, ptr %16, align 4
  br label %85

85:                                               ; preds = %84, %82
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #3
  %86 = load i32, ptr %16, align 4
  switch i32 %86, label %124 [
    i32 0, label %87
  ]

87:                                               ; preds = %85
  br label %88

88:                                               ; preds = %87, %48
  %89 = load i32, ptr %15, align 4, !tbaa !9
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = sub nsw i32 %90, %91
  %93 = icmp slt i32 %89, %92
  br i1 %93, label %94, label %120

94:                                               ; preds = %88
  %95 = load i64, ptr %12, align 8, !tbaa !11
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %97) #3
  %99 = load i8, ptr %98, align 1, !tbaa !15
  %100 = sext i8 %99 to i64
  %101 = load i64, ptr %14, align 8, !tbaa !11
  %102 = mul nsw i64 %100, %101
  %103 = sub nsw i64 %95, %102
  %104 = mul nsw i64 101, %103
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = load i32, ptr %6, align 4, !tbaa !9
  %107 = add nsw i32 %105, %106
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %108) #3
  %110 = load i8, ptr %109, align 1, !tbaa !15
  %111 = sext i8 %110 to i64
  %112 = add nsw i64 %104, %111
  %113 = srem i64 %112, 1009
  store i64 %113, ptr %12, align 8, !tbaa !11
  %114 = load i64, ptr %12, align 8, !tbaa !11
  %115 = icmp slt i64 %114, 0
  br i1 %115, label %116, label %119

116:                                              ; preds = %94
  %117 = load i64, ptr %12, align 8, !tbaa !11
  %118 = add nsw i64 %117, 1009
  store i64 %118, ptr %12, align 8, !tbaa !11
  br label %119

119:                                              ; preds = %116, %94
  br label %120

120:                                              ; preds = %119, %88
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %15, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %15, align 4, !tbaa !9
  br label %33, !llvm.loop !20

124:                                              ; preds = %85, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %125 = load i32, ptr %16, align 4
  switch i32 %125, label %127 [
    i32 2, label %126
  ]

126:                                              ; preds = %124
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %127

127:                                              ; preds = %126, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %128 = load i32, ptr %3, align 4
  ret i32 %128

129:                                              ; preds = %44, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %10, align 8
  %132 = load i32, ptr %11, align 4
  %133 = insertvalue { ptr, i32 } poison, ptr %131, 0
  %134 = insertvalue { ptr, i32 } %133, i32 %132, 1
  resume { ptr, i32 } %134
}

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 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 = { 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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !17}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z9fastPoweriii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z10createHashNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z9rabinKarpNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef %0, ptr noundef nonnull %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #2
  %6 = trunc i64 %5 to i32
  %7 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #2
  %8 = trunc i64 %7 to i32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %9 = invoke noundef i64 @_Z10createHashNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull %3, i32 noundef %6)
          to label %10 unwind label %47

10:                                               ; preds = %2
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #2
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %0)
  %11 = invoke noundef i64 @_Z10createHashNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull %4, i32 noundef %6)
          to label %12 unwind label %49

12:                                               ; preds = %10
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #2
  %13 = add nsw i32 %6, -1
  %14 = call noundef i64 @_Z9fastPoweriii(i32 noundef 101, i32 noundef %13, i32 noundef 1009)
  %15 = sub nsw i32 %8, %6
  %.not57 = icmp slt i32 %15, 0
  br i1 %.not57, label %.loopexit, label %.lr.ph60

.lr.ph60:                                         ; preds = %12
  %.not4853 = icmp sgt i32 %6, 0
  br i1 %.not4853, label %.lr.ph60.split.us.preheader, label %.lr.ph60.split.preheader

.lr.ph60.split.preheader:                         ; preds = %.lr.ph60
  %sext = shl i64 %5, 32
  %16 = ashr exact i64 %sext, 32
  %17 = zext nneg i32 %15 to i64
  %18 = add i64 %7, 1
  %19 = sub i64 %18, %5
  %wide.trip.count = and i64 %19, 4294967295
  br label %.lr.ph60.split

.lr.ph60.split.us.preheader:                      ; preds = %.lr.ph60
  %20 = zext nneg i32 %15 to i64
  %21 = and i64 %5, 2147483647
  %22 = add i64 %7, 1
  %23 = sub i64 %22, %5
  %wide.trip.count78 = and i64 %23, 4294967295
  br label %.lr.ph60.split.us

.lr.ph60.split.us:                                ; preds = %.lr.ph60.split.us.preheader, %45
  %indvars.iv68 = phi i64 [ 0, %.lr.ph60.split.us.preheader ], [ %indvars.iv.next69, %45 ]
  %.03958.us = phi i64 [ %11, %.lr.ph60.split.us.preheader ], [ %.140.us, %45 ]
  %24 = icmp eq i64 %9, %.03958.us
  br i1 %24, label %.preheader.us, label %.thread.us

.preheader.us:                                    ; preds = %.lr.ph60.split.us, %46
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %46 ], [ %indvars.iv68, %.lr.ph60.split.us ]
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %46 ], [ 0, %.lr.ph60.split.us ]
  %25 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv66) #2
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv70) #2
  %28 = load i8, ptr %27, align 1, !tbaa !5
  %.not47.us = icmp eq i8 %26, %28
  br i1 %.not47.us, label %46, label %.thread.us

.thread.us:                                       ; preds = %.preheader.us, %.lr.ph60.split.us
  %29 = icmp ult i64 %indvars.iv68, %20
  br i1 %29, label %30, label %45

30:                                               ; preds = %.thread.us
  %31 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv68) #2
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %33 = sext i8 %32 to i64
  %34 = mul nsw i64 %14, %33
  %35 = sub nsw i64 %.03958.us, %34
  %36 = mul nsw i64 %35, 101
  %37 = add nuw nsw i64 %indvars.iv68, %21
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %37) #2
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = sext i8 %39 to i64
  %41 = add nsw i64 %36, %40
  %42 = srem i64 %41, 1009
  %43 = icmp slt i64 %42, 0
  %44 = add nsw i64 %42, 1009
  %spec.select.us = select i1 %43, i64 %44, i64 %42
  br label %45

45:                                               ; preds = %30, %.thread.us
  %.140.us = phi i64 [ %.03958.us, %.thread.us ], [ %spec.select.us, %30 ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count78
  br i1 %exitcond79.not, label %.loopexit, label %.lr.ph60.split.us, !llvm.loop !8

46:                                               ; preds = %.preheader.us
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next67, %21
  br i1 %exitcond76.not, label %.loopexit.loopexit, label %.preheader.us, !llvm.loop !10

47:                                               ; preds = %2
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %71

49:                                               ; preds = %10
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %71

.lr.ph60.split:                                   ; preds = %.lr.ph60.split.preheader, %68
  %indvars.iv = phi i64 [ 0, %.lr.ph60.split.preheader ], [ %indvars.iv.next, %68 ]
  %.03958 = phi i64 [ %11, %.lr.ph60.split.preheader ], [ %.140, %68 ]
  %51 = icmp eq i64 %9, %.03958
  br i1 %51, label %.loopexit.loopexit81.split.loop.exit, label %.thread

.thread:                                          ; preds = %.lr.ph60.split
  %52 = icmp ult i64 %indvars.iv, %17
  br i1 %52, label %53, label %68

53:                                               ; preds = %.thread
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv) #2
  %55 = load i8, ptr %54, align 1, !tbaa !5
  %56 = sext i8 %55 to i64
  %57 = mul nsw i64 %14, %56
  %58 = sub nsw i64 %.03958, %57
  %59 = mul nsw i64 %58, 101
  %60 = add nsw i64 %indvars.iv, %16
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %60) #2
  %62 = load i8, ptr %61, align 1, !tbaa !5
  %63 = sext i8 %62 to i64
  %64 = add nsw i64 %59, %63
  %65 = srem i64 %64, 1009
  %66 = icmp slt i64 %65, 0
  %67 = add nsw i64 %65, 1009
  %spec.select = select i1 %66, i64 %67, i64 %65
  br label %68

68:                                               ; preds = %53, %.thread
  %.140 = phi i64 [ %.03958, %.thread ], [ %spec.select, %53 ]
  %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 %.loopexit, label %.lr.ph60.split, !llvm.loop !8

.loopexit.loopexit:                               ; preds = %46
  %69 = trunc nuw nsw i64 %indvars.iv68 to i32
  br label %.loopexit

.loopexit.loopexit81.split.loop.exit:             ; preds = %.lr.ph60.split
  %70 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.loopexit

.loopexit:                                        ; preds = %68, %45, %.loopexit.loopexit81.split.loop.exit, %.loopexit.loopexit, %12
  %spec.select49 = phi i32 [ -1, %12 ], [ %69, %.loopexit.loopexit ], [ %70, %.loopexit.loopexit81.split.loop.exit ], [ -1, %45 ], [ -1, %68 ]
  ret i32 %spec.select49

71:                                               ; preds = %49, %47
  %.sink = phi ptr [ %4, %49 ], [ %3, %47 ]
  %.pn = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %.sink) #2
  resume { ptr, i32 } %.pn
}

; 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 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 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}


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