; LLVM IR from zumrudu-anka/Algorithms :: C++/Searching Algorithms/Binary Search/WithRecursion.ll (Z25BinarySearchWithRecursionPiii)

; 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 [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z25BinarySearchWithRecursionPiii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = sdiv i32 %14, 2
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %28

17:                                               ; preds = %3
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = sdiv i32 %19, 2
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr %18, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp eq i32 %23, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %17
  store i1 true, ptr %4, align 1
  br label %137

27:                                               ; preds = %17
  store i1 false, ptr %4, align 1
  br label %137

28:                                               ; preds = %3
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = sdiv i32 %30, 2
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %29, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = icmp eq i32 %34, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %28
  store i1 true, ptr %4, align 1
  br label %137

38:                                               ; preds = %28
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = sdiv i32 %40, 2
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %39, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = icmp sgt i32 %44, %45
  br i1 %46, label %47, label %84

47:                                               ; preds = %38
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = sdiv i32 %51, 2
  %53 = sext i32 %52 to i64
  %54 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %53, i64 4)
  %55 = extractvalue { i64, i1 } %54, 1
  %56 = extractvalue { i64, i1 } %54, 0
  %57 = select i1 %55, i64 -1, i64 %56
  %58 = call noalias noundef nonnull ptr @_Znam(i64 noundef %57) #6
  store ptr %58, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %75, %47
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = sdiv i32 %61, 2
  %63 = icmp slt i32 %60, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %78

65:                                               ; preds = %59
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %66, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %71, i64 %73
  store i32 %70, ptr %74, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %65
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %9, align 4, !tbaa !9
  br label %59, !llvm.loop !11

78:                                               ; preds = %64
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = sdiv i32 %80, 2
  %82 = load i32, ptr %7, align 4, !tbaa !9
  %83 = call noundef zeroext i1 @_Z25BinarySearchWithRecursionPiii(ptr noundef %79, i32 noundef %81, i32 noundef %82)
  store i1 %83, ptr %4, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %137

84:                                               ; preds = %38
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef @.str.1)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %88 = load i32, ptr %6, align 4, !tbaa !9
  %89 = srem i32 %88, 2
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %94

91:                                               ; preds = %84
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = sdiv i32 %92, 2
  br label %98

94:                                               ; preds = %84
  %95 = load i32, ptr %6, align 4, !tbaa !9
  %96 = sdiv i32 %95, 2
  %97 = add nsw i32 %96, 1
  br label %98

98:                                               ; preds = %94, %91
  %99 = phi i32 [ %93, %91 ], [ %97, %94 ]
  store i32 %99, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %101, i64 4)
  %103 = extractvalue { i64, i1 } %102, 1
  %104 = extractvalue { i64, i1 } %102, 0
  %105 = select i1 %103, i64 -1, i64 %104
  %106 = call noalias noundef nonnull ptr @_Znam(i64 noundef %105) #6
  store ptr %106, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = sdiv i32 %107, 2
  store i32 %108, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %127, %98
  %110 = load i32, ptr %12, align 4, !tbaa !9
  %111 = load i32, ptr %6, align 4, !tbaa !9
  %112 = icmp slt i32 %110, %111
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = load i32, ptr %10, align 4, !tbaa !9
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %132

117:                                              ; preds = %109
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr %123, i64 %125
  store i32 %122, ptr %126, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %117
  %128 = load i32, ptr %12, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %12, align 4, !tbaa !9
  %130 = load i32, ptr %13, align 4, !tbaa !9
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %13, align 4, !tbaa !9
  br label %109, !llvm.loop !13

132:                                              ; preds = %116
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = load i32, ptr %7, align 4, !tbaa !9
  %136 = call noundef zeroext i1 @_Z25BinarySearchWithRecursionPiii(ptr noundef %133, i32 noundef %134, i32 noundef %135)
  store i1 %136, ptr %4, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %137

137:                                              ; preds = %132, %78, %37, %27, %26
  %138 = load i1, ptr %4, align 1
  ret i1 %138
}

; 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) #1

; 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)) #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(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 = { nounwind }
attributes #6 = { builtin allocsize(0) }

!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 = distinct !{!13, !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 [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z25BinarySearchWithRecursionPiii(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %.off54 = add i32 %1, 1
  %4 = icmp ult i32 %.off54, 3
  br i1 %4, label %tailrecurse._crit_edge, label %.lr.ph57

tailrecurse.backedge:                             ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %.lr.ph53.prol.loopexit, %.lr.ph53, %middle.block75, %middle.block, %48, %16
  %.tr.be = phi ptr [ %22, %16 ], [ %57, %48 ], [ %22, %middle.block ], [ %57, %middle.block75 ], [ %22, %.lr.ph53 ], [ %22, %.lr.ph53.prol.loopexit ], [ %57, %.lr.ph ], [ %57, %.lr.ph.prol.loopexit ]
  %.tr46.be = phi i32 [ %8, %16 ], [ %52, %48 ], [ %8, %middle.block ], [ %52, %middle.block75 ], [ %8, %.lr.ph53 ], [ %8, %.lr.ph53.prol.loopexit ], [ %52, %.lr.ph ], [ %52, %.lr.ph.prol.loopexit ]
  %.off = add nsw i32 %.tr46.be, 1
  %5 = icmp ult i32 %.off, 3
  br i1 %5, label %tailrecurse._crit_edge, label %.lr.ph57

tailrecurse._crit_edge:                           ; preds = %tailrecurse.backedge, %3
  %.tr.lcssa = phi ptr [ %0, %3 ], [ %.tr.be, %tailrecurse.backedge ]
  %6 = load i32, ptr %.tr.lcssa, align 4, !tbaa !5
  %7 = icmp eq i32 %6, %2
  br label %.loopexit

.lr.ph57:                                         ; preds = %3, %tailrecurse.backedge
  %.tr4656 = phi i32 [ %.tr46.be, %tailrecurse.backedge ], [ %1, %3 ]
  %.tr55 = phi ptr [ %.tr.be, %tailrecurse.backedge ], [ %0, %3 ]
  %.tr5571 = ptrtoint ptr %.tr55 to i64
  %8 = sdiv i32 %.tr4656, 2
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds i32, ptr %.tr55, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp eq i32 %11, %2
  br i1 %12, label %.loopexit, label %13

13:                                               ; preds = %.lr.ph57
  %14 = icmp sgt i32 %11, %2
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br i1 %14, label %16, label %48

16:                                               ; preds = %13
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @.str)
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %19 = icmp slt i32 %.tr4656, -1
  %20 = shl nsw i64 %9, 2
  %21 = select i1 %19, i64 -1, i64 %20
  %22 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #3
  %23 = icmp sgt i32 %.tr4656, 1
  br i1 %23, label %.lr.ph53.preheader, label %tailrecurse.backedge

.lr.ph53.preheader:                               ; preds = %16
  %24 = ptrtoint ptr %22 to i64
  %wide.trip.count67 = zext nneg i32 %8 to i64
  %min.iters.check = icmp ult i32 %8, 8
  %25 = sub i64 %24, %.tr5571
  %diff.check = icmp ult i64 %25, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.lr.ph53.preheader89, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph53.preheader
  %n.vec = and i64 %wide.trip.count67, 1073741816
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %26 = getelementptr inbounds i32, ptr %.tr55, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <4 x i32>, ptr %26, align 4, !tbaa !5
  %wide.load72 = load <4 x i32>, ptr %27, align 4, !tbaa !5
  %28 = getelementptr inbounds i32, ptr %22, i64 %index
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  store <4 x i32> %wide.load, ptr %28, align 4, !tbaa !5
  store <4 x i32> %wide.load72, ptr %29, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count67
  br i1 %cmp.n, label %tailrecurse.backedge, label %.lr.ph53.preheader89

.lr.ph53.preheader89:                             ; preds = %middle.block, %.lr.ph53.preheader
  %indvars.iv64.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec, %middle.block ]
  %xtraiter92 = and i64 %wide.trip.count67, 3
  %lcmp.mod93.not = icmp eq i64 %xtraiter92, 0
  br i1 %lcmp.mod93.not, label %.lr.ph53.prol.loopexit, label %.lr.ph53.prol

.lr.ph53.prol:                                    ; preds = %.lr.ph53.preheader89, %.lr.ph53.prol
  %indvars.iv64.prol = phi i64 [ %indvars.iv.next65.prol, %.lr.ph53.prol ], [ %indvars.iv64.ph, %.lr.ph53.preheader89 ]
  %prol.iter94 = phi i64 [ %prol.iter94.next, %.lr.ph53.prol ], [ 0, %.lr.ph53.preheader89 ]
  %31 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv64.prol
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv64.prol
  store i32 %32, ptr %33, align 4, !tbaa !5
  %indvars.iv.next65.prol = add nuw nsw i64 %indvars.iv64.prol, 1
  %prol.iter94.next = add i64 %prol.iter94, 1
  %prol.iter94.cmp.not = icmp eq i64 %prol.iter94.next, %xtraiter92
  br i1 %prol.iter94.cmp.not, label %.lr.ph53.prol.loopexit, label %.lr.ph53.prol, !llvm.loop !13

.lr.ph53.prol.loopexit:                           ; preds = %.lr.ph53.prol, %.lr.ph53.preheader89
  %indvars.iv64.unr = phi i64 [ %indvars.iv64.ph, %.lr.ph53.preheader89 ], [ %indvars.iv.next65.prol, %.lr.ph53.prol ]
  %34 = sub nsw i64 %indvars.iv64.ph, %wide.trip.count67
  %35 = icmp ugt i64 %34, -4
  br i1 %35, label %tailrecurse.backedge, label %.lr.ph53

.lr.ph53:                                         ; preds = %.lr.ph53.prol.loopexit, %.lr.ph53
  %indvars.iv64 = phi i64 [ %indvars.iv.next65.3, %.lr.ph53 ], [ %indvars.iv64.unr, %.lr.ph53.prol.loopexit ]
  %36 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv64
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv64
  store i32 %37, ptr %38, align 4, !tbaa !5
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %39 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv.next65
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv.next65
  store i32 %40, ptr %41, align 4, !tbaa !5
  %indvars.iv.next65.1 = add nuw nsw i64 %indvars.iv64, 2
  %42 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv.next65.1
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv.next65.1
  store i32 %43, ptr %44, align 4, !tbaa !5
  %indvars.iv.next65.2 = add nuw nsw i64 %indvars.iv64, 3
  %45 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv.next65.2
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv.next65.2
  store i32 %46, ptr %47, align 4, !tbaa !5
  %indvars.iv.next65.3 = add nuw nsw i64 %indvars.iv64, 4
  %exitcond68.not.3 = icmp eq i64 %indvars.iv.next65.3, %wide.trip.count67
  br i1 %exitcond68.not.3, label %tailrecurse.backedge, label %.lr.ph53, !llvm.loop !15

48:                                               ; preds = %13
  %49 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @.str.1)
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %51 = and i32 %.tr4656, 1
  %52 = add nsw i32 %8, %51
  %53 = zext i32 %52 to i64
  %54 = icmp slt i32 %52, 0
  %55 = shl nuw nsw i64 %53, 2
  %56 = select i1 %54, i64 -1, i64 %55
  %57 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %56) #3
  %58 = ptrtoint ptr %57 to i64
  %59 = icmp sgt i32 %52, 0
  br i1 %59, label %.lr.ph.preheader, label %tailrecurse.backedge

.lr.ph.preheader:                                 ; preds = %48
  %min.iters.check77 = icmp ult i32 %52, 8
  br i1 %min.iters.check77, label %.lr.ph.preheader90, label %vector.memcheck73

vector.memcheck73:                                ; preds = %.lr.ph.preheader
  %60 = shl nsw i64 %9, 2
  %61 = add i64 %60, %.tr5571
  %62 = sub i64 %58, %61
  %diff.check74 = icmp ult i64 %62, 32
  br i1 %diff.check74, label %.lr.ph.preheader90, label %vector.ph78

vector.ph78:                                      ; preds = %vector.memcheck73
  %n.vec80 = and i64 %53, 2147483640
  %ind.end = add nsw i64 %n.vec80, %9
  br label %vector.body83

vector.body83:                                    ; preds = %vector.body83, %vector.ph78
  %index84 = phi i64 [ 0, %vector.ph78 ], [ %index.next87, %vector.body83 ]
  %offset.idx = add i64 %index84, %9
  %63 = getelementptr inbounds i32, ptr %.tr55, i64 %offset.idx
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %wide.load85 = load <4 x i32>, ptr %63, align 4, !tbaa !5
  %wide.load86 = load <4 x i32>, ptr %64, align 4, !tbaa !5
  %65 = getelementptr inbounds i32, ptr %57, i64 %index84
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  store <4 x i32> %wide.load85, ptr %65, align 4, !tbaa !5
  store <4 x i32> %wide.load86, ptr %66, align 4, !tbaa !5
  %index.next87 = add nuw i64 %index84, 8
  %67 = icmp eq i64 %index.next87, %n.vec80
  br i1 %67, label %middle.block75, label %vector.body83, !llvm.loop !16

middle.block75:                                   ; preds = %vector.body83
  %cmp.n88 = icmp eq i64 %n.vec80, %53
  br i1 %cmp.n88, label %tailrecurse.backedge, label %.lr.ph.preheader90

.lr.ph.preheader90:                               ; preds = %middle.block75, %vector.memcheck73, %.lr.ph.preheader
  %indvars.iv59.ph = phi i64 [ %9, %vector.memcheck73 ], [ %9, %.lr.ph.preheader ], [ %ind.end, %middle.block75 ]
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck73 ], [ 0, %.lr.ph.preheader ], [ %n.vec80, %middle.block75 ]
  %xtraiter = and i64 %53, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader90, %.lr.ph.prol
  %indvars.iv59.prol = phi i64 [ %indvars.iv.next60.prol, %.lr.ph.prol ], [ %indvars.iv59.ph, %.lr.ph.preheader90 ]
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader90 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader90 ]
  %68 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv59.prol
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds i32, ptr %57, i64 %indvars.iv.prol
  store i32 %69, ptr %70, align 4, !tbaa !5
  %indvars.iv.next60.prol = add nsw i64 %indvars.iv59.prol, 1
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !17

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader90
  %indvars.iv59.unr = phi i64 [ %indvars.iv59.ph, %.lr.ph.preheader90 ], [ %indvars.iv.next60.prol, %.lr.ph.prol ]
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader90 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %71 = sub nsw i64 %indvars.iv.ph, %53
  %72 = icmp ugt i64 %71, -4
  br i1 %72, label %tailrecurse.backedge, label %.lr.ph.preheader90.new

.lr.ph.preheader90.new:                           ; preds = %.lr.ph.prol.loopexit
  %invariant.gep = getelementptr i8, ptr %57, i64 4
  %invariant.gep95 = getelementptr i8, ptr %57, i64 8
  %invariant.gep97 = getelementptr i8, ptr %57, i64 12
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader90.new
  %indvars.iv59 = phi i64 [ %indvars.iv59.unr, %.lr.ph.preheader90.new ], [ %indvars.iv.next60.3, %.lr.ph ]
  %indvars.iv = phi i64 [ %indvars.iv.unr, %.lr.ph.preheader90.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %73 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv59
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = getelementptr inbounds i32, ptr %57, i64 %indvars.iv
  store i32 %74, ptr %75, align 4, !tbaa !5
  %indvars.iv.next60 = add nsw i64 %indvars.iv59, 1
  %76 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv.next60
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
  store i32 %77, ptr %gep, align 4, !tbaa !5
  %indvars.iv.next60.1 = add nsw i64 %indvars.iv59, 2
  %78 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv.next60.1
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %gep96 = getelementptr i32, ptr %invariant.gep95, i64 %indvars.iv
  store i32 %79, ptr %gep96, align 4, !tbaa !5
  %indvars.iv.next60.2 = add nsw i64 %indvars.iv59, 3
  %80 = getelementptr inbounds i32, ptr %.tr55, i64 %indvars.iv.next60.2
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %gep98 = getelementptr i32, ptr %invariant.gep97, i64 %indvars.iv
  store i32 %81, ptr %gep98, align 4, !tbaa !5
  %indvars.iv.next60.3 = add nsw i64 %indvars.iv59, 4
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %53
  br i1 %exitcond.not.3, label %tailrecurse.backedge, label %.lr.ph, !llvm.loop !18

.loopexit:                                        ; preds = %.lr.ph57, %tailrecurse._crit_edge
  %.040 = phi i1 [ %7, %tailrecurse._crit_edge ], [ true, %.lr.ph57 ]
  ret i1 %.040
}

; 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 #1

; 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)) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #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 = { 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 #2 = { nobuiltin allocsize(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 = { builtin allocsize(0) }

!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 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10, !11, !12}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !10, !11}


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