; LLVM IR from UtkarshPathrabe/Competitive-Coding :: HackerRank Solutions/Algorithms/Search (Encryption)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [82 x i8], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %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 i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 82, ptr %2) #7
  %16 = getelementptr inbounds [82 x i8], ptr %2, i64 0, i64 0
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %18 = getelementptr inbounds [82 x i8], ptr %2, i64 0, i64 0
  %19 = call i64 @strlen(ptr noundef %18) #8
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %21)
  %23 = call double @llvm.floor.f64(double %22)
  %24 = fptosi double %23 to i32
  store i32 %24, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %25)
  %27 = call double @llvm.ceil.f64(double %26)
  %28 = fptosi double %27 to i32
  store i32 %28, ptr %5, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = mul nsw i32 %29, %30
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %36

34:                                               ; preds = %0
  %35 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %35, ptr %4, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %34, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %37 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %37, ptr %6, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %44, %36
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = mul nsw i32 %40, %41
  %43 = icmp slt i32 %39, %42
  br i1 %43, label %44, label %49

44:                                               ; preds = %38
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [82 x i8], ptr %2, i64 0, i64 %47
  store i8 64, ptr %48, align 1, !tbaa !9
  br label %38, !llvm.loop !10

49:                                               ; preds = %38
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [82 x i8], ptr %2, i64 0, i64 %51
  store i8 0, ptr %52, align 1, !tbaa !9
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = zext i32 %53 to i64
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = zext i32 %55 to i64
  %57 = call ptr @llvm.stacksave.p0()
  store ptr %57, ptr %7, align 8
  %58 = mul nuw i64 %54, %56
  %59 = alloca i8, i64 %58, align 16
  store i64 %54, ptr %8, align 8
  store i64 %56, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %88, %49
  %61 = load i32, ptr %10, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 4, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %91

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %84, %65
  %67 = load i32, ptr %13, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 7, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %87

71:                                               ; preds = %66
  %72 = load i32, ptr %11, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %11, align 4, !tbaa !5
  %74 = sext i32 %72 to i64
  %75 = getelementptr inbounds [82 x i8], ptr %2, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = mul nsw i64 %78, %56
  %80 = getelementptr inbounds i8, ptr %59, i64 %79
  %81 = load i32, ptr %13, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %80, i64 %82
  store i8 %76, ptr %83, align 1, !tbaa !9
  br label %84

84:                                               ; preds = %71
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %13, align 4, !tbaa !5
  br label %66, !llvm.loop !12

87:                                               ; preds = %70
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %10, align 4, !tbaa !5
  br label %60, !llvm.loop !13

91:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %130, %91
  %93 = load i32, ptr %14, align 4, !tbaa !5
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 10, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %133

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %125, %97
  %99 = load i32, ptr %15, align 4, !tbaa !5
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 13, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %128

103:                                              ; preds = %98
  %104 = load i32, ptr %15, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul nsw i64 %105, %56
  %107 = getelementptr inbounds i8, ptr %59, i64 %106
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i8, ptr %107, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !9
  %112 = sext i8 %111 to i32
  %113 = icmp ne i32 %112, 64
  br i1 %113, label %114, label %124

114:                                              ; preds = %103
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = mul nsw i64 %116, %56
  %118 = getelementptr inbounds i8, ptr %59, i64 %117
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i8, ptr %118, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !9
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %122)
  br label %124

124:                                              ; preds = %114, %103
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %15, align 4, !tbaa !5
  br label %98, !llvm.loop !14

128:                                              ; preds = %102
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %130

130:                                              ; preds = %128
  %131 = load i32, ptr %14, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %14, align 4, !tbaa !5
  br label %92, !llvm.loop !15

133:                                              ; preds = %96
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  %134 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %134)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 82, ptr %2) #7
  %135 = load i32, ptr %1, align 4
  ret i32 %135
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; 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_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #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) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

attributes #0 = { mustprogress norecurse 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 = { 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 = { 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 #4 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind willreturn }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [82 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 82, ptr nonnull %1) #9
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %1)
  %3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #10
  %4 = trunc i64 %3 to i32
  %5 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %4)
  %6 = call double @llvm.floor.f64(double %5)
  %7 = fptosi double %6 to i32
  %8 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %4)
  %9 = call double @llvm.ceil.f64(double %8)
  %10 = fptosi double %9 to i32
  %11 = mul nsw i32 %10, %7
  %12 = icmp slt i32 %11, %4
  %spec.select = select i1 %12, i32 %10, i32 %7
  %13 = mul nsw i32 %spec.select, %10
  %14 = icmp sgt i32 %13, %4
  %sext84 = shl i64 %3, 32
  %15 = ashr exact i64 %sext84, 32
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %scevgep = getelementptr i8, ptr %1, i64 %15
  %16 = xor i32 %4, -1
  %17 = add i32 %13, %16
  %18 = zext i32 %17 to i64
  %19 = add nuw nsw i64 %18, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 64, i64 %19, i1 false), !tbaa !5
  %wide.trip.count = sext i32 %13 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %0
  %.pre-phi = phi i64 [ %15, %0 ], [ %wide.trip.count, %.lr.ph.preheader ]
  %20 = getelementptr inbounds [82 x i8], ptr %1, i64 0, i64 %.pre-phi
  store i8 0, ptr %20, align 1, !tbaa !5
  %21 = zext i32 %spec.select to i64
  %22 = zext i32 %10 to i64
  %23 = call ptr @llvm.stacksave.p0()
  %24 = mul nuw i64 %21, %22
  %25 = alloca i8, i64 %24, align 16
  %26 = icmp sgt i32 %spec.select, 0
  %27 = icmp sgt i32 %10, 0
  br i1 %26, label %.preheader41.lr.ph, label %.preheader40.thread86

.preheader41.lr.ph:                               ; preds = %._crit_edge
  br i1 %27, label %.preheader41.us.preheader, label %._crit_edge54

.preheader41.us.preheader:                        ; preds = %.preheader41.lr.ph
  %28 = zext nneg i32 %10 to i64
  %xtraiter = and i64 %21, 1
  %29 = icmp eq i32 %spec.select, 1
  br i1 %29, label %.preheader.lr.ph.unr-lcssa, label %.preheader41.us.preheader.new

.preheader41.us.preheader.new:                    ; preds = %.preheader41.us.preheader
  %unroll_iter = and i64 %21, 2147483646
  br label %.preheader41.us

.preheader41.us:                                  ; preds = %.preheader41.us, %.preheader41.us.preheader.new
  %indvar = phi i64 [ 0, %.preheader41.us.preheader.new ], [ %indvar.next.1, %.preheader41.us ]
  %.03649.us = phi i64 [ 0, %.preheader41.us.preheader.new ], [ %35, %.preheader41.us ]
  %niter = phi i64 [ 0, %.preheader41.us.preheader.new ], [ %niter.next.1, %.preheader41.us ]
  %30 = mul nuw nsw i64 %indvar, %22
  %scevgep59 = getelementptr i8, ptr %25, i64 %30
  %sext85 = shl i64 %.03649.us, 32
  %31 = ashr exact i64 %sext85, 32
  %scevgep60 = getelementptr i8, ptr %1, i64 %31
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %scevgep59, ptr align 1 %scevgep60, i64 %22, i1 false), !tbaa !5
  %32 = add nsw i64 %.03649.us, %28
  %indvar.next = or disjoint i64 %indvar, 1
  %33 = mul nuw nsw i64 %indvar.next, %22
  %scevgep59.1 = getelementptr i8, ptr %25, i64 %33
  %sext85.1 = shl i64 %32, 32
  %34 = ashr exact i64 %sext85.1, 32
  %scevgep60.1 = getelementptr i8, ptr %1, i64 %34
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep59.1, ptr align 1 %scevgep60.1, i64 %22, i1 false), !tbaa !5
  %35 = add nsw i64 %34, %28
  %indvar.next.1 = add nuw nsw i64 %indvar, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.lr.ph.unr-lcssa.loopexit, label %.preheader41.us, !llvm.loop !8

.preheader40.thread86:                            ; preds = %._crit_edge
  br i1 %27, label %.preheader.preheader, label %._crit_edge54

.preheader.lr.ph.unr-lcssa.loopexit:              ; preds = %.preheader41.us
  %36 = shl i64 %35, 32
  %37 = ashr exact i64 %36, 32
  br label %.preheader.lr.ph.unr-lcssa

.preheader.lr.ph.unr-lcssa:                       ; preds = %.preheader.lr.ph.unr-lcssa.loopexit, %.preheader41.us.preheader
  %indvar.unr = phi i64 [ 0, %.preheader41.us.preheader ], [ %indvar.next.1, %.preheader.lr.ph.unr-lcssa.loopexit ]
  %.03649.us.unr = phi i64 [ 0, %.preheader41.us.preheader ], [ %37, %.preheader.lr.ph.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.lr.ph, label %.preheader41.us.epil

.preheader41.us.epil:                             ; preds = %.preheader.lr.ph.unr-lcssa
  %38 = mul nuw nsw i64 %indvar.unr, %22
  %scevgep59.epil = getelementptr i8, ptr %25, i64 %38
  %scevgep60.epil = getelementptr i8, ptr %1, i64 %.03649.us.unr
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep59.epil, ptr align 1 %scevgep60.epil, i64 %22, i1 false), !tbaa !5
  br label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader.lr.ph.unr-lcssa, %.preheader41.us.epil
  br i1 %26, label %.preheader.us, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader40.thread86, %.preheader.lr.ph
  br label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge52.us
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %._crit_edge52.us ], [ 0, %.preheader.lr.ph ]
  %invariant.gep.us = getelementptr inbounds i8, ptr %25, i64 %indvars.iv79
  br label %39

39:                                               ; preds = %.preheader.us, %44
  %indvars.iv74 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next75, %44 ]
  %40 = mul nuw nsw i64 %indvars.iv74, %22
  %gep.us = getelementptr inbounds i8, ptr %invariant.gep.us, i64 %40
  %41 = load i8, ptr %gep.us, align 1, !tbaa !5
  %.not.us = icmp eq i8 %41, 64
  br i1 %.not.us, label %44, label %42

42:                                               ; preds = %39
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %41)
  br label %44

44:                                               ; preds = %42, %39
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %21
  br i1 %exitcond78.not, label %._crit_edge52.us, label %39, !llvm.loop !10

._crit_edge52.us:                                 ; preds = %44
  %45 = 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)
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %22
  br i1 %exitcond83.not, label %._crit_edge54, label %.preheader.us, !llvm.loop !11

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.03453 = phi i32 [ %47, %.preheader ], [ 0, %.preheader.preheader ]
  %46 = 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)
  %47 = add nuw nsw i32 %.03453, 1
  %exitcond73.not = icmp eq i32 %47, %10
  br i1 %exitcond73.not, label %._crit_edge54, label %.preheader, !llvm.loop !11

._crit_edge54:                                    ; preds = %.preheader, %._crit_edge52.us, %.preheader41.lr.ph, %.preheader40.thread86
  call void @llvm.stackrestore.p0(ptr %23)
  call void @llvm.lifetime.end.p0(i64 82, ptr nonnull %1) #9
  ret i32 0
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; Function Attrs: mustprogress 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_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8

attributes #0 = { mustprogress norecurse 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { inlinehint 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
attributes #10 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}


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